diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/game_list.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/game_list.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/main.h | 8 |
4 files changed, 23 insertions, 3 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 9308cfef8..da956c99b 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -505,6 +505,10 @@ void GameList::PopupContextMenu(const QPoint& menu_location) { | |||
| 505 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) { | 505 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) { |
| 506 | QAction* favorite = context_menu.addAction(tr("Favorite")); | 506 | QAction* favorite = context_menu.addAction(tr("Favorite")); |
| 507 | context_menu.addSeparator(); | 507 | context_menu.addSeparator(); |
| 508 | QAction* start_game = context_menu.addAction(tr("Start Game")); | ||
| 509 | QAction* start_game_global = | ||
| 510 | context_menu.addAction(tr("Start Game without Custom Configuration")); | ||
| 511 | context_menu.addSeparator(); | ||
| 508 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); | 512 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); |
| 509 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); | 513 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); |
| 510 | QAction* open_transferable_shader_cache = | 514 | QAction* open_transferable_shader_cache = |
| @@ -540,6 +544,12 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri | |||
| 540 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { | 544 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { |
| 541 | emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path); | 545 | emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path); |
| 542 | }); | 546 | }); |
| 547 | connect(start_game, &QAction::triggered, [this, path]() { | ||
| 548 | emit BootGame(QString::fromStdString(path), 0, StartGameType::Normal); | ||
| 549 | }); | ||
| 550 | connect(start_game_global, &QAction::triggered, [this, path]() { | ||
| 551 | emit BootGame(QString::fromStdString(path), 0, StartGameType::Global); | ||
| 552 | }); | ||
| 543 | connect(open_mod_location, &QAction::triggered, [this, program_id, path]() { | 553 | connect(open_mod_location, &QAction::triggered, [this, program_id, path]() { |
| 544 | emit OpenFolderRequested(program_id, GameListOpenTarget::ModData, path); | 554 | emit OpenFolderRequested(program_id, GameListOpenTarget::ModData, path); |
| 545 | }); | 555 | }); |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index ab6866735..b630e34ff 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -28,6 +28,7 @@ class GameListWorker; | |||
| 28 | class GameListSearchField; | 28 | class GameListSearchField; |
| 29 | class GameListDir; | 29 | class GameListDir; |
| 30 | class GMainWindow; | 30 | class GMainWindow; |
| 31 | enum class StartGameType; | ||
| 31 | 32 | ||
| 32 | namespace FileSys { | 33 | namespace FileSys { |
| 33 | class ManualContentProvider; | 34 | class ManualContentProvider; |
| @@ -82,6 +83,7 @@ public: | |||
| 82 | static const QStringList supported_file_extensions; | 83 | static const QStringList supported_file_extensions; |
| 83 | 84 | ||
| 84 | signals: | 85 | signals: |
| 86 | void BootGame(const QString& game_path, std::size_t program_index, StartGameType type); | ||
| 85 | void GameChosen(const QString& game_path); | 87 | void GameChosen(const QString& game_path); |
| 86 | void ShouldCancelWorker(); | 88 | void ShouldCancelWorker(); |
| 87 | void OpenFolderRequested(u64 program_id, GameListOpenTarget target, | 89 | void OpenFolderRequested(u64 program_id, GameListOpenTarget target, |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e683fb920..19339ff2d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1094,6 +1094,7 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { | |||
| 1094 | } | 1094 | } |
| 1095 | 1095 | ||
| 1096 | void GMainWindow::ConnectWidgetEvents() { | 1096 | void GMainWindow::ConnectWidgetEvents() { |
| 1097 | connect(game_list, &GameList::BootGame, this, &GMainWindow::BootGame); | ||
| 1097 | connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile); | 1098 | connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile); |
| 1098 | connect(game_list, &GameList::OpenDirectory, this, &GMainWindow::OnGameListOpenDirectory); | 1099 | connect(game_list, &GameList::OpenDirectory, this, &GMainWindow::OnGameListOpenDirectory); |
| 1099 | connect(game_list, &GameList::OpenFolderRequested, this, &GMainWindow::OnGameListOpenFolder); | 1100 | connect(game_list, &GameList::OpenFolderRequested, this, &GMainWindow::OnGameListOpenFolder); |
| @@ -1320,7 +1321,7 @@ void GMainWindow::SelectAndSetCurrentUser() { | |||
| 1320 | Settings::values.current_user = dialog.GetIndex(); | 1321 | Settings::values.current_user = dialog.GetIndex(); |
| 1321 | } | 1322 | } |
| 1322 | 1323 | ||
| 1323 | void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { | 1324 | void GMainWindow::BootGame(const QString& filename, std::size_t program_index, StartGameType type) { |
| 1324 | LOG_INFO(Frontend, "yuzu starting..."); | 1325 | LOG_INFO(Frontend, "yuzu starting..."); |
| 1325 | StoreRecentFile(filename); // Put the filename on top of the list | 1326 | StoreRecentFile(filename); // Put the filename on top of the list |
| 1326 | 1327 | ||
| @@ -1332,7 +1333,8 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { | |||
| 1332 | const auto v_file = Core::GetGameFileFromPath(vfs, filename.toUtf8().constData()); | 1333 | const auto v_file = Core::GetGameFileFromPath(vfs, filename.toUtf8().constData()); |
| 1333 | const auto loader = Loader::GetLoader(system, v_file, program_index); | 1334 | const auto loader = Loader::GetLoader(system, v_file, program_index); |
| 1334 | 1335 | ||
| 1335 | if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) { | 1336 | if (loader != nullptr && loader->ReadProgramId(title_id) == Loader::ResultStatus::Success && |
| 1337 | type == StartGameType::Normal) { | ||
| 1336 | // Load per game settings | 1338 | // Load per game settings |
| 1337 | const auto file_path = std::filesystem::path{filename.toStdU16String()}; | 1339 | const auto file_path = std::filesystem::path{filename.toStdU16String()}; |
| 1338 | const auto config_file_name = title_id == 0 | 1340 | const auto config_file_name = title_id == 0 |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 490b6889f..11f152cbe 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -39,6 +39,11 @@ class GameListPlaceholder; | |||
| 39 | 39 | ||
| 40 | class QtSoftwareKeyboardDialog; | 40 | class QtSoftwareKeyboardDialog; |
| 41 | 41 | ||
| 42 | enum class StartGameType { | ||
| 43 | Normal, // Can use custom configuration | ||
| 44 | Global, // Only uses global configuration | ||
| 45 | }; | ||
| 46 | |||
| 42 | namespace Core::Frontend { | 47 | namespace Core::Frontend { |
| 43 | struct ControllerParameters; | 48 | struct ControllerParameters; |
| 44 | struct InlineAppearParameters; | 49 | struct InlineAppearParameters; |
| @@ -181,7 +186,8 @@ private: | |||
| 181 | void AllowOSSleep(); | 186 | void AllowOSSleep(); |
| 182 | 187 | ||
| 183 | bool LoadROM(const QString& filename, std::size_t program_index); | 188 | bool LoadROM(const QString& filename, std::size_t program_index); |
| 184 | void BootGame(const QString& filename, std::size_t program_index = 0); | 189 | void BootGame(const QString& filename, std::size_t program_index = 0, |
| 190 | StartGameType with_config = StartGameType::Normal); | ||
| 185 | void ShutdownGame(); | 191 | void ShutdownGame(); |
| 186 | 192 | ||
| 187 | void ShowTelemetryCallout(); | 193 | void ShowTelemetryCallout(); |