mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 23:42:43 +00:00
Adding all Daniel Suggestions and fixed F9 not working with debug menu open.
This commit is contained in:
parent
5ab35212c8
commit
f31973030e
@ -118,22 +118,6 @@ void L::DrawMenuBar() {
|
||||
|
||||
EndMainMenuBar();
|
||||
}
|
||||
|
||||
if (IsKeyPressed(ImGuiKey_F9, false)) {
|
||||
if (io.KeyCtrl && io.KeyAlt) {
|
||||
if (!DebugState.ShouldPauseInSubmit()) {
|
||||
DebugState.RequestFrameDump(dump_frame_count);
|
||||
}
|
||||
}
|
||||
if (!io.KeyCtrl && !io.KeyAlt) {
|
||||
if (isSystemPaused) {
|
||||
DebugState.ResumeGuestThreads();
|
||||
} else {
|
||||
DebugState.PauseGuestThreads();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (open_popup_options) {
|
||||
OpenPopup("GPU Tools Options");
|
||||
just_opened_options = true;
|
||||
@ -383,7 +367,11 @@ void L::Draw() {
|
||||
}
|
||||
|
||||
if (IsKeyPressed(ImGuiKey_F9, false)) {
|
||||
if (!io.KeyCtrl && !io.KeyAlt) {
|
||||
if (io.KeyCtrl && io.KeyAlt) {
|
||||
if (!DebugState.ShouldPauseInSubmit()) {
|
||||
DebugState.RequestFrameDump(dump_frame_count);
|
||||
}
|
||||
} else {
|
||||
if (DebugState.IsGuestThreadsPaused()) {
|
||||
DebugState.ResumeGuestThreads();
|
||||
SDL_Log("Game resumed from Keyboard");
|
||||
|
@ -197,8 +197,6 @@ void MainWindow::AddUiWidgets() {
|
||||
ui->toolBar->clear();
|
||||
|
||||
ui->toolBar->addWidget(createSpacer(this));
|
||||
ui->toolBar->addWidget(
|
||||
createButtonWithLabel(ui->refreshButton, tr("Refresh List"), showLabels));
|
||||
ui->toolBar->addWidget(createButtonWithLabel(ui->playButton, tr("Play"), showLabels));
|
||||
ui->toolBar->addWidget(createButtonWithLabel(ui->pauseButton, tr("Pause"), showLabels));
|
||||
ui->toolBar->addWidget(createButtonWithLabel(ui->stopButton, tr("Stop"), showLabels));
|
||||
@ -212,7 +210,15 @@ void MainWindow::AddUiWidgets() {
|
||||
createButtonWithLabel(ui->controllerButton, tr("Controllers"), showLabels));
|
||||
ui->toolBar->addWidget(createButtonWithLabel(ui->keyboardButton, tr("Keyboard"), showLabels));
|
||||
ui->toolBar->addWidget(createSpacer(this));
|
||||
|
||||
ui->toolBar->addWidget(
|
||||
createButtonWithLabel(ui->refreshButton, tr("Refresh List"), showLabels));
|
||||
ui->toolBar->addWidget(createSpacer(this));
|
||||
QFrame* line = new QFrame(this);
|
||||
line->setFrameShape(QFrame::VLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
line->setMinimumWidth(2);
|
||||
ui->toolBar->addWidget(line);
|
||||
ui->toolBar->addWidget(createSpacer(this));
|
||||
if (showLabels) {
|
||||
QLabel* pauseButtonLabel = ui->pauseButton->parentWidget()->findChild<QLabel*>();
|
||||
if (pauseButtonLabel) {
|
||||
@ -1473,6 +1479,10 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) {
|
||||
}
|
||||
|
||||
void MainWindow::StartEmulator(std::filesystem::path path) {
|
||||
if (isGameRunning) {
|
||||
QMessageBox::critical(nullptr, tr("Run Game"), QString(tr("Game is already running!")));
|
||||
return;
|
||||
}
|
||||
isGameRunning = true;
|
||||
#ifdef __APPLE__
|
||||
// SDL on macOS requires main thread.
|
||||
|
@ -170,25 +170,28 @@ void WindowThemes::SetWindowTheme(Theme theme, QLineEdit* mw_searchbar) {
|
||||
qApp->setPalette(themePalette);
|
||||
break;
|
||||
case Theme::Oled:
|
||||
mw_searchbar->setStyleSheet(
|
||||
"QLineEdit {"
|
||||
"background-color: #000000; color: #ffffff; border: 1px solid #a0a0a0; "
|
||||
"border-radius: 4px; padding: 5px; }"
|
||||
"border: 1px solid #808080; border-radius: 4px; }");
|
||||
themePalette.setColor(QPalette::Window, Qt::black);
|
||||
mw_searchbar->setStyleSheet("QLineEdit:focus {"
|
||||
"border: 1px solid #2A82DA; }");
|
||||
themePalette.setColor(QPalette::Window, QColor(0, 0, 0, 0));
|
||||
themePalette.setColor(QPalette::WindowText, Qt::white);
|
||||
themePalette.setColor(QPalette::Base, Qt::black);
|
||||
themePalette.setColor(QPalette::AlternateBase, Qt::black);
|
||||
themePalette.setColor(QPalette::ToolTipBase, Qt::black);
|
||||
themePalette.setColor(QPalette::Base, QColor(0, 0, 0, 0));
|
||||
themePalette.setColor(QPalette::AlternateBase, QColor(0, 0, 0, 0));
|
||||
themePalette.setColor(QPalette::ToolTipBase, QColor(0, 0, 0, 0));
|
||||
themePalette.setColor(QPalette::ToolTipText, Qt::white);
|
||||
themePalette.setColor(QPalette::Text, Qt::white);
|
||||
themePalette.setColor(QPalette::Button, QColor(5, 5, 5));
|
||||
themePalette.setColor(QPalette::Button, QColor(0, 0, 0, 0));
|
||||
themePalette.setColor(QPalette::ButtonText, Qt::white);
|
||||
themePalette.setColor(QPalette::BrightText, Qt::red);
|
||||
themePalette.setColor(QPalette::Link, QColor(42, 130, 218));
|
||||
themePalette.setColor(QPalette::Highlight, QColor(42, 130, 218));
|
||||
themePalette.setColor(QPalette::HighlightedText, Qt::white);
|
||||
themePalette.setColor(QPalette::HighlightedText, QColor(0, 0, 0, 0));
|
||||
qApp->setPalette(themePalette);
|
||||
qApp->setStyleSheet("QLineEdit {"
|
||||
"background-color: QColor(0, 0, 0, 0); color: QColor(0, 0, 0, 0); border: 1px solid #a0a0a0; "
|
||||
"border-radius: 4px; padding: 5px; }"
|
||||
|
||||
"QCheckBox::indicator:unchecked {"
|
||||
"border: 1px solid #808080; border-radius: 4px; }");
|
||||
break;
|
||||
}
|
||||
}
|
@ -334,6 +334,7 @@ WindowSDL::WindowSDL(s32 width_, s32 height_, Input::GameController* controller_
|
||||
WindowSDL::~WindowSDL() = default;
|
||||
|
||||
void WindowSDL::WaitEvent() {
|
||||
// Called on main thread
|
||||
SDL_Event event;
|
||||
|
||||
if (!SDL_WaitEvent(&event)) {
|
||||
@ -343,6 +344,7 @@ void WindowSDL::WaitEvent() {
|
||||
if (ImGui::Core::ProcessEvent(&event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (event.type) {
|
||||
case SDL_EVENT_WINDOW_RESIZED:
|
||||
case SDL_EVENT_WINDOW_MAXIMIZED:
|
||||
@ -378,6 +380,8 @@ void WindowSDL::WaitEvent() {
|
||||
case SDL_EVENT_GAMEPAD_AXIS_MOTION:
|
||||
OnGamepadEvent(&event);
|
||||
break;
|
||||
// i really would have appreciated ANY KIND OF DOCUMENTATION ON THIS
|
||||
// AND IT DOESN'T EVEN USE PROPER ENUMS
|
||||
case SDL_EVENT_GAMEPAD_SENSOR_UPDATE:
|
||||
switch ((SDL_SensorType)event.gsensor.sensor) {
|
||||
case SDL_SENSOR_GYRO:
|
||||
@ -412,6 +416,8 @@ void WindowSDL::WaitEvent() {
|
||||
DebugState.PauseGuestThreads();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user