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 "gettext.h"
#include "filesys.h" #include "filesys.h"
#include "../gui/guiSkin.h" #include "../gui/guiSkin.h"
#include "irrlicht_changes/static_text.h"
#include "irr_ptr.h" #include "irr_ptr.h"
RenderingEngine *RenderingEngine::s_singleton = nullptr; 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); core::rect<s32> textrect(center - textsize / 2, center + textsize / 2);
gui::IGUIStaticText *guitext = 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); guitext->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
if (sky && g_settings->getBool("menu_clouds")) { 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); core::rect<s32> rect(0, 0, 600 * s, 40 * s);
rect += topleft + v2s32(25 * s, 3 * s); rect += topleft + v2s32(25 * s, 3 * s);
//gui::IGUIStaticText *t = //gui::IGUIStaticText *t =
Environment->addStaticText(wstrgettext("Keybindings.").c_str(), gui::StaticText::add(Environment, wstrgettext("Keybindings."), rect,
rect, false, true, this, -1); false, true, this, -1);
//t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT); //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); core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft + v2s32(offset.X, offset.Y); rect += topleft + v2s32(offset.X, offset.Y);
Environment->addStaticText(k->button_name.c_str(), rect, false, true, gui::StaticText::add(Environment, k->button_name, rect,
this, -1); false, true, this, -1);
} }
{ {
@ -300,8 +300,8 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
if (key_in_use && !this->key_used_text) { if (key_in_use && !this->key_used_text) {
core::rect<s32> rect(0, 0, 600, 40); core::rect<s32> rect(0, 0, 600, 40);
rect += v2s32(0, 0) + v2s32(25, 30); rect += v2s32(0, 0) + v2s32(25, 30);
this->key_used_text = Environment->addStaticText( this->key_used_text = gui::StaticText::add(Environment,
wstrgettext("Key already in use").c_str(), wstrgettext("Key already in use"),
rect, false, true, this, -1); rect, false, true, this, -1);
} else if (!key_in_use && this->key_used_text) { } else if (!key_in_use && this->key_used_text) {
this->key_used_text->remove(); 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); core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft_client + v2s32(25 * s, ypos + 6 * 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); false, true, this, -1);
} }
{ {
@ -104,8 +104,8 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{ {
core::rect<s32> rect(0, 0, 150 * s, 20 * s); core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft_client + v2s32(25 * s, ypos + 6 * s); rect += topleft_client + v2s32(25 * s, ypos + 6 * s);
Environment->addStaticText(wstrgettext("New Password").c_str(), rect, false, true, gui::StaticText::add(Environment, wstrgettext("New Password"), rect,
this, -1); false, true, this, -1);
} }
{ {
core::rect<s32> rect(0, 0, 230 * s, 30 * s); 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); core::rect<s32> rect(0, 0, 150 * s, 20 * s);
rect += topleft_client + v2s32(25 * s, ypos + 6 * 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); false, true, this, -1);
} }
{ {
@ -147,9 +147,9 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
{ {
core::rect<s32> rect(0, 0, 300 * s, 20 * s); core::rect<s32> rect(0, 0, 300 * s, 20 * s);
rect += topleft_client + v2s32(35 * s, ypos); rect += topleft_client + v2s32(35 * s, ypos);
IGUIElement *e = Environment->addStaticText( IGUIElement *e = gui::StaticText::add(
wstrgettext("Passwords do not match!").c_str(), rect, false, Environment, wstrgettext("Passwords do not match!"), rect,
true, this, ID_message); false, true, this, ID_message);
e->setVisible(false); e->setVisible(false);
} }
} }

View File

@ -73,7 +73,7 @@ void GUIVolumeChange::regenerateGui(v2u32 screensize)
core::rect<s32> rect(0, 0, 160 * s, 20 * s); core::rect<s32> rect(0, 0, 160 * s, 20 * s);
rect = rect + v2s32(size.X / 2 - 80 * s, size.Y / 2 - 70 * 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); rect, false, true, this, ID_soundText);
} }
{ {