diff options
author | german77 <juangerman-13@hotmail.com> | 2022-02-20 08:58:34 +0100 |
---|---|---|
committer | german77 <juangerman-13@hotmail.com> | 2022-02-20 21:28:21 +0100 |
commit | b504df9d0233c2d3545cb08b186e41a3b46ca461 (patch) | |
tree | e58d767e75106e21c512fbc8ccc1dc3d189e6492 | |
parent | Merge pull request #7867 from german77/amiibo (diff) | |
download | yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.gz yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.bz2 yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.lz yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.xz yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.tar.zst yuzu-b504df9d0233c2d3545cb08b186e41a3b46ca461.zip |
-rw-r--r-- | src/yuzu/main.cpp | 10 |
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"), |