aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.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_EnchantingMenu.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_EnchantingMenu.cpp')
-rw-r--r--Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp b/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp
index 27459ccc..f90c4b12 100644
--- a/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp
+++ b/Minecraft.Client/Common/UI/UIScene_EnchantingMenu.cpp
@@ -14,14 +14,14 @@ UIScene_EnchantingMenu::UIScene_EnchantingMenu(int iPad, void *_initData, UILaye
m_enchantButton[1].init(1);
m_enchantButton[2].init(2);
- EnchantingScreenInput *initData = (EnchantingScreenInput *)_initData;
+ EnchantingScreenInput *initData = static_cast<EnchantingScreenInput *>(_initData);
m_labelEnchant.init( initData->name.empty() ? app.GetString(IDS_ENCHANT) : initData->name );
Minecraft *pMinecraft = Minecraft::GetInstance();
- if( pMinecraft->localgameModes[initData->iPad] != NULL )
+ if( pMinecraft->localgameModes[initData->iPad] != nullptr )
{
- TutorialMode *gameMode = (TutorialMode *)pMinecraft->localgameModes[initData->iPad];
+ TutorialMode *gameMode = static_cast<TutorialMode *>(pMinecraft->localgameModes[initData->iPad]);
m_previousTutorialState = gameMode->getTutorial()->getCurrentState();
gameMode->getTutorial()->changeTutorialState(e_Tutorial_State_Enchanting_Menu, this);
}
@@ -194,7 +194,7 @@ void UIScene_EnchantingMenu::setSectionSelectedSlot(ESceneSection eSection, int
int index = (y * cols) + x;
- UIControl_SlotList *slotList = NULL;
+ UIControl_SlotList *slotList = nullptr;
switch( eSection )
{
case eSectionEnchantSlot:
@@ -216,7 +216,7 @@ void UIScene_EnchantingMenu::setSectionSelectedSlot(ESceneSection eSection, int
UIControl *UIScene_EnchantingMenu::getSection(ESceneSection eSection)
{
- UIControl *control = NULL;
+ UIControl *control = nullptr;
switch( eSection )
{
case eSectionEnchantSlot:
@@ -247,7 +247,7 @@ UIControl *UIScene_EnchantingMenu::getSection(ESceneSection eSection)
void UIScene_EnchantingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
{
Minecraft *pMinecraft = Minecraft::GetInstance();
- if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
+ if(pMinecraft->localplayers[m_iPad] == nullptr || pMinecraft->localgameModes[m_iPad] == nullptr) return;
if(wcscmp((wchar_t *)region->name,L"EnchantmentBook")==0)
@@ -264,7 +264,7 @@ void UIScene_EnchantingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
else
{
int slotId = -1;
- swscanf((wchar_t*)region->name,L"slot_Button%d",&slotId);
+ swscanf(static_cast<wchar_t *>(region->name),L"slot_Button%d",&slotId);
if(slotId >= 0)
{
// Setup GDraw, normal game render states and matrices