mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add "simple singleplayer mode"; Fix a number of GUI things
This commit is contained in:
parent
899004207d
commit
6298878bfa
9 changed files with 101 additions and 48 deletions
|
@ -34,10 +34,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,
|
||||
gui::IGUIElement* parent, s32 id,
|
||||
IGameCallback *gamecallback,
|
||||
IMenuManager *menumgr):
|
||||
GUIModalMenu(env, parent, id, menumgr)
|
||||
IMenuManager *menumgr,
|
||||
bool simple_singleplayer_mode):
|
||||
GUIModalMenu(env, parent, id, menumgr),
|
||||
m_gamecallback(gamecallback),
|
||||
m_simple_singleplayer_mode(simple_singleplayer_mode)
|
||||
{
|
||||
m_gamecallback = gamecallback;
|
||||
}
|
||||
|
||||
GUIPauseMenu::~GUIPauseMenu()
|
||||
|
@ -106,7 +108,7 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
|
|||
*/
|
||||
const s32 btn_height = 30;
|
||||
const s32 btn_gap = 20;
|
||||
const s32 btn_num = 4;
|
||||
const s32 btn_num = m_simple_singleplayer_mode ? 3 : 4;
|
||||
s32 btn_y = size.Y/2-((btn_num*btn_height+(btn_num-1)*btn_gap))/2;
|
||||
changeCtype("");
|
||||
{
|
||||
|
@ -116,18 +118,21 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
|
|||
wgettext("Continue"));
|
||||
}
|
||||
btn_y += btn_height + btn_gap;
|
||||
if(!m_simple_singleplayer_mode)
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||
Environment->addButton(rect, this, 261,
|
||||
wgettext("Change Password"));
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||
Environment->addButton(rect, this, 261,
|
||||
wgettext("Change Password"));
|
||||
}
|
||||
btn_y += btn_height + btn_gap;
|
||||
}
|
||||
btn_y += btn_height + btn_gap;
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 140, btn_height);
|
||||
rect = rect + v2s32(size.X/2-140/2, btn_y);
|
||||
Environment->addButton(rect, this, 260,
|
||||
wgettext("Disconnect"));
|
||||
wgettext("Exit to Menu"));
|
||||
}
|
||||
btn_y += btn_height + btn_gap;
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue