mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-09-07 04:09:08 +01:00
Merge pull request #7927 from german77/amiibo
yuzu: Disconnect amiibos on drag and drop
This commit is contained in:
commit
f582a4482d
1 changed files with 10 additions and 0 deletions
|
@ -2937,6 +2937,7 @@ void GMainWindow::OnLoadAmiibo() {
|
||||||
if (nfc_state == Service::NFP::DeviceState::TagFound ||
|
if (nfc_state == Service::NFP::DeviceState::TagFound ||
|
||||||
nfc_state == Service::NFP::DeviceState::TagMounted) {
|
nfc_state == Service::NFP::DeviceState::TagMounted) {
|
||||||
nfc->CloseAmiibo();
|
nfc->CloseAmiibo();
|
||||||
|
QMessageBox::warning(this, tr("Amiibo"), tr("The current amiibo has been removed"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2965,6 +2966,15 @@ void GMainWindow::LoadAmiibo(const QString& filename) {
|
||||||
return;
|
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};
|
QFile nfc_file{filename};
|
||||||
if (!nfc_file.open(QIODevice::ReadOnly)) {
|
if (!nfc_file.open(QIODevice::ReadOnly)) {
|
||||||
QMessageBox::warning(this, tr("Error opening Amiibo data file"),
|
QMessageBox::warning(this, tr("Error opening Amiibo data file"),
|
||||||
|
|
Loading…
Reference in a new issue