summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar german772022-02-20 01:58:34 -0600
committerGravatar german772022-02-20 14:28:21 -0600
commitb504df9d0233c2d3545cb08b186e41a3b46ca461 (patch)
treee58d767e75106e21c512fbc8ccc1dc3d189e6492 /src
parentMerge pull request #7867 from german77/amiibo (diff)
downloadyuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.gz
yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.xz
yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.zip
yuzu: Remove amiibos on drag and drop
Diffstat (limited to '')
-rw-r--r--src/yuzu/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e3fd38a02..b3a8da0ea 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2937,6 +2937,7 @@ void GMainWindow::OnLoadAmiibo() {
2937 if (nfc_state == Service::NFP::DeviceState::TagFound || 2937 if (nfc_state == Service::NFP::DeviceState::TagFound ||
2938 nfc_state == Service::NFP::DeviceState::TagMounted) { 2938 nfc_state == Service::NFP::DeviceState::TagMounted) {
2939 nfc->CloseAmiibo(); 2939 nfc->CloseAmiibo();
2940 QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
2940 return; 2941 return;
2941 } 2942 }
2942 2943
@@ -2965,6 +2966,15 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
2965 return; 2966 return;
2966 } 2967 }
2967 2968
2969 // Remove amiibo if one is connected
2970 const auto nfc_state = nfc->GetCurrentState();
2971 if (nfc_state == Service::NFP::DeviceState::TagFound ||
2972 nfc_state == Service::NFP::DeviceState::TagMounted) {
2973 nfc->CloseAmiibo();
2974 QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
2975 return;
2976 }
2977
2968 QFile nfc_file{filename}; 2978 QFile nfc_file{filename};
2969 if (!nfc_file.open(QIODevice::ReadOnly)) { 2979 if (!nfc_file.open(QIODevice::ReadOnly)) {
2970 QMessageBox::warning(this, tr("Error opening Amiibo data file"), 2980 QMessageBox::warning(this, tr("Error opening Amiibo data file"),