From a9be52c41a02d207233199e98898fe7483d7e817 Mon Sep 17 00:00:00 2001 From: ModMaker101 <119018978+ModMaker101@users.noreply.github.com> Date: Sat, 7 Mar 2026 21:56:03 -0500 Subject: 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 --- Minecraft.Client/Common/XUI/XUI_MultiGameInfo.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Minecraft.Client/Common/XUI/XUI_MultiGameInfo.cpp') diff --git a/Minecraft.Client/Common/XUI/XUI_MultiGameInfo.cpp b/Minecraft.Client/Common/XUI/XUI_MultiGameInfo.cpp index bbfa243b..c1dba282 100644 --- a/Minecraft.Client/Common/XUI/XUI_MultiGameInfo.cpp +++ b/Minecraft.Client/Common/XUI/XUI_MultiGameInfo.cpp @@ -31,7 +31,7 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled XuiControlSetText(m_labelTNTOn,app.GetString(IDS_LABEL_TNT)); XuiControlSetText(m_labelFireOn,app.GetString(IDS_LABEL_FIRE_SPREADS)); - JoinMenuInitData *initData = (JoinMenuInitData *)pInitData->pvInitData; + JoinMenuInitData *initData = static_cast(pInitData->pvInitData); m_selectedSession = initData->selectedSession; m_iPad = initData->iPad; // 4J-PB - don't delete this - it's part of the joinload structure @@ -39,7 +39,7 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { - if( m_selectedSession->data.players[i] != NULL ) + if( m_selectedSession->data.players[i] != nullptr ) { playersList.InsertItems(i,1); #ifndef _CONTENT_PACKAGE @@ -55,7 +55,7 @@ HRESULT CScene_MultiGameInfo::OnInit( XUIMessageInit* pInitData, BOOL& bHandled } else { - // Leave the loop when we hit the first NULL player + // Leave the loop when we hit the first nullptr player break; } } @@ -185,7 +185,7 @@ HRESULT CScene_MultiGameInfo::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHan rfHandled = TRUE; break; case VK_PAD_Y: - if(m_selectedSession != NULL && playersList.TreeHasFocus() && playersList.GetItemCount() > 0) + if(m_selectedSession != nullptr && playersList.TreeHasFocus() && playersList.GetItemCount() > 0) { PlayerUID xuid = m_selectedSession->data.players[playersList.GetCurSel()]; if( xuid != INVALID_XUID ) @@ -237,7 +237,7 @@ HRESULT CScene_MultiGameInfo::OnNotifyKillFocus(HXUIOBJ hObjSource, XUINotifyFoc int CScene_MultiGameInfo::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad) { - CScene_MultiGameInfo* pClass = (CScene_MultiGameInfo*)pParam; + CScene_MultiGameInfo* pClass = static_cast(pParam); if(bContinue==true) { @@ -302,7 +302,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) int messageText = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_SINGLE_LOCAL; if(dwSignedInUsers > 1) messageText = IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_ALL_LOCAL; - StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, messageText, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); + StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, messageText, uiIDA,1,ProfileManager.GetPrimaryPad(),nullptr,nullptr, app.GetStringTable()); } else if(noPrivileges) @@ -311,7 +311,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) pClass->m_bIgnoreInput=false; UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; - StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); + StorageManager.RequestMessageBox( IDS_NO_MULTIPLAYER_PRIVILEGE_TITLE, IDS_NO_MULTIPLAYER_PRIVILEGE_JOIN_TEXT, uiIDA,1,ProfileManager.GetPrimaryPad(),nullptr,nullptr, app.GetStringTable()); } else { @@ -338,7 +338,7 @@ void CScene_MultiGameInfo::JoinGame(CScene_MultiGameInfo* pClass) { UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; - StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); + StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA,1,ProfileManager.GetPrimaryPad(),nullptr,nullptr, app.GetStringTable()); exitReasonStringId = -1; app.NavigateToHomeMenu(); @@ -361,7 +361,7 @@ HRESULT CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) int selectedIndex = 0; for(unsigned int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; ++i) { - if( m_selectedSession->data.players[i] != NULL ) + if( m_selectedSession->data.players[i] != nullptr ) { if(m_selectedSession->data.players[i] == selectedPlayerXUID) selectedIndex = i; playersList.InsertItems(i,1); @@ -378,7 +378,7 @@ HRESULT CScene_MultiGameInfo::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) } else { - // Leave the loop when we hit the first NULL player + // Leave the loop when we hit the first nullptr player break; } } -- cgit v1.2.3