1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-21 18:11:11 +00:00

New world removal GUI code

This commit is contained in:
Perttu Ahola 2012-03-26 02:19:41 +03:00
parent 5b31d32da8
commit 405347769a
4 changed files with 75 additions and 31 deletions

View file

@ -93,12 +93,21 @@ void GUIConfirmMenu::regenerateGui(v2u32 screensize)
v2s32 size = rect.getSize();
gui::IGUISkin *skin = Environment->getSkin();
gui::IGUIFont *font = skin->getFont();
s32 msg_h = font->getDimension(m_message_text.c_str()).Height;
s32 msg_w = font->getDimension(m_message_text.c_str()).Width;
if(msg_h > 200)
msg_h = 200;
if(msg_w > 540)
msg_w = 540;
/*
Add stuff
*/
{
core::rect<s32> rect(0, 0, 300, 20);
rect += v2s32(size.X/2-300/2, size.Y/2-30/2-25);
core::rect<s32> rect(0, 0, msg_w, msg_h);
rect += v2s32(size.X/2-msg_w/2, size.Y/2-30/2 - msg_h/2);
Environment->addStaticText(m_message_text.c_str(),
rect, false, true, this, -1);
}
@ -106,13 +115,13 @@ void GUIConfirmMenu::regenerateGui(v2u32 screensize)
int bw = 100;
{
core::rect<s32> rect(0, 0, bw, 30);
rect = rect + v2s32(size.X/2-bw/2-(bw/2+5), size.Y/2-30/2+25);
rect = rect + v2s32(size.X/2-bw/2-(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
Environment->addButton(rect, this, GUI_ID_YES,
wgettext("Yes"));
}
{
core::rect<s32> rect(0, 0, bw, 30);
rect = rect + v2s32(size.X/2-bw/2+(bw/2+5), size.Y/2-30/2+25);
rect = rect + v2s32(size.X/2-bw/2+(bw/2+5), size.Y/2-30/2+5 + msg_h/2);
Environment->addButton(rect, this, GUI_ID_NO,
wgettext("No"));
}