Merge pull request #7867 from german77/amiibo
nfp: Improve amiibo support
This commit is contained in:
commit
2984695265
7 changed files with 1030 additions and 335 deletions
|
@ -934,7 +934,7 @@ void GMainWindow::InitializeHotkeys() {
|
|||
hotkey_registry.LoadHotkeys();
|
||||
|
||||
LinkActionShortcut(ui->action_Load_File, QStringLiteral("Load File"));
|
||||
LinkActionShortcut(ui->action_Load_Amiibo, QStringLiteral("Load Amiibo"));
|
||||
LinkActionShortcut(ui->action_Load_Amiibo, QStringLiteral("Load/Remove Amiibo"));
|
||||
LinkActionShortcut(ui->action_Exit, QStringLiteral("Exit yuzu"));
|
||||
LinkActionShortcut(ui->action_Restart, QStringLiteral("Restart Emulation"));
|
||||
LinkActionShortcut(ui->action_Pause, QStringLiteral("Continue/Pause Emulation"));
|
||||
|
@ -2927,6 +2927,24 @@ void GMainWindow::OnLoadAmiibo() {
|
|||
return;
|
||||
}
|
||||
|
||||
Service::SM::ServiceManager& sm = system->ServiceManager();
|
||||
auto nfc = sm.GetService<Service::NFP::Module::Interface>("nfp:user");
|
||||
if (nfc == nullptr) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("The current game is not looking for amiibos"));
|
||||
return;
|
||||
}
|
||||
const auto nfc_state = nfc->GetCurrentState();
|
||||
if (nfc_state == Service::NFP::DeviceState::TagFound ||
|
||||
nfc_state == Service::NFP::DeviceState::TagMounted) {
|
||||
nfc->CloseAmiibo();
|
||||
return;
|
||||
}
|
||||
|
||||
if (nfc_state != Service::NFP::DeviceState::SearchingForTag) {
|
||||
QMessageBox::warning(this, tr("Error"), tr("The current game is not looking for amiibos"));
|
||||
return;
|
||||
}
|
||||
|
||||
is_amiibo_file_select_active = true;
|
||||
const QString extensions{QStringLiteral("*.bin")};
|
||||
const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue