Updated to use smartcmd's MinecraftConsoles
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "TutorialConstraints.h"
|
||||
#include "InfoTask.h"
|
||||
#include "..\..\..\Minecraft.World\Material.h"
|
||||
#include "..\..\Windows64\KeyboardMouseInput.h"
|
||||
|
||||
InfoTask::InfoTask(Tutorial *tutorial, int descriptionId, int promptId /*= -1*/, bool requiresUserInput /*= false*/,
|
||||
int iMapping /*= 0*/, ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/)
|
||||
@@ -36,7 +37,7 @@ bool InfoTask::isCompleted()
|
||||
return false;
|
||||
|
||||
bool bAllComplete = true;
|
||||
|
||||
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
// If the player is under water then allow all keypresses so they can jump out
|
||||
@@ -46,9 +47,9 @@ bool InfoTask::isCompleted()
|
||||
{
|
||||
// If a menu is displayed, then we use the handleUIInput to complete the task
|
||||
bAllComplete = true;
|
||||
for(AUTO_VAR(it, completedMappings.begin()); it != completedMappings.end(); ++it)
|
||||
for( auto& it : completedMappings )
|
||||
{
|
||||
bool current = (*it).second;
|
||||
bool current = it.second;
|
||||
if(!current)
|
||||
{
|
||||
bAllComplete = false;
|
||||
@@ -60,14 +61,18 @@ bool InfoTask::isCompleted()
|
||||
{
|
||||
int iCurrent=0;
|
||||
|
||||
for(AUTO_VAR(it, completedMappings.begin()); it != completedMappings.end(); ++it)
|
||||
for( auto& it : completedMappings )
|
||||
{
|
||||
bool current = (*it).second;
|
||||
bool current = it.second;
|
||||
if(!current)
|
||||
{
|
||||
if( InputManager.GetValue(pMinecraft->player->GetXboxPad(), (*it).first) > 0 )
|
||||
#ifdef _WINDOWS64
|
||||
if (InputManager.GetValue(pMinecraft->player->GetXboxPad(), it.first) > 0 || g_KBMInput.IsKeyDown(VK_SPACE))
|
||||
#else
|
||||
if( InputManager.GetValue(pMinecraft->player->GetXboxPad(), it.first) > 0)
|
||||
#endif
|
||||
{
|
||||
(*it).second = true;
|
||||
it.second = true;
|
||||
bAllComplete=true;
|
||||
}
|
||||
else
|
||||
@@ -106,11 +111,11 @@ void InfoTask::handleUIInput(int iAction)
|
||||
{
|
||||
if(bHasBeenActivated)
|
||||
{
|
||||
for(AUTO_VAR(it, completedMappings.begin()); it != completedMappings.end(); ++it)
|
||||
for( auto& it : completedMappings )
|
||||
{
|
||||
if( iAction == (*it).first )
|
||||
if( iAction == it.first )
|
||||
{
|
||||
(*it).second = true;
|
||||
it.second = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user