mirror of
https://git.suyu.dev/suyu/suyu
synced 2025-09-19 12:37:59 -05:00
Implement option to start QLaunch from Tools menu
This commit is contained in:
@@ -1577,6 +1577,7 @@ void GMainWindow::ConnectMenuEvents() {
|
||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartFormatter); });
|
||||
connect_menu(ui->action_Load_Mii_Edit, &GMainWindow::OnMiiEdit);
|
||||
connect_menu(ui->action_Open_Controller_Menu, &GMainWindow::OnOpenControllerMenu);
|
||||
connect_menu(ui->action_Load_Home_Menu, &GMainWindow::OnHomeMenu);
|
||||
connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot);
|
||||
|
||||
// TAS
|
||||
@@ -4291,6 +4292,29 @@ void GMainWindow::OnOpenControllerMenu() {
|
||||
LibraryAppletParameters(ControllerAppletId, Service::AM::AppletId::Controller));
|
||||
}
|
||||
|
||||
void GMainWindow::OnHomeMenu() {
|
||||
constexpr u64 QLaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
|
||||
auto bis_system = system->GetFileSystemController().GetSystemNANDContents();
|
||||
if (!bis_system) {
|
||||
QMessageBox::warning(this, tr("No firmware available"),
|
||||
tr("Please install the firmware to use the Home Menu."));
|
||||
return;
|
||||
}
|
||||
|
||||
auto qlaunch_applet_nca = bis_system->GetEntry(QLaunchId, FileSys::ContentRecordType::Program);
|
||||
if (!qlaunch_applet_nca) {
|
||||
QMessageBox::warning(this, tr("Home Menu Applet"),
|
||||
tr("Home Menu is not available. Please reinstall firmware."));
|
||||
return;
|
||||
}
|
||||
|
||||
system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch);
|
||||
|
||||
const auto filename = QString::fromStdString((qlaunch_applet_nca->GetFullPath()));
|
||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
||||
BootGame(filename, LibraryAppletParameters(QLaunchId, Service::AM::AppletId::QLaunch));
|
||||
}
|
||||
|
||||
void GMainWindow::OnCaptureScreenshot() {
|
||||
if (emu_thread == nullptr || !emu_thread->IsRunning()) {
|
||||
return;
|
||||
|
@@ -399,6 +399,7 @@ private slots:
|
||||
void OnCabinet(Service::NFP::CabinetMode mode);
|
||||
void OnMiiEdit();
|
||||
void OnOpenControllerMenu();
|
||||
void OnHomeMenu();
|
||||
void OnCaptureScreenshot();
|
||||
void OnCheckFirmwareDecryption();
|
||||
void OnLanguageChanged(const QString& locale);
|
||||
|
@@ -173,6 +173,7 @@
|
||||
<addaction name="action_Load_Album"/>
|
||||
<addaction name="action_Load_Mii_Edit"/>
|
||||
<addaction name="action_Open_Controller_Menu"/>
|
||||
<addaction name="action_Load_Home_Menu"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Capture_Screenshot"/>
|
||||
<addaction name="menuTAS"/>
|
||||
@@ -475,6 +476,11 @@
|
||||
<string>Install Decryption Keys</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Load_Home_Menu">
|
||||
<property name="text">
|
||||
<string>Open Home Menu</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="suyu.qrc"/>
|
||||
|
Reference in New Issue
Block a user