This commit is contained in:
Robert Peralta 2025-04-20 14:19:31 +01:00 committed by GitHub
commit a01b088854
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 33 additions and 1 deletions

View file

@ -74,7 +74,10 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
po::options_description hidden{ "Hidden options" };
hidden.add_options()
("nsight", po::value<bool>()->implicit_value(true), "NSight debugging options")
("legacy", po::value<bool>()->implicit_value(true), "Intel legacy graphic mode");
("legacy", po::value<bool>()->implicit_value(true), "Intel legacy graphic mode")
("logs", po::value<bool>()->implicit_value(true), "Opens the log window on launch")
("debug", po::value<bool>()->implicit_value(true), "Opens the debugger window on launch");
po::options_description extractor{ "Extractor tool" };
extractor.add_options()
@ -177,6 +180,12 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
if (vm.count("enable-gdbstub"))
s_enable_gdbstub = vm["enable-gdbstub"].as<bool>();
if (vm.count("logs"))
s_open_log_window_on_launch = vm["logs"].as<bool>();
if (vm.count("debug"))
s_open_debug_window_on_launch = vm["debug"].as<bool>();
std::wstring extract_path, log_path;
std::string output_path;
if (vm.count("extract"))

View file

@ -27,6 +27,9 @@ public:
static bool ForceInterpreter() { return s_force_interpreter; };
static bool OpenLogWindowOnLaunch() { return s_open_log_window_on_launch; };
static bool OpenDebugWindowOnLaunch() { return s_open_debug_window_on_launch; };
static std::optional<uint32> GetPersistentId() { return s_persistent_id; }
private:
@ -42,6 +45,9 @@ private:
inline static bool s_force_interpreter = false;
inline static bool s_open_log_window_on_launch = false;
inline static bool s_open_debug_window_on_launch = false;
inline static std::optional<uint32> s_persistent_id{};
static bool ExtractorTool(std::wstring_view wud_path, std::string_view output_path, std::wstring_view log_path);

View file

@ -158,6 +158,8 @@ wxDEFINE_EVENT(wxEVT_SET_WINDOW_TITLE, wxCommandEvent);
wxDEFINE_EVENT(wxEVT_REQUEST_GAMELIST_REFRESH, wxCommandEvent);
wxDEFINE_EVENT(wxEVT_LAUNCH_GAME, wxLaunchGameEvent);
wxDEFINE_EVENT(wxEVT_REQUEST_RECREATE_CANVAS, wxCommandEvent);
wxDEFINE_EVENT(wxEVT_OPEN_LOGGING_WINDOW, wxCommandEvent);
wxDEFINE_EVENT(wxEVT_OPEN_DEBUG_WINDOWS, wxCommandEvent);
wxBEGIN_EVENT_TABLE(MainWindow, wxFrame)
EVT_TIMER(MAINFRAME_ID_TIMER1, MainWindow::OnTimer)
@ -306,6 +308,8 @@ MainWindow::MainWindow()
auto* main_sizer = new wxBoxSizer(wxVERTICAL);
auto load_file = LaunchSettings::GetLoadFile();
auto load_title_id = LaunchSettings::GetLoadTitleID();
auto open_log_window = LaunchSettings::OpenLogWindowOnLaunch();
auto open_debug_window = LaunchSettings::OpenDebugWindowOnLaunch();
bool quick_launch = false;
if (load_file)
@ -362,6 +366,19 @@ MainWindow::MainWindow()
{
g_gdbstub = std::make_unique<GDBServer>(config.gdb_port);
}
if(open_log_window)
{
wxCommandEvent event(wxEVT_OPEN_LOGGING_WINDOW);
OnLoggingWindow(event);
}
if (open_debug_window)
{
wxCommandEvent event(wxEVT_OPEN_DEBUG_WINDOWS);
OnDebugViewPPCDebugger(event);
}
}
MainWindow::~MainWindow()