diff --git a/src/xrGame/UIGameAHunt.cpp b/src/xrGame/UIGameAHunt.cpp index 848c12b3881..b2297f08313 100644 --- a/src/xrGame/UIGameAHunt.cpp +++ b/src/xrGame/UIGameAHunt.cpp @@ -21,7 +21,7 @@ void CUIGameAHunt::Init(int stage) if (stage == 0) { // shared inherited::Init(stage); - m_buy_msg_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_ah_buy", Window); + m_buy_msg_caption = UIHelper::CreateStatic(*MsgConfig, "mp_ah_buy", Window); } if (stage == 1) { // unique @@ -31,16 +31,16 @@ void CUIGameAHunt::Init(int stage) uiXml.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "ui_game_ahunt.xml"); CUIXmlInit::InitWindow(uiXml, "global", 0, Window); - CUIXmlInit::InitTextWnd(uiXml, "fraglimit", 0, m_pFragLimitIndicator); + CUIXmlInit::InitStatic(uiXml, "fraglimit", 0, m_pFragLimitIndicator); - m_pReinforcementInidcator = xr_new(); + m_pReinforcementInidcator = xr_new("Reinforcement indicator"); m_pReinforcementInidcator->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(uiXml, "reinforcement", 0, m_pReinforcementInidcator); + CUIXmlInit::InitStatic(uiXml, "reinforcement", 0, m_pReinforcementInidcator); CUIXmlInit::InitStatic(uiXml, "team1_icon", 0, m_team1_icon); CUIXmlInit::InitStatic(uiXml, "team2_icon", 0, m_team2_icon); - CUIXmlInit::InitTextWnd(uiXml, "team1_score", 0, m_team1_score); - CUIXmlInit::InitTextWnd(uiXml, "team2_score", 0, m_team2_score); + CUIXmlInit::InitStatic(uiXml, "team1_score", 0, m_team1_score); + CUIXmlInit::InitStatic(uiXml, "team2_score", 0, m_team2_score); m_pMoneyIndicator->InitFromXML(uiXml); m_pRankIndicator->InitFromXml(uiXml); diff --git a/src/xrGame/UIGameAHunt.h b/src/xrGame/UIGameAHunt.h index bbcb37663e0..11bc150be3e 100644 --- a/src/xrGame/UIGameAHunt.h +++ b/src/xrGame/UIGameAHunt.h @@ -10,7 +10,6 @@ class CUIAHuntFragList; class CUIAHuntPlayerList; class game_cl_ArtefactHunt; -class CUITextWnd; class CUIMessageBoxEx; class CUIGameAHunt : public CUIGameTDM @@ -20,7 +19,7 @@ class CUIGameAHunt : public CUIGameTDM typedef CUIGameTDM inherited; public: - CUITextWnd* m_pReinforcementInidcator; + CUIStatic* m_pReinforcementInidcator; CUIMessageBoxEx* m_pBuySpawnMsgBox; public: @@ -33,5 +32,5 @@ class CUIGameAHunt : public CUIGameTDM void SetBuyMsgCaption(LPCSTR str); protected: - CUITextWnd* m_buy_msg_caption; + CUIStatic* m_buy_msg_caption; }; diff --git a/src/xrGame/UIGameCTA.cpp b/src/xrGame/UIGameCTA.cpp index 136959e94f3..97c3cca6edc 100644 --- a/src/xrGame/UIGameCTA.cpp +++ b/src/xrGame/UIGameCTA.cpp @@ -50,14 +50,14 @@ void CUIGameCTA::Init(int stage) { if (stage == 0) { - m_round_result_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_round_result", Window); - m_pressbuy_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_pressbuy", Window); - m_pressjump_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_pressjump", Window); - m_spectator_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_spectator", Window); - m_spectrmode_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_spetatormode", Window); - m_warm_up_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_warm_up", Window); - m_time_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_timelimit", Window); - m_demo_play_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_demo_play", Window); + m_round_result_caption = UIHelper::CreateStatic(*MsgConfig, "mp_round_result", Window); + m_pressbuy_caption = UIHelper::CreateStatic(*MsgConfig, "mp_pressbuy", Window); + m_pressjump_caption = UIHelper::CreateStatic(*MsgConfig, "mp_pressjump", Window); + m_spectator_caption = UIHelper::CreateStatic(*MsgConfig, "mp_spectator", Window); + m_spectrmode_caption = UIHelper::CreateStatic(*MsgConfig, "mp_spetatormode", Window); + m_warm_up_caption = UIHelper::CreateStatic(*MsgConfig, "mp_warm_up", Window); + m_time_caption = UIHelper::CreateStatic(*MsgConfig, "mp_timelimit", Window); + m_demo_play_caption = UIHelper::CreateStatic(*MsgConfig, "mp_demo_play", Window); teamPanels = xr_new(); teamPanels->Init(TEAM_PANELS_XML_NAME, "team_panels_wnd"); @@ -75,25 +75,25 @@ void CUIGameCTA::Init(int stage) m_pRankIndicator->SetAutoDelete(true); m_pRankIndicator->InitFromXml(uiXml); - m_pReinforcementInidcator = xr_new(); + m_pReinforcementInidcator = xr_new("Reinforcement indicator"); m_pReinforcementInidcator->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(uiXml, "reinforcement", 0, m_pReinforcementInidcator); + CUIXmlInit::InitStatic(uiXml, "reinforcement", 0, m_pReinforcementInidcator); m_team1_icon = xr_new("Team 1 icon"); m_team2_icon = xr_new("Team 2 icon"); CUIXmlInit::InitStatic(uiXml, "team1_icon", 0, m_team1_icon); CUIXmlInit::InitStatic(uiXml, "team2_icon", 0, m_team2_icon); - m_team1_score = xr_new(); - m_team2_score = xr_new(); + m_team1_score = xr_new("Team 1 score"); + m_team2_score = xr_new("Team 2 score"); m_team1_score->SetAutoDelete(true); m_team2_score->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(uiXml, "team1_score", 0, m_team1_score); - CUIXmlInit::InitTextWnd(uiXml, "team2_score", 0, m_team2_score); + CUIXmlInit::InitStatic(uiXml, "team1_score", 0, m_team1_score); + CUIXmlInit::InitStatic(uiXml, "team2_score", 0, m_team2_score); - m_pFragLimitIndicator = xr_new(); + m_pFragLimitIndicator = xr_new("Frag limit indicator"); m_pFragLimitIndicator->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(uiXml, "fraglimit", 0, m_pFragLimitIndicator); + CUIXmlInit::InitStatic(uiXml, "fraglimit", 0, m_pFragLimitIndicator); } if (stage == 2) diff --git a/src/xrGame/UIGameCTA.h b/src/xrGame/UIGameCTA.h index 71ee1e51385..674b875895e 100644 --- a/src/xrGame/UIGameCTA.h +++ b/src/xrGame/UIGameCTA.h @@ -23,7 +23,6 @@ class CUIProgressShape; class CUIMessageBoxEx; class UIVoteStatusWnd; class game_cl_CaptureTheArtefact; -class CUITextWnd; /// This class used to control UI part of client for Capture the Artefact mp game mode. class CUIGameCTA : public UIGameMP @@ -31,14 +30,14 @@ class CUIGameCTA : public UIGameMP CUISpawnWnd* m_pUITeamSelectWnd; CUIStatic* m_team1_icon; CUIStatic* m_team2_icon; - CUITextWnd* m_team1_score{}; - CUITextWnd* m_team2_score{}; - CUITextWnd* m_pFragLimitIndicator{}; + CUIStatic* m_team1_score{}; + CUIStatic* m_team2_score{}; + CUIStatic* m_pFragLimitIndicator{}; game_cl_CaptureTheArtefact* m_game{}; CUIMoneyIndicator* m_pMoneyIndicator; CUIRankIndicator* m_pRankIndicator; - CUITextWnd* m_pReinforcementInidcator; + CUIStatic* m_pReinforcementInidcator; CUIMessageBoxEx* m_pBuySpawnMsgBox{}; UIVoteStatusWnd* m_voteStatusWnd{}; @@ -52,15 +51,15 @@ class CUIGameCTA : public UIGameMP UITeamPanels* teamPanels{}; bool m_team_panels_shown{}; - CUITextWnd* m_spectator_caption; - CUITextWnd* m_pressjump_caption; - CUITextWnd* m_pressbuy_caption; - CUITextWnd* m_round_result_caption; - CUITextWnd* m_force_respawn_time_caption; - CUITextWnd* m_spectrmode_caption; - CUITextWnd* m_warm_up_caption; - CUITextWnd* m_time_caption; - CUITextWnd* m_demo_play_caption; + CUIStatic* m_spectator_caption; + CUIStatic* m_pressjump_caption; + CUIStatic* m_pressbuy_caption; + CUIStatic* m_round_result_caption; + CUIStatic* m_force_respawn_time_caption; + CUIStatic* m_spectrmode_caption; + CUIStatic* m_warm_up_caption; + CUIStatic* m_time_caption; + CUIStatic* m_demo_play_caption; struct PresetItem { diff --git a/src/xrGame/UIGameDM.cpp b/src/xrGame/UIGameDM.cpp index 056fb063d27..60a62096406 100644 --- a/src/xrGame/UIGameDM.cpp +++ b/src/xrGame/UIGameDM.cpp @@ -51,19 +51,19 @@ void CUIGameDM::Init(int stage) m_pMoneyIndicator->SetAutoDelete(true); m_pRankIndicator = xr_new(); m_pRankIndicator->SetAutoDelete(true); - m_pFragLimitIndicator = xr_new(); + m_pFragLimitIndicator = xr_new("Frag limit indicator"); m_pFragLimitIndicator->SetAutoDelete(true); inherited::Init(stage); - m_time_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_timelimit", Window); - m_spectrmode_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_spetatormode", Window); - m_spectator_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_spectator", Window); - m_pressjump_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_pressjump", Window); - m_pressbuy_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_pressbuy", Window); - m_round_result_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_round_result", Window); - m_force_respawn_time_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_force_respawn_time", Window); - m_demo_play_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_demo_play", Window); - m_warm_up_caption = UIHelper::CreateTextWnd(*MsgConfig, "mp_warm_up", Window); + m_time_caption = UIHelper::CreateStatic(*MsgConfig, "mp_timelimit", Window); + m_spectrmode_caption = UIHelper::CreateStatic(*MsgConfig, "mp_spetatormode", Window); + m_spectator_caption = UIHelper::CreateStatic(*MsgConfig, "mp_spectator", Window); + m_pressjump_caption = UIHelper::CreateStatic(*MsgConfig, "mp_pressjump", Window); + m_pressbuy_caption = UIHelper::CreateStatic(*MsgConfig, "mp_pressbuy", Window); + m_round_result_caption = UIHelper::CreateStatic(*MsgConfig, "mp_round_result", Window); + m_force_respawn_time_caption = UIHelper::CreateStatic(*MsgConfig, "mp_force_respawn_time", Window); + m_demo_play_caption = UIHelper::CreateStatic(*MsgConfig, "mp_demo_play", Window); + m_warm_up_caption = UIHelper::CreateStatic(*MsgConfig, "mp_warm_up", Window); } if (stage == 1) { // unique @@ -73,7 +73,7 @@ void CUIGameDM::Init(int stage) CUIXmlInit::InitWindow(uiXml, "global", 0, Window); m_pMoneyIndicator->InitFromXML(uiXml); m_pRankIndicator->InitFromXml(uiXml); - CUIXmlInit::InitTextWnd(uiXml, "fraglimit", 0, m_pFragLimitIndicator); + CUIXmlInit::InitStatic(uiXml, "fraglimit", 0, m_pFragLimitIndicator); } if (stage == 2) { // after diff --git a/src/xrGame/UIGameDM.h b/src/xrGame/UIGameDM.h index c45d9a93a6a..d7e400c22ae 100644 --- a/src/xrGame/UIGameDM.h +++ b/src/xrGame/UIGameDM.h @@ -11,7 +11,6 @@ class CUIRankIndicator; class UIVoteStatusWnd; class CUIMapDesc; class UITeamPanels; -class CUITextWnd; class CUIGameDM : public UIGameMP { @@ -27,19 +26,19 @@ class CUIGameDM : public UIGameMP UITeamPanels* m_pTeamPanels; - CUITextWnd* m_time_caption; - CUITextWnd* m_spectrmode_caption; - CUITextWnd* m_spectator_caption; - CUITextWnd* m_pressjump_caption; - CUITextWnd* m_pressbuy_caption; - CUITextWnd* m_round_result_caption; - CUITextWnd* m_force_respawn_time_caption; - CUITextWnd* m_demo_play_caption; - CUITextWnd* m_warm_up_caption; + CUIStatic* m_time_caption; + CUIStatic* m_spectrmode_caption; + CUIStatic* m_spectator_caption; + CUIStatic* m_pressjump_caption; + CUIStatic* m_pressbuy_caption; + CUIStatic* m_round_result_caption; + CUIStatic* m_force_respawn_time_caption; + CUIStatic* m_demo_play_caption; + CUIStatic* m_warm_up_caption; CUIMoneyIndicator* m_pMoneyIndicator; CUIRankIndicator* m_pRankIndicator; - CUITextWnd* m_pFragLimitIndicator; + CUIStatic* m_pFragLimitIndicator; UIVoteStatusWnd* m_voteStatusWnd; public: diff --git a/src/xrGame/UIGameTDM.cpp b/src/xrGame/UIGameTDM.cpp index 693e7e04b7d..a369762a6a7 100644 --- a/src/xrGame/UIGameTDM.cpp +++ b/src/xrGame/UIGameTDM.cpp @@ -32,15 +32,15 @@ void CUIGameTDM::Init(int stage) m_pUITeamSelectWnd = xr_new(); m_team1_icon = xr_new("Team 1 icon"); m_team2_icon = xr_new("Team 2 icon"); - m_team1_score = xr_new(); + m_team1_score = xr_new("Team 1 score"); m_team1_score->SetAutoDelete(true); - m_team2_score = xr_new(); + m_team2_score = xr_new("Team 2 score"); m_team2_score->SetAutoDelete(true); - m_buy_msg_caption = xr_new(); + m_buy_msg_caption = xr_new("Buy message caption"); m_buy_msg_caption->SetAutoDelete(true); inherited::Init(stage); - CUIXmlInit::InitTextWnd(*MsgConfig, "mp_tdm_buy", 0, m_buy_msg_caption); + CUIXmlInit::InitStatic(*MsgConfig, "mp_tdm_buy", 0, m_buy_msg_caption); } if (stage == 1) { // unique @@ -52,9 +52,9 @@ void CUIGameTDM::Init(int stage) CUIXmlInit::InitWindow(uiXml, "global", 0, Window); CUIXmlInit::InitStatic(uiXml, "team1_icon", 0, m_team1_icon); CUIXmlInit::InitStatic(uiXml, "team2_icon", 0, m_team2_icon); - CUIXmlInit::InitTextWnd(uiXml, "team1_score", 0, m_team1_score); - CUIXmlInit::InitTextWnd(uiXml, "team2_score", 0, m_team2_score); - CUIXmlInit::InitTextWnd(uiXml, "fraglimit", 0, m_pFragLimitIndicator); + CUIXmlInit::InitStatic(uiXml, "team1_score", 0, m_team1_score); + CUIXmlInit::InitStatic(uiXml, "team2_score", 0, m_team2_score); + CUIXmlInit::InitStatic(uiXml, "fraglimit", 0, m_pFragLimitIndicator); m_pMoneyIndicator->InitFromXML(uiXml); m_pRankIndicator->InitFromXml(uiXml); diff --git a/src/xrGame/UIGameTDM.h b/src/xrGame/UIGameTDM.h index 69f087aac39..7296fa0c079 100644 --- a/src/xrGame/UIGameTDM.h +++ b/src/xrGame/UIGameTDM.h @@ -13,7 +13,6 @@ class CUITDMPlayerList; class CUISkinSelectorWnd; class game_cl_TeamDeathmatch; class CUIStatic; -class CUITextWnd; class CUISpawnWnd; class CUIGameTDM : public CUIGameDM @@ -28,9 +27,9 @@ class CUIGameTDM : public CUIGameDM protected: CUIStatic* m_team1_icon; CUIStatic* m_team2_icon; - CUITextWnd* m_team1_score; - CUITextWnd* m_team2_score; - CUITextWnd* m_buy_msg_caption; + CUIStatic* m_team1_score; + CUIStatic* m_team2_score; + CUIStatic* m_buy_msg_caption; public: CUIGameTDM(); diff --git a/src/xrGame/UIPlayerItem.cpp b/src/xrGame/UIPlayerItem.cpp index 1ec0a80553d..91bc9cb2cff 100644 --- a/src/xrGame/UIPlayerItem.cpp +++ b/src/xrGame/UIPlayerItem.cpp @@ -53,11 +53,11 @@ void UIPlayerItem::InitTextParams(CUIXml& uiXml) if (!text_param_node) break; LPCSTR param_name = uiXml.ReadAttrib(text_param_node, "name", "param_name_not_set_in_name_attribute"); - CUITextWnd* temp_static = xr_new(); + auto* temp_static = xr_new("Text param"); VERIFY(temp_static); this->AttachChild(temp_static); temp_static->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(uiXml, TEXTPARAM_NODE_NAME, i, temp_static); + CUIXmlInit::InitStatic(uiXml, TEXTPARAM_NODE_NAME, i, temp_static); m_text_params.emplace(shared_str(param_name), temp_static); } } @@ -85,8 +85,8 @@ void UIPlayerItem::InitIconParams(CUIXml& uiXml) void UIPlayerItem::UpdateTextParams(game_PlayerState const* ps) { buffer_vector value_store(xr_alloca(512), 512, 512, char(0)); - TMapStrToUIText::iterator ie = m_text_params.end(); - for (TMapStrToUIText::iterator i = m_text_params.begin(); i != ie; ++i) + const auto ie = m_text_params.end(); + for (auto i = m_text_params.begin(); i != ie; ++i) { VERIFY(i->second); GetTextParamValue(ps, i->first, value_store); @@ -98,8 +98,8 @@ void UIPlayerItem::UpdateTextParams(game_PlayerState const* ps) void UIPlayerItem::UpdateIconParams(game_PlayerState const* ps) { buffer_vector value_store(xr_alloca(512), 512, 512, char(0)); - TMapStrToUIStatic::iterator ie = m_icon_params.end(); - for (TMapStrToUIStatic::iterator i = m_icon_params.begin(); i != ie; ++i) + const auto ie = m_icon_params.end(); + for (auto i = m_icon_params.begin(); i != ie; ++i) { VERIFY(i->second); GetIconParamValue(ps, i->first, value_store); diff --git a/src/xrGame/UIPlayerItem.h b/src/xrGame/UIPlayerItem.h index fb929b47d9f..b38168a1391 100644 --- a/src/xrGame/UIPlayerItem.h +++ b/src/xrGame/UIPlayerItem.h @@ -19,8 +19,8 @@ class UIPlayerItem final : public CUIWindow { private: typedef CUIWindow inherited; - typedef AssociativeVector TMapStrToUIText; - typedef AssociativeVector TMapStrToUIStatic; + typedef AssociativeVector TMapStrToUIText; + typedef AssociativeVector TMapStrToUIStats; // this is for the case when user disconnects. // we just call method RemovePlayer UITeamState* m_teamState; @@ -30,7 +30,7 @@ class UIPlayerItem final : public CUIWindow s32 m_checkPoints; TMapStrToUIText m_text_params; - TMapStrToUIStatic m_icon_params; + TMapStrToUIStats m_icon_params; ClientID myClientId; UIPlayerItem(); diff --git a/src/xrGame/UIZoneMap.cpp b/src/xrGame/UIZoneMap.cpp index f7043a887da..777e17ff01d 100644 --- a/src/xrGame/UIZoneMap.cpp +++ b/src/xrGame/UIZoneMap.cpp @@ -93,7 +93,7 @@ void CUIZoneMap::Init(bool motionIconAttached) { CUIXmlInit::InitStatic(uiXml, "minimap:static_counter", 0, &m_Counter); m_background.AttachChild(&m_Counter); - CUIXmlInit::InitTextWnd(uiXml, "minimap:static_counter:text_static", 0, &m_Counter_text); + CUIXmlInit::InitStatic(uiXml, "minimap:static_counter:text_static", 0, &m_Counter_text); m_Counter.AttachChild(&m_Counter_text); if (motionIconAttached) diff --git a/src/xrGame/UIZoneMap.h b/src/xrGame/UIZoneMap.h index 7b64fcd6cff..fcbe6f79c56 100644 --- a/src/xrGame/UIZoneMap.h +++ b/src/xrGame/UIZoneMap.h @@ -18,7 +18,7 @@ class CUIZoneMap CUIStatic m_compass{ "Compass" }; CUIWindow m_clipFrame{ "Clip frame" }; CUIStatic m_Counter{ "Counter" }; - CUITextWnd m_Counter_text{}; + CUIStatic m_Counter_text{ "Counter text" }; CUIStatic* m_clock_wnd{}; CUIStatic* m_pointerDistanceText{}; diff --git a/src/xrGame/ui/ChangeWeatherDialog.cpp b/src/xrGame/ui/ChangeWeatherDialog.cpp index e065c276816..a3da7be7e3f 100644 --- a/src/xrGame/ui/ChangeWeatherDialog.cpp +++ b/src/xrGame/ui/ChangeWeatherDialog.cpp @@ -15,7 +15,7 @@ ButtonListDialog::ButtonListDialog(pcstr window_name) Background = xr_new("Background"); Background->SetAutoDelete(true); AttachChild(Background); - Header = xr_new(); + Header = xr_new("Header"); Header->SetAutoDelete(true); AttachChild(Header); CancelButton = xr_new(); @@ -32,7 +32,7 @@ void ButtonListDialog::Initialize(int buttonCount) btn.Button = xr_new(); btn.Button->SetAutoDelete(true); AttachChild(btn.Button); - btn.Text = xr_new(); + btn.Text = xr_new("Text"); btn.Text->SetAutoDelete(true); AttachChild(btn.Text); buttons.push_back(btn); @@ -81,7 +81,7 @@ void ButtonListDialog::SendMessage(CUIWindow* wnd, s16 msg, void* data /*= nullp void ChangeWeatherDialog::InitChangeWeather(CUIXml& xmlDoc) { CUIXmlInit::InitWindow(xmlDoc, "change_weather", 0, this); - CUIXmlInit::InitTextWnd(xmlDoc, "change_weather:header", 0, Header); + CUIXmlInit::InitStatic(xmlDoc, "change_weather:header", 0, Header); CUIXmlInit::InitStatic(xmlDoc, "change_weather:background", 0, Background); CUIXmlInit::Init3tButton(xmlDoc, "change_weather:btn_cancel", 0, CancelButton); auto& gameWeathers = gMapListHelper.GetGameWeathers(); @@ -96,7 +96,7 @@ void ChangeWeatherDialog::InitChangeWeather(CUIXml& xmlDoc) xr_sprintf(path, "change_weather:btn_%d", i+1); CUIXmlInit::Init3tButton(xmlDoc, path, 0, GetButton(i).Button); xr_sprintf(path, "change_weather:txt_%d", i+1); - CUIXmlInit::InitTextWnd(xmlDoc, path, 0, GetButton(i).Text); + CUIXmlInit::InitStatic(xmlDoc, path, 0, GetButton(i).Text); } Log("! Weathers name sorted by alphabet !"); weathers[0].Name = gameWeathers[0].Name; @@ -120,7 +120,7 @@ void ChangeWeatherDialog::OnButtonClick(int i) void ChangeGameTypeDialog::InitChangeGameType(CUIXml& xmlDoc) { CUIXmlInit::InitWindow(xmlDoc, "change_gametype", 0, this); - CUIXmlInit::InitTextWnd(xmlDoc, "change_gametype:header", 0, Header); + CUIXmlInit::InitStatic(xmlDoc, "change_gametype:header", 0, Header); CUIXmlInit::InitStatic(xmlDoc, "change_gametype:background", 0, Background); CUIXmlInit::Init3tButton(xmlDoc, "change_gametype:btn_cancel", 0, CancelButton); // XXX nitrocaster: get it from somewhere @@ -133,7 +133,7 @@ void ChangeGameTypeDialog::InitChangeGameType(CUIXml& xmlDoc) xr_sprintf(path, "change_gametype:btn_%d", i + 1); CUIXmlInit::Init3tButton(xmlDoc, path, 0, GetButton(i).Button); xr_sprintf(path, "change_gametype:txt_%d", i + 1); - CUIXmlInit::InitTextWnd(xmlDoc, path, 0, GetButton(i).Text); + CUIXmlInit::InitStatic(xmlDoc, path, 0, GetButton(i).Text); gameTypes[i] = xmlDoc.ReadAttrib(path, 0, "id"); } } diff --git a/src/xrGame/ui/ChangeWeatherDialog.hpp b/src/xrGame/ui/ChangeWeatherDialog.hpp index ce7e0b704fd..5d9b8a291c5 100644 --- a/src/xrGame/ui/ChangeWeatherDialog.hpp +++ b/src/xrGame/ui/ChangeWeatherDialog.hpp @@ -3,7 +3,6 @@ #include "UIDialogWnd.h" class CUIStatic; -class CUITextWnd; class CUI3tButton; class CUIKickPlayer; class CUIChangeMap; @@ -15,10 +14,10 @@ class ButtonListDialog : public CUIDialogWnd struct NamedButton { CUI3tButton* Button; - CUITextWnd* Text; + CUIStatic* Text; }; - CUITextWnd* Header; + CUIStatic* Header; CUIStatic* Background; CUI3tButton* CancelButton; diff --git a/src/xrGame/ui/UIAchievements.cpp b/src/xrGame/ui/UIAchievements.cpp index 489a9a6c551..39849187bdf 100644 --- a/src/xrGame/ui/UIAchievements.cpp +++ b/src/xrGame/ui/UIAchievements.cpp @@ -22,8 +22,8 @@ void CUIAchievements::init_from_xml(CUIXml& xml) XML_NODE node = xml.NavigateToNode("achievements_itm", 0); xml.SetLocalRoot(node); - m_name = UIHelper::CreateTextWnd(xml, "name", this); - m_descr = UIHelper::CreateTextWnd(xml, "descr", this); + m_name = UIHelper::CreateStatic(xml, "name", this); + m_descr = UIHelper::CreateStatic(xml, "descr", this); m_icon = UIHelper::CreateStatic(xml, "icon", this); m_hint = UIHelper::CreateHint(xml, "hint_wnd"); diff --git a/src/xrGame/ui/UIAchievements.h b/src/xrGame/ui/UIAchievements.h index 5d23ac2fb21..e18e7a453f9 100644 --- a/src/xrGame/ui/UIAchievements.h +++ b/src/xrGame/ui/UIAchievements.h @@ -3,7 +3,6 @@ class CUIXml; class CUIStatic; -class CUITextWnd; class UIHint; class CUIScrollView; @@ -13,8 +12,8 @@ class CUIAchievements final : public CUIWindow private: CUIScrollView* m_parent{}; - CUITextWnd* m_name{}; - CUITextWnd* m_descr{}; + CUIStatic* m_name{}; + CUIStatic* m_descr{}; CUIStatic* m_icon{}; UIHint* m_hint{}; string128 m_functor_str; diff --git a/src/xrGame/ui/UIActorMenu.h b/src/xrGame/ui/UIActorMenu.h index cc54826dfec..ecf76bcd22f 100644 --- a/src/xrGame/ui/UIActorMenu.h +++ b/src/xrGame/ui/UIActorMenu.h @@ -14,7 +14,6 @@ class ui_actor_state_wnd; class CUIItemInfo; class CUIFrameLineWnd; class CUIStatic; -class CUITextWnd; class CUI3tButton; class CInventoryOwner; class CInventoryBox; diff --git a/src/xrGame/ui/UIBoosterInfo.cpp b/src/xrGame/ui/UIBoosterInfo.cpp index 9f69c24270a..91fbe37a579 100644 --- a/src/xrGame/ui/UIBoosterInfo.cpp +++ b/src/xrGame/ui/UIBoosterInfo.cpp @@ -208,7 +208,7 @@ void UIBoosterInfoItem::Init(CUIXml& xml, LPCSTR section) xml.SetLocalRoot(xml.NavigateToNode(section)); m_caption = UIHelper::CreateStatic(xml, "caption", this); - m_value = UIHelper::CreateTextWnd(xml, "value", this); + m_value = UIHelper::CreateStatic(xml, "value", this); m_magnitude = xml.ReadAttribFlt("value", 0, "magnitude", 1.0f); m_show_sign = (xml.ReadAttribInt("value", 0, "show_sign", 1) == 1); diff --git a/src/xrGame/ui/UIBoosterInfo.h b/src/xrGame/ui/UIBoosterInfo.h index 68f2198f5d1..246c1a32b9b 100644 --- a/src/xrGame/ui/UIBoosterInfo.h +++ b/src/xrGame/ui/UIBoosterInfo.h @@ -4,7 +4,6 @@ class CUIXml; class CUIStatic; -class CUITextWnd; class UIBoosterInfoItem; class CUIBoosterInfo final : public CUIWindow @@ -42,7 +41,7 @@ class UIBoosterInfoItem final : public CUIWindow private: CUIStatic* m_caption{}; - CUITextWnd* m_value{}; + CUIStatic* m_value{}; float m_magnitude; bool m_show_sign; shared_str m_unit_str; diff --git a/src/xrGame/ui/UIChangeMap.cpp b/src/xrGame/ui/UIChangeMap.cpp index 7ff549107cd..3a7ec32764e 100644 --- a/src/xrGame/ui/UIChangeMap.cpp +++ b/src/xrGame/ui/UIChangeMap.cpp @@ -22,7 +22,7 @@ CUIChangeMap::CUIChangeMap() : CUIDialogWnd(CUIChangeMap::GetDebugType()) bkgrnd->SetAutoDelete(true); AttachChild(bkgrnd); - header = xr_new(); + header = xr_new("Header"); header->SetAutoDelete(true); AttachChild(header); @@ -34,7 +34,7 @@ CUIChangeMap::CUIChangeMap() : CUIDialogWnd(CUIChangeMap::GetDebugType()) map_frame->SetAutoDelete(true); AttachChild(map_frame); - map_version = xr_new(); + map_version = xr_new("Map version"); map_version->SetAutoDelete(true); AttachChild(map_version); @@ -62,10 +62,10 @@ CUIChangeMap::CUIChangeMap() : CUIDialogWnd(CUIChangeMap::GetDebugType()) void CUIChangeMap::InitChangeMap(CUIXml& xml_doc) { CUIXmlInit::InitWindow(xml_doc, "change_map", 0, this); - CUIXmlInit::InitTextWnd(xml_doc, "change_map:header", 0, header); + CUIXmlInit::InitStatic(xml_doc, "change_map:header", 0, header); CUIXmlInit::InitStatic(xml_doc, "change_map:background", 0, bkgrnd); CUIXmlInit::InitStatic(xml_doc, "change_map:map_frame", 0, map_frame); - CUIXmlInit::InitTextWnd(xml_doc, "change_map:map_ver_txt", 0, map_version); + CUIXmlInit::InitStatic(xml_doc, "change_map:map_ver_txt", 0, map_version); CUIXmlInit::InitStatic(xml_doc, "change_map:map_pic", 0, map_pic); // CUIXmlInit::InitFrameWindow (xml_doc, "change_map:list_back", 0, lst_back); // CUIXmlInit::InitFrameWindow (xml_doc, "change_map:frame", 0, frame); diff --git a/src/xrGame/ui/UIChangeMap.h b/src/xrGame/ui/UIChangeMap.h index 6c668006054..546c2fc73f4 100644 --- a/src/xrGame/ui/UIChangeMap.h +++ b/src/xrGame/ui/UIChangeMap.h @@ -3,7 +3,6 @@ #include "UIDialogWnd.h" class CUIStatic; -class CUITextWnd; class CUI3tButton; class CUIFrameWindow; class CUIListBox; @@ -28,10 +27,10 @@ class CUIChangeMap final : public CUIDialogWnd void FillUpList(); CUIStatic* bkgrnd; - CUITextWnd* header; + CUIStatic* header; CUIStatic* map_pic; CUIStatic* map_frame; - CUITextWnd* map_version; + CUIStatic* map_version; CUIFrameWindow* frame; CUIFrameWindow* lst_back; CUIListBox* lst; diff --git a/src/xrGame/ui/UICharacterInfo.cpp b/src/xrGame/ui/UICharacterInfo.cpp index e3367896ab5..e4e08f91eea 100644 --- a/src/xrGame/ui/UICharacterInfo.cpp +++ b/src/xrGame/ui/UICharacterInfo.cpp @@ -157,7 +157,7 @@ void CUICharacterInfo::InitCharacter(u16 id) pUIBio->Clear(); if (chInfo.Bio().size()) { - CUITextWnd* pItem = xr_new(); + auto* pItem = xr_new("Biography"); pItem->SetWidth(pUIBio->GetDesiredChildWidth()); pItem->SetText(chInfo.Bio().c_str()); pItem->AdjustHeightToText(); diff --git a/src/xrGame/ui/UIChatWnd.cpp b/src/xrGame/ui/UIChatWnd.cpp index e8fff98a62e..259b45ec6cc 100644 --- a/src/xrGame/ui/UIChatWnd.cpp +++ b/src/xrGame/ui/UIChatWnd.cpp @@ -19,16 +19,16 @@ void CUIChatWnd::PendingMode(bool const is_pending_mode) if (pendingGameMode) return; - UIPrefix->SetWndRect(pending_prefix_rect); - UIEditBox->SetWndRect(pending_edit_rect); + UIPrefix.SetWndRect(pending_prefix_rect); + UIEditBox.SetWndRect(pending_edit_rect); pendingGameMode = true; return; } if (!pendingGameMode) return; - UIPrefix->SetWndRect(inprogress_prefix_rect); - UIEditBox->SetWndRect(inprogress_edit_rect); + UIPrefix.SetWndRect(inprogress_prefix_rect); + UIEditBox.SetWndRect(inprogress_edit_rect); pendingGameMode = false; } @@ -37,12 +37,14 @@ const pcstr CHAT_EDITBOX_PENDING = "chat_editbox_pending"; void CUIChatWnd::Init(CUIXml& uiXml) { - UIPrefix = UIHelper::CreateTextWnd(uiXml, "chat_prefix", this); - inprogress_prefix_rect = UIPrefix->GetWndRect(); + AttachChild(&UIPrefix); + CUIXmlInit::InitStatic(uiXml, "chat_prefix", 0, &UIPrefix); + inprogress_prefix_rect = UIPrefix.GetWndRect(); - UIEditBox = UIHelper::CreateEditBox(uiXml, "chat_edit_box", this); - inprogress_edit_rect = UIEditBox->GetWndRect(); - UIEditBox->SetWindowName("chat_edit_box"); + AttachChild(&UIEditBox); + CUIXmlInit::InitEditBox(uiXml, "chat_edit_box", 0, &UIEditBox); + inprogress_edit_rect = UIEditBox.GetWndRect(); + UIEditBox.SetWindowName("chat_edit_box"); pendingGameMode = false; @@ -61,32 +63,32 @@ void CUIChatWnd::Init(CUIXml& uiXml) pending_edit_rect.y2 = uiXml.ReadAttribFlt(CHAT_EDITBOX_PENDING, 0, "height"); pending_edit_rect.rb.add(pending_edit_rect.lt); - Register(UIEditBox); - AddCallback(UIEditBox, EDIT_TEXT_COMMIT, CUIWndCallback::void_function(this, &CUIChatWnd::OnChatCommit)); - AddCallback(UIEditBox, EDIT_TEXT_CANCEL, CUIWndCallback::void_function(this, &CUIChatWnd::OnChatCancel)); + Register(&UIEditBox); + AddCallback(&UIEditBox, EDIT_TEXT_COMMIT, CUIWndCallback::void_function(this, &CUIChatWnd::OnChatCommit)); + AddCallback(&UIEditBox, EDIT_TEXT_CANCEL, CUIWndCallback::void_function(this, &CUIChatWnd::OnChatCancel)); } void CUIChatWnd::SetEditBoxPrefix(LPCSTR prefix) { - UIPrefix->SetText(prefix); - UIPrefix->AdjustWidthToText(); + UIPrefix.SetText(prefix); + UIPrefix.AdjustWidthToText(); Fvector2 _pos; - _pos.x = UIPrefix->GetWndPos().x + UIPrefix->GetWidth() + 5.0f; - _pos.y = UIEditBox->GetWndPos().y; - UIEditBox->SetWndPos(_pos); - UIEditBox->ClearText(); + _pos.x = UIPrefix.GetWndPos().x + UIPrefix.GetWidth() + 5.0f; + _pos.y = UIEditBox.GetWndPos().y; + UIEditBox.SetWndPos(_pos); + UIEditBox.ClearText(); } void CUIChatWnd::Show(bool status) { - UIEditBox->CaptureFocus(status); + UIEditBox.CaptureFocus(status); inherited::Show(status); } void CUIChatWnd::SendMessage(CUIWindow* pWnd, s16 msg, void* pData) { CUIWndCallback::OnEvent(pWnd, msg, pData); } void CUIChatWnd::OnChatCommit(CUIWindow* w, void* d) { - Game().ChatSay(UIEditBox->GetText(), sendNextMessageToAll); + Game().ChatSay(UIEditBox.GetText(), sendNextMessageToAll); HideDialog(); } diff --git a/src/xrGame/ui/UIChatWnd.h b/src/xrGame/ui/UIChatWnd.h index e3fa905a570..a89a025c262 100644 --- a/src/xrGame/ui/UIChatWnd.h +++ b/src/xrGame/ui/UIChatWnd.h @@ -5,7 +5,6 @@ class CUIXml; class CUIGameLog; class CUIEditBox; -class CUITextWnd; class CUIChatWnd final : public CUIDialogWnd, public CUIWndCallback { @@ -25,8 +24,8 @@ class CUIChatWnd final : public CUIDialogWnd, public CUIWndCallback pcstr GetDebugType() override { return "CUIChatWnd"; } protected: - CUIEditBox* UIEditBox; - CUITextWnd* UIPrefix; + CUIEditBox UIEditBox; + CUIStatic UIPrefix{ "Chat prefix" }; bool sendNextMessageToAll; bool pendingGameMode; diff --git a/src/xrGame/ui/UIDebugFonts.cpp b/src/xrGame/ui/UIDebugFonts.cpp index dcb52122461..b46007ae02b 100644 --- a/src/xrGame/ui/UIDebugFonts.cpp +++ b/src/xrGame/ui/UIDebugFonts.cpp @@ -47,7 +47,7 @@ void CUIDebugFonts::FillUpList() for (; it != it_e; ++it) { CGameFont* F = *(*it); - CUITextWnd* pItem = xr_new(); + auto* pItem = xr_new("Item"); pItem->SetWndPos(pos); pItem->SetWndSize(sz); #ifdef DEBUG diff --git a/src/xrGame/ui/UIDemoPlayControl.cpp b/src/xrGame/ui/UIDemoPlayControl.cpp index db0b6983ffb..20d30ddff52 100644 --- a/src/xrGame/ui/UIDemoPlayControl.cpp +++ b/src/xrGame/ui/UIDemoPlayControl.cpp @@ -31,7 +31,7 @@ CUIDemoPlayControl::CUIDemoPlayControl() AttachChild(m_rewind_until_btn); m_repeat_rewind_btn = xr_new(); AttachChild(m_repeat_rewind_btn); - m_static_demo_status = xr_new(); + m_static_demo_status = xr_new("Demo status"); AttachChild(m_static_demo_status); m_all_players = xr_new(); @@ -81,7 +81,7 @@ void CUIDemoPlayControl::Init() CUIXmlInit::Init3tButton(xml_doc, "demo_play_control:btn_rewind_until", 0, m_rewind_until_btn); CUIXmlInit::Init3tButton(xml_doc, "demo_play_control:btn_repeat_rewind", 0, m_repeat_rewind_btn); CUIXmlInit::InitProgressBar(xml_doc, "demo_play_control:progress", 0, m_progress_bar); - CUIXmlInit::InitTextWnd(xml_doc, "demo_play_control:static_demo_status", 0, m_static_demo_status); + CUIXmlInit::InitStatic(xml_doc, "demo_play_control:static_demo_status", 0, m_static_demo_status); CUIWindow tmp_prop_boxes_wnd("tmp_prop_boxes_wnd"); CUIXmlInit::InitWindow(xml_doc, "demo_play_control:rewind_property_boxes", 0, &tmp_prop_boxes_wnd); diff --git a/src/xrGame/ui/UIDemoPlayControl.h b/src/xrGame/ui/UIDemoPlayControl.h index 09fbeadb3df..f3127bc0e18 100644 --- a/src/xrGame/ui/UIDemoPlayControl.h +++ b/src/xrGame/ui/UIDemoPlayControl.h @@ -9,7 +9,6 @@ class CUI3tButton; class CUIProgressBar; class CUIPropertiesBox; -class CUITextWnd; class CUIStatic; class demoplay_control; @@ -80,7 +79,7 @@ class CUIDemoPlayControl final : public CUIDialogWnd, public CUIWndCallback CUI3tButton* m_rewind_until_btn; CUI3tButton* m_repeat_rewind_btn; CUIProgressBar* m_progress_bar; - CUITextWnd* m_static_demo_status; + CUIStatic* m_static_demo_status; Fvector2 m_last_curr_pos; demoplay_control* m_demo_play_control; diff --git a/src/xrGame/ui/UIDragDropReferenceList.cpp b/src/xrGame/ui/UIDragDropReferenceList.cpp index a6df3b8bfdf..a01eb883ff4 100644 --- a/src/xrGame/ui/UIDragDropReferenceList.cpp +++ b/src/xrGame/ui/UIDragDropReferenceList.cpp @@ -51,7 +51,7 @@ void CUIDragDropReferenceList::Initialize(pcstr labelSection /*= nullptr*/, pcst { string32 temp; xr_sprintf(temp, labelSection, i + j + 1); - CUITextWnd* label = UIHelper::CreateTextWnd(*uiXml, temp, this, false); + auto* label = UIHelper::CreateStatic(*uiXml, temp, this, false); if (label) { if (true /*!label->WndPosIsProbablyRelative()*/) // Without this, UI Frustum will cull our label diff --git a/src/xrGame/ui/UIDragDropReferenceList.h b/src/xrGame/ui/UIDragDropReferenceList.h index 6b6aa2102ce..0b9f802ab96 100644 --- a/src/xrGame/ui/UIDragDropReferenceList.h +++ b/src/xrGame/ui/UIDragDropReferenceList.h @@ -10,7 +10,7 @@ class CUIDragDropReferenceList final : public CUIDragDropListEx typedef xr_vector ITEMS_REFERENCES_VEC; typedef ITEMS_REFERENCES_VEC::iterator ITEMS_REFERENCES_VEC_IT; ITEMS_REFERENCES_VEC m_references; - xr_vector m_labels; + xr_vector m_labels; pcstr m_translation_id; public: diff --git a/src/xrGame/ui/UIGameLog.cpp b/src/xrGame/ui/UIGameLog.cpp index 84e40e406ca..c7eb97885cc 100644 --- a/src/xrGame/ui/UIGameLog.cpp +++ b/src/xrGame/ui/UIGameLog.cpp @@ -19,9 +19,9 @@ CUIGameLog::CUIGameLog() m_pFont = NULL; } -CUITextWnd* CUIGameLog::AddLogMessage(LPCSTR msg) +CUIStatic* CUIGameLog::AddLogMessage(LPCSTR msg) { - CUITextWnd* pItem = NULL; + CUIStatic* pItem{}; ADD_TEXT_TO_VIEW3(msg, pItem, this); pItem->SetFont(m_pFont); pItem->SetTextColor(txt_color); @@ -57,7 +57,7 @@ void CUIGameLog::AddChatMessage(LPCSTR msg, LPCSTR author) _TrimRight(fullLine); - CUITextWnd* pItem = xr_new(); + auto* pItem = xr_new("Chat message"); pItem->SetTextComplexMode(true); pItem->SetText(fullLine); pItem->SetCutWordsMode(true); diff --git a/src/xrGame/ui/UIGameLog.h b/src/xrGame/ui/UIGameLog.h index bffbfe7ee89..f51900d4b52 100644 --- a/src/xrGame/ui/UIGameLog.h +++ b/src/xrGame/ui/UIGameLog.h @@ -14,14 +14,13 @@ class CUIXml; class CUIPdaKillMessage; class CUIPdaMsgListItem; class CUIStatic; -class CUITextWnd; struct KillMessageStruct; class CUIGameLog final : public CUIScrollView { public: CUIGameLog(); - CUITextWnd* AddLogMessage(LPCSTR msg); + CUIStatic* AddLogMessage(LPCSTR msg); CUIPdaKillMessage* AddLogMessage(KillMessageStruct& msg); CUIPdaMsgListItem* AddPdaMessage(); void AddChatMessage(LPCSTR msg, LPCSTR author); diff --git a/src/xrGame/ui/UIHelper.cpp b/src/xrGame/ui/UIHelper.cpp index 9cd05ed06f9..dde3e06f51c 100644 --- a/src/xrGame/ui/UIHelper.cpp +++ b/src/xrGame/ui/UIHelper.cpp @@ -84,25 +84,6 @@ CUIScrollView* UIHelper::CreateScrollView(CUIXml& xml, LPCSTR ui_path, CUIWindow return ui; } -CUITextWnd* UIHelper::CreateTextWnd(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical) -{ - // If it's not critical element, then don't crash if it doesn't exist - if (!critical && !xml.NavigateToNode(ui_path, 0)) - return nullptr; - - auto ui = xr_new(); - if (!CUIXmlInit::InitTextWnd(xml, ui_path, 0, ui, critical) && !critical) - { - xr_delete(ui); - } - if (ui && parent) - { - parent->AttachChild(ui); - ui->SetAutoDelete(true); - } - return ui; -} - CUIEditBox* UIHelper::CreateEditBox(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical) { // If it's not critical element, then don't crash if it doesn't exist diff --git a/src/xrGame/ui/UIHelper.h b/src/xrGame/ui/UIHelper.h index d78d782cb3d..41e40c8562f 100644 --- a/src/xrGame/ui/UIHelper.h +++ b/src/xrGame/ui/UIHelper.h @@ -12,7 +12,6 @@ class CUIXml; class CUIWindow; class CUIStatic; class CUIScrollView; -class CUITextWnd; class CUIProgressBar; class CUIProgressShape; class CUIFrameLineWnd; @@ -34,7 +33,6 @@ class UIHelper static CUIStatic* CreateStatic(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical = true); static CUIStatic* CreateStatic(CUIXml& xml, LPCSTR ui_path, int index, CUIWindow* parent, bool critical = true); static CUIScrollView* CreateScrollView(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical = true); - static CUITextWnd* CreateTextWnd(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical = true); static CUIProgressBar* CreateProgressBar(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical = true); static CUIProgressShape* CreateProgressShape(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical = true); static CUIFrameLineWnd* CreateFrameLine(CUIXml& xml, LPCSTR ui_path, CUIWindow* parent, bool critical = true); diff --git a/src/xrGame/ui/UIHudStatesWnd.cpp b/src/xrGame/ui/UIHudStatesWnd.cpp index 1e62e5fa31a..8376d301380 100644 --- a/src/xrGame/ui/UIHudStatesWnd.cpp +++ b/src/xrGame/ui/UIHudStatesWnd.cpp @@ -144,12 +144,12 @@ void CUIHudStatesWnd::InitFromXml(CUIXml& xml, LPCSTR path) m_ui_weapon_sign_ammo = UIHelper::CreateStatic(xml, "static_ammo", weaponsParent, false); //m_ui_weapon_sign_ammo->SetEllipsis( CUIStatic::eepEnd, 2 ); - m_ui_weapon_cur_ammo = UIHelper::CreateTextWnd(xml, "static_cur_ammo", this, false); - m_ui_weapon_fmj_ammo = UIHelper::CreateTextWnd(xml, "static_fmj_ammo", this, false); - m_ui_weapon_ap_ammo = UIHelper::CreateTextWnd(xml, "static_ap_ammo", this, false); - m_ui_weapon_third_ammo = UIHelper::CreateTextWnd(xml, "static_third_ammo", this, false); //Alundaio: Option to display a third ammo type - m_fire_mode = UIHelper::CreateTextWnd(xml, "static_fire_mode", this); - m_ui_grenade = UIHelper::CreateTextWnd(xml, "static_grenade", this, false); + m_ui_weapon_cur_ammo = UIHelper::CreateStatic(xml, "static_cur_ammo", this, false); + m_ui_weapon_fmj_ammo = UIHelper::CreateStatic(xml, "static_fmj_ammo", this, false); + m_ui_weapon_ap_ammo = UIHelper::CreateStatic(xml, "static_ap_ammo", this, false); + m_ui_weapon_third_ammo = UIHelper::CreateStatic(xml, "static_third_ammo", this, false); //Alundaio: Option to display a third ammo type + m_fire_mode = UIHelper::CreateStatic(xml, "static_fire_mode", this); + m_ui_grenade = UIHelper::CreateStatic(xml, "static_grenade", this, false); m_ui_weapon_icon = UIHelper::CreateStatic(xml, "static_wpn_icon", weaponsParent); m_ui_weapon_icon->SetShader(InventoryUtilities::GetEquipmentIconsShader()); diff --git a/src/xrGame/ui/UIHudStatesWnd.h b/src/xrGame/ui/UIHudStatesWnd.h index 21acc2a5593..4f4c7358ab9 100644 --- a/src/xrGame/ui/UIHudStatesWnd.h +++ b/src/xrGame/ui/UIHudStatesWnd.h @@ -5,7 +5,6 @@ #include "actor_defs.h" class CUIStatic; -class CUITextWnd; class CUIProgressBar; class CUIProgressShape; class CUIXml; @@ -30,12 +29,12 @@ class CUIHudStatesWnd final : public CUIWindow xr_map m_resist_back; xr_map m_indik; - CUITextWnd* m_ui_weapon_cur_ammo; - CUITextWnd* m_ui_weapon_fmj_ammo; - CUITextWnd* m_ui_weapon_ap_ammo; - CUITextWnd* m_ui_weapon_third_ammo; //Alundaio - CUITextWnd* m_fire_mode; - CUITextWnd* m_ui_grenade; + CUIStatic* m_ui_weapon_cur_ammo; + CUIStatic* m_ui_weapon_fmj_ammo; + CUIStatic* m_ui_weapon_ap_ammo; + CUIStatic* m_ui_weapon_third_ammo; //Alundaio + CUIStatic* m_fire_mode; + CUIStatic* m_ui_grenade; II_BriefInfo m_item_info; CUIStatic* m_ui_weapon_sign_ammo; diff --git a/src/xrGame/ui/UIInventoryUtilities.cpp b/src/xrGame/ui/UIInventoryUtilities.cpp index ef657774699..17b818c0a20 100644 --- a/src/xrGame/ui/UIInventoryUtilities.cpp +++ b/src/xrGame/ui/UIInventoryUtilities.cpp @@ -379,7 +379,7 @@ void InventoryUtilities::UpdateWeight(CUIStatic& wnd, CInventoryOwner* pInvOwner ////////////////////////////////////////////////////////////////////////// -void InventoryUtilities::UpdateWeightStr(CUITextWnd& wnd, CUITextWnd& wnd_max, CInventoryOwner* pInvOwner) +void InventoryUtilities::UpdateWeightStr(CUIStatic& wnd, CUIStatic& wnd_max, CInventoryOwner* pInvOwner) { R_ASSERT(pInvOwner); string128 buf; diff --git a/src/xrGame/ui/UIInventoryUtilities.h b/src/xrGame/ui/UIInventoryUtilities.h index 3be52cfcd76..aec3cc63893 100644 --- a/src/xrGame/ui/UIInventoryUtilities.h +++ b/src/xrGame/ui/UIInventoryUtilities.h @@ -3,7 +3,7 @@ #include "character_info_defs.h" #include "xrUICore/ui_defs.h" -class CUITextWnd; +class CUIStatic; //размеры сетки в текстуре инвентаря #define INV_GRID_WIDTH 50.0f @@ -75,7 +75,7 @@ const shared_str Get_GameTimeAndDate_AsString(); LPCSTR GetTimePeriodAsString(pstr _buff, u32 buff_sz, ALife::_TIME_ID _from, ALife::_TIME_ID _to); // Отобразить вес, который несет (*pInvOwner) void UpdateWeight(CUIStatic& wnd, CInventoryOwner* pInvOwner, bool withPrefix = false); -void UpdateWeightStr(CUITextWnd& wnd, CUITextWnd& wnd_max, CInventoryOwner* pInvOwner); +void UpdateWeightStr(CUIStatic& wnd, CUIStatic& wnd_max, CInventoryOwner* pInvOwner); // Функции получения строки-идентификатора ранга и отношения по их числовому идентификатору LPCSTR GetRankAsText(CHARACTER_RANK_VALUE rankID); diff --git a/src/xrGame/ui/UIItemInfo.cpp b/src/xrGame/ui/UIItemInfo.cpp index 24004dd475c..eb93af24b81 100644 --- a/src/xrGame/ui/UIItemInfo.cpp +++ b/src/xrGame/ui/UIItemInfo.cpp @@ -84,13 +84,13 @@ bool CUIItemInfo::InitItemInfo(cpcstr xml_name) } UIBackground = UIHelper::CreateFrameWindow(uiXml, "background_frame", this, false); - UIName = UIHelper::CreateTextWnd(uiXml, "static_name", this, false); + UIName = UIHelper::CreateStatic(uiXml, "static_name", this, false); if (UIName) m_complex_desc = (uiXml.ReadAttribInt("static_name", 0, "complex_desc", 0) == 1); - UIWeight = UIHelper::CreateTextWnd(uiXml, "static_weight", this, false); - UICost = UIHelper::CreateTextWnd(uiXml, "static_cost", this, false); - UITradeTip = UIHelper::CreateTextWnd(uiXml, "static_no_trade", this, false); + UIWeight = UIHelper::CreateStatic(uiXml, "static_weight", this, false); + UICost = UIHelper::CreateStatic(uiXml, "static_cost", this, false); + UITradeTip = UIHelper::CreateStatic(uiXml, "static_no_trade", this, false); if (uiXml.NavigateToNode("descr_list", 0)) { @@ -269,7 +269,7 @@ void CUIItemInfo::InitItem(CUICellItem* pCellItem, CInventoryItem* pCompareItem, VERIFY(0 == UIDesc->GetSize()); if (m_desc_info.bShowDescrText) { - CUITextWnd* pItem = xr_new(); + auto* pItem = xr_new("Description"); pItem->SetTextColor(m_desc_info.uDescClr); pItem->SetFont(m_desc_info.pDescFont); pItem->SetWidth(UIDesc->GetDesiredChildWidth()); diff --git a/src/xrGame/ui/UIItemInfo.h b/src/xrGame/ui/UIItemInfo.h index 2da03e2d239..2335b6e70dc 100644 --- a/src/xrGame/ui/UIItemInfo.h +++ b/src/xrGame/ui/UIItemInfo.h @@ -3,7 +3,6 @@ class CInventoryItem; class CUIStatic; -class CUITextWnd; class CUIScrollView; class CUIProgressBar; class CUIConditionParams; @@ -54,10 +53,10 @@ class CUIItemInfo final : public CUIWindow u32 delay; CUIFrameWindow* UIBackground; - CUITextWnd* UIName; - CUITextWnd* UIWeight; - CUITextWnd* UICost; - CUITextWnd* UITradeTip; + CUIStatic* UIName; + CUIStatic* UIWeight; + CUIStatic* UICost; + CUIStatic* UITradeTip; // CUIStatic* UIDesc_line; CUIScrollView* UIDesc; bool m_complex_desc; diff --git a/src/xrGame/ui/UIKeyBinding.cpp b/src/xrGame/ui/UIKeyBinding.cpp index 94f02a33907..f79c9e16266 100644 --- a/src/xrGame/ui/UIKeyBinding.cpp +++ b/src/xrGame/ui/UIKeyBinding.cpp @@ -139,18 +139,17 @@ void CUIKeyBinding::OnKeyMapChanged() void CUIKeyBinding::CheckStructure(CUIXml& xml_doc) { bool first = true; - CUITextWnd* item = nullptr; for (int i = 0; true; ++i) { - LPCSTR action_name = actions[i].action_name; - if (action_name) + if (cpcstr action_name = actions[i].action_name) { if (!IsActionExist(action_name, xml_doc)) { + CUIStatic* item = nullptr; if (first) { - item = xr_new(); + item = xr_new("First action"); item->SetWndPos(Fvector2().set(0, 0)); item->SetWndSize(Fvector2().set(m_scroll_wnd->GetWndSize().x, 20.0f)); item->SetText("NEXT ITEMS NOT DESCRIBED IN COMMAND DESC LIST"); @@ -159,7 +158,7 @@ void CUIKeyBinding::CheckStructure(CUIXml& xml_doc) m_scroll_wnd->AddWindow(item, true); } - item = xr_new(); + item = xr_new(action_name); item->SetWndPos(Fvector2().set(0, 0)); item->SetWndSize(Fvector2().set(m_scroll_wnd->GetWndSize().x, 20.0f)); item->SetText(action_name); diff --git a/src/xrGame/ui/UIListItemServer.h b/src/xrGame/ui/UIListItemServer.h index b82b5cec756..897a009f819 100644 --- a/src/xrGame/ui/UIListItemServer.h +++ b/src/xrGame/ui/UIListItemServer.h @@ -64,14 +64,15 @@ class CUIListItemServer final : public CUIListBoxItem LIST_SRV_SIZES m_sizes; LIST_SRV_ITEM m_srv_info; + CUIStatic* m_iconPass; CUIStatic* m_iconDedicated; // CUIStatic* m_iconPunkBuster; CUIStatic* m_iconUserPass; - CUITextWnd* m_server; - CUITextWnd* m_map; - CUITextWnd* m_game; - CUITextWnd* m_players; - CUITextWnd* m_ping; - CUITextWnd* m_version; + CUIStatic* m_server; + CUIStatic* m_map; + CUIStatic* m_game; + CUIStatic* m_players; + CUIStatic* m_ping; + CUIStatic* m_version; }; diff --git a/src/xrGame/ui/UILogsWnd.cpp b/src/xrGame/ui/UILogsWnd.cpp index c17287f3f0b..bdfc5d5195b 100644 --- a/src/xrGame/ui/UILogsWnd.cpp +++ b/src/xrGame/ui/UILogsWnd.cpp @@ -119,7 +119,7 @@ bool CUILogsWnd::Init() if (!m_center_background) m_center_background2 = UIHelper::CreateStatic(m_uiXml, "center_background", this, false); - m_center_caption = UIHelper::CreateTextWnd(m_uiXml, "center_caption", this); + m_center_caption = UIHelper::CreateStatic(m_uiXml, "center_caption", this); string256 buf; xr_strcpy(buf, sizeof(buf), m_center_caption->GetText()); @@ -139,8 +139,8 @@ bool CUILogsWnd::Init() m_filter_news->SetCheck(true); m_filter_talk->SetCheck(true); - m_date_caption = UIHelper::CreateTextWnd(m_uiXml, "date_caption", this, false); - m_date = UIHelper::CreateTextWnd(m_uiXml, "date", this, false); + m_date_caption = UIHelper::CreateStatic(m_uiXml, "date_caption", this, false); + m_date = UIHelper::CreateStatic(m_uiXml, "date", this, false); if (m_date || m_date_caption) { @@ -148,7 +148,7 @@ bool CUILogsWnd::Init() "Please, provide both [date] and [date_caption] tags in xml file", m_uiXml.m_xml_file_name); } - m_period_caption = UIHelper::CreateTextWnd(m_uiXml, "period_caption", this); + m_period_caption = UIHelper::CreateStatic(m_uiXml, "period_caption", this); m_period = UIHelper::CreateStatic(m_uiXml, "period", this); m_prev_period = UIHelper::Create3tButton(m_uiXml, "btn_prev_period", this); diff --git a/src/xrGame/ui/UILogsWnd.h b/src/xrGame/ui/UILogsWnd.h index fd5e1dd9144..a3d0f589509 100644 --- a/src/xrGame/ui/UILogsWnd.h +++ b/src/xrGame/ui/UILogsWnd.h @@ -16,7 +16,6 @@ #include "xrUICore/XML/xrUIXmlParser.h" class CUIStatic; -class CUITextWnd; class CUIXml; class CUIProgressBar; class CUIFrameLineWnd; @@ -38,16 +37,16 @@ class CUILogsWnd final : public CUIWindow, public CUIWndCallback CUIFrameWindow* m_center_background; CUIStatic* m_center_background2; - CUITextWnd* m_center_caption; + CUIStatic* m_center_caption; CUICharacterInfo* m_actor_ch_info; CUICheckButton* m_filter_news; CUICheckButton* m_filter_talk; - CUITextWnd* m_date_caption; - CUITextWnd* m_date; + CUIStatic* m_date_caption; + CUIStatic* m_date; - CUITextWnd* m_period_caption; + CUIStatic* m_period_caption; CUIStatic* m_period; ALife::_TIME_ID m_start_game_time; diff --git a/src/xrGame/ui/UIMMShniaga.cpp b/src/xrGame/ui/UIMMShniaga.cpp index 46a3b87f133..00065088d96 100644 --- a/src/xrGame/ui/UIMMShniaga.cpp +++ b/src/xrGame/ui/UIMMShniaga.cpp @@ -142,7 +142,7 @@ void CUIMMShniaga::InitShniaga(CUIXml& xml_doc, LPCSTR path) void CUIMMShniaga::OnDeviceReset() {} -void CUIMMShniaga::CreateList(xr_vector& lst, CUIXml& xml_doc, LPCSTR path, bool required /*= true*/) +void CUIMMShniaga::CreateList(xr_vector& lst, CUIXml& xml_doc, LPCSTR path, bool required /*= true*/) { u32 color; CGameFont* pF; @@ -167,11 +167,9 @@ void CUIMMShniaga::CreateList(xr_vector& lst, CUIXml& xml_doc, LPCS XML_NODE tab_node = xml_doc.NavigateToNode(path, 0); xml_doc.SetLocalRoot(tab_node); - CUITextWnd* st; - for (int i = 0; i < nodes_num; ++i) { - st = xr_new(); + auto* st = xr_new("Button"); st->SetWndPos(Fvector2().set(0, 0)); st->SetWndSize(Fvector2().set(m_view->GetDesiredChildWidth(), button_height)); st->SetFont(pF); @@ -196,7 +194,7 @@ void CUIMMShniaga::CreateList(xr_vector& lst, CUIXml& xml_doc, LPCS void CUIMMShniaga::SetPage(enum_page_id page_id, LPCSTR xml_file, LPCSTR xml_path) { VERIFY(m_page != page_id); - xr_vector* lst = NULL; + xr_vector* lst = nullptr; switch (page_id) { case epi_main: lst = &m_buttons; break; diff --git a/src/xrGame/ui/UIMMShniaga.h b/src/xrGame/ui/UIMMShniaga.h index a806cabd846..a66a609289d 100644 --- a/src/xrGame/ui/UIMMShniaga.h +++ b/src/xrGame/ui/UIMMShniaga.h @@ -2,7 +2,6 @@ #include "xrUICore/Windows/UIWindow.h" class CUIStatic; -class CUITextWnd; class CUIXml; class CUIScrollView; class CMMSound; @@ -59,7 +58,7 @@ class CUIMMShniaga final : public CUIWindow, public CDeviceResetNotifier void ProcessEvent(EVENT ev); bool IsButton(CUIWindow* st); - void CreateList(xr_vector& lst, CUIXml& xml_doc, LPCSTR path, bool required = true); + void CreateList(xr_vector& lst, CUIXml& xml_doc, LPCSTR path, bool required = true); void ShowMain(); void ShowNewGame(); void ShowNetworkGame(); @@ -80,9 +79,9 @@ class CUIMMShniaga final : public CUIWindow, public CDeviceResetNotifier float m_mag_pos; float m_offset; - xr_vector m_buttons; - xr_vector m_buttons_new; - xr_vector m_buttons_new_network; + xr_vector m_buttons; + xr_vector m_buttons_new; + xr_vector m_buttons_new_network; int m_selected_btn; enum_page_id m_page; diff --git a/src/xrGame/ui/UIMPChangeMapAdm.cpp b/src/xrGame/ui/UIMPChangeMapAdm.cpp index c9d941d9139..37bb87c73a2 100644 --- a/src/xrGame/ui/UIMPChangeMapAdm.cpp +++ b/src/xrGame/ui/UIMPChangeMapAdm.cpp @@ -20,7 +20,7 @@ CUIMpChangeMapAdm::CUIMpChangeMapAdm() : CUIWindow("CUIMpChangeMapAdm") map_frame->SetAutoDelete(true); AttachChild(map_frame); - map_version = xr_new(); + map_version = xr_new("Map version"); map_version->SetAutoDelete(true); AttachChild(map_version); @@ -37,7 +37,7 @@ void CUIMpChangeMapAdm::Init(CUIXml& xml_doc) { CUIXmlInit::InitWindow(xml_doc, "change_map_adm", 0, this); CUIXmlInit::InitStatic(xml_doc, "change_map_adm:map_frame", 0, map_frame); - CUIXmlInit::InitTextWnd(xml_doc, "change_map_adm:map_ver_txt", 0, map_version); + CUIXmlInit::InitStatic(xml_doc, "change_map_adm:map_ver_txt", 0, map_version); CUIXmlInit::InitStatic(xml_doc, "change_map_adm:map_pic", 0, map_pic); CUIXmlInit::InitListBox(xml_doc, "change_map_adm:list", 0, lst); CUIXmlInit::Init3tButton(xml_doc, "change_map_adm:btn_ok", 0, btn_ok); diff --git a/src/xrGame/ui/UIMPChangeMapAdm.h b/src/xrGame/ui/UIMPChangeMapAdm.h index 2c5654ab9a7..8510743ca3b 100644 --- a/src/xrGame/ui/UIMPChangeMapAdm.h +++ b/src/xrGame/ui/UIMPChangeMapAdm.h @@ -5,7 +5,6 @@ class CUIXml; class CUIStatic; -class CUITextWnd; class CUIListBox; class CUI3tButton; @@ -14,7 +13,7 @@ class CUIMpChangeMapAdm final : public CUIWindow, public CUIWndCallback typedef CUIWindow inherited; CUIStatic* map_pic; CUIStatic* map_frame; - CUITextWnd* map_version; + CUIStatic* map_version; CUIListBox* lst; CUI3tButton* btn_ok; diff --git a/src/xrGame/ui/UIMPPlayersAdm.cpp b/src/xrGame/ui/UIMPPlayersAdm.cpp index 1c594216482..59140601247 100644 --- a/src/xrGame/ui/UIMPPlayersAdm.cpp +++ b/src/xrGame/ui/UIMPPlayersAdm.cpp @@ -45,7 +45,7 @@ CUIMpPlayersAdm::CUIMpPlayersAdm() : CUIWindow("CUIMpPlayersAdm") m_pPingLimitTrack->SetAutoDelete(true); AttachChild(m_pPingLimitTrack); - m_pPingLimitText = xr_new(); + m_pPingLimitText = xr_new("Ping limit"); m_pPingLimitText->SetAutoDelete(true); AttachChild(m_pPingLimitText); @@ -69,11 +69,11 @@ CUIMpPlayersAdm::CUIMpPlayersAdm() : CUIWindow("CUIMpPlayersAdm") m_pBanPlayerCombo->SetAutoDelete(true); AttachChild(m_pBanPlayerCombo); - // m_pBanTimeTrack = new CUITrackBar(); + // m_pBanTimeTrack = xr_new(); // m_pBanTimeTrack->SetAutoDelete(true); // AttachChild(m_pBanTimeTrack); - // m_pBanTimeText = new CUITextWnd(); + // m_pBanTimeText = xr_new("Ban time"); // m_pBanTimeText->SetAutoDelete(true); // AttachChild(m_pBanTimeText); } @@ -88,14 +88,14 @@ void CUIMpPlayersAdm::Init(CUIXml& xml_doc) CUIXmlInit::Init3tButton(xml_doc, "players_adm:config_all_button", 0, m_pConfigAllBtn); CUIXmlInit::Init3tButton(xml_doc, "players_adm:max_ping_limit_button", 0, m_pPingLimitBtn); CUIXmlInit::InitTrackBar(xml_doc, "players_adm:max_ping_limit_track", 0, m_pPingLimitTrack); - CUIXmlInit::InitTextWnd(xml_doc, "players_adm:max_ping_limit_text", 0, m_pPingLimitText); + CUIXmlInit::InitStatic(xml_doc, "players_adm:max_ping_limit_text", 0, m_pPingLimitText); CUIXmlInit::Init3tButton(xml_doc, "players_adm:screen_player_button", 0, m_pScreenPlayerBtn); CUIXmlInit::Init3tButton(xml_doc, "players_adm:config_player_button", 0, m_pConfigPlayerBtn); CUIXmlInit::Init3tButton(xml_doc, "players_adm:kick_player_button", 0, m_pKickPlayerBtn); CUIXmlInit::Init3tButton(xml_doc, "players_adm:ban_player_button", 0, m_pBanPlayerBtn); CUIXmlInit::InitComboBox(xml_doc, "players_adm:ban_player_combo", 0, m_pBanPlayerCombo); // CUIXmlInit::InitTrackBar(xml_doc, "players_adm:ban_time_track", 0, m_pBanTimeTrack); - // CUIXmlInit::InitTextWnd(xml_doc, "players_adm:ban_time_text", 0, m_pBanTimeText); + // CUIXmlInit::InitStatic(xml_doc, "players_adm:ban_time_text", 0, m_pBanTimeText); RefreshPlayersList(); int min, max; g_sv_adm_menu_ping_limit = iCeil(Console->GetInteger("sv_max_ping_limit", min, max) / 10.0f); diff --git a/src/xrGame/ui/UIMPPlayersAdm.h b/src/xrGame/ui/UIMPPlayersAdm.h index 51f7e30a5a0..b82043501db 100644 --- a/src/xrGame/ui/UIMPPlayersAdm.h +++ b/src/xrGame/ui/UIMPPlayersAdm.h @@ -7,7 +7,6 @@ class CUIXml; class CUIListBox; class CUI3tButton; class CUITrackBar; -class CUITextWnd; class CUIComboBox; class CUIMpPlayersAdm final : public CUIWindow, public CUIWndCallback @@ -19,14 +18,14 @@ class CUIMpPlayersAdm final : public CUIWindow, public CUIWndCallback CUI3tButton* m_pConfigAllBtn; CUI3tButton* m_pPingLimitBtn; CUITrackBar* m_pPingLimitTrack; - CUITextWnd* m_pPingLimitText; + CUIStatic* m_pPingLimitText; CUI3tButton* m_pScreenPlayerBtn; CUI3tButton* m_pConfigPlayerBtn; CUI3tButton* m_pKickPlayerBtn; CUI3tButton* m_pBanPlayerBtn; CUIComboBox* m_pBanPlayerCombo; // CUITrackBar* m_pBanTimeTrack; - // CUITextWnd* m_pBanTimeText; + // CUIStatic* m_pBanTimeText; public: CUIMpPlayersAdm(); ~CUIMpPlayersAdm() override; diff --git a/src/xrGame/ui/UIMainIngameWnd.cpp b/src/xrGame/ui/UIMainIngameWnd.cpp index a9cd904b7be..7eb7074cf35 100644 --- a/src/xrGame/ui/UIMainIngameWnd.cpp +++ b/src/xrGame/ui/UIMainIngameWnd.cpp @@ -104,7 +104,7 @@ void CUIMainIngameWnd::Init() //--------------------------------------------------------- // Подсказки, которые возникают при наведении прицела на объект - UIStaticQuickHelp = UIHelper::CreateTextWnd(uiXml, "quick_info", this); + UIStaticQuickHelp = UIHelper::CreateStatic(uiXml, "quick_info", this); uiXml.SetLocalRoot(uiXml.GetRoot()); @@ -248,8 +248,7 @@ void CUIMainIngameWnd::Init() m_quick_slots_icons.push_back(slot); xr_sprintf(path, "quick_slot%d_text", i); - CUITextWnd* text = UIHelper::CreateTextWnd(uiXml, path, this); - m_quick_slots_texts.push_back(text); + m_quick_slots_texts.emplace_back(UIHelper::CreateStatic(uiXml, path, this)); i++; } diff --git a/src/xrGame/ui/UIMainIngameWnd.h b/src/xrGame/ui/UIMainIngameWnd.h index cbc4fed938e..ee25106e5c9 100644 --- a/src/xrGame/ui/UIMainIngameWnd.h +++ b/src/xrGame/ui/UIMainIngameWnd.h @@ -29,7 +29,7 @@ class CUIMainIngameWnd final : public CUIWindow protected: CUIStatic* UIStaticDiskIO{}; - CUITextWnd* UIStaticQuickHelp{}; + CUIStatic* UIStaticQuickHelp{}; CUIMotionIcon* UIMotionIcon{}; CUIZoneMap* UIZoneMap{}; @@ -65,7 +65,7 @@ class CUIMainIngameWnd final : public CUIWindow void OnSectorChanged(IRender_Sector::sector_id_t sector); xr_vector m_quick_slots_icons; - xr_vector m_quick_slots_texts; + xr_vector m_quick_slots_texts; protected: // 5 статиков для отображения иконок: diff --git a/src/xrGame/ui/UIMapInfo.cpp b/src/xrGame/ui/UIMapInfo.cpp index 3a5eb3ca50e..efd43d0c094 100644 --- a/src/xrGame/ui/UIMapInfo.cpp +++ b/src/xrGame/ui/UIMapInfo.cpp @@ -31,7 +31,7 @@ void CUIMapInfo::InitMapInfo(Fvector2 pos, Fvector2 size) else \ text += *StringTable().translate(z); \ text += "%c[default]\\n"; \ - st = new CUITextWnd(); \ + st = xr_new("Text"); \ st->SetTextComplexMode(true); \ st->SetFont(txt_font); \ st->SetTextColor(header_color); \ @@ -49,7 +49,6 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) CUIXml xml_doc; xml_doc.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "ui_mapinfo.xml"); - CUITextWnd* st; // try to find file with info xr_string info_path = "text" DELIMITER "map_desc" DELIMITER; info_path += map_name; @@ -63,8 +62,8 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) xr_string text; // map name - st = xr_new(); - CUIXmlInit::InitTextWnd(xml_doc, "map_name", 0, st); + auto* st = xr_new("Map name"); + CUIXmlInit::InitStatic(xml_doc, "map_name", 0, st); xr_string S = StringTable().translate(map_name).c_str(); if (map_ver) @@ -116,7 +115,7 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) text += "%c[default]\\n"; - st = xr_new(); + st = xr_new("Game modes"); st->SetTextComplexMode(true); st->SetFont(txt_font); st->SetTextColor(header_color); @@ -132,8 +131,8 @@ void CUIMapInfo::InitMap(LPCSTR map_name, LPCSTR map_ver) } else { - st = xr_new(); - CUIXmlInit::InitTextWnd(xml_doc, "map_name", 0, st); + auto* st = xr_new("Map name"); + CUIXmlInit::InitStatic(xml_doc, "map_name", 0, st); st->SetTextST(map_name); st->SetWidth(m_view->GetDesiredChildWidth()); st->AdjustHeightToText(); diff --git a/src/xrGame/ui/UIMoneyIndicator.cpp b/src/xrGame/ui/UIMoneyIndicator.cpp index 6c920fac01d..9d12cd1b9ea 100644 --- a/src/xrGame/ui/UIMoneyIndicator.cpp +++ b/src/xrGame/ui/UIMoneyIndicator.cpp @@ -22,8 +22,8 @@ void CUIMoneyIndicator::InitFromXML(CUIXml& xml_doc) { CUIXmlInit::InitWindow(xml_doc, "money_wnd", 0, this); CUIXmlInit::InitStatic(xml_doc, "money_wnd:money_indicator", 0, &m_back); - CUIXmlInit::InitTextWnd(xml_doc, "money_wnd:money_indicator:total_money", 0, &m_money_amount); - CUIXmlInit::InitTextWnd(xml_doc, "money_wnd:money_change", 0, &m_money_change); + CUIXmlInit::InitStatic(xml_doc, "money_wnd:money_indicator:total_money", 0, &m_money_amount); + CUIXmlInit::InitStatic(xml_doc, "money_wnd:money_change", 0, &m_money_change); CUIXmlInit::InitScrollView(xml_doc, "money_wnd:money_bonus_list", 0, m_pBonusMoney); CGameFont* pF; u32 color; diff --git a/src/xrGame/ui/UIMoneyIndicator.h b/src/xrGame/ui/UIMoneyIndicator.h index 458d2779186..29fc77529e4 100644 --- a/src/xrGame/ui/UIMoneyIndicator.h +++ b/src/xrGame/ui/UIMoneyIndicator.h @@ -19,8 +19,8 @@ class CUIMoneyIndicator final : public CUIWindow pcstr GetDebugType() override { return "CUIMoneyIndicator"; } protected: - CUIStatic m_back; - CUITextWnd m_money_amount; - CUITextWnd m_money_change; + CUIStatic m_back{ "Background" }; + CUIStatic m_money_amount{ "Money amount" }; + CUIStatic m_money_change{ "Money change" }; CUIGameLog* m_pBonusMoney; }; diff --git a/src/xrGame/ui/UIMpTradeWnd.h b/src/xrGame/ui/UIMpTradeWnd.h index 4aedf73a918..4003d786551 100644 --- a/src/xrGame/ui/UIMpTradeWnd.h +++ b/src/xrGame/ui/UIMpTradeWnd.h @@ -9,7 +9,6 @@ class CUIDragDropListEx; class CUI3tButton; class CUIStatic; -class CUITextWnd; class CUIMpItemsStoreWnd; class CUITabControl; class CUICellItem; @@ -148,12 +147,12 @@ class CUIMpTradeWnd final : public IBuyWnd, public CUIWndCallback bool m_bIgnoreMoneyAndRank; // controls CUIWindow* m_shop_wnd; - CUITextWnd* m_static_curr_items_money; - CUITextWnd* m_static_player_money; - CUITextWnd* m_static_preset_money[5]; + CUIStatic* m_static_curr_items_money; + CUIStatic* m_static_player_money; + CUIStatic* m_static_preset_money[5]; CUIStatic* m_static_player_rank; - CUITextWnd* m_static_information; - CUITextWnd* m_static_money_change; + CUIStatic* m_static_information; + CUIStatic* m_static_money_change; CUI3tButton* m_btn_shop_back; CUI3tButton* m_btn_ok; CUI3tButton* m_btn_cancel; diff --git a/src/xrGame/ui/UIMpTradeWnd_init.cpp b/src/xrGame/ui/UIMpTradeWnd_init.cpp index 2405fbf93d7..d0e4edeec0d 100644 --- a/src/xrGame/ui/UIMpTradeWnd_init.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_init.cpp @@ -179,14 +179,14 @@ void CUIMpTradeWnd::Init(const shared_str& sectionName, const shared_str& sectio //(this, //&CUIMpTradeWnd::OnBtnRifleAmmo2Clicked )); - m_static_player_money = UIHelper::CreateTextWnd(xml_doc, "static_player_money", this); - m_static_curr_items_money = UIHelper::CreateTextWnd(xml_doc, "static_curr_items_money", this); + m_static_player_money = UIHelper::CreateStatic(xml_doc, "static_player_money", this); + m_static_curr_items_money = UIHelper::CreateStatic(xml_doc, "static_curr_items_money", this); - m_static_preset_money[0] = UIHelper::CreateTextWnd(xml_doc, "static_preset_money_last", this); - m_static_preset_money[1] = UIHelper::CreateTextWnd(xml_doc, "static_preset_money_1", this); - m_static_preset_money[2] = UIHelper::CreateTextWnd(xml_doc, "static_preset_money_2", this); - m_static_preset_money[3] = UIHelper::CreateTextWnd(xml_doc, "static_preset_money_3", this); - m_static_preset_money[4] = UIHelper::CreateTextWnd(xml_doc, "static_preset_money_def", this); + m_static_preset_money[0] = UIHelper::CreateStatic(xml_doc, "static_preset_money_last", this); + m_static_preset_money[1] = UIHelper::CreateStatic(xml_doc, "static_preset_money_1", this); + m_static_preset_money[2] = UIHelper::CreateStatic(xml_doc, "static_preset_money_2", this); + m_static_preset_money[3] = UIHelper::CreateStatic(xml_doc, "static_preset_money_3", this); + m_static_preset_money[4] = UIHelper::CreateStatic(xml_doc, "static_preset_money_def", this); // preset money indicators m_item_color_restr_rank = CUIXmlInit::GetColor(xml_doc, "item_color_restr_rank", 0, color_rgba(255, 255, 255, 255)); @@ -201,8 +201,8 @@ void CUIMpTradeWnd::Init(const shared_str& sectionName, const shared_str& sectio m_static_player_rank = UIHelper::CreateStatic(xml_doc, "static_player_rank", this); m_static_item_rank = UIHelper::CreateStatic(xml_doc, "static_item_rank", this); - m_static_information = UIHelper::CreateTextWnd(xml_doc, "static_info", this); - m_static_money_change = UIHelper::CreateTextWnd(xml_doc, "static_money_change", this); + m_static_information = UIHelper::CreateStatic(xml_doc, "static_info", this); + m_static_money_change = UIHelper::CreateStatic(xml_doc, "static_money_change", this); m_item_info = xr_new(); AttachChild(m_item_info); diff --git a/src/xrGame/ui/UIMpTradeWnd_misc.cpp b/src/xrGame/ui/UIMpTradeWnd_misc.cpp index 021727a4de3..1d27d28bb40 100644 --- a/src/xrGame/ui/UIMpTradeWnd_misc.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_misc.cpp @@ -83,7 +83,7 @@ void CUIMpTradeWnd::UpdateMoneyIndicator() // update preset money for (u32 i = _preset_idx_last; i <= _preset_idx_3; ++i) { - CUITextWnd* st = m_static_preset_money[i]; + auto* st = m_static_preset_money[i]; _cost = GetPresetCost((ETradePreset)i); xr_sprintf(buff, "%d", _cost); st->SetText(buff); diff --git a/src/xrGame/ui/UINewsItemWnd.cpp b/src/xrGame/ui/UINewsItemWnd.cpp index 8b346ceb0e3..18406af4f45 100644 --- a/src/xrGame/ui/UINewsItemWnd.cpp +++ b/src/xrGame/ui/UINewsItemWnd.cpp @@ -18,16 +18,16 @@ void CUINewsItemWnd::Init(CUIXml& uiXml, LPCSTR start_from) uiXml.SetLocalRoot(node); m_UIImage = UIHelper::CreateStatic(uiXml, "image", this); - m_UICaption = UIHelper::CreateTextWnd(uiXml, "caption_static", this, false); // no caption tag in SOC + m_UICaption = UIHelper::CreateStatic(uiXml, "caption_static", this, false); // no caption tag in SOC - m_UIText = UIHelper::CreateTextWnd(uiXml, "text_static", this, false); - m_UIDate = UIHelper::CreateTextWnd(uiXml, "date_static", this, false); + m_UIText = UIHelper::CreateStatic(uiXml, "text_static", this, false); + m_UIDate = UIHelper::CreateStatic(uiXml, "date_static", this, false); // SOC if (!m_UIText) - m_UIText = UIHelper::CreateTextWnd(uiXml, "text_cont", this, false); + m_UIText = UIHelper::CreateStatic(uiXml, "text_cont", this, false); if (!m_UIDate) - m_UIDate = UIHelper::CreateTextWnd(uiXml, "date_text_cont", this, false); + m_UIDate = UIHelper::CreateStatic(uiXml, "date_text_cont", this, false); uiXml.SetLocalRoot(stored_root); } diff --git a/src/xrGame/ui/UINewsItemWnd.h b/src/xrGame/ui/UINewsItemWnd.h index 0b1434b5053..e4a20f8fa00 100644 --- a/src/xrGame/ui/UINewsItemWnd.h +++ b/src/xrGame/ui/UINewsItemWnd.h @@ -3,16 +3,15 @@ #include "xrUICore/XML/xrUIXmlParser.h" class CUIStatic; -class CUITextWnd; struct GAME_NEWS_DATA; class CUINewsItemWnd final : public CUIWindow { typedef CUIWindow inherited; - CUITextWnd* m_UIDate; - CUITextWnd* m_UICaption; - CUITextWnd* m_UIText; + CUIStatic* m_UIDate; + CUIStatic* m_UICaption; + CUIStatic* m_UIText; CUIStatic* m_UIImage; public: diff --git a/src/xrGame/ui/UIOutfitInfo.cpp b/src/xrGame/ui/UIOutfitInfo.cpp index 591d9ce0a47..56e77d070aa 100644 --- a/src/xrGame/ui/UIOutfitInfo.cpp +++ b/src/xrGame/ui/UIOutfitInfo.cpp @@ -39,7 +39,7 @@ constexpr cpcstr immunity_st_names[] = }; CUIOutfitImmunity::CUIOutfitImmunity() - : CUIWindow("CUIOutfitImmunity"), m_name("Name") + : CUIWindow("CUIOutfitImmunity"), m_name("Name"), m_value("Value") { AttachChild(&m_name); AttachChild(&m_progress); @@ -66,7 +66,7 @@ bool CUIOutfitImmunity::InitFromXml(CUIXml& xml_doc, LPCSTR base_str, u32 hit_ty strconcat(sizeof(buf), buf, base_str, ":", immunity_names[hit_type], ":static_value"); if (xml_doc.NavigateToNode(buf, 0) && !CallOfPripyatMode) { - CUIXmlInit::InitTextWnd(xml_doc, buf, 0, &m_value); + CUIXmlInit::InitStatic(xml_doc, buf, 0, &m_value); m_value.Show(true); } else diff --git a/src/xrGame/ui/UIOutfitInfo.h b/src/xrGame/ui/UIOutfitInfo.h index e7f162ebfb0..a36743a8684 100644 --- a/src/xrGame/ui/UIOutfitInfo.h +++ b/src/xrGame/ui/UIOutfitInfo.h @@ -22,7 +22,7 @@ class CUIOutfitImmunity final : public CUIWindow protected: CUIStatic m_name; // texture + name CUIDoubleProgressBar m_progress; - CUITextWnd m_value; // 100% + CUIStatic m_value; // 100% float m_magnitude; }; // class CUIOutfitImmunity diff --git a/src/xrGame/ui/UIPdaKillMessage.cpp b/src/xrGame/ui/UIPdaKillMessage.cpp index 80368801494..6b7e4153749 100644 --- a/src/xrGame/ui/UIPdaKillMessage.cpp +++ b/src/xrGame/ui/UIPdaKillMessage.cpp @@ -37,7 +37,7 @@ void CUIPdaKillMessage::Init(KillMessageStruct& msg, CGameFont* F) SetColorAnimation("ui_main_msgs_short", LA_ONLYALPHA | LA_TEXTCOLOR | LA_TEXTURECOLOR, 5000.0f); } -float CUIPdaKillMessage::InitText(CUITextWnd& refStatic, float x, ColoredName& info) +float CUIPdaKillMessage::InitText(CUIStatic& refStatic, float x, ColoredName& info) { if (0 == xr_strlen(info.m_name)) return 0.0f; diff --git a/src/xrGame/ui/UIPdaKillMessage.h b/src/xrGame/ui/UIPdaKillMessage.h index 8022157171d..ae37aa7e463 100644 --- a/src/xrGame/ui/UIPdaKillMessage.h +++ b/src/xrGame/ui/UIPdaKillMessage.h @@ -15,11 +15,11 @@ class CUIPdaKillMessage final : public CUIColorAnimConrollerContainer pcstr GetDebugType() override { return "CUIPdaKillMessage"; } protected: - float InitText(CUITextWnd& refStatic, float x, ColoredName& info); + float InitText(CUIStatic& refStatic, float x, ColoredName& info); float InitIcon(CUIStatic& refStatic, float x, IconInfo& info); - CUITextWnd m_victim_name; - CUIStatic m_initiator{ "Initiator" }; - CUITextWnd m_killer_name; - CUIStatic m_ext_info{ "Ext. info" }; + CUIStatic m_victim_name{ "Victim name" }; + CUIStatic m_initiator { "Initiator" }; + CUIStatic m_killer_name{ "Killer name" }; + CUIStatic m_ext_info { "Ext. info" }; }; diff --git a/src/xrGame/ui/UIPdaMsgListItem.cpp b/src/xrGame/ui/UIPdaMsgListItem.cpp index f3b36f685d7..d924b709c0c 100644 --- a/src/xrGame/ui/UIPdaMsgListItem.cpp +++ b/src/xrGame/ui/UIPdaMsgListItem.cpp @@ -21,14 +21,14 @@ void CUIPdaMsgListItem::InitPdaMsgListItem(const Fvector2& size) AttachChild(&UIIcon); CUIXmlInit::InitStatic(uiXml, "icon_static", 0, &UIIcon); - if (CUIXmlInit::InitTextWnd(uiXml, "time_static", 0, &UITimeText, false)) + if (CUIXmlInit::InitStatic(uiXml, "time_static", 0, &UITimeText, false)) AttachChild(&UITimeText); - if (CUIXmlInit::InitTextWnd(uiXml, "caption_static", 0, &UICaptionText, false)) + if (CUIXmlInit::InitStatic(uiXml, "caption_static", 0, &UICaptionText, false)) AttachChild(&UICaptionText); - if (CUIXmlInit::InitTextWnd(uiXml, "msg_static", 0, &UIMsgText, false) || - CUIXmlInit::InitTextWnd(uiXml, "text_static", 0, &UIMsgText, false)) + if (CUIXmlInit::InitStatic(uiXml, "msg_static", 0, &UIMsgText, false) || + CUIXmlInit::InitStatic(uiXml, "text_static", 0, &UIMsgText, false)) { AttachChild(&UIMsgText); } diff --git a/src/xrGame/ui/UIPdaMsgListItem.h b/src/xrGame/ui/UIPdaMsgListItem.h index 63ca09ea26e..e15ac85a622 100644 --- a/src/xrGame/ui/UIPdaMsgListItem.h +++ b/src/xrGame/ui/UIPdaMsgListItem.h @@ -18,8 +18,8 @@ class CUIPdaMsgListItem final : public CUIColorAnimConrollerContainer pcstr GetDebugType() override { return "CUIPdaMsgListItem"; } - CUIStatic UIIcon{ "Icon" }; - CUITextWnd UITimeText; - CUITextWnd UICaptionText; - CUITextWnd UIMsgText; + CUIStatic UIIcon { "Icon" }; + CUIStatic UITimeText { "Time text" }; + CUIStatic UICaptionText{ "Caption text" }; + CUIStatic UIMsgText { "Message text" }; }; diff --git a/src/xrGame/ui/UIPdaWnd.cpp b/src/xrGame/ui/UIPdaWnd.cpp index 2cd90634e02..95ea764824b 100644 --- a/src/xrGame/ui/UIPdaWnd.cpp +++ b/src/xrGame/ui/UIPdaWnd.cpp @@ -81,7 +81,7 @@ void CUIPdaWnd::Init() UIMainPdaFrame = UIHelper::CreateStatic(uiXml, "background_static", this); m_caption = UIHelper::CreateStatic(uiXml, "caption_static", this); m_caption_const = (m_caption->GetText()); - m_clock = UIHelper::CreateTextWnd(uiXml, "clock_wnd", this, false); + m_clock = UIHelper::CreateStatic(uiXml, "clock_wnd", this, false); if (uiXml.NavigateToNode("anim_static")) // XXX: Replace with UIHelper { @@ -201,8 +201,7 @@ void CUIPdaWnd::Update() if (m_clock) { - m_clock->TextItemControl().SetText( - GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes).c_str()); + m_clock->SetText(GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes).c_str()); } if (pUILogsWnd) diff --git a/src/xrGame/ui/UIPdaWnd.h b/src/xrGame/ui/UIPdaWnd.h index c77760ecec1..97df348816f 100644 --- a/src/xrGame/ui/UIPdaWnd.h +++ b/src/xrGame/ui/UIPdaWnd.h @@ -7,7 +7,6 @@ class CUIFrameLineWnd; class CUI3tButton; class CUITabControl; class CUIStatic; -class CUITextWnd; class CUIXml; class CUIFrameWindow; class UIHint; @@ -35,7 +34,7 @@ class CUIPdaWnd final : public CUIDialogWnd CUIStatic* m_caption; shared_str m_caption_const; CUIAnimatedStatic* m_anim_static; - CUITextWnd* m_clock; + CUIStatic* m_clock; // Текущий активный диалог CUIWindow* m_pActiveDialog; diff --git a/src/xrGame/ui/UIRankFaction.cpp b/src/xrGame/ui/UIRankFaction.cpp index 37583b954c3..e90767bdc41 100644 --- a/src/xrGame/ui/UIRankFaction.cpp +++ b/src/xrGame/ui/UIRankFaction.cpp @@ -85,14 +85,14 @@ void CUIRankFaction::init_from_xml(CUIXml& xml) { CUIXmlInit::InitWindow(xml, "fraction_stand_wnd", 0, this); - m_sn = UIHelper::CreateTextWnd(xml, "serial_number", this); - m_name = UIHelper::CreateTextWnd(xml, "name", this); + m_sn = UIHelper::CreateStatic(xml, "serial_number", this); + m_name = UIHelper::CreateStatic(xml, "name", this); m_icon = UIHelper::CreateStatic(xml, "icon", this); m_icon_over = UIHelper::CreateStatic(xml, "icon_over", this); - m_location_static = UIHelper::CreateTextWnd(xml, "location_static", this); - m_location_value = UIHelper::CreateTextWnd(xml, "location_value", this); - m_power_static = UIHelper::CreateTextWnd(xml, "power_static", this); - m_power_value = UIHelper::CreateTextWnd(xml, "power_value", this); + m_location_static = UIHelper::CreateStatic(xml, "location_static", this); + m_location_value = UIHelper::CreateStatic(xml, "location_value", this); + m_power_static = UIHelper::CreateStatic(xml, "power_static", this); + m_power_value = UIHelper::CreateStatic(xml, "power_value", this); m_relation_minus = UIHelper::CreateProgressBar(xml, "relation_minus", this); m_relation_center_minus = UIHelper::CreateProgressBar(xml, "relation_center_minus", this); @@ -102,8 +102,8 @@ void CUIRankFaction::init_from_xml(CUIXml& xml) m_origin_static = UIHelper::CreateStatic(xml, "origin_static", this); m_border_minus = UIHelper::CreateStatic(xml, "border_minus", this); m_border_plus = UIHelper::CreateStatic(xml, "border_plus", this); - m_enemy_static = UIHelper::CreateTextWnd(xml, "enemy_static", this); - m_frined_static = UIHelper::CreateTextWnd(xml, "frined_static", this); + m_enemy_static = UIHelper::CreateStatic(xml, "enemy_static", this); + m_frined_static = UIHelper::CreateStatic(xml, "frined_static", this); m_rating_up = UIHelper::CreateStatic(xml, "rating_up", this); m_rating_down = UIHelper::CreateStatic(xml, "rating_down", this); diff --git a/src/xrGame/ui/UIRankFaction.h b/src/xrGame/ui/UIRankFaction.h index c4dfc4d7cba..1997c591aa5 100644 --- a/src/xrGame/ui/UIRankFaction.h +++ b/src/xrGame/ui/UIRankFaction.h @@ -11,7 +11,6 @@ class CUIXml; class CUIStatic; -class CUITextWnd; class CUIProgressBar; class CActor; @@ -19,14 +18,14 @@ class CUIRankFaction final : public CUIWindow { FactionState m_faction_state; - CUITextWnd* m_sn; - CUITextWnd* m_name; + CUIStatic* m_sn; + CUIStatic* m_name; CUIStatic* m_icon; CUIStatic* m_icon_over; - CUITextWnd* m_location_static; - CUITextWnd* m_location_value; - CUITextWnd* m_power_static; - CUITextWnd* m_power_value; + CUIStatic* m_location_static; + CUIStatic* m_location_value; + CUIStatic* m_power_static; + CUIStatic* m_power_value; CUIProgressBar* m_relation_minus; CUIProgressBar* m_relation_center_minus; @@ -36,8 +35,8 @@ class CUIRankFaction final : public CUIWindow CUIStatic* m_origin_static; CUIStatic* m_border_minus; CUIStatic* m_border_plus; - CUITextWnd* m_enemy_static; - CUITextWnd* m_frined_static; + CUIStatic* m_enemy_static; + CUIStatic* m_frined_static; CUIStatic* m_rating_up; CUIStatic* m_rating_down; diff --git a/src/xrGame/ui/UIRankingWnd.cpp b/src/xrGame/ui/UIRankingWnd.cpp index 80a3df7154f..888cee11a17 100644 --- a/src/xrGame/ui/UIRankingWnd.cpp +++ b/src/xrGame/ui/UIRankingWnd.cpp @@ -105,15 +105,15 @@ bool CUIRankingWnd::Init() m_actor_ch_info->InitCharacterInfo(&xml, "actor_ch_info"); m_icon_overlay = UIHelper::CreateFrameWindow(xml, "actor_icon_over", this, false); - m_money_caption = UIHelper::CreateTextWnd(xml, "money_caption", this); - m_money_value = UIHelper::CreateTextWnd(xml, "money_value", this); + m_money_caption = UIHelper::CreateStatic(xml, "money_caption", this); + m_money_value = UIHelper::CreateStatic(xml, "money_value", this); m_money_caption->AdjustWidthToText(); pos = m_money_caption->GetWndPos(); pos.x += m_money_caption->GetWndSize().x + 10.0f; m_money_value->SetWndPos(pos); - m_center_caption = UIHelper::CreateTextWnd(xml, "center_caption", this); + m_center_caption = UIHelper::CreateStatic(xml, "center_caption", this); m_faction_static = UIHelper::CreateStatic(xml, "fraction_static", this, false); m_faction_line1 = UIHelper::CreateFrameLine(xml, "fraction_line1", this, false); m_faction_line2 = UIHelper::CreateFrameLine(xml, "fraction_line2", this, false); @@ -127,16 +127,16 @@ bool CUIRankingWnd::Init() for (u8 i = 0; i < m_stat_count; ++i) { - m_stat_caption[i] = xr_new(); + m_stat_caption[i] = xr_new("Caption"); AttachChild(m_stat_caption[i]); m_stat_caption[i]->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(xml, "stat", i, m_stat_caption[i]); + CUIXmlInit::InitStatic(xml, "stat", i, m_stat_caption[i]); m_stat_caption[i]->AdjustWidthToText(); - m_stat_info[i] = xr_new(); + m_stat_info[i] = xr_new("Info"); AttachChild(m_stat_info[i]); m_stat_info[i]->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(xml, "stat", i, m_stat_info[i]); + CUIXmlInit::InitStatic(xml, "stat", i, m_stat_info[i]); m_stat_info[i]->SetTextColor(value_color); diff --git a/src/xrGame/ui/UIRankingWnd.h b/src/xrGame/ui/UIRankingWnd.h index 32749d43b83..7774761c820 100644 --- a/src/xrGame/ui/UIRankingWnd.h +++ b/src/xrGame/ui/UIRankingWnd.h @@ -31,10 +31,10 @@ class CUIRankingWnd final : public CUIWindow, public CUIWndCallback CUICharacterInfo* m_actor_ch_info; - CUITextWnd* m_money_caption; - CUITextWnd* m_money_value; + CUIStatic* m_money_caption; + CUIStatic* m_money_value; - CUITextWnd* m_center_caption; + CUIStatic* m_center_caption; CUIStatic* m_faction_static; CUIFrameLineWnd* m_faction_line1; CUIFrameLineWnd* m_faction_line2; @@ -59,8 +59,8 @@ class CUIRankingWnd final : public CUIWindow, public CUIWndCallback { max_stat_info = 15 }; - CUITextWnd* m_stat_caption[max_stat_info]; - CUITextWnd* m_stat_info[max_stat_info]; + CUIStatic* m_stat_caption[max_stat_info]; + CUIStatic* m_stat_info[max_stat_info]; u32 m_delay; u32 m_previous_time; diff --git a/src/xrGame/ui/UIServerInfo.cpp b/src/xrGame/ui/UIServerInfo.cpp index eec10d10ef0..bd755bf5f05 100644 --- a/src/xrGame/ui/UIServerInfo.cpp +++ b/src/xrGame/ui/UIServerInfo.cpp @@ -35,7 +35,7 @@ CUIServerInfo::CUIServerInfo() AttachChild(m_text_desc); m_text_desc->SetAutoDelete(true); - m_text_body = xr_new(); + m_text_body = xr_new("Text body"); // m_text_desc->AttachChild (m_text_body); // m_text_body->SetAutoDelete (true); @@ -63,7 +63,7 @@ void CUIServerInfo::Init() CUIXmlInit::InitScrollView(xml_doc, "server_info:text_desc", 0, m_text_desc); CUIXmlInit::InitStatic(xml_doc, "server_info:image", 0, m_image); - CUIXmlInit::InitTextWnd(xml_doc, "server_info:text_body", 0, m_text_body); + CUIXmlInit::InitStatic(xml_doc, "server_info:text_body", 0, m_text_body); m_text_body->SetTextComplexMode(true); m_text_body->SetWidth(m_text_desc->GetDesiredChildWidth()); m_text_desc->AddWindow(m_text_body, true); diff --git a/src/xrGame/ui/UIServerInfo.h b/src/xrGame/ui/UIServerInfo.h index 606342d214c..3c25bc8ef6b 100644 --- a/src/xrGame/ui/UIServerInfo.h +++ b/src/xrGame/ui/UIServerInfo.h @@ -7,8 +7,6 @@ class CUIStatic; class CUIScrollView; class CUI3tButton; -class CUI3tButton; -class CUITextWnd; class CUIServerInfo final : public CUIDialogWnd, public CUIWndCallback { @@ -37,7 +35,7 @@ class CUIServerInfo final : public CUIDialogWnd, public CUIWndCallback CUIStatic* m_caption; CUIStatic* m_background; CUIScrollView* m_text_desc; - CUITextWnd* m_text_body; + CUIStatic* m_text_body; CUIStatic* m_image; CUI3tButton* m_btn_spectator; CUI3tButton* m_btn_next; diff --git a/src/xrGame/ui/UISpeechMenu.cpp b/src/xrGame/ui/UISpeechMenu.cpp index 376f5de83b9..8c4cb8db0a5 100644 --- a/src/xrGame/ui/UISpeechMenu.cpp +++ b/src/xrGame/ui/UISpeechMenu.cpp @@ -26,7 +26,6 @@ CUISpeechMenu::CUISpeechMenu(LPCSTR section_name) void CUISpeechMenu::InitList(LPCSTR section_name) { R_ASSERT2(pSettings->section_exist(section_name), section_name); - CUITextWnd* pItem = NULL; string64 phrase; string256 str; @@ -39,6 +38,7 @@ void CUISpeechMenu::InitList(LPCSTR section_name) _GetItem(s, 0, phrase); xr_sprintf(str, "%d. %s", i + 1, StringTable().translate(phrase).c_str()); + CUIStatic* pItem{}; ADD_TEXT_TO_VIEW3(str, pItem, m_pList); pItem->SetFont(m_pFont); pItem->SetTextColor(m_text_color); diff --git a/src/xrGame/ui/UIStatsPlayerList.cpp b/src/xrGame/ui/UIStatsPlayerList.cpp index 0a76b2d766a..06d72e00391 100644 --- a/src/xrGame/ui/UIStatsPlayerList.cpp +++ b/src/xrGame/ui/UIStatsPlayerList.cpp @@ -122,7 +122,7 @@ void CUIStatsPlayerList::InitHeader(CUIXml& xml_doc, LPCSTR path) { for (u32 i = 0; i < m_field_info.size(); ++i) { - CUITextWnd* st = xr_new(); + auto* st = xr_new("Field"); st->SetAutoDelete(true); st->SetWndPos(Fvector2().set(indent, 10.0f)); st->SetWndSize(Fvector2().set(m_field_info[i].width, m_header->GetHeight())); @@ -148,7 +148,7 @@ void CUIStatsPlayerList::InitHeader(CUIXml& xml_doc, LPCSTR path) } else { - CUITextWnd* st = xr_new(); + auto* st = xr_new("Field"); st->SetAutoDelete(true); st->SetWndPos(Fvector2().set(10, 0)); st->SetWndSize(Fvector2().set(this->GetDesiredChildWidth(), m_h.h)); @@ -187,9 +187,9 @@ void CUIStatsPlayerList::InitTeamHeader(CUIXml& xml_doc, LPCSTR path) CUIXmlInit::InitFont(xml_doc, strconcat(sizeof(_path), _path, path, ":team_header:text_format"), 0, t.c, t.f); t.h = m_header_team->GetHeight(); - m_header_text = xr_new(); + m_header_text = xr_new("Header"); m_header_text->SetAutoDelete(true); - CUIXmlInit::InitTextWnd(xml_doc, strconcat(sizeof(_path), _path, path, ":team_header:header"), 0, m_header_text); + CUIXmlInit::InitStatic(xml_doc, strconcat(sizeof(_path), _path, path, ":team_header:header"), 0, m_header_text); m_header_text->SetWidth(GetDesiredChildWidth()); m_header_text->SetVTextAlignment(valCenter); m_header_team->AttachChild(m_header_text); diff --git a/src/xrGame/ui/UIStatsPlayerList.h b/src/xrGame/ui/UIStatsPlayerList.h index 94fe5c0ffa1..ba2fd3fee33 100644 --- a/src/xrGame/ui/UIStatsPlayerList.h +++ b/src/xrGame/ui/UIStatsPlayerList.h @@ -4,7 +4,7 @@ #include "UIStatsPlayerInfo.h" class CUIXml; -class CUITextWnd; +class CUIStatic; typedef bool (*player_cmp_func)(LPVOID v1, LPVOID v2); @@ -42,7 +42,7 @@ class CUIStatsPlayerList final : public CUIScrollView CUIStatic* m_header; CUIWindow* m_header_team; - CUITextWnd* m_header_text; + CUIStatic* m_header_text; u32 m_prev_upd_time; typedef struct diff --git a/src/xrGame/ui/UITalkDialogWnd.cpp b/src/xrGame/ui/UITalkDialogWnd.cpp index ecc535c22f5..aaf15cc5c06 100644 --- a/src/xrGame/ui/UITalkDialogWnd.cpp +++ b/src/xrGame/ui/UITalkDialogWnd.cpp @@ -15,7 +15,6 @@ #include "alife_registry_wrappers.h" #include "UIHelper.h" - CUITalkDialogWnd::CUITalkDialogWnd() : CUIWindow("CUITalkDialogWnd"), m_uiXml(nullptr), @@ -363,7 +362,7 @@ CUIQuestionItem::CUIQuestionItem(CUIXml* xml_doc, LPCSTR path) AddCallback(m_text, BUTTON_CLICKED, CUIWndCallback::void_function(this, &CUIQuestionItem::OnTextClicked)); strconcat(sizeof(str), str, path, ":num_text"); - m_num_text = UIHelper::CreateTextWnd(*xml_doc, str, this, false); + m_num_text = UIHelper::CreateStatic(*xml_doc, str, this, false); } void CUIQuestionItem::Init(LPCSTR val, LPCSTR text) @@ -391,10 +390,10 @@ CUIAnswerItem::CUIAnswerItem(CUIXml* xml_doc, LPCSTR path) string512 str; strconcat(sizeof(str), str, path, ":content_text"); - m_text = UIHelper::CreateTextWnd(*xml_doc, str, this); + m_text = UIHelper::CreateStatic(*xml_doc, str, this); strconcat(sizeof(str), str, path, ":name_caption"); - m_name = UIHelper::CreateTextWnd(*xml_doc, str, this); + m_name = UIHelper::CreateStatic(*xml_doc, str, this); SetAutoDelete(true); } diff --git a/src/xrGame/ui/UITalkDialogWnd.h b/src/xrGame/ui/UITalkDialogWnd.h index 93c2ddaa1e6..32111499ef4 100644 --- a/src/xrGame/ui/UITalkDialogWnd.h +++ b/src/xrGame/ui/UITalkDialogWnd.h @@ -94,7 +94,7 @@ class CUIQuestionItem final : public CUIWindow, public CUIWndCallback float m_min_height; public: - CUITextWnd* m_num_text; + CUIStatic* m_num_text; CUI3tButton* m_text; shared_str m_s_value; CUIQuestionItem(CUIXml* xml_doc, LPCSTR path); @@ -112,8 +112,8 @@ class CUIAnswerItem: public CUIWindow float m_min_height; float m_bottom_footer; - CUITextWnd* m_text; - CUITextWnd* m_name; + CUIStatic* m_text; + CUIStatic* m_name; public: CUIAnswerItem(CUIXml* xml_doc, LPCSTR path); diff --git a/src/xrGame/ui/UITradeBar.cpp b/src/xrGame/ui/UITradeBar.cpp index 9e973619f40..ad05147db65 100644 --- a/src/xrGame/ui/UITradeBar.cpp +++ b/src/xrGame/ui/UITradeBar.cpp @@ -12,12 +12,12 @@ void CUITradeBar::init_from_xml(CUIXml& uiXml, pcstr path) if (!CallOfPripyatMode) { - CUITextWnd* m_TradeCaption = UIHelper::CreateTextWnd(uiXml, "trade_caption", this, false); + m_TradeCaption = UIHelper::CreateStatic(uiXml, "trade_caption", this, false); if (m_TradeCaption) m_TradeCaption->AdjustWidthToText(); } - m_TradePrice = UIHelper::CreateTextWnd(uiXml, "trade_price", this); - m_TradeWeightMax = UIHelper::CreateTextWnd(uiXml, "trade_weight_max", this); + m_TradePrice = UIHelper::CreateStatic(uiXml, "trade_price", this); + m_TradeWeightMax = UIHelper::CreateStatic(uiXml, "trade_weight_max", this); uiXml.SetLocalRoot(stored_root); } diff --git a/src/xrGame/ui/UITradeBar.h b/src/xrGame/ui/UITradeBar.h index 554a293ab5d..952827e7651 100644 --- a/src/xrGame/ui/UITradeBar.h +++ b/src/xrGame/ui/UITradeBar.h @@ -2,9 +2,9 @@ class CUITradeBar final : public CUIStatic { - CUITextWnd* m_TradeCaption{}; - CUITextWnd* m_TradePrice{}; - CUITextWnd* m_TradeWeightMax{}; + CUIStatic* m_TradeCaption{}; + CUIStatic* m_TradePrice{}; + CUIStatic* m_TradeWeightMax{}; public: CUITradeBar() : CUIStatic("Trade Bar") {} diff --git a/src/xrGame/ui/UIVote.cpp b/src/xrGame/ui/UIVote.cpp index e30f88c8a06..fbe80d1e463 100644 --- a/src/xrGame/ui/UIVote.cpp +++ b/src/xrGame/ui/UIVote.cpp @@ -16,13 +16,13 @@ CUIVote::CUIVote() : CUIDialogWnd(CUIVote::GetDebugType()) bkgrnd = xr_new("Background"); bkgrnd->SetAutoDelete(true); AttachChild(bkgrnd); - msg = xr_new(); + msg = xr_new("Message"); msg->SetAutoDelete(true); AttachChild(msg); for (int i = 0; i < 3; i++) { - cap[i] = xr_new(); + cap[i] = xr_new("Caption"); cap[i]->SetAutoDelete(true); AttachChild(cap[i]); // frame[i] = new CUIFrameWindow(); frame[i]->SetAutoDelete(true); AttachChild(frame[i]); @@ -50,14 +50,14 @@ void CUIVote::Init() xml_doc.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "voting_category.xml"); CUIXmlInit::InitWindow(xml_doc, "vote", 0, this); CUIXmlInit::InitStatic(xml_doc, "vote:background", 0, bkgrnd); - CUIXmlInit::InitTextWnd(xml_doc, "vote:msg", 0, msg); + CUIXmlInit::InitStatic(xml_doc, "vote:msg", 0, msg); string256 path; for (int i = 0; i < 3; i++) { xr_sprintf(path, "vote:list_cap_%d", i + 1); - CUIXmlInit::InitTextWnd(xml_doc, path, 0, cap[i]); + CUIXmlInit::InitStatic(xml_doc, path, 0, cap[i]); // xr_sprintf (path, "vote:list_back_%d", i+1); // CUIXmlInit::InitFrameWindow (xml_doc, path, 0, frame[i]); xr_sprintf(path, "vote:list_%d", i + 1); diff --git a/src/xrGame/ui/UIVote.h b/src/xrGame/ui/UIVote.h index a2651968fdf..50bd633b694 100644 --- a/src/xrGame/ui/UIVote.h +++ b/src/xrGame/ui/UIVote.h @@ -3,7 +3,6 @@ #include "UIDialogWnd.h" class CUIStatic; -class CUITextWnd; class CUI3tButton; class CUIListBox; class CUIFrameWindow; @@ -24,8 +23,8 @@ class CUIVote final : public CUIDialogWnd pcstr GetDebugType() override { return "CUIVote"; } protected: - CUITextWnd* msg; - CUITextWnd* cap[3]; + CUIStatic* msg; + CUIStatic* cap[3]; CUIFrameWindow* frame[3]; CUIListBox* list[3]; diff --git a/src/xrGame/ui/UIVoteStatusWnd.cpp b/src/xrGame/ui/UIVoteStatusWnd.cpp index be6f33cc020..d7c9cc8b1cd 100644 --- a/src/xrGame/ui/UIVoteStatusWnd.cpp +++ b/src/xrGame/ui/UIVoteStatusWnd.cpp @@ -5,20 +5,20 @@ void UIVoteStatusWnd::InitFromXML(CUIXml& xml_doc) { - m_str_message = xr_new(); + m_str_message = xr_new("Message"); m_str_message->SetAutoDelete(true); AttachChild(m_str_message); - m_hint = xr_new(); + m_hint = xr_new("Hint"); m_hint->SetAutoDelete(true); AttachChild(m_hint); - m_time_message = xr_new(); + m_time_message = xr_new("Time message"); m_time_message->SetAutoDelete(true); AttachChild(m_time_message); CUIXmlInit::InitFrameWindow(xml_doc, "vote_wnd", 0, this); - CUIXmlInit::InitTextWnd(xml_doc, "vote_wnd:static_str_message", 0, m_str_message); - CUIXmlInit::InitTextWnd(xml_doc, "vote_wnd:static_hint", 0, m_hint); - CUIXmlInit::InitTextWnd(xml_doc, "vote_wnd:static_time_message", 0, m_time_message); + CUIXmlInit::InitStatic(xml_doc, "vote_wnd:static_str_message", 0, m_str_message); + CUIXmlInit::InitStatic(xml_doc, "vote_wnd:static_hint", 0, m_hint); + CUIXmlInit::InitStatic(xml_doc, "vote_wnd:static_time_message", 0, m_time_message); } void UIVoteStatusWnd::SetVoteTimeResultMsg(LPCSTR s) { m_time_message->SetText(s); } diff --git a/src/xrGame/ui/UIVoteStatusWnd.h b/src/xrGame/ui/UIVoteStatusWnd.h index 615da051b4a..409cf6aaabb 100644 --- a/src/xrGame/ui/UIVoteStatusWnd.h +++ b/src/xrGame/ui/UIVoteStatusWnd.h @@ -2,13 +2,13 @@ #include "xrUICore/Windows/UIFrameWindow.h" class CUIXml; -class CUITextWnd; +class CUIStatic; class UIVoteStatusWnd final : public CUIFrameWindow { - CUITextWnd* m_str_message{}; - CUITextWnd* m_hint{}; - CUITextWnd* m_time_message{}; + CUIStatic* m_str_message{}; + CUIStatic* m_hint{}; + CUIStatic* m_time_message{}; public: UIVoteStatusWnd() : CUIFrameWindow(UIVoteStatusWnd::GetDebugType()) {} diff --git a/src/xrGame/ui/UIWeightBar.cpp b/src/xrGame/ui/UIWeightBar.cpp index 691929b8258..89eb6a4414f 100644 --- a/src/xrGame/ui/UIWeightBar.cpp +++ b/src/xrGame/ui/UIWeightBar.cpp @@ -11,12 +11,12 @@ void CUIWeightBar::init_from_xml(CUIXml& uiXml, pcstr path) m_BottomInfo = UIHelper::CreateStatic(uiXml, buf, this); xr_sprintf(buf, "%s_weight", path); - m_Weight = UIHelper::CreateTextWnd(uiXml, buf, this); + m_Weight = UIHelper::CreateStatic(uiXml, buf, this); xr_sprintf(buf, "%s_weight_max", path); - m_WeightMax = UIHelper::CreateTextWnd(uiXml, buf, this, false); + m_WeightMax = UIHelper::CreateStatic(uiXml, buf, this, false); { - CUITextWnd* weightLabel = m_WeightMax ? m_WeightMax : m_Weight; + const auto* weightLabel = m_WeightMax ? m_WeightMax : m_Weight; m_Weight_end_x = weightLabel->GetWndPos().x; } m_BottomInfo->AdjustWidthToText(); diff --git a/src/xrGame/ui/UIWeightBar.h b/src/xrGame/ui/UIWeightBar.h index 837692a5ad9..f764eda502f 100644 --- a/src/xrGame/ui/UIWeightBar.h +++ b/src/xrGame/ui/UIWeightBar.h @@ -3,8 +3,8 @@ class CUIWeightBar final : public CUIWindow { CUIStatic* m_BottomInfo{}; - CUITextWnd* m_Weight{}; - CUITextWnd* m_WeightMax{}; + CUIStatic* m_Weight{}; + CUIStatic* m_WeightMax{}; float m_Weight_end_x{}; public: diff --git a/src/xrGame/ui/UIWpnParams.cpp b/src/xrGame/ui/UIWpnParams.cpp index 8e7e763fb8b..82ea67046f5 100644 --- a/src/xrGame/ui/UIWpnParams.cpp +++ b/src/xrGame/ui/UIWpnParams.cpp @@ -69,10 +69,10 @@ bool CUIWpnParams::InitFromXml(CUIXml& xml_doc) m_icon_han = UIHelper::CreateStatic(xml_doc, "wpn_params:static_handling", this, false); m_icon_rpm = UIHelper::CreateStatic(xml_doc, "wpn_params:static_rpm", this, false); - CUIXmlInit::InitTextWnd(xml_doc, "wpn_params:cap_accuracy", 0, &m_textAccuracy); - CUIXmlInit::InitTextWnd(xml_doc, "wpn_params:cap_damage", 0, &m_textDamage); - CUIXmlInit::InitTextWnd(xml_doc, "wpn_params:cap_handling", 0, &m_textHandling); - CUIXmlInit::InitTextWnd(xml_doc, "wpn_params:cap_rpm", 0, &m_textRPM); + CUIXmlInit::InitStatic(xml_doc, "wpn_params:cap_accuracy", 0, &m_textAccuracy); + CUIXmlInit::InitStatic(xml_doc, "wpn_params:cap_damage", 0, &m_textDamage); + CUIXmlInit::InitStatic(xml_doc, "wpn_params:cap_handling", 0, &m_textHandling); + CUIXmlInit::InitStatic(xml_doc, "wpn_params:cap_rpm", 0, &m_textRPM); m_progressAccuracy.InitFromXml(xml_doc, "wpn_params:progress_accuracy"); m_progressDamage.InitFromXml(xml_doc, "wpn_params:progress_damage"); @@ -82,10 +82,10 @@ bool CUIWpnParams::InitFromXml(CUIXml& xml_doc) if (IsGameTypeSingle()) { m_stAmmo = UIHelper::CreateStatic(xml_doc, "wpn_params:static_ammo", this, false); - m_textAmmoCount = UIHelper::CreateTextWnd(xml_doc, "wpn_params:cap_ammo_count", this, false); - m_textAmmoCount2 = UIHelper::CreateTextWnd(xml_doc, "wpn_params:cap_ammo_count2", this, false); - m_textAmmoTypes = UIHelper::CreateTextWnd(xml_doc, "wpn_params:cap_ammo_types", this, false); - m_textAmmoUsedType = UIHelper::CreateTextWnd(xml_doc, "wpn_params:cap_ammo_used_type", this, false); + m_textAmmoCount = UIHelper::CreateStatic(xml_doc, "wpn_params:cap_ammo_count", this, false); + m_textAmmoCount2 = UIHelper::CreateStatic(xml_doc, "wpn_params:cap_ammo_count2", this, false); + m_textAmmoTypes = UIHelper::CreateStatic(xml_doc, "wpn_params:cap_ammo_types", this, false); + m_textAmmoUsedType = UIHelper::CreateStatic(xml_doc, "wpn_params:cap_ammo_used_type", this, false); m_stAmmoType1 = UIHelper::CreateStatic(xml_doc, "wpn_params:static_ammo_type1", this, false); m_stAmmoType2 = UIHelper::CreateStatic(xml_doc, "wpn_params:static_ammo_type2", this, false); } diff --git a/src/xrGame/ui/UIWpnParams.h b/src/xrGame/ui/UIWpnParams.h index 020d398fa53..a97bc67a829 100644 --- a/src/xrGame/ui/UIWpnParams.h +++ b/src/xrGame/ui/UIWpnParams.h @@ -30,14 +30,14 @@ class CUIWpnParams final : public CUIWindow CUIStatic* m_icon_rpm; CUIStatic* m_stAmmo; - CUITextWnd m_textAccuracy; - CUITextWnd m_textHandling; - CUITextWnd m_textDamage; - CUITextWnd m_textRPM; - CUITextWnd* m_textAmmoTypes; - CUITextWnd* m_textAmmoUsedType; - CUITextWnd* m_textAmmoCount; - CUITextWnd* m_textAmmoCount2; + CUIStatic m_textAccuracy{ "Accuracy" }; + CUIStatic m_textHandling{ "Handling" }; + CUIStatic m_textDamage{ "Damage" }; + CUIStatic m_textRPM{ "RPM" }; + CUIStatic* m_textAmmoTypes; + CUIStatic* m_textAmmoUsedType; + CUIStatic* m_textAmmoCount; + CUIStatic* m_textAmmoCount2; CUIStatic* m_stAmmoType1; CUIStatic* m_stAmmoType2; CUIStatic* m_Prop_line; diff --git a/src/xrGame/ui/map_hint.h b/src/xrGame/ui/map_hint.h index b38507a4154..b4ccc11fe4c 100644 --- a/src/xrGame/ui/map_hint.h +++ b/src/xrGame/ui/map_hint.h @@ -3,7 +3,6 @@ #include "xrCore/Containers/AssociativeVector.hpp" class CUIStatic; -class CUITextWnd; class CUIXml; class CGameTask; class CMapSpot; diff --git a/src/xrGame/ui/ui_af_params.cpp b/src/xrGame/ui/ui_af_params.cpp index 87640371df4..57593b770aa 100644 --- a/src/xrGame/ui/ui_af_params.cpp +++ b/src/xrGame/ui/ui_af_params.cpp @@ -212,7 +212,7 @@ UIArtefactParamItem::InitResult UIArtefactParamItem::Init(CUIXml& xml, pcstr sec xml.SetLocalRoot(xml.NavigateToNode(section)); m_caption = UIHelper::CreateStatic(xml, "caption", this); - m_value = UIHelper::CreateTextWnd(xml, "value", this); + m_value = UIHelper::CreateStatic(xml, "value", this); m_magnitude = xml.ReadAttribFlt("value", 0, "magnitude", 1.0f); m_sign_inverse = (xml.ReadAttribInt("value", 0, "sign_inverse", 0) == 1); @@ -244,7 +244,7 @@ UIArtefactParamItem::InitResult UIArtefactParamItem::InitPlain(CUIXml& xml, pcst AttachChild(m_caption); m_caption->Show(false); // hack - m_value = xr_new(); + m_value = xr_new("Value"); m_value->SetAutoDelete(true); AttachChild(m_value); m_value->Show(false); // hack diff --git a/src/xrGame/ui/ui_af_params.h b/src/xrGame/ui/ui_af_params.h index cfa714d3b4c..9b7c9fe1c38 100644 --- a/src/xrGame/ui/ui_af_params.h +++ b/src/xrGame/ui/ui_af_params.h @@ -4,7 +4,6 @@ class CUIXml; class CUIStatic; -class CUITextWnd; class UIArtefactParamItem; class CUIArtefactParams final : public CUIWindow @@ -61,7 +60,7 @@ class UIArtefactParamItem final : public CUIStatic private: CUIStatic* m_caption{}; - CUITextWnd* m_value{}; + CUIStatic* m_value{}; float m_magnitude; bool m_sign_inverse; shared_str m_unit_str; diff --git a/src/xrUICore/Buttons/UIBtnHint.cpp b/src/xrUICore/Buttons/UIBtnHint.cpp index 14c07a5dfec..f4a02a9001f 100644 --- a/src/xrUICore/Buttons/UIBtnHint.cpp +++ b/src/xrUICore/Buttons/UIBtnHint.cpp @@ -15,13 +15,12 @@ CUIButtonHint::CUIButtonHint() uiXml.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "hint_item.xml"); CUIXmlInitBase::InitFrameWindow(uiXml, "button_hint", 0, this); - m_text = xr_new(); + m_text = xr_new("Text"); m_text->SetAutoDelete(true); CUIWindow::AttachChild(m_text); - CUIXmlInitBase::InitTextWnd(uiXml, "button_hint:description", 0, m_text); + CUIXmlInitBase::InitStatic(uiXml, "button_hint:description", 0, m_text); } - void CUIButtonHint::OnRender() { if (m_enabledOnFrame) diff --git a/src/xrUICore/Buttons/UIBtnHint.h b/src/xrUICore/Buttons/UIBtnHint.h index d5aee5350ba..8e1b8f0a52f 100644 --- a/src/xrUICore/Buttons/UIBtnHint.h +++ b/src/xrUICore/Buttons/UIBtnHint.h @@ -1,13 +1,13 @@ #pragma once #include "xrUICore/Windows/UIFrameWindow.h" -class CUITextWnd; +class CUIStatic; class XRUICORE_API CUIButtonHint final : public CUIFrameWindow { CUIWindow* m_ownerWnd; - CUITextWnd* m_text; + CUIStatic* m_text; bool m_enabledOnFrame; public: diff --git a/src/xrUICore/ComboBox/UIComboBox.h b/src/xrUICore/ComboBox/UIComboBox.h index a4cabb4cf99..8d5524d65d7 100644 --- a/src/xrUICore/ComboBox/UIComboBox.h +++ b/src/xrUICore/ComboBox/UIComboBox.h @@ -68,7 +68,7 @@ class XRUICORE_API CUIComboBox final : public CUIWindow, public CUIOptionsItem, int m_opt_backup_value; CUI_IB_FrameLineWnd m_frameLine; - CUITextWnd m_text; + CUIStatic m_text{ "Text" }; CUIFrameWindow m_list_frame{ "List frame" }; u32 m_textColor[2]; diff --git a/src/xrUICore/Hint/UIHint.cpp b/src/xrUICore/Hint/UIHint.cpp index cad40ef8651..f2b83134269 100644 --- a/src/xrUICore/Hint/UIHint.cpp +++ b/src/xrUICore/Hint/UIHint.cpp @@ -31,10 +31,10 @@ void UIHint::init_from_xml(CUIXml& xml, LPCSTR path) m_background->SetAutoDelete(true); CUIXmlInitBase::InitFrameWindow(xml, "background", 0, m_background); - m_text = xr_new(); + m_text = xr_new("Text"); AttachChild(m_text); m_text->SetAutoDelete(true); - CUIXmlInitBase::InitTextWnd(xml, "text", 0, m_text); + CUIXmlInitBase::InitStatic(xml, "text", 0, m_text); m_border = xml.ReadAttribFlt("background", 0, "border", 0.0f); diff --git a/src/xrUICore/Hint/UIHint.h b/src/xrUICore/Hint/UIHint.h index 44fb62166c3..9fc234c154e 100644 --- a/src/xrUICore/Hint/UIHint.h +++ b/src/xrUICore/Hint/UIHint.h @@ -11,7 +11,6 @@ #include "xrUICore/Windows/UIWindow.h" class CUIStatic; -class CUITextWnd; class CUIFrameWindow; class CUIXml; @@ -39,7 +38,7 @@ class XRUICORE_API UIHint final : public CUIWindow protected: CUIFrameWindow* m_background; - CUITextWnd* m_text; + CUIStatic* m_text; bool m_visible; float m_border; diff --git a/src/xrUICore/ListBox/UIListBoxItem.cpp b/src/xrUICore/ListBox/UIListBoxItem.cpp index 45a485a4cc7..e18d5a81e28 100644 --- a/src/xrUICore/ListBox/UIListBoxItem.cpp +++ b/src/xrUICore/ListBox/UIListBoxItem.cpp @@ -76,9 +76,9 @@ CUIStatic* CUIListBoxItem::AddIconField(float width) return st; } -CUITextWnd* CUIListBoxItem::AddTextField(LPCSTR txt, float width) +CUIStatic* CUIListBoxItem::AddTextField(LPCSTR txt, float width) { - CUITextWnd* st = xr_new(); + auto* st = xr_new("Text field"); st->SetAutoDelete(true); st->SetWndPos(Fvector2().set(FieldsLength(), 0.0f)); st->SetWndSize(Fvector2().set(width, GetHeight())); diff --git a/src/xrUICore/ListBox/UIListBoxItem.h b/src/xrUICore/ListBox/UIListBoxItem.h index bf38867260b..9cd36abb7dd 100644 --- a/src/xrUICore/ListBox/UIListBoxItem.h +++ b/src/xrUICore/ListBox/UIListBoxItem.h @@ -1,7 +1,6 @@ #pragma once #include "xrUICore/Windows/UIFrameLineWnd.h" -class CUITextWnd; class CUIStatic; class XRUICORE_API CUIListBoxItem : public CUIFrameLineWnd, public CUISelectable @@ -21,10 +20,10 @@ class XRUICORE_API CUIListBoxItem : public CUIFrameLineWnd, public CUISelectable void SetData(void* data); void* GetData(); - CUITextWnd* AddTextField(LPCSTR txt, float width); + CUIStatic* AddTextField(LPCSTR txt, float width); CUIStatic* AddIconField(float width); - CUITextWnd* GetTextItem() { return m_text; } + CUIStatic* GetTextItem() const { return m_text; } // TextControl void SetText(LPCSTR txt); LPCSTR GetText(); @@ -36,7 +35,7 @@ class XRUICORE_API CUIListBoxItem : public CUIFrameLineWnd, public CUISelectable pcstr GetDebugType() override { return "CUIListBoxItem"; } protected: - CUITextWnd* m_text; + CUIStatic* m_text; u32 tag; void* pData; float FieldsLength() const; diff --git a/src/xrUICore/MessageBox/UIMessageBox.cpp b/src/xrUICore/MessageBox/UIMessageBox.cpp index 196331f22c9..f9a76a5a24f 100644 --- a/src/xrUICore/MessageBox/UIMessageBox.cpp +++ b/src/xrUICore/MessageBox/UIMessageBox.cpp @@ -149,9 +149,9 @@ bool CUIMessageBox::InitMessageBox(LPCSTR box_template) strconcat(sizeof(str), str, box_template, ":message_text"); if (uiXml.NavigateToNode(str, 0)) { - m_UIStaticText = xr_new(); + m_UIStaticText = xr_new("Text"); AttachChild(m_UIStaticText); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticText); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticText); } xr_strcpy(str, box_template); @@ -221,9 +221,9 @@ bool CUIMessageBox::InitMessageBox(LPCSTR box_template) case MESSAGEBOX_DIRECT_IP: strconcat(sizeof(str), str, box_template, ":cap_host"); - m_UIStaticHost = xr_new(); + m_UIStaticHost = xr_new("Host"); AttachChild(m_UIStaticHost); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticHost); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticHost); strconcat(sizeof(str), str, box_template, ":edit_host"); m_UIEditHost = xr_new(); @@ -231,9 +231,9 @@ bool CUIMessageBox::InitMessageBox(LPCSTR box_template) CUIXmlInitBase::InitEditBox(uiXml, str, 0, m_UIEditHost); strconcat(sizeof(str), str, box_template, ":cap_password"); - m_UIStaticPass = xr_new(); + m_UIStaticPass = xr_new("Password"); AttachChild(m_UIStaticPass); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticPass); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticPass); strconcat(sizeof(str), str, box_template, ":edit_password"); m_UIEditPass = xr_new(); @@ -255,14 +255,14 @@ bool CUIMessageBox::InitMessageBox(LPCSTR box_template) case MESSAGEBOX_PASSWORD: { strconcat(sizeof(str), str, box_template, ":cap_user_password"); - m_UIStaticUserPass = xr_new(); + m_UIStaticUserPass = xr_new("User password"); AttachChild(m_UIStaticUserPass); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticUserPass); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticUserPass); strconcat(sizeof(str), str, box_template, ":cap_password"); - m_UIStaticPass = xr_new(); + m_UIStaticPass = xr_new("Password"); AttachChild(m_UIStaticPass); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticPass); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticPass); strconcat(sizeof(str), str, box_template, ":edit_user_password"); m_UIEditUserPass = xr_new(); @@ -288,14 +288,14 @@ bool CUIMessageBox::InitMessageBox(LPCSTR box_template) case MESSAGEBOX_RA_LOGIN: strconcat(sizeof(str), str, box_template, ":cap_login"); - m_UIStaticUserPass = xr_new(); + m_UIStaticUserPass = xr_new("Login"); AttachChild(m_UIStaticUserPass); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticUserPass); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticUserPass); strconcat(sizeof(str), str, box_template, ":cap_password"); - m_UIStaticPass = xr_new(); + m_UIStaticPass = xr_new("Password"); AttachChild(m_UIStaticPass); - CUIXmlInitBase::InitTextWnd(uiXml, str, 0, m_UIStaticPass); + CUIXmlInitBase::InitStatic(uiXml, str, 0, m_UIStaticPass); strconcat(sizeof(str), str, box_template, ":edit_login"); m_UIEditUserPass = xr_new(); diff --git a/src/xrUICore/MessageBox/UIMessageBox.h b/src/xrUICore/MessageBox/UIMessageBox.h index a8903356a94..95f72c77417 100644 --- a/src/xrUICore/MessageBox/UIMessageBox.h +++ b/src/xrUICore/MessageBox/UIMessageBox.h @@ -60,10 +60,10 @@ class XRUICORE_API CUIMessageBox final : public CUIStatic CUI3tButton* m_UIButtonCopy; CUIStatic* m_UIStaticPicture; - CUITextWnd* m_UIStaticText; - CUITextWnd* m_UIStaticHost; - CUITextWnd* m_UIStaticPass; - CUITextWnd* m_UIStaticUserPass; + CUIStatic* m_UIStaticText; + CUIStatic* m_UIStaticHost; + CUIStatic* m_UIStaticPass; + CUIStatic* m_UIStaticUserPass; CUIEditBox* m_UIEditHost; CUIEditBox* m_UIEditPass; CUIEditBox* m_UIEditUserPass; diff --git a/src/xrUICore/ScrollView/UIScrollView.h b/src/xrUICore/ScrollView/UIScrollView.h index 6b92f8a28df..0c02a6754c6 100644 --- a/src/xrUICore/ScrollView/UIScrollView.h +++ b/src/xrUICore/ScrollView/UIScrollView.h @@ -89,7 +89,7 @@ class XRUICORE_API CUIScrollView : public CUIWindow, public CUIWndCallback }; #define ADD_TEXT_TO_VIEW3(txt, st, view) \ - st = xr_new(); \ + st = xr_new("Text"); \ st->SetFont(UI().Font().pFontLetterica16Russian); \ st->SetText(txt); \ st->SetTextComplexMode(true); \ @@ -98,5 +98,5 @@ class XRUICORE_API CUIScrollView : public CUIWindow, public CUIWndCallback view->AddWindow(st, true) #define ADD_TEXT_TO_VIEW2(txt, view) \ - CUITextWnd* pSt; \ + CUIStatic* pSt; \ ADD_TEXT_TO_VIEW3(txt, pSt, view)