mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-12 23:38:47 -05:00
Merge pull request #11473 from liamwhite/fix-launch-param
am: Implement UserChannel parameters
This commit is contained in:
@ -589,10 +589,12 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
|
||||
emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path);
|
||||
});
|
||||
connect(start_game, &QAction::triggered, [this, path]() {
|
||||
emit BootGame(QString::fromStdString(path), 0, 0, StartGameType::Normal);
|
||||
emit BootGame(QString::fromStdString(path), 0, 0, StartGameType::Normal,
|
||||
AmLaunchType::UserInitiated);
|
||||
});
|
||||
connect(start_game_global, &QAction::triggered, [this, path]() {
|
||||
emit BootGame(QString::fromStdString(path), 0, 0, StartGameType::Global);
|
||||
emit BootGame(QString::fromStdString(path), 0, 0, StartGameType::Global,
|
||||
AmLaunchType::UserInitiated);
|
||||
});
|
||||
connect(open_mod_location, &QAction::triggered, [this, program_id, path]() {
|
||||
emit OpenFolderRequested(program_id, GameListOpenTarget::ModData, path);
|
||||
|
@ -28,6 +28,7 @@ class GameListWorker;
|
||||
class GameListSearchField;
|
||||
class GameListDir;
|
||||
class GMainWindow;
|
||||
enum class AmLaunchType;
|
||||
enum class StartGameType;
|
||||
|
||||
namespace FileSys {
|
||||
@ -103,7 +104,7 @@ public:
|
||||
|
||||
signals:
|
||||
void BootGame(const QString& game_path, u64 program_id, std::size_t program_index,
|
||||
StartGameType type);
|
||||
StartGameType type, AmLaunchType launch_type);
|
||||
void GameChosen(const QString& game_path, const u64 title_id = 0);
|
||||
void ShouldCancelWorker();
|
||||
void OpenFolderRequested(u64 program_id, GameListOpenTarget target,
|
||||
|
@ -1705,7 +1705,8 @@ void GMainWindow::AllowOSSleep() {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t program_index) {
|
||||
bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t program_index,
|
||||
AmLaunchType launch_type) {
|
||||
// Shutdown previous session if the emu thread is still active...
|
||||
if (emu_thread != nullptr) {
|
||||
ShutdownGame();
|
||||
@ -1717,6 +1718,10 @@ bool GMainWindow::LoadROM(const QString& filename, u64 program_id, std::size_t p
|
||||
|
||||
system->SetFilesystem(vfs);
|
||||
|
||||
if (launch_type == AmLaunchType::UserInitiated) {
|
||||
system->GetUserChannel().clear();
|
||||
}
|
||||
|
||||
system->SetAppletFrontendSet({
|
||||
std::make_unique<QtAmiiboSettings>(*this), // Amiibo Settings
|
||||
(UISettings::values.controller_applet_disabled.GetValue() == true)
|
||||
@ -1856,7 +1861,7 @@ void GMainWindow::ConfigureFilesystemProvider(const std::string& filepath) {
|
||||
}
|
||||
|
||||
void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t program_index,
|
||||
StartGameType type) {
|
||||
StartGameType type, AmLaunchType launch_type) {
|
||||
LOG_INFO(Frontend, "yuzu starting...");
|
||||
StoreRecentFile(filename); // Put the filename on top of the list
|
||||
|
||||
@ -1900,7 +1905,7 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t
|
||||
}
|
||||
}
|
||||
|
||||
if (!LoadROM(filename, program_id, program_index)) {
|
||||
if (!LoadROM(filename, program_id, program_index, launch_type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3369,7 +3374,8 @@ void GMainWindow::OnLoadComplete() {
|
||||
|
||||
void GMainWindow::OnExecuteProgram(std::size_t program_index) {
|
||||
ShutdownGame();
|
||||
BootGame(last_filename_booted, 0, program_index);
|
||||
BootGame(last_filename_booted, 0, program_index, StartGameType::Normal,
|
||||
AmLaunchType::ApplicationInitiated);
|
||||
}
|
||||
|
||||
void GMainWindow::OnExit() {
|
||||
|
@ -58,6 +58,11 @@ enum class StartGameType {
|
||||
Global, // Only uses global configuration
|
||||
};
|
||||
|
||||
enum class AmLaunchType {
|
||||
UserInitiated,
|
||||
ApplicationInitiated,
|
||||
};
|
||||
|
||||
namespace Core {
|
||||
enum class SystemResultStatus : u32;
|
||||
class System;
|
||||
@ -239,9 +244,11 @@ private:
|
||||
void PreventOSSleep();
|
||||
void AllowOSSleep();
|
||||
|
||||
bool LoadROM(const QString& filename, u64 program_id, std::size_t program_index);
|
||||
bool LoadROM(const QString& filename, u64 program_id, std::size_t program_index,
|
||||
AmLaunchType launch_type);
|
||||
void BootGame(const QString& filename, u64 program_id = 0, std::size_t program_index = 0,
|
||||
StartGameType with_config = StartGameType::Normal);
|
||||
StartGameType with_config = StartGameType::Normal,
|
||||
AmLaunchType launch_type = AmLaunchType::UserInitiated);
|
||||
void ShutdownGame();
|
||||
|
||||
void ShowTelemetryCallout();
|
||||
|
Reference in New Issue
Block a user