Replace all actual uses of irrlicht CGUIStaticText with our StaticText

This commit is contained in:
Desour 2023-08-09 01:58:07 +02:00 committed by sfan5
parent d75c956dbc
commit 7e7aceb8c1
4 changed files with 16 additions and 15 deletions

View File

@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "gettext.h"
#include "filesys.h"
#include "../gui/guiSkin.h"
#include "irrlicht_changes/static_text.h"
#include "irr_ptr.h"
RenderingEngine *RenderingEngine::s_singleton = nullptr;
@ -235,7 +236,7 @@ void RenderingEngine::draw_load_screen(const std::wstring &text,
core::rect<s32> textrect(center - textsize / 2, center + textsize / 2);
gui::IGUIStaticText *guitext =
guienv->addStaticText(text.c_str(), textrect, false, false);
gui::StaticText::add(guienv, text, textrect, false, false);
guitext->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
if (sky && g_settings->getBool("menu_clouds")) {

View File

@ -123,8 +123,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
core::rect<s32> rect(0, 0, 600 * s, 40 * s);
rect += topleft + v2s32(25 * s, 3 * s);
//gui::IGUIStaticText *t =
Environment->addStaticText(wstrgettext("Keybindings.").c_str(),
rect, false, true, this, -1);
gui::StaticText::add(Environment, wstrgettext("Keybindings."), rect,
false, true, this, -1);
//t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
}
@ -138,8 +138,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft + v2s32(offset.X, offset.Y);
Environment->addStaticText(k->button_name.c_str(), rect, false, true,
this, -1);
gui::StaticText::add(Environment, k->button_name, rect,
false, true, this, -1);
}
{
@ -300,8 +300,8 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
if (key_in_use && !this->key_used_text) {
core::rect<s32> rect(0, 0, 600, 40);
rect += v2s32(0, 0) + v2s32(25, 30);
this->key_used_text = Environment->addStaticText(
wstrgettext("Key already in use").c_str(),
this->key_used_text = gui::StaticText::add(Environment,
wstrgettext("Key already in use"),
rect, false, true, this, -1);
} else if (!key_in_use && this->key_used_text) {
this->key_used_text->remove();

View File

@ -89,7 +89,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft_client + v2s32(25 * s, ypos + 6 * s);
Environment->addStaticText(wstrgettext("Old Password").c_str(), rect,
gui::StaticText::add(Environment, wstrgettext("Old Password"), rect,
false, true, this, -1);
}
{
@ -104,8 +104,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft_client + v2s32(25 * s, ypos + 6 * s);
Environment->addStaticText(wstrgettext("New Password").c_str(), rect, false, true,
this, -1);
gui::StaticText::add(Environment, wstrgettext("New Password"), rect,
false, true, this, -1);
}
{
core::rect<s32> rect(0, 0, 230 * s, 30 * s);
@ -118,7 +118,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft_client + v2s32(25 * s, ypos + 6 * s);
Environment->addStaticText(wstrgettext("Confirm Password").c_str(), rect,
gui::StaticText::add(Environment, wstrgettext("Confirm Password"), rect,
false, true, this, -1);
}
{
@ -147,9 +147,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{
core::rect<s32> rect(0, 0, 300 * s, 20 * s);
rect += topleft_client + v2s32(35 * s, ypos);
IGUIElement *e = Environment->addStaticText(
wstrgettext("Passwords do not match!").c_str(), rect, false,
true, this, ID_message);
IGUIElement *e = gui::StaticText::add(
Environment, wstrgettext("Passwords do not match!"), rect,
false, true, this, ID_message);
e->setVisible(false);
}
}

View File

@ -73,7 +73,7 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
core::rect<s32> rect(0, 0, 160 * s, 20 * s);
rect = rect + v2s32(size.X / 2 - 80 * s, size.Y / 2 - 70 * s);
Environment->addStaticText(fwgettext("Sound Volume: %d%%", volume).c_str(),
StaticText::add(Environment, fwgettext("Sound Volume: %d%%", volume),
rect, false, true, this, ID_soundText);
}
{