aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIControl.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-07 21:56:03 -0500
committerGitHub <noreply@github.com>2026-03-08 09:56:03 +0700
commita9be52c41a02d207233199e98898fe7483d7e817 (patch)
tree71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.Client/Common/UI/UIControl.cpp
parent1be5faaea781402e7de06b263eeca4c688b7712c (diff)
Project modernization (#630)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
Diffstat (limited to 'Minecraft.Client/Common/UI/UIControl.cpp')
-rw-r--r--Minecraft.Client/Common/UI/UIControl.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/Minecraft.Client/Common/UI/UIControl.cpp b/Minecraft.Client/Common/UI/UIControl.cpp
index 3d853ac4..7582e82f 100644
--- a/Minecraft.Client/Common/UI/UIControl.cpp
+++ b/Minecraft.Client/Common/UI/UIControl.cpp
@@ -6,7 +6,7 @@
UIControl::UIControl()
{
- m_parentScene = NULL;
+ m_parentScene = nullptr;
m_lastOpacity = 1.0f;
m_controlName = "";
m_isVisible = true;
@@ -31,15 +31,15 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
m_nameVisible = registerFastName(L"visible");
F64 fx, fy, fwidth, fheight;
- IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , NULL , &fx );
- IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , NULL , &fy );
- IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
- IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &fheight );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , nullptr , &fx );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , nullptr , &fy );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , nullptr , &fwidth );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , nullptr , &fheight );
- m_x = (S32)fx;
- m_y = (S32)fy;
- m_width = (S32)Math::round(fwidth);
- m_height = (S32)Math::round(fheight);
+ m_x = static_cast<S32>(fx);
+ m_y = static_cast<S32>(fy);
+ m_width = static_cast<S32>(Math::round(fwidth));
+ m_height = static_cast<S32>(Math::round(fheight));
return res;
}
@@ -47,14 +47,14 @@ bool UIControl::setupControl(UIScene *scene, IggyValuePath *parent, const string
void UIControl::UpdateControl()
{
F64 fx, fy, fwidth, fheight;
- IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , NULL , &fx );
- IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , NULL , &fy );
- IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , NULL , &fwidth );
- IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , NULL , &fheight );
- m_x = (S32)fx;
- m_y = (S32)fy;
- m_width = (S32)Math::round(fwidth);
- m_height = (S32)Math::round(fheight);
+ IggyValueGetF64RS( getIggyValuePath() , m_nameXPos , nullptr , &fx );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameYPos , nullptr , &fy );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameWidth , nullptr , &fwidth );
+ IggyValueGetF64RS( getIggyValuePath() , m_nameHeight , nullptr , &fheight );
+ m_x = static_cast<S32>(fx);
+ m_y = static_cast<S32>(fy);
+ m_width = static_cast<S32>(Math::round(fwidth));
+ m_height = static_cast<S32>(Math::round(fheight));
}
void UIControl::ReInit()
@@ -76,7 +76,7 @@ void UIControl::ReInit()
IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, m_parentScene->m_rootPath , m_funcSetAlpha , 2 , value );
}
- IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, NULL, m_isVisible );
+ IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, nullptr, m_isVisible );
}
IggyValuePath *UIControl::getIggyValuePath()
@@ -130,7 +130,7 @@ void UIControl::setVisible(bool visible)
{
if(visible != m_isVisible)
{
- rrbool succ = IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, NULL, visible );
+ rrbool succ = IggyValueSetBooleanRS( getIggyValuePath(), m_nameVisible, nullptr, visible );
if(succ) m_isVisible = visible;
else app.DebugPrintf("Failed to set visibility for control\n");
}
@@ -140,7 +140,7 @@ bool UIControl::getVisible()
{
rrbool bVisible = false;
- IggyResult result = IggyValueGetBooleanRS ( getIggyValuePath() , m_nameVisible, NULL, &bVisible );
+ IggyResult result = IggyValueGetBooleanRS ( getIggyValuePath() , m_nameVisible, nullptr, &bVisible );
m_isVisible = bVisible;