This commit is contained in:
rainmakerv2 2024-12-18 07:58:06 +08:00
parent f4239c5b63
commit 7c02243ac0
2 changed files with 4 additions and 3 deletions

View File

@ -27,7 +27,7 @@
#endif
namespace QtExternal {
static bool isGameRunning = false;
extern bool isGameRunning = false;
}
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
@ -558,7 +558,7 @@ void MainWindow::CreateConnects() {
void MainWindow::StartGame() {
using namespace QtExternal;
QtExternal::isGameRunning = true;
BackgroundMusicPlayer::getInstance().stopMusic();
QString gamePath = "";
int table_mode = Config::getTableMode();

View File

@ -380,7 +380,8 @@ void SettingsDialog::GammaSliderChange(int value) {
float Gammafloat = static_cast<float>((value / 1000.0f));
ui->GammaLabel->setText(QString::number(Gammafloat, 'f', 3));
// GetGammaRef crashes if no game is running, set isGameRunning to false when MainWindow::StopGame is implemented
// GetGammaRef crashes if no game running, set isGameRunning to false
// when MainWindow::StopGame is implemented in the future
if (QtExternal::isGameRunning) {
presenter->GetGammaRef() = Gammafloat;
}