From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- .../Common/Tutorial/ChangeStateConstraint.cpp | 14 ++-- .../Common/Tutorial/ChangeStateConstraint.h | 2 +- Minecraft.Client/Common/Tutorial/ChoiceTask.cpp | 7 +- .../Common/Tutorial/CompleteUsingItemTask.cpp | 2 +- .../Common/Tutorial/ControllerTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/ControllerTask.h | 2 +- Minecraft.Client/Common/Tutorial/CraftTask.cpp | 4 +- Minecraft.Client/Common/Tutorial/CraftTask.h | 4 +- .../Common/Tutorial/DiggerItemHint.cpp | 4 +- .../Common/Tutorial/EffectChangedTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/FullTutorial.cpp | 78 ++++++++--------- .../Common/Tutorial/FullTutorialActiveTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/InfoTask.cpp | 5 +- Minecraft.Client/Common/Tutorial/PickupTask.h | 2 +- .../Common/Tutorial/ProcedureCompoundTask.cpp | 2 +- .../Common/Tutorial/ProcedureCompoundTask.h | 2 +- .../Common/Tutorial/ProgressFlagTask.h | 2 +- .../Common/Tutorial/RideEntityTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/RideEntityTask.h | 2 +- Minecraft.Client/Common/Tutorial/StatTask.cpp | 4 +- Minecraft.Client/Common/Tutorial/StateChangeTask.h | 2 +- Minecraft.Client/Common/Tutorial/TakeItemHint.cpp | 2 +- Minecraft.Client/Common/Tutorial/Tutorial.cpp | 97 +++++++++++----------- Minecraft.Client/Common/Tutorial/Tutorial.h | 4 +- Minecraft.Client/Common/Tutorial/TutorialHint.cpp | 2 +- Minecraft.Client/Common/Tutorial/TutorialMode.cpp | 8 +- Minecraft.Client/Common/Tutorial/TutorialMode.h | 2 +- Minecraft.Client/Common/Tutorial/TutorialTask.cpp | 2 +- Minecraft.Client/Common/Tutorial/UseItemTask.h | 2 +- Minecraft.Client/Common/Tutorial/UseTileTask.h | 4 +- .../Common/Tutorial/XuiCraftingTask.cpp | 4 +- Minecraft.Client/Common/Tutorial/XuiCraftingTask.h | 4 +- 32 files changed, 137 insertions(+), 140 deletions(-) (limited to 'Minecraft.Client/Common/Tutorial') diff --git a/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp b/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp index 06e73d6f..f01db84e 100644 --- a/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp +++ b/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.cpp @@ -61,9 +61,9 @@ void ChangeStateConstraint::tick(int iPad) // Send update settings packet to server Minecraft *pMinecraft = Minecraft::GetInstance(); shared_ptr player = minecraft->localplayers[iPad]; - if(player != nullptr && player->connection && player->connection->getNetworkPlayer() != nullptr) + if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) { - player->connection->send(std::make_shared(player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs)); + player->connection->send( shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); } } } @@ -89,7 +89,7 @@ void ChangeStateConstraint::tick(int iPad) if(m_changeGameMode) { - if(minecraft->localgameModes[iPad] != nullptr) + if(minecraft->localgameModes[iPad] != NULL) { m_changedFromGameMode = minecraft->localplayers[iPad]->abilities.instabuild ? GameType::CREATIVE : GameType::SURVIVAL; @@ -102,9 +102,9 @@ void ChangeStateConstraint::tick(int iPad) // Send update settings packet to server Minecraft *pMinecraft = Minecraft::GetInstance(); shared_ptr player = minecraft->localplayers[iPad]; - if(player != nullptr && player->connection && player->connection->getNetworkPlayer() != nullptr) + if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) { - player->connection->send(std::make_shared(player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs)); + player->connection->send( shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); } } } @@ -126,9 +126,9 @@ void ChangeStateConstraint::tick(int iPad) // Send update settings packet to server Minecraft *pMinecraft = Minecraft::GetInstance(); shared_ptr player = minecraft->localplayers[iPad]; - if(player != nullptr && player->connection && player->connection->getNetworkPlayer() != nullptr) + if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL) { - player->connection->send(std::make_shared(player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs)); + player->connection->send( shared_ptr( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) ); } } } diff --git a/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.h b/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.h index e5f2d74b..2156870d 100644 --- a/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.h +++ b/Minecraft.Client/Common/Tutorial/ChangeStateConstraint.h @@ -30,7 +30,7 @@ private: public: virtual ConstraintType getType() { return e_ConstraintChangeState; } - ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = nullptr ); + ChangeStateConstraint( Tutorial *tutorial, eTutorial_State targetState, eTutorial_State sourceStates[], DWORD sourceStatesCount, double x0, double y0, double z0, double x1, double y1, double z1, bool contains = true, bool changeGameMode = false, GameType *targetGameMode = NULL ); ~ChangeStateConstraint(); virtual void tick(int iPad); diff --git a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp index 023e4b22..1ea34ace 100644 --- a/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ChoiceTask.cpp @@ -8,12 +8,11 @@ #include "ChoiceTask.h" #include "..\..\..\Minecraft.World\Material.h" #include "..\..\Windows64\KeyboardMouseInput.h" -#include "Common/UI/UI.h" ChoiceTask::ChoiceTask(Tutorial *tutorial, int descriptionId, int promptId /*= -1*/, bool requiresUserInput /*= false*/, - int iConfirmMapping /*= 0*/, int iCancelMapping /*= 0*/, - eTutorial_CompletionAction cancelAction /*= e_Tutorial_Completion_None*/, ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/) - : TutorialTask( tutorial, descriptionId, false, nullptr, true, false, false ) + int iConfirmMapping /*= 0*/, int iCancelMapping /*= 0*/, + eTutorial_CompletionAction cancelAction /*= e_Tutorial_Completion_None*/, ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/) + : TutorialTask( tutorial, descriptionId, false, NULL, true, false, false ) { if(requiresUserInput == true) { diff --git a/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp b/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp index f2fb8c12..43b2f7f3 100644 --- a/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp +++ b/Minecraft.Client/Common/Tutorial/CompleteUsingItemTask.cpp @@ -3,7 +3,7 @@ #include "CompleteUsingItemTask.h" CompleteUsingItemTask::CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion) - : TutorialTask( tutorial, descriptionId, enablePreCompletion, nullptr) + : TutorialTask( tutorial, descriptionId, enablePreCompletion, NULL) { m_iValidItemsA= new int [itemIdsLength]; for(int i=0;i *inConstraints /*= nullptr*/, + Tutorial *tutorial, int descriptionId, bool enablePreCompletion /*= true*/, vector *inConstraints /*= NULL*/, bool bShowMinimumTime /*=false*/, bool bAllowFade /*=true*/, bool m_bTaskReminders /*=true*/ ) : TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ), m_quantity( quantity ), @@ -17,7 +17,7 @@ CraftTask::CraftTask( int itemId, int auxValue, int quantity, } CraftTask::CraftTask( int *items, int *auxValues, int numItems, int quantity, - Tutorial *tutorial, int descriptionId, bool enablePreCompletion /*= true*/, vector *inConstraints /*= nullptr*/, + Tutorial *tutorial, int descriptionId, bool enablePreCompletion /*= true*/, vector *inConstraints /*= NULL*/, bool bShowMinimumTime /*=false*/, bool bAllowFade /*=true*/, bool m_bTaskReminders /*=true*/ ) : TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ), m_quantity( quantity ), diff --git a/Minecraft.Client/Common/Tutorial/CraftTask.h b/Minecraft.Client/Common/Tutorial/CraftTask.h index 4246711e..1496f07a 100644 --- a/Minecraft.Client/Common/Tutorial/CraftTask.h +++ b/Minecraft.Client/Common/Tutorial/CraftTask.h @@ -5,10 +5,10 @@ class CraftTask : public TutorialTask { public: CraftTask( int itemId, int auxValue, int quantity, - Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector *inConstraints = nullptr, + Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector *inConstraints = NULL, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ); CraftTask( int *items, int *auxValues, int numItems, int quantity, - Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector *inConstraints = nullptr, + Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector *inConstraints = NULL, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ); ~CraftTask(); diff --git a/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp b/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp index 428bbe3c..86dbe500 100644 --- a/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp +++ b/Minecraft.Client/Common/Tutorial/DiggerItemHint.cpp @@ -22,7 +22,7 @@ DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descri int DiggerItemHint::startDestroyBlock(shared_ptr item, Tile *tile) { - if(item != nullptr) + if(item != NULL) { bool itemFound = false; for(unsigned int i=0;i item, Tile *tile) int DiggerItemHint::attack(shared_ptr item, shared_ptr entity) { - if(item != nullptr) + if(item != NULL) { bool itemFound = false; for(unsigned int i=0;iid, this, IDS_TUTORIAL_TASK_PLACE_DOOR) ); addTask(e_Tutorial_State_Gameplay, new CraftTask( Tile::torch_Id, -1, 1, this, IDS_TUTORIAL_TASK_CREATE_TORCH) ); - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"tutorialArea"); - if(area != nullptr) + if(area != NULL) { vector *areaConstraints = new vector(); areaConstraints->push_back( new AreaConstraint( IDS_TUTORIAL_CONSTRAINT_TUTORIAL_AREA, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -283,10 +283,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * MINECART * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"minecartArea"); - if(area != nullptr) + if(area != NULL) { addHint(e_Tutorial_State_Gameplay, new AreaHint(e_Tutorial_Hint_Always_On, this, e_Tutorial_State_Gameplay, e_Tutorial_State_Riding_Minecart, IDS_TUTORIAL_HINT_MINECART, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1 ) ); } @@ -298,10 +298,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * BOAT * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"boatArea"); - if(area != nullptr) + if(area != NULL) { addHint(e_Tutorial_State_Gameplay, new AreaHint(e_Tutorial_Hint_Always_On, this, e_Tutorial_State_Gameplay, e_Tutorial_State_Riding_Boat, IDS_TUTORIAL_HINT_BOAT, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1 ) ); } @@ -313,10 +313,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * FISHING * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"fishingArea"); - if(area != nullptr) + if(area != NULL) { addHint(e_Tutorial_State_Gameplay, new AreaHint(e_Tutorial_Hint_Always_On, this, e_Tutorial_State_Gameplay, e_Tutorial_State_Fishing, IDS_TUTORIAL_HINT_FISHING, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1 ) ); } @@ -328,10 +328,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * PISTON - SELF-REPAIRING BRIDGE * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"pistonBridgeArea"); - if(area != nullptr) + if(area != NULL) { addHint(e_Tutorial_State_Gameplay, new AreaHint(e_Tutorial_Hint_Always_On, this, e_Tutorial_State_Gameplay, e_Tutorial_State_None, IDS_TUTORIAL_HINT_PISTON_SELF_REPAIRING_BRIDGE, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1, true ) ); } @@ -343,10 +343,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * PISTON - PISTON AND REDSTONE CIRCUITS * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"pistonArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State redstoneAndPistonStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Redstone_And_Piston, redstoneAndPistonStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -368,10 +368,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * PORTAL * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"portalArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State portalStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Portal, portalStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -391,10 +391,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * CREATIVE * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"creativeArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State creativeStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_CreativeMode, creativeStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1,true,true,GameType::CREATIVE) ); @@ -411,7 +411,7 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) ProcedureCompoundTask *creativeFinalTask = new ProcedureCompoundTask( this ); AABB *exitArea = app.getGameRuleDefinitions()->getNamedArea(L"creativeExitArea"); - if(exitArea != nullptr) + if(exitArea != NULL) { vector *creativeExitAreaConstraints = new vector(); creativeExitAreaConstraints->push_back( new AreaConstraint( -1, exitArea->x0,exitArea->y0,exitArea->z0,exitArea->x1,exitArea->y1,exitArea->z1,true,false) ); @@ -434,10 +434,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * BREWING * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"brewingArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State brewingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Brewing, brewingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -467,10 +467,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * ENCHANTING * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"enchantingArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State enchantingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Enchanting, enchantingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -492,10 +492,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * ANVIL * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"anvilArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State enchantingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Anvil, enchantingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -517,10 +517,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * TRADING * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"tradingArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State tradingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Trading, tradingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -541,10 +541,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * FIREWORKS * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"fireworksArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State fireworkStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Fireworks, fireworkStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -563,10 +563,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * BEACON * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"beaconArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State beaconStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Beacon, beaconStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -585,10 +585,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * HOPPER * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"hopperArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State hopperStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Hopper, hopperStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -610,10 +610,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * ENDERCHEST * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"enderchestArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State enchantingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Enderchests, enchantingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -632,10 +632,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * FARMING * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"farmingArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State farmingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Farming, farmingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -661,10 +661,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * BREEDING * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"breedingArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State breedingStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Breeding, breedingStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); @@ -689,10 +689,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/) * SNOW AND IRON GOLEM * */ - if(app.getGameRuleDefinitions() != nullptr) + if(app.getGameRuleDefinitions() != NULL) { AABB *area = app.getGameRuleDefinitions()->getNamedArea(L"golemArea"); - if(area != nullptr) + if(area != NULL) { eTutorial_State golemStates[] = {e_Tutorial_State_Gameplay}; AddGlobalConstraint( new ChangeStateConstraint(this, e_Tutorial_State_Golem, golemStates, 1, area->x0,area->y0,area->z0,area->x1,area->y1,area->z1) ); diff --git a/Minecraft.Client/Common/Tutorial/FullTutorialActiveTask.cpp b/Minecraft.Client/Common/Tutorial/FullTutorialActiveTask.cpp index f1357c6c..54985d21 100644 --- a/Minecraft.Client/Common/Tutorial/FullTutorialActiveTask.cpp +++ b/Minecraft.Client/Common/Tutorial/FullTutorialActiveTask.cpp @@ -3,7 +3,7 @@ #include "FullTutorialActiveTask.h" FullTutorialActiveTask::FullTutorialActiveTask(Tutorial *tutorial, eTutorial_CompletionAction completeAction /*= e_Tutorial_Completion_None*/) - : TutorialTask( tutorial, -1, false, nullptr, false, false, false ) + : TutorialTask( tutorial, -1, false, NULL, false, false, false ) { m_completeAction = completeAction; } diff --git a/Minecraft.Client/Common/Tutorial/InfoTask.cpp b/Minecraft.Client/Common/Tutorial/InfoTask.cpp index 2e481804..6a78ed92 100644 --- a/Minecraft.Client/Common/Tutorial/InfoTask.cpp +++ b/Minecraft.Client/Common/Tutorial/InfoTask.cpp @@ -8,11 +8,10 @@ #include "InfoTask.h" #include "..\..\..\Minecraft.World\Material.h" #include "..\..\Windows64\KeyboardMouseInput.h" -#include "Common/UI/UI.h" InfoTask::InfoTask(Tutorial *tutorial, int descriptionId, int promptId /*= -1*/, bool requiresUserInput /*= false*/, - int iMapping /*= 0*/, ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/) - : TutorialTask( tutorial, descriptionId, false, nullptr, true, false, false ) + int iMapping /*= 0*/, ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/) + : TutorialTask( tutorial, descriptionId, false, NULL, true, false, false ) { if(requiresUserInput == true) { diff --git a/Minecraft.Client/Common/Tutorial/PickupTask.h b/Minecraft.Client/Common/Tutorial/PickupTask.h index 9f2d2426..68e1d479 100644 --- a/Minecraft.Client/Common/Tutorial/PickupTask.h +++ b/Minecraft.Client/Common/Tutorial/PickupTask.h @@ -8,7 +8,7 @@ class PickupTask : public TutorialTask { public: PickupTask( int itemId, unsigned int quantity, int auxValue, - Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector *inConstraints = nullptr, + Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector *inConstraints = NULL, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ) : TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ), m_itemId( itemId), diff --git a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp index ddf15a55..0e3b3e37 100644 --- a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp +++ b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.cpp @@ -11,7 +11,7 @@ ProcedureCompoundTask::~ProcedureCompoundTask() void ProcedureCompoundTask::AddTask(TutorialTask *task) { - if(task != nullptr) + if(task != NULL) { m_taskSequence.push_back(task); } diff --git a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h index 0a5b7eee..36b32798 100644 --- a/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h +++ b/Minecraft.Client/Common/Tutorial/ProcedureCompoundTask.h @@ -8,7 +8,7 @@ class ProcedureCompoundTask : public TutorialTask { public: ProcedureCompoundTask(Tutorial *tutorial ) - : TutorialTask(tutorial, -1, false, nullptr, false, true, false ) + : TutorialTask(tutorial, -1, false, NULL, false, true, false ) {} ~ProcedureCompoundTask(); diff --git a/Minecraft.Client/Common/Tutorial/ProgressFlagTask.h b/Minecraft.Client/Common/Tutorial/ProgressFlagTask.h index 9baea5a5..b96e1bc0 100644 --- a/Minecraft.Client/Common/Tutorial/ProgressFlagTask.h +++ b/Minecraft.Client/Common/Tutorial/ProgressFlagTask.h @@ -17,7 +17,7 @@ private: EProgressFlagType m_type; public: ProgressFlagTask(char *flags, char mask, EProgressFlagType type, Tutorial *tutorial ) : - TutorialTask(tutorial, -1, false, nullptr ), + TutorialTask(tutorial, -1, false, NULL ), flags( flags ), m_mask( mask ), m_type( type ) {} diff --git a/Minecraft.Client/Common/Tutorial/RideEntityTask.cpp b/Minecraft.Client/Common/Tutorial/RideEntityTask.cpp index 29b77645..29fe592d 100644 --- a/Minecraft.Client/Common/Tutorial/RideEntityTask.cpp +++ b/Minecraft.Client/Common/Tutorial/RideEntityTask.cpp @@ -23,7 +23,7 @@ bool RideEntityTask::isCompleted() void RideEntityTask::onRideEntity(shared_ptr entity) { - if (entity->instanceof(static_cast(m_eType))) + if (entity->instanceof((eINSTANCEOF) m_eType)) { bIsCompleted = true; } diff --git a/Minecraft.Client/Common/Tutorial/RideEntityTask.h b/Minecraft.Client/Common/Tutorial/RideEntityTask.h index 749b187f..d9b6d41e 100644 --- a/Minecraft.Client/Common/Tutorial/RideEntityTask.h +++ b/Minecraft.Client/Common/Tutorial/RideEntityTask.h @@ -13,7 +13,7 @@ protected: public: RideEntityTask(const int eTYPE, Tutorial *tutorial, int descriptionId, - bool enablePreCompletion = false, vector *inConstraints = nullptr, + bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); virtual bool isCompleted(); diff --git a/Minecraft.Client/Common/Tutorial/StatTask.cpp b/Minecraft.Client/Common/Tutorial/StatTask.cpp index c2dc82aa..5f8b215e 100644 --- a/Minecraft.Client/Common/Tutorial/StatTask.cpp +++ b/Minecraft.Client/Common/Tutorial/StatTask.cpp @@ -6,7 +6,7 @@ #include "StatTask.h" StatTask::StatTask(Tutorial *tutorial, int descriptionId, bool enablePreCompletion, Stat *stat, int variance /*= 1*/) - : TutorialTask( tutorial, descriptionId, enablePreCompletion, nullptr ) + : TutorialTask( tutorial, descriptionId, enablePreCompletion, NULL ) { this->stat = stat; @@ -20,6 +20,6 @@ bool StatTask::isCompleted() return true; Minecraft *minecraft = Minecraft::GetInstance(); - bIsCompleted = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) >= static_cast(targetValue); + bIsCompleted = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) >= (unsigned int)targetValue; return bIsCompleted; } \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/StateChangeTask.h b/Minecraft.Client/Common/Tutorial/StateChangeTask.h index ab34d35d..fb9e6396 100644 --- a/Minecraft.Client/Common/Tutorial/StateChangeTask.h +++ b/Minecraft.Client/Common/Tutorial/StateChangeTask.h @@ -9,7 +9,7 @@ private: eTutorial_State m_state; public: StateChangeTask(eTutorial_State state, - Tutorial *tutorial, int descriptionId = -1, bool enablePreCompletion = false, vector *inConstraints = nullptr, + Tutorial *tutorial, int descriptionId = -1, bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ) : TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ), m_state( state ) diff --git a/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp b/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp index 3a318488..a1a5c37a 100644 --- a/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp +++ b/Minecraft.Client/Common/Tutorial/TakeItemHint.cpp @@ -19,7 +19,7 @@ TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], u bool TakeItemHint::onTake(shared_ptr item) { - if(item != nullptr) + if(item != NULL) { bool itemFound = false; for(unsigned int i=0;i Tutorial::s_completableTasks; @@ -32,7 +31,7 @@ int Tutorial::m_iTutorialFreezeTimeValue = 8000; bool Tutorial::PopupMessageDetails::isSameContent(PopupMessageDetails *other) { - if(other == nullptr) return false; + if(other == NULL) return false; bool textTheSame = (m_messageId == other->m_messageId) && (m_messageString.compare(other->m_messageString) == 0); bool titleTheSame = (m_titleId == other->m_titleId) && (m_titleString.compare(other->m_titleString) == 0); @@ -361,12 +360,12 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad ) m_hintDisplayed = false; m_freezeTime = false; m_timeFrozen = false; - m_UIScene = nullptr; + m_UIScene = NULL; m_allowShow = true; m_bHasTickedOnce = false; m_firstTickTime = 0; - m_lastMessage = nullptr; + m_lastMessage = NULL; lastMessageTime = 0; m_iTaskReminders = 0; @@ -375,13 +374,13 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad ) m_CurrentState = e_Tutorial_State_Gameplay; m_hasStateChanged = false; #ifdef _XBOX - m_hTutorialScene=nullptr; + m_hTutorialScene=NULL; #endif for(unsigned int i = 0; i < e_Tutorial_State_Max; ++i) { - currentTask[i] = nullptr; - currentFailedConstraint[i] = nullptr; + currentTask[i] = NULL; + currentFailedConstraint[i] = NULL; } // DEFAULT TASKS THAT ALL TUTORIALS SHARE @@ -1013,7 +1012,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad ) addTask(e_Tutorial_State_Horse, new InfoTask(this, IDS_TUTORIAL_TASK_HORSE_TAMING2, IDS_TUTORIAL_PROMPT_PRESS_A_TO_CONTINUE, true, ACTION_MENU_A) ); // 4J-JEV: Only force the RideEntityTask if we're on the full-tutorial. - if (isFullTutorial) addTask(e_Tutorial_State_Horse, new RideEntityTask(eTYPE_HORSE, this, IDS_TUTORIAL_TASK_HORSE_RIDE, true, nullptr, false, false, false) ); + if (isFullTutorial) addTask(e_Tutorial_State_Horse, new RideEntityTask(eTYPE_HORSE, this, IDS_TUTORIAL_TASK_HORSE_RIDE, true, NULL, false, false, false) ); else addTask(e_Tutorial_State_Horse, new InfoTask(this, IDS_TUTORIAL_TASK_HORSE_RIDE, IDS_TUTORIAL_PROMPT_PRESS_A_TO_CONTINUE, true, ACTION_MENU_A) ); addTask(e_Tutorial_State_Horse, new InfoTask(this, IDS_TUTORIAL_TASK_HORSE_SADDLES, IDS_TUTORIAL_PROMPT_PRESS_A_TO_CONTINUE, true, ACTION_MENU_A) ); @@ -1164,8 +1163,8 @@ Tutorial::~Tutorial() delete it; } - currentTask[i] = nullptr; - currentFailedConstraint[i] = nullptr; + currentTask[i] = NULL; + currentFailedConstraint[i] = NULL; } } @@ -1174,7 +1173,7 @@ void Tutorial::debugResetPlayerSavedProgress(int iPad) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(iPad); #else - GAME_SETTINGS *pGameSettings = static_cast(ProfileManager.GetGameDefinedProfileData(iPad)); + GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(iPad); #endif ZeroMemory( pGameSettings->ucTutorialCompletion, TUTORIAL_PROFILE_STORAGE_BYTES ); pGameSettings->uiSpecialTutorialBitmask = 0; @@ -1203,7 +1202,7 @@ void Tutorial::setCompleted( int completableId ) #if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(m_iPad); #else - GAME_SETTINGS *pGameSettings = static_cast(ProfileManager.GetGameDefinedProfileData(m_iPad)); + GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(m_iPad); #endif int arrayIndex = completableIndex >> 3; int bitIndex = 7 - (completableIndex % 8); @@ -1236,7 +1235,7 @@ bool Tutorial::getCompleted( int completableId ) #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)StorageManager.GetGameDefinedProfileData(m_iPad); #else - GAME_SETTINGS *pGameSettings = static_cast(ProfileManager.GetGameDefinedProfileData(m_iPad)); + GAME_SETTINGS *pGameSettings = (GAME_SETTINGS *)ProfileManager.GetGameDefinedProfileData(m_iPad); #endif int arrayIndex = completableIndex >> 3; int bitIndex = 7 - (completableIndex % 8); @@ -1363,7 +1362,7 @@ void Tutorial::tick() if(!m_allowShow) { - if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) + if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) { uiTempDisabled = true; } @@ -1413,7 +1412,7 @@ void Tutorial::tick() if(ui.IsPauseMenuDisplayed( m_iPad ) ) { - if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) + if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) { uiTempDisabled = true; } @@ -1461,12 +1460,12 @@ void Tutorial::tick() // Check constraints // Only need to update these if we aren't already failing something - if( !m_allTutorialsComplete && (currentFailedConstraint[m_CurrentState] == nullptr || currentFailedConstraint[m_CurrentState]->isConstraintSatisfied(m_iPad)) ) + if( !m_allTutorialsComplete && (currentFailedConstraint[m_CurrentState] == NULL || currentFailedConstraint[m_CurrentState]->isConstraintSatisfied(m_iPad)) ) { - if( currentFailedConstraint[m_CurrentState] != nullptr && currentFailedConstraint[m_CurrentState]->isConstraintSatisfied(m_iPad) ) + if( currentFailedConstraint[m_CurrentState] != NULL && currentFailedConstraint[m_CurrentState]->isConstraintSatisfied(m_iPad) ) { constraintChanged = true; - currentFailedConstraint[m_CurrentState] = nullptr; + currentFailedConstraint[m_CurrentState] = NULL; } for (auto& constraint : constraints[m_CurrentState]) { @@ -1478,7 +1477,7 @@ void Tutorial::tick() } } - if( !m_allTutorialsComplete && currentFailedConstraint[m_CurrentState] == nullptr ) + if( !m_allTutorialsComplete && currentFailedConstraint[m_CurrentState] == NULL ) { // Update tasks bool isCurrentTask = true; @@ -1497,7 +1496,7 @@ void Tutorial::tick() eTutorial_CompletionAction compAction = task->getCompletionAction(); it = activeTasks[m_CurrentState].erase( it ); delete task; - task = nullptr; + task = NULL; if( activeTasks[m_CurrentState].size() > 0 ) { @@ -1553,12 +1552,12 @@ void Tutorial::tick() { setStateCompleted( m_CurrentState ); - currentTask[m_CurrentState] = nullptr; + currentTask[m_CurrentState] = NULL; } taskChanged = true; // If we can complete this early, check if we can complete it right now - if( currentTask[m_CurrentState] != nullptr && currentTask[m_CurrentState]->isPreCompletionEnabled() ) + if( currentTask[m_CurrentState] != NULL && currentTask[m_CurrentState]->isPreCompletionEnabled() ) { isCurrentTask = true; } @@ -1567,7 +1566,7 @@ void Tutorial::tick() { ++it; } - if( task != nullptr && task->ShowMinimumTime() && task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) + if( task != NULL && task->ShowMinimumTime() && task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) { task->setShownForMinimumTime(); @@ -1588,7 +1587,7 @@ void Tutorial::tick() } } - if( currentTask[m_CurrentState] == nullptr && activeTasks[m_CurrentState].size() > 0 ) + if( currentTask[m_CurrentState] == NULL && activeTasks[m_CurrentState].size() > 0 ) { currentTask[m_CurrentState] = activeTasks[m_CurrentState][0]; currentTask[m_CurrentState]->setAsCurrentTask(); @@ -1617,17 +1616,17 @@ void Tutorial::tick() } if( constraintChanged || taskChanged || m_hasStateChanged || - (currentFailedConstraint[m_CurrentState] == nullptr && currentTask[m_CurrentState] != nullptr && (m_lastMessage == nullptr || currentTask[m_CurrentState]->getDescriptionId() != m_lastMessage->m_messageId) && !m_hintDisplayed) + (currentFailedConstraint[m_CurrentState] == NULL && currentTask[m_CurrentState] != NULL && (m_lastMessage == NULL || currentTask[m_CurrentState]->getDescriptionId() != m_lastMessage->m_messageId) && !m_hintDisplayed) ) { - if( currentFailedConstraint[m_CurrentState] != nullptr ) + if( currentFailedConstraint[m_CurrentState] != NULL ) { PopupMessageDetails *message = new PopupMessageDetails(); message->m_messageId = currentFailedConstraint[m_CurrentState]->getDescriptionId(); message->m_allowFade = false; setMessage( message ); } - else if( currentTask[m_CurrentState] != nullptr ) + else if( currentTask[m_CurrentState] != NULL ) { PopupMessageDetails *message = new PopupMessageDetails(); message->m_messageId = currentTask[m_CurrentState]->getDescriptionId(); @@ -1638,7 +1637,7 @@ void Tutorial::tick() } else { - setMessage( nullptr ); + setMessage( NULL ); } } @@ -1647,7 +1646,7 @@ void Tutorial::tick() m_hintDisplayed = false; } - if( currentFailedConstraint[m_CurrentState] == nullptr && currentTask[m_CurrentState] != nullptr && (m_iTaskReminders!=0) && (lastMessageTime + (m_iTaskReminders * m_iTutorialReminderTime) ) < GetTickCount() ) + if( currentFailedConstraint[m_CurrentState] == NULL && currentTask[m_CurrentState] != NULL && (m_iTaskReminders!=0) && (lastMessageTime + (m_iTaskReminders * m_iTutorialReminderTime) ) < GetTickCount() ) { // Reminder PopupMessageDetails *message = new PopupMessageDetails(); @@ -1672,7 +1671,7 @@ void Tutorial::tick() bool Tutorial::setMessage(PopupMessageDetails *message) { - if(message != nullptr && !message->m_forceDisplay && + if(message != NULL && !message->m_forceDisplay && m_lastMessageState == m_CurrentState && message->isSameContent(m_lastMessage) && ( !message->m_isReminder || ( (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount() && message->m_isReminder ) ) @@ -1682,7 +1681,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) return false; } - if(message != nullptr && (message->m_messageId > 0 || !message->m_messageString.empty()) ) + if(message != NULL && (message->m_messageId > 0 || !message->m_messageString.empty()) ) { m_lastMessageState = m_CurrentState; @@ -1696,7 +1695,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) else { auto it = messages.find(message->m_messageId); - if( it != messages.end() && it->second != nullptr ) + if( it != messages.end() && it->second != NULL ) { TutorialMessage *messageString = it->second; text = wstring( messageString->getMessageForDisplay() ); @@ -1726,7 +1725,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) else if(message->m_promptId >= 0) { auto it = messages.find(message->m_promptId); - if(it != messages.end() && it->second != nullptr) + if(it != messages.end() && it->second != NULL) { TutorialMessage *prompt = it->second; text.append( prompt->getMessageForDisplay() ); @@ -1755,7 +1754,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) ui.SetTutorialDescription( m_iPad, &popupInfo ); } } - else if( (m_lastMessage != nullptr && m_lastMessage->m_messageId != -1) ) //&& (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount() ) + else if( (m_lastMessage != NULL && m_lastMessage->m_messageId != -1) ) //&& (lastMessageTime + m_iTutorialReminderTime ) > GetTickCount() ) { // This should cause the popup to dissappear TutorialPopupInfo popupInfo; @@ -1764,7 +1763,7 @@ bool Tutorial::setMessage(PopupMessageDetails *message) ui.SetTutorialDescription( m_iPad, &popupInfo ); } - if(m_lastMessage != nullptr) delete m_lastMessage; + if(m_lastMessage != NULL) delete m_lastMessage; m_lastMessage = message; return true; @@ -1778,7 +1777,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message) bool messageShown = false; DWORD time = GetTickCount(); - if(message != nullptr && (message->m_forceDisplay || hintsOn) && + if(message != NULL && (message->m_forceDisplay || hintsOn) && (!message->m_delay || ( (m_hintDisplayed && (time - m_lastHintDisplayedTime) > m_iTutorialHintDelayTime ) || @@ -1793,7 +1792,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message) { m_lastHintDisplayedTime = time; m_hintDisplayed = true; - if(hint!=nullptr) setHintCompleted( hint ); + if(hint!=NULL) setHintCompleted( hint ); } } return messageShown; @@ -1816,7 +1815,7 @@ void Tutorial::showTutorialPopup(bool show) if(!show) { - if( currentTask[m_CurrentState] != nullptr && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) + if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) { uiTempDisabled = true; } @@ -1927,7 +1926,7 @@ void Tutorial::handleUIInput(int iAction) { if( m_hintDisplayed ) return; - if(currentTask[m_CurrentState] != nullptr) + if(currentTask[m_CurrentState] != NULL) currentTask[m_CurrentState]->handleUIInput(iAction); } @@ -1989,7 +1988,7 @@ void Tutorial::onSelectedItemChanged(shared_ptr item) // Menus and states like riding in a minecart will NOT allow this if( isSelectedItemState() ) { - if(item != nullptr) + if(item != NULL) { switch(item->id) { @@ -2152,7 +2151,7 @@ void Tutorial::AddConstraint(TutorialConstraint *c) void Tutorial::RemoveConstraint(TutorialConstraint *c, bool delayedRemove /*= false*/) { if( currentFailedConstraint[m_CurrentState] == c ) - currentFailedConstraint[m_CurrentState] = nullptr; + currentFailedConstraint[m_CurrentState] = NULL; if( c->getQueuedForRemoval() ) { @@ -2212,16 +2211,16 @@ void Tutorial::addMessage(int messageId, bool limitRepeats /*= false*/, unsigned } #ifdef _XBOX -void Tutorial::changeTutorialState(eTutorial_State newState, CXuiScene *scene /*= nullptr*/) +void Tutorial::changeTutorialState(eTutorial_State newState, CXuiScene *scene /*= NULL*/) #else -void Tutorial::changeTutorialState(eTutorial_State newState, UIScene *scene /*= nullptr*/) +void Tutorial::changeTutorialState(eTutorial_State newState, UIScene *scene /*= NULL*/) #endif { if(newState == m_CurrentState) { // If clearing the scene, make sure that the tutorial popup has its reference to this scene removed #ifndef _XBOX - if( scene == nullptr ) + if( scene == NULL ) { ui.RemoveInteractSceneReference(m_iPad, m_UIScene); } @@ -2242,7 +2241,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState, UIScene *scene /*= } // The action that caused the change of state may also have completed the current task - if( currentTask[m_CurrentState] != nullptr && currentTask[m_CurrentState]->isCompleted() ) + if( currentTask[m_CurrentState] != NULL && currentTask[m_CurrentState]->isCompleted() ) { activeTasks[m_CurrentState].erase( find( activeTasks[m_CurrentState].begin(), activeTasks[m_CurrentState].end(), currentTask[m_CurrentState]) ); @@ -2253,21 +2252,21 @@ void Tutorial::changeTutorialState(eTutorial_State newState, UIScene *scene /*= } else { - currentTask[m_CurrentState] = nullptr; + currentTask[m_CurrentState] = NULL; } } - if( currentTask[m_CurrentState] != nullptr ) + if( currentTask[m_CurrentState] != NULL ) { currentTask[m_CurrentState]->onStateChange(newState); } // Make sure that the current message is cleared - setMessage( nullptr ); + setMessage( NULL ); // If clearing the scene, make sure that the tutorial popup has its reference to this scene removed #ifndef _XBOX - if( scene == nullptr ) + if( scene == NULL ) { ui.RemoveInteractSceneReference(m_iPad, m_UIScene); } diff --git a/Minecraft.Client/Common/Tutorial/Tutorial.h b/Minecraft.Client/Common/Tutorial/Tutorial.h index c36a9086..169c33e3 100644 --- a/Minecraft.Client/Common/Tutorial/Tutorial.h +++ b/Minecraft.Client/Common/Tutorial/Tutorial.h @@ -139,9 +139,9 @@ public: bool getCompleted( int completableId ); #ifdef _XBOX - void changeTutorialState(eTutorial_State newState, CXuiScene *scene = nullptr); + void changeTutorialState(eTutorial_State newState, CXuiScene *scene = NULL); #else - void changeTutorialState(eTutorial_State newState, UIScene *scene = nullptr); + void changeTutorialState(eTutorial_State newState, UIScene *scene = NULL); #endif bool isSelectedItemState(); diff --git a/Minecraft.Client/Common/Tutorial/TutorialHint.cpp b/Minecraft.Client/Common/Tutorial/TutorialHint.cpp index d80d7d16..5f0808bf 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialHint.cpp +++ b/Minecraft.Client/Common/Tutorial/TutorialHint.cpp @@ -9,7 +9,7 @@ TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, eHintType type, bool allowFade /*= true*/) : m_id( id ), m_tutorial(tutorial), m_descriptionId( descriptionId ), m_type( type ), m_counter( 0 ), - m_lastTile( nullptr ), m_hintNeeded( true ), m_allowFade(allowFade) + m_lastTile( NULL ), m_hintNeeded( true ), m_allowFade(allowFade) { tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients); } diff --git a/Minecraft.Client/Common/Tutorial/TutorialMode.cpp b/Minecraft.Client/Common/Tutorial/TutorialMode.cpp index 50a45a42..82c81598 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialMode.cpp +++ b/Minecraft.Client/Common/Tutorial/TutorialMode.cpp @@ -15,7 +15,7 @@ TutorialMode::TutorialMode(int iPad, Minecraft *minecraft, ClientConnection *con TutorialMode::~TutorialMode() { - if(tutorial != nullptr) + if(tutorial != NULL) delete tutorial; } @@ -38,7 +38,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face) } shared_ptr item = minecraft->player->getSelectedItem(); int damageBefore; - if(item != nullptr) + if(item != NULL) { damageBefore = item->getDamageValue(); } @@ -46,7 +46,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face) if(!tutorial->m_allTutorialsComplete) { - if ( item != nullptr && item->isDamageableItem() ) + if ( item != NULL && item->isDamageableItem() ) { int max = item->getMaxDamage(); int damageNow = item->getDamageValue(); @@ -88,7 +88,7 @@ bool TutorialMode::useItemOn(shared_ptr player, Level *level, shared_ptr if(!bTestUseOnly) { - if(item != nullptr) + if(item != NULL) { haveItem = true; itemCount = item->count; diff --git a/Minecraft.Client/Common/Tutorial/TutorialMode.h b/Minecraft.Client/Common/Tutorial/TutorialMode.h index 2263a91c..75e24edf 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialMode.h +++ b/Minecraft.Client/Common/Tutorial/TutorialMode.h @@ -19,7 +19,7 @@ public: virtual void startDestroyBlock(int x, int y, int z, int face); virtual bool destroyBlock(int x, int y, int z, int face); virtual void tick(); - virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=nullptr); + virtual bool useItemOn(shared_ptr player, Level *level, shared_ptr item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL); virtual void attack(shared_ptr player, shared_ptr entity); virtual bool isInputAllowed(int mapping); diff --git a/Minecraft.Client/Common/Tutorial/TutorialTask.cpp b/Minecraft.Client/Common/Tutorial/TutorialTask.cpp index 1b6d84b2..53fdd275 100644 --- a/Minecraft.Client/Common/Tutorial/TutorialTask.cpp +++ b/Minecraft.Client/Common/Tutorial/TutorialTask.cpp @@ -9,7 +9,7 @@ TutorialTask::TutorialTask(Tutorial *tutorial, int descriptionId, bool enablePre areConstraintsEnabled( false ), bIsCompleted( false ), bHasBeenActivated( false ), m_bAllowFade(bAllowFade), m_bTaskReminders(bTaskReminders), m_bShowMinimumTime( bShowMinimumTime), m_bShownForMinimumTime( false ) { - if(inConstraints != nullptr) + if(inConstraints != NULL) { for(auto& constraint : *inConstraints) { diff --git a/Minecraft.Client/Common/Tutorial/UseItemTask.h b/Minecraft.Client/Common/Tutorial/UseItemTask.h index 9c8f0192..6c729540 100644 --- a/Minecraft.Client/Common/Tutorial/UseItemTask.h +++ b/Minecraft.Client/Common/Tutorial/UseItemTask.h @@ -13,7 +13,7 @@ private: public: UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId, - bool enablePreCompletion = false, vector *inConstraints = nullptr, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); + bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); virtual bool isCompleted(); virtual void useItem(shared_ptr item, bool bTestUseOnly=false); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/UseTileTask.h b/Minecraft.Client/Common/Tutorial/UseTileTask.h index 1f72fb2e..74b3a40c 100644 --- a/Minecraft.Client/Common/Tutorial/UseTileTask.h +++ b/Minecraft.Client/Common/Tutorial/UseTileTask.h @@ -16,9 +16,9 @@ private: public: UseTileTask(const int tileId, int x, int y, int z, Tutorial *tutorial, int descriptionId, - bool enablePreCompletion = false, vector *inConstraints = nullptr, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); + bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true ); UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId, - bool enablePreCompletion = false, vector *inConstraints = nullptr, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true); + bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true); virtual bool isCompleted(); virtual void useItemOn(Level *level, shared_ptr item, int x, int y, int z, bool bTestUseOnly=false); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/Tutorial/XuiCraftingTask.cpp b/Minecraft.Client/Common/Tutorial/XuiCraftingTask.cpp index d0217d19..71b88479 100644 --- a/Minecraft.Client/Common/Tutorial/XuiCraftingTask.cpp +++ b/Minecraft.Client/Common/Tutorial/XuiCraftingTask.cpp @@ -22,13 +22,13 @@ bool XuiCraftingTask::isCompleted() switch(m_type) { case e_Crafting_SelectGroup: - if(craftScene != nullptr && craftScene->getCurrentGroup() == m_group) + if(craftScene != NULL && craftScene->getCurrentGroup() == m_group) { completed = true; } break; case e_Crafting_SelectItem: - if(craftScene != nullptr && craftScene->isItemSelected(m_item)) + if(craftScene != NULL && craftScene->isItemSelected(m_item)) { completed = true; } diff --git a/Minecraft.Client/Common/Tutorial/XuiCraftingTask.h b/Minecraft.Client/Common/Tutorial/XuiCraftingTask.h index 146b1554..2dc48709 100644 --- a/Minecraft.Client/Common/Tutorial/XuiCraftingTask.h +++ b/Minecraft.Client/Common/Tutorial/XuiCraftingTask.h @@ -12,7 +12,7 @@ public: }; // Select group - XuiCraftingTask(Tutorial *tutorial, int descriptionId, Recipy::_eGroupType groupToSelect, bool enablePreCompletion = false, vector *inConstraints = nullptr, + XuiCraftingTask(Tutorial *tutorial, int descriptionId, Recipy::_eGroupType groupToSelect, bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ) : TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ), m_group(groupToSelect), @@ -20,7 +20,7 @@ public: {} // Select Item - XuiCraftingTask(Tutorial *tutorial, int descriptionId, int itemId, bool enablePreCompletion = false, vector *inConstraints = nullptr, + XuiCraftingTask(Tutorial *tutorial, int descriptionId, int itemId, bool enablePreCompletion = false, vector *inConstraints = NULL, bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ) : TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ), m_item(itemId), -- cgit v1.2.3