mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Registration dialog: Larger text field with scrollbars (#7047)
Center text, text area doubled now
This commit is contained in:
parent
673f7196a2
commit
57418111a8
1 changed files with 14 additions and 7 deletions
|
@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
|
||||||
#include "guiConfirmRegistration.h"
|
#include "guiConfirmRegistration.h"
|
||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
#include "intlGUIEditBox.h"
|
||||||
#include <IGUICheckBox.h>
|
#include <IGUICheckBox.h>
|
||||||
#include <IGUIEditBox.h>
|
#include <IGUIEditBox.h>
|
||||||
#include <IGUIButton.h>
|
#include <IGUIButton.h>
|
||||||
|
@ -66,8 +67,8 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
|
||||||
/*
|
/*
|
||||||
Calculate new sizes and positions
|
Calculate new sizes and positions
|
||||||
*/
|
*/
|
||||||
core::rect<s32> rect(screensize.X / 2 - 600 / 2, screensize.Y / 2 - 300 / 2,
|
core::rect<s32> rect(screensize.X / 2 - 600 / 2, screensize.Y / 2 - 360 / 2,
|
||||||
screensize.X / 2 + 600 / 2, screensize.Y / 2 + 300 / 2);
|
screensize.X / 2 + 600 / 2, screensize.Y / 2 + 360 / 2);
|
||||||
|
|
||||||
DesiredRect = rect;
|
DesiredRect = rect;
|
||||||
recalculateAbsolutePosition(false);
|
recalculateAbsolutePosition(false);
|
||||||
|
@ -85,7 +86,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
|
||||||
std::string address = m_address;
|
std::string address = m_address;
|
||||||
if (address.empty())
|
if (address.empty())
|
||||||
address = "localhost";
|
address = "localhost";
|
||||||
core::rect<s32> rect(0, 0, 540, 90);
|
core::rect<s32> rect(0, 0, 540, 180);
|
||||||
rect += topleft_client + v2s32(30, ypos);
|
rect += topleft_client + v2s32(30, ypos);
|
||||||
static const std::string info_text_template = strgettext(
|
static const std::string info_text_template = strgettext(
|
||||||
"You are about to join the server at %1$s with the "
|
"You are about to join the server at %1$s with the "
|
||||||
|
@ -98,11 +99,17 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
|
||||||
char info_text_buf[1024];
|
char info_text_buf[1024];
|
||||||
snprintf(info_text_buf, sizeof(info_text_buf), info_text_template.c_str(),
|
snprintf(info_text_buf, sizeof(info_text_buf), info_text_template.c_str(),
|
||||||
address.c_str(), m_playername.c_str());
|
address.c_str(), m_playername.c_str());
|
||||||
Environment->addStaticText(narrow_to_wide_c(info_text_buf), rect, false,
|
|
||||||
true, this, -1);
|
gui::intlGUIEditBox *e = new gui::intlGUIEditBox(
|
||||||
|
utf8_to_wide_c(info_text_buf), true, Environment, this,
|
||||||
|
ID_message, rect, false, true);
|
||||||
|
e->drop();
|
||||||
|
e->setMultiLine(true);
|
||||||
|
e->setWordWrap(true);
|
||||||
|
e->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_CENTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
ypos += 120;
|
ypos += 210;
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 540, 30);
|
core::rect<s32> rect(0, 0, 540, 30);
|
||||||
rect += topleft_client + v2s32(30, ypos);
|
rect += topleft_client + v2s32(30, ypos);
|
||||||
|
@ -111,7 +118,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
|
||||||
e->setPasswordBox(true);
|
e->setPasswordBox(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ypos += 90;
|
ypos += 60;
|
||||||
{
|
{
|
||||||
core::rect<s32> rect(0, 0, 230, 35);
|
core::rect<s32> rect(0, 0, 230, 35);
|
||||||
rect = rect + v2s32(size.X / 2 - 220, ypos);
|
rect = rect + v2s32(size.X / 2 - 220, ypos);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue