aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.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/UIScene_DebugSetCamera.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/UIScene_DebugSetCamera.cpp')
-rw-r--r--Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp
index 62ee60b1..51eab5aa 100644
--- a/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp
+++ b/Minecraft.Client/Common/UI/UIScene_DebugSetCamera.cpp
@@ -17,7 +17,7 @@ UIScene_DebugSetCamera::UIScene_DebugSetCamera(int iPad, void *initData, UILayer
currentPosition->player = playerNo;
Minecraft *pMinecraft = Minecraft::GetInstance();
- if (pMinecraft != NULL)
+ if (pMinecraft != nullptr)
{
Vec3 *vec = pMinecraft->localplayers[playerNo]->getPos(1.0);
@@ -143,7 +143,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
#ifdef _WINDOWS64
if (isDirectEditBlocking()) return;
#endif
- switch((int)controlId)
+ switch(static_cast<int>(controlId))
{
case eControl_Teleport:
app.SetXuiServerAction( ProfileManager.GetPrimaryPad(),
@@ -155,7 +155,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
case eControl_CamZ:
case eControl_YRot:
case eControl_Elevation:
- m_keyboardCallbackControl = (eControls)((int)controlId);
+ m_keyboardCallbackControl = static_cast<eControls>(static_cast<int>(controlId));
#ifdef _WINDOWS64
if (g_KBMInput.IsKBMActive())
{
@@ -173,6 +173,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
ui.NavigateToScene(m_iPad, eUIScene_Keyboard, &kbData, eUILayer_Fullscreen, eUIGroup_Fullscreen);
}
#else
+>>>>>>> origin/main
InputManager.RequestKeyboard(L"Enter something",L"",(DWORD)0,25,&UIScene_DebugSetCamera::KeyboardCompleteCallback,this,C_4JInput::EKeyboardMode_Default);
#endif
break;
@@ -181,7 +182,7 @@ void UIScene_DebugSetCamera::handlePress(F64 controlId, F64 childId)
void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected)
{
- switch((int)controlId)
+ switch(static_cast<int>(controlId))
{
case eControl_LockPlayer:
app.SetFreezePlayers(selected);
@@ -191,18 +192,19 @@ void UIScene_DebugSetCamera::handleCheckboxToggled(F64 controlId, bool selected)
int UIScene_DebugSetCamera::KeyboardCompleteCallback(LPVOID lpParam,bool bRes)
{
- UIScene_DebugSetCamera *pClass=(UIScene_DebugSetCamera *)lpParam;
+ UIScene_DebugSetCamera *pClass=static_cast<UIScene_DebugSetCamera *>(lpParam);
uint16_t pchText[2048];
ZeroMemory(pchText, 2048 * sizeof(uint16_t));
#ifdef _WINDOWS64
Win64_GetKeyboardText(pchText, 2048);
#else
+>>>>>>> origin/main
InputManager.GetText(pchText);
#endif
if(pchText[0]!=0)
{
- wstring value = (wchar_t *)pchText;
+ wstring value = reinterpret_cast<wchar_t*>(pchText);
double val = 0;
if(!value.empty()) val = _fromString<double>( value );
switch(pClass->m_keyboardCallbackControl)