summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-02-25 08:13:32 +0100
committerGitHub <noreply@github.com>2022-02-25 08:13:32 +0100
commitf582a4482dda24891141d4ddb8a725a5dfdacddd (patch)
tree8d88fb1b8633a4b392e8c45dc2855233d6c61013
parentMerge pull request #7859 from german77/battery_again (diff)
parentyuzu: Remove amiibos on drag and drop (diff)
downloadyuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.tar
yuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.tar.gz
yuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.tar.bz2
yuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.tar.lz
yuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.tar.xz
yuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.tar.zst
yuzu-f582a4482dda24891141d4ddb8a725a5dfdacddd.zip
-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() {
if (nfc_state == Service::NFP::DeviceState::TagFound ||
nfc_state == Service::NFP::DeviceState::TagMounted) {
nfc->CloseAmiibo();
+ QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
return;
}
@@ -2965,6 +2966,15 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
return;
}
+ // Remove amiibo if one is connected
+ const auto nfc_state = nfc->GetCurrentState();
+ if (nfc_state == Service::NFP::DeviceState::TagFound ||
+ nfc_state == Service::NFP::DeviceState::TagMounted) {
+ nfc->CloseAmiibo();
+ QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
+ return;
+ }
+
QFile nfc_file{filename};
if (!nfc_file.open(QIODevice::ReadOnly)) {
QMessageBox::warning(this, tr("Error opening Amiibo data file"),