diff options
| author | ModMaker101 <119018978+ModMaker101@users.noreply.github.com> | 2026-03-07 21:56:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-08 09:56:03 +0700 |
| commit | a9be52c41a02d207233199e98898fe7483d7e817 (patch) | |
| tree | 71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.Client/Common/XUI/XUI_Ctrl_4JList.cpp | |
| parent | 1be5faaea781402e7de06b263eeca4c688b7712c (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/XUI/XUI_Ctrl_4JList.cpp')
| -rw-r--r-- | Minecraft.Client/Common/XUI/XUI_Ctrl_4JList.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Minecraft.Client/Common/XUI/XUI_Ctrl_4JList.cpp b/Minecraft.Client/Common/XUI/XUI_Ctrl_4JList.cpp index 4c615979..7523c523 100644 --- a/Minecraft.Client/Common/XUI/XUI_Ctrl_4JList.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Ctrl_4JList.cpp @@ -7,7 +7,7 @@ HRESULT CXuiCtrl4JList::OnInit(XUIMessageInit *pInitData, BOOL& bHandled) { InitializeCriticalSection(&m_AccessListData); - m_hSelectionChangedHandlerObj = NULL; + m_hSelectionChangedHandlerObj = nullptr; return S_OK; } @@ -22,13 +22,13 @@ void CXuiCtrl4JList::AddData( const LIST_ITEM_INFO& ItemInfo , int iSortListFrom if(ItemInfo.pwszText) { - dwLen1=(int)wcslen(ItemInfo.pwszText)*sizeof(WCHAR); + dwLen1=static_cast<int>(wcslen(ItemInfo.pwszText))*sizeof(WCHAR); dwBytes+=dwLen1+sizeof(WCHAR); } if(ItemInfo.pwszImage) { - dwLen2=(int)(wcslen(ItemInfo.pwszImage))*sizeof(WCHAR); + dwLen2=static_cast<int>(wcslen(ItemInfo.pwszImage))*sizeof(WCHAR); dwBytes+=dwLen2+sizeof(WCHAR); } @@ -59,11 +59,11 @@ void CXuiCtrl4JList::AddData( const LIST_ITEM_INFO& ItemInfo , int iSortListFrom // need to remember the original index of this addition before it gets sorted - this will get used to load the game if(iSortListFromIndex!=-1) { - pItemInfo->iIndex=(int)m_vListData.size()-iSortListFromIndex; + pItemInfo->iIndex=static_cast<int>(m_vListData.size())-iSortListFromIndex; } else { - pItemInfo->iIndex=(int)m_vListData.size(); + pItemInfo->iIndex=static_cast<int>(m_vListData.size()); } // added to force a sort order for DLC @@ -110,7 +110,7 @@ void CXuiCtrl4JList::RemoveAllData( ) { EnterCriticalSection(&m_AccessListData); - int iSize=(int)m_vListData.size(); + int iSize=static_cast<int>(m_vListData.size()); for(int i=0;i<iSize;i++) { LIST_ITEM_INFO *pBack = m_vListData.back(); @@ -304,7 +304,7 @@ HRESULT CXuiCtrl4JList::OnGetSourceDataText(XUIMessageGetSourceText *pGetSourceT HRESULT CXuiCtrl4JList::OnGetItemCountAll(XUIMessageGetItemCount *pGetItemCountData,BOOL& bHandled) { - pGetItemCountData->cItems = (int)m_vListData.size(); + pGetItemCountData->cItems = static_cast<int>(m_vListData.size()); bHandled = TRUE; return S_OK; } @@ -315,7 +315,7 @@ HRESULT CXuiCtrl4JList::OnGetSourceDataImage(XUIMessageGetSourceImage *pGetSourc { // Check for a brush EnterCriticalSection(&m_AccessListData); - if(GetData(pGetSourceImageData->iItem).hXuiBrush!=NULL) + if(GetData(pGetSourceImageData->iItem).hXuiBrush!=nullptr) { pGetSourceImageData->hBrush=GetData(pGetSourceImageData->iItem).hXuiBrush; } |
