Skip to content

Commit

Permalink
Keep the game paused in pause menu settings
Browse files Browse the repository at this point in the history
The button_exit[]s were replaced by regular button[]s, to avoid a very short unpause when you
click the btn_settings (probably because it uses ClientEvent stuff).
  • Loading branch information
Desour authored and sfan5 committed Feb 14, 2025
1 parent dd0070a commit 2c50066
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/client/game_formspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ void GameFormSpec::showPauseMenuFormSpec(const std::string &formspec, const std:
&m_input->joystick, fs_src, txt_dst, "",
m_client->getSoundManager());

// FIXME: can't enable this for now because "fps_max_unfocused" also applies
// when the game is paused, making the settings menu much less enjoyable.
// m_formspec->doPause = true;
m_formspec->doPause = true;
}

void GameFormSpec::showNodeFormspec(const std::string &formspec, const v3s16 &nodepos)
Expand Down Expand Up @@ -376,18 +374,18 @@ void GameFormSpec::showPauseMenu()
<< strgettext("Continue") << "]";

if (!simple_singleplayer_mode) {
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_change_password;"
os << "button[4," << (ypos++) << ";3,0.5;btn_change_password;"
<< strgettext("Change Password") << "]";
} else {
os << "field[4.95,0;5,1.5;;" << strgettext("Game paused") << ";]";
}

os << "button_exit[4," << (ypos++) << ";3,0.5;btn_settings;"
os << "button[4," << (ypos++) << ";3,0.5;btn_settings;"
<< strgettext("Settings") << "]";

#ifndef __ANDROID__
#if USE_SOUND
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_sound;"
os << "button[4," << (ypos++) << ";3,0.5;btn_sound;"
<< strgettext("Sound Volume") << "]";
#endif
#endif
Expand Down

0 comments on commit 2c50066

Please sign in to comment.