mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 23:02:47 +01:00
yuzu: Allow to open and remove the amiibo
This commit is contained in:
parent
fc9abd3c62
commit
41b65d38fa
3 changed files with 24 additions and 5 deletions
|
@ -75,13 +75,13 @@ const std::array<UISettings::Shortcut, 20> Config::default_hotkeys{{
|
||||||
{QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), QStringLiteral(""), Qt::WindowShortcut}},
|
{QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), QStringLiteral(""), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), QStringLiteral("Home+Minus"), Qt::WindowShortcut}},
|
{QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), QStringLiteral("Home+Minus"), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), QStringLiteral("Home+B"), Qt::WindowShortcut}},
|
{QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), QStringLiteral("Home+B"), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), QStringLiteral("Home+A"), Qt::WidgetWithChildrenShortcut}},
|
|
||||||
{QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), QStringLiteral(""), Qt::WidgetWithChildrenShortcut}},
|
{QStringLiteral("Load File"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+O"), QStringLiteral(""), Qt::WidgetWithChildrenShortcut}},
|
||||||
|
{QStringLiteral("Load/Remove Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), QStringLiteral("Home+A"), Qt::WidgetWithChildrenShortcut}},
|
||||||
{QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), QStringLiteral(""), Qt::WindowShortcut}},
|
{QStringLiteral("Restart Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F6"), QStringLiteral(""), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), QStringLiteral(""), Qt::WindowShortcut}},
|
{QStringLiteral("Stop Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F5"), QStringLiteral(""), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("TAS Start/Stop"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F5"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
|
||||||
{QStringLiteral("TAS Reset"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F6"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
|
||||||
{QStringLiteral("TAS Record"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F7"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
{QStringLiteral("TAS Record"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F7"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
||||||
|
{QStringLiteral("TAS Reset"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F6"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
||||||
|
{QStringLiteral("TAS Start/Stop"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F5"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), QStringLiteral(""), Qt::WindowShortcut}},
|
{QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), QStringLiteral(""), Qt::WindowShortcut}},
|
||||||
{QStringLiteral("Toggle Framerate Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+U"), QStringLiteral("Home+Y"), Qt::ApplicationShortcut}},
|
{QStringLiteral("Toggle Framerate Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+U"), QStringLiteral("Home+Y"), Qt::ApplicationShortcut}},
|
||||||
{QStringLiteral("Toggle Mouse Panning"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F9"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
{QStringLiteral("Toggle Mouse Panning"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F9"), QStringLiteral(""), Qt::ApplicationShortcut}},
|
||||||
|
|
|
@ -980,7 +980,7 @@ void GMainWindow::InitializeHotkeys() {
|
||||||
hotkey_registry.LoadHotkeys();
|
hotkey_registry.LoadHotkeys();
|
||||||
|
|
||||||
LinkActionShortcut(ui->action_Load_File, QStringLiteral("Load File"));
|
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_Exit, QStringLiteral("Exit yuzu"));
|
||||||
LinkActionShortcut(ui->action_Restart, QStringLiteral("Restart Emulation"));
|
LinkActionShortcut(ui->action_Restart, QStringLiteral("Restart Emulation"));
|
||||||
LinkActionShortcut(ui->action_Pause, QStringLiteral("Continue/Pause Emulation"));
|
LinkActionShortcut(ui->action_Pause, QStringLiteral("Continue/Pause Emulation"));
|
||||||
|
@ -2912,6 +2912,25 @@ void GMainWindow::OnLoadAmiibo() {
|
||||||
return;
|
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;
|
is_amiibo_file_select_active = true;
|
||||||
const QString extensions{QStringLiteral("*.bin")};
|
const QString extensions{QStringLiteral("*.bin")};
|
||||||
const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions);
|
const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions);
|
||||||
|
|
|
@ -266,7 +266,7 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load &Amiibo...</string>
|
<string>Load/Remove &Amiibo...</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Report_Compatibility">
|
<action name="action_Report_Compatibility">
|
||||||
|
|
Loading…
Reference in a new issue