aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-08 19:08:36 -0400
committerGitHub <noreply@github.com>2026-03-08 18:08:36 -0500
commit28614b922fb77149a54da1a87bebfbc98736f296 (patch)
tree7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp
parent88798b501d0cf6287b6f87acb2592676e3cec58d (diff)
Modernize project codebase (#906)
* 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 * Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp')
-rw-r--r--Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp
index cc3afeca..576b7557 100644
--- a/Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp
+++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_4JEdit.cpp
@@ -10,7 +10,7 @@ HRESULT CXuiCtrl4JEdit::OnInit(XUIMessageInit* pInitData, BOOL& rfHandled)
// set a limit for the text box
m_uTextLimit=XUI_4JEDIT_MAX_CHARS-1;
XuiEditSetTextLimit(m_hObj,m_uTextLimit);
- // Find the text limit. (Add one for NULL terminator)
+ // Find the text limit. (Add one for nullptr terminator)
//m_uTextLimit = min( XuiEditGetTextLimit(m_hObj) + 1, XUI_4JEDIT_MAX_CHARS);
ZeroMemory( wchText , sizeof(WCHAR)*(m_uTextLimit+1) );
@@ -127,7 +127,7 @@ HRESULT CXuiCtrl4JEdit::OnChar(XUIMessageChar* pInputData, BOOL& rfHandled)
XuiSendMessage( hBaseObj, &xuiMsg );
rfHandled = TRUE;
- SendNotifyValueChanged((int)pInputData->wch);
+ SendNotifyValueChanged(static_cast<int>(pInputData->wch));
return hr;
}
@@ -145,7 +145,7 @@ HRESULT CXuiCtrl4JEdit::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandled)
if( pThis->m_bReadOnly ) return hr;
- // Find the text limit. (Add one for NULL terminator)
+ // Find the text limit. (Add one for nullptr terminator)
//m_uTextLimit = min( XuiEditGetTextLimit(m_hObj) + 1, XUI_4JEDIT_MAX_CHARS);
if((((pInputData->dwKeyCode == VK_PAD_A) && (pInputData->wch == 0)) || (pInputData->dwKeyCode == VK_PAD_START)) && !(pInputData->dwFlags & XUI_INPUT_FLAG_REPEAT))
@@ -185,14 +185,14 @@ HRESULT CXuiCtrl4JEdit::SendNotifyValueChanged(int iValue)
int CXuiCtrl4JEdit::KeyboardReturned(void *pParam,bool bSet)
{
- CXuiCtrl4JEdit* pClass = (CXuiCtrl4JEdit*)pParam;
+ CXuiCtrl4JEdit* pClass = static_cast<CXuiCtrl4JEdit *>(pParam);
HRESULT hr = S_OK;
if(bSet)
{
pClass->SetText(pClass->wchText);
// need to move the caret to the end of the newly set text
- XuiEditSetCaretPosition(pClass->m_hObj, (int)wcsnlen(pClass->wchText, 50));
+ XuiEditSetCaretPosition(pClass->m_hObj, static_cast<int>(wcsnlen(pClass->wchText, 50)));
pClass->SendNotifyValueChanged(10); // 10 for a return
}