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 a9be52c41a.
This commit is contained in:
@@ -61,9 +61,9 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
shared_ptr<MultiplayerLocalPlayer> 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<PlayerInfoPacket>(player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs));
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( 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<MultiplayerLocalPlayer> 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<PlayerInfoPacket>(player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs));
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( 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<MultiplayerLocalPlayer> 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<PlayerInfoPacket>(player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs));
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<itemIdsLength;i++)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
ControllerTask::ControllerTask(Tutorial *tutorial, int descriptionId, bool enablePreCompletion, bool showMinimumTime,
|
||||
int mappings[], unsigned int mappingsLength, int iCompletionMaskA[], int iCompletionMaskACount, int iSouthpawMappings[], unsigned int uiSouthpawMappingsCount)
|
||||
: TutorialTask( tutorial, descriptionId, enablePreCompletion, nullptr, showMinimumTime )
|
||||
: TutorialTask( tutorial, descriptionId, enablePreCompletion, NULL, showMinimumTime )
|
||||
{
|
||||
for(unsigned int i = 0; i < mappingsLength; ++i)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ private:
|
||||
bool CompletionMaskIsValid();
|
||||
public:
|
||||
ControllerTask(Tutorial *tutorial, int descriptionId, bool enablePreCompletion, bool showMinimumTime,
|
||||
int mappings[], unsigned int mappingsLength, int iCompletionMaskA[]=nullptr, int iCompletionMaskACount=0, int iSouthpawMappings[]=nullptr, unsigned int uiSouthpawMappingsCount=0);
|
||||
int mappings[], unsigned int mappingsLength, int iCompletionMaskA[]=NULL, int iCompletionMaskACount=0, int iSouthpawMappings[]=NULL, unsigned int uiSouthpawMappingsCount=0);
|
||||
~ControllerTask();
|
||||
virtual bool isCompleted();
|
||||
virtual void setAsCurrentTask(bool active = true);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
|
||||
|
||||
CraftTask::CraftTask( int itemId, int auxValue, int quantity,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion /*= true*/, vector<TutorialConstraint *> *inConstraints /*= nullptr*/,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion /*= true*/, vector<TutorialConstraint *> *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<TutorialConstraint *> *inConstraints /*= nullptr*/,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion /*= true*/, vector<TutorialConstraint *> *inConstraints /*= NULL*/,
|
||||
bool bShowMinimumTime /*=false*/, bool bAllowFade /*=true*/, bool m_bTaskReminders /*=true*/ )
|
||||
: TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ),
|
||||
m_quantity( quantity ),
|
||||
|
||||
@@ -5,10 +5,10 @@ class CraftTask : public TutorialTask
|
||||
{
|
||||
public:
|
||||
CraftTask( int itemId, int auxValue, int quantity,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector<TutorialConstraint *> *inConstraints = nullptr,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector<TutorialConstraint *> *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<TutorialConstraint *> *inConstraints = nullptr,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector<TutorialConstraint *> *inConstraints = NULL,
|
||||
bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true );
|
||||
|
||||
~CraftTask();
|
||||
|
||||
@@ -22,7 +22,7 @@ DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descri
|
||||
|
||||
int DiggerItemHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
if(item != nullptr)
|
||||
if(item != NULL)
|
||||
{
|
||||
bool itemFound = false;
|
||||
for(unsigned int i=0;i<m_iItemsCount;i++)
|
||||
@@ -48,7 +48,7 @@ int DiggerItemHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
|
||||
int DiggerItemHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
|
||||
{
|
||||
if(item != nullptr)
|
||||
if(item != NULL)
|
||||
{
|
||||
bool itemFound = false;
|
||||
for(unsigned int i=0;i<m_iItemsCount;i++)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
EffectChangedTask::EffectChangedTask(Tutorial *tutorial, int descriptionId, MobEffect *effect, bool apply,
|
||||
bool enablePreCompletion, bool bShowMinimumTime, bool bAllowFade, bool bTaskReminders )
|
||||
: TutorialTask(tutorial,descriptionId,enablePreCompletion,nullptr,bShowMinimumTime,bAllowFade,bTaskReminders)
|
||||
: TutorialTask(tutorial,descriptionId,enablePreCompletion,NULL,bShowMinimumTime,bAllowFade,bTaskReminders)
|
||||
{
|
||||
m_effect = effect;
|
||||
m_apply = apply;
|
||||
|
||||
@@ -154,10 +154,10 @@ FullTutorial::FullTutorial(int iPad, bool isTrial /*= false*/)
|
||||
addTask(e_Tutorial_State_Gameplay, new UseItemTask(Item::door_wood->id, 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<TutorialConstraint *> *areaConstraints = new vector<TutorialConstraint *>();
|
||||
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<TutorialConstraint *> *creativeExitAreaConstraints = new vector<TutorialConstraint *>();
|
||||
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) );
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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<TutorialConstraint *> *inConstraints = nullptr,
|
||||
Tutorial *tutorial, int descriptionId, bool enablePreCompletion = true, vector<TutorialConstraint *> *inConstraints = NULL,
|
||||
bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true )
|
||||
: TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ),
|
||||
m_itemId( itemId),
|
||||
|
||||
@@ -11,7 +11,7 @@ ProcedureCompoundTask::~ProcedureCompoundTask()
|
||||
|
||||
void ProcedureCompoundTask::AddTask(TutorialTask *task)
|
||||
{
|
||||
if(task != nullptr)
|
||||
if(task != NULL)
|
||||
{
|
||||
m_taskSequence.push_back(task);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 )
|
||||
{}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ bool RideEntityTask::isCompleted()
|
||||
|
||||
void RideEntityTask::onRideEntity(shared_ptr<Entity> entity)
|
||||
{
|
||||
if (entity->instanceof(static_cast<eINSTANCEOF>(m_eType)))
|
||||
if (entity->instanceof((eINSTANCEOF) m_eType))
|
||||
{
|
||||
bIsCompleted = true;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ protected:
|
||||
|
||||
public:
|
||||
RideEntityTask(const int eTYPE, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = nullptr,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL,
|
||||
bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
|
||||
virtual bool isCompleted();
|
||||
|
||||
@@ -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<unsigned int>(targetValue);
|
||||
bIsCompleted = minecraft->stats[ProfileManager.GetPrimaryPad()]->getTotalValue( stat ) >= (unsigned int)targetValue;
|
||||
return bIsCompleted;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ private:
|
||||
eTutorial_State m_state;
|
||||
public:
|
||||
StateChangeTask(eTutorial_State state,
|
||||
Tutorial *tutorial, int descriptionId = -1, bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = nullptr,
|
||||
Tutorial *tutorial, int descriptionId = -1, bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL,
|
||||
bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true ) :
|
||||
TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ),
|
||||
m_state( state )
|
||||
|
||||
@@ -19,7 +19,7 @@ TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], u
|
||||
|
||||
bool TakeItemHint::onTake(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(item != nullptr)
|
||||
if(item != NULL)
|
||||
{
|
||||
bool itemFound = false;
|
||||
for(unsigned int i=0;i<m_iItemsCount;i++)
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "TutorialTasks.h"
|
||||
#include "TutorialConstraints.h"
|
||||
#include "TutorialHints.h"
|
||||
#include "Common/UI/UI.h"
|
||||
|
||||
vector<int> 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<GAME_SETTINGS *>(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<GAME_SETTINGS *>(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<GAME_SETTINGS *>(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<ItemInstance> 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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<ItemInstance> 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> player, Level *level, shared_ptr
|
||||
|
||||
if(!bTestUseOnly)
|
||||
{
|
||||
if(item != nullptr)
|
||||
if(item != NULL)
|
||||
{
|
||||
haveItem = true;
|
||||
itemCount = item->count;
|
||||
|
||||
@@ -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> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=nullptr);
|
||||
virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
|
||||
|
||||
virtual bool isInputAllowed(int mapping);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
|
||||
public:
|
||||
UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = nullptr, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
virtual bool isCompleted();
|
||||
virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
};
|
||||
@@ -16,9 +16,9 @@ private:
|
||||
|
||||
public:
|
||||
UseTileTask(const int tileId, int x, int y, int z, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = nullptr, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = nullptr, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true);
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true);
|
||||
virtual bool isCompleted();
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
};
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public:
|
||||
};
|
||||
|
||||
// Select group
|
||||
XuiCraftingTask(Tutorial *tutorial, int descriptionId, Recipy::_eGroupType groupToSelect, bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = nullptr,
|
||||
XuiCraftingTask(Tutorial *tutorial, int descriptionId, Recipy::_eGroupType groupToSelect, bool enablePreCompletion = false, vector<TutorialConstraint *> *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<TutorialConstraint *> *inConstraints = nullptr,
|
||||
XuiCraftingTask(Tutorial *tutorial, int descriptionId, int itemId, bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL,
|
||||
bool bShowMinimumTime=false, bool bAllowFade=true, bool m_bTaskReminders=true )
|
||||
: TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints, bShowMinimumTime, bAllowFade, m_bTaskReminders ),
|
||||
m_item(itemId),
|
||||
|
||||
Reference in New Issue
Block a user