chore: format everything

This commit is contained in:
Tropical
2026-03-30 02:13:59 -05:00
parent 470ddf959d
commit c9b90cae2c
463 changed files with 12748 additions and 11285 deletions

View File

@@ -21,8 +21,7 @@ bool AreaTask::isCompleted() {
switch (m_completionState) {
case eAreaTaskCompletion_CompleteOnConstraintsSatisfied: {
bool allSatisfied = true;
for (auto it = constraints.begin(); it != constraints.end();
++it) {
for (auto it = constraints.begin(); it != constraints.end(); ++it) {
TutorialConstraint* constraint = *it;
if (!constraint->isConstraintSatisfied(tutorial->getPad())) {
allSatisfied = false;

View File

@@ -14,7 +14,8 @@ ChoiceTask::ChoiceTask(
int iCancelMapping /*= 0*/,
eTutorial_CompletionAction cancelAction /*= e_Tutorial_Completion_None*/,
ETelemetryChallenges telemetryEvent /*= eTelemetryTutorial_NoEvent*/)
: TutorialTask(tutorial, descriptionId, false, nullptr, true, false, false) {
: TutorialTask(tutorial, descriptionId, false, nullptr, true, false,
false) {
if (requiresUserInput == true) {
constraints.push_back(new InputConstraint(iConfirmMapping));
constraints.push_back(new InputConstraint(iCancelMapping));

View File

@@ -23,7 +23,8 @@ public:
ControllerTask(Tutorial* tutorial, int descriptionId,
bool enablePreCompletion, bool showMinimumTime,
int mappings[], unsigned int mappingsLength,
int iCompletionMaskA[] = nullptr, int iCompletionMaskACount = 0,
int iCompletionMaskA[] = nullptr,
int iCompletionMaskACount = 0,
int iSouthpawMappings[] = nullptr,
unsigned int uiSouthpawMappingsCount = 0);
~ControllerTask();

View File

@@ -2,11 +2,12 @@
#include "CraftTask.h"
#include "../../Minecraft.World/Headers/net.minecraft.world.item.h"
CraftTask::CraftTask(int itemId, int auxValue, int quantity, Tutorial* tutorial,
int descriptionId, bool enablePreCompletion /*= true*/,
std::vector<TutorialConstraint*>* inConstraints /*= nullptr*/,
bool bShowMinimumTime /*=false*/,
bool bAllowFade /*=true*/, bool m_bTaskReminders /*=true*/)
CraftTask::CraftTask(
int itemId, int auxValue, int quantity, Tutorial* tutorial,
int descriptionId, bool enablePreCompletion /*= true*/,
std::vector<TutorialConstraint*>* inConstraints /*= nullptr*/,
bool bShowMinimumTime /*=false*/, bool bAllowFade /*=true*/,
bool m_bTaskReminders /*=true*/)
: TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints,
bShowMinimumTime, bAllowFade, m_bTaskReminders),
m_quantity(quantity),
@@ -18,12 +19,12 @@ CraftTask::CraftTask(int itemId, int auxValue, int quantity, Tutorial* tutorial,
m_auxValues[0] = auxValue;
}
CraftTask::CraftTask(int* items, int* auxValues, int numItems, int quantity,
Tutorial* tutorial, int descriptionId,
bool enablePreCompletion /*= true*/,
std::vector<TutorialConstraint*>* inConstraints /*= nullptr*/,
bool bShowMinimumTime /*=false*/,
bool bAllowFade /*=true*/, bool m_bTaskReminders /*=true*/)
CraftTask::CraftTask(
int* items, int* auxValues, int numItems, int quantity, Tutorial* tutorial,
int descriptionId, bool enablePreCompletion /*= true*/,
std::vector<TutorialConstraint*>* inConstraints /*= nullptr*/,
bool bShowMinimumTime /*=false*/, bool bAllowFade /*=true*/,
bool m_bTaskReminders /*=true*/)
: TutorialTask(tutorial, descriptionId, enablePreCompletion, inConstraints,
bShowMinimumTime, bAllowFade, m_bTaskReminders),
m_quantity(quantity),

View File

@@ -12,7 +12,8 @@ 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) {
: TutorialTask(tutorial, descriptionId, false, nullptr, true, false,
false) {
if (requiresUserInput == true) {
constraints.push_back(new InputConstraint(iMapping));
}
@@ -45,8 +46,8 @@ bool InfoTask::isCompleted() {
// If a menu is displayed, then we use the handleUIInput to complete the
// task
bAllComplete = true;
for (auto it = completedMappings.begin();
it != completedMappings.end(); ++it) {
for (auto it = completedMappings.begin(); it != completedMappings.end();
++it) {
bool current = (*it).second;
if (!current) {
bAllComplete = false;
@@ -56,8 +57,8 @@ bool InfoTask::isCompleted() {
} else {
int iCurrent = 0;
for (auto it = completedMappings.begin();
it != completedMappings.end(); ++it) {
for (auto it = completedMappings.begin(); it != completedMappings.end();
++it) {
bool current = (*it).second;
if (!current) {
if (InputManager.GetValue(pMinecraft->player->GetXboxPad(),
@@ -94,8 +95,8 @@ void InfoTask::setAsCurrentTask(bool active /*= true*/) {
void InfoTask::handleUIInput(int iAction) {
if (bHasBeenActivated) {
for (auto it = completedMappings.begin();
it != completedMappings.end(); ++it) {
for (auto it = completedMappings.begin(); it != completedMappings.end();
++it) {
if (iAction == (*it).first) {
(*it).second = true;
}

View File

@@ -2,8 +2,7 @@
#include "ProcedureCompoundTask.h"
ProcedureCompoundTask::~ProcedureCompoundTask() {
for (auto it = m_taskSequence.begin(); it < m_taskSequence.end();
++it) {
for (auto it = m_taskSequence.begin(); it < m_taskSequence.end(); ++it) {
delete (*it);
}
}

View File

@@ -1683,8 +1683,8 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad(iPad) {
if (isFullTutorial)
addTask(e_Tutorial_State_Horse,
new RideEntityTask(eTYPE_HORSE, this,
IDS_TUTORIAL_TASK_HORSE_RIDE, true, nullptr,
false, false, false));
IDS_TUTORIAL_TASK_HORSE_RIDE, true,
nullptr, false, false, false));
else
addTask(e_Tutorial_State_Horse,
new InfoTask(this, IDS_TUTORIAL_TASK_HORSE_RIDE,
@@ -1929,8 +1929,8 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad(iPad) {
}
Tutorial::~Tutorial() {
for (auto it = m_globalConstraints.begin();
it != m_globalConstraints.end(); ++it) {
for (auto it = m_globalConstraints.begin(); it != m_globalConstraints.end();
++it) {
delete (*it);
}
for (std::unordered_map<int, TutorialMessage*>::iterator it =
@@ -1968,8 +1968,8 @@ void Tutorial::setCompleted(int completableId) {
// }
int completableIndex = -1;
for (auto it = s_completableTasks.begin();
it < s_completableTasks.end(); ++it) {
for (auto it = s_completableTasks.begin(); it < s_completableTasks.end();
++it) {
++completableIndex;
if (*it == completableId) {
break;
@@ -1996,8 +1996,8 @@ bool Tutorial::getCompleted(int completableId) {
// }
int completableIndex = -1;
for (auto it = s_completableTasks.begin();
it < s_completableTasks.end(); ++it) {
for (auto it = s_completableTasks.begin(); it < s_completableTasks.end();
++it) {
++completableIndex;
if (*it == completableId) {
break;
@@ -2152,8 +2152,8 @@ void Tutorial::tick() {
}
// Check constraints
for (auto it = m_globalConstraints.begin();
it < m_globalConstraints.end(); ++it) {
for (auto it = m_globalConstraints.begin(); it < m_globalConstraints.end();
++it) {
TutorialConstraint* constraint = *it;
constraint->tick(m_iPad);
}
@@ -2234,8 +2234,7 @@ void Tutorial::tick() {
// gameplay state so that they are in effect for
// a bit longer
auto itCon =
constraintsToRemove[m_CurrentState]
.begin();
constraintsToRemove[m_CurrentState].begin();
while (
itCon !=
constraintsToRemove[m_CurrentState].end()) {
@@ -2259,8 +2258,7 @@ void Tutorial::tick() {
}
// Fall through the the normal complete state
case e_Tutorial_Completion_Complete_State:
for (auto
itRem =
for (auto itRem =
activeTasks[m_CurrentState].begin();
itRem < activeTasks[m_CurrentState].end();
++itRem) {
@@ -2273,8 +2271,7 @@ void Tutorial::tick() {
activeTasks[m_CurrentState].at(
activeTasks[m_CurrentState].size() - 1);
activeTasks[m_CurrentState].pop_back();
for (auto
itRem =
for (auto itRem =
activeTasks[m_CurrentState].begin();
itRem < activeTasks[m_CurrentState].end();
++itRem) {
@@ -2773,8 +2770,8 @@ void Tutorial::onLookAtEntity(std::shared_ptr<Entity> entity) {
}
}
if ((m_CurrentState == e_Tutorial_State_Gameplay) && entity->instanceof
(eTYPE_HORSE)) {
if ((m_CurrentState == e_Tutorial_State_Gameplay) &&
entity->instanceof(eTYPE_HORSE)) {
changeTutorialState(e_Tutorial_State_Horse);
}
@@ -2898,7 +2895,7 @@ void Tutorial::RemoveConstraint(TutorialConstraint* c,
}
auto it = find(constraints[m_CurrentState].begin(),
constraints[m_CurrentState].end(), c);
constraints[m_CurrentState].end(), c);
if (it != constraints[m_CurrentState].end())
constraints[m_CurrentState].erase(
find(constraints[m_CurrentState].begin(),
@@ -2934,8 +2931,7 @@ void Tutorial::addMessage(
}
void Tutorial::changeTutorialState(eTutorial_State newState,
UIScene* scene /*= nullptr*/)
{
UIScene* scene /*= nullptr*/) {
if (newState == m_CurrentState) {
// If clearing the scene, make sure that the tutorial popup has its
// reference to this scene removed

View File

@@ -135,7 +135,8 @@ public:
void setCompleted(int completableId);
bool getCompleted(int completableId);
void changeTutorialState(eTutorial_State newState, UIScene* scene = nullptr);
void changeTutorialState(eTutorial_State newState,
UIScene* scene = nullptr);
bool isSelectedItemState();
bool setMessage(PopupMessageDetails* message);

View File

@@ -22,7 +22,8 @@ public:
virtual bool useItemOn(std::shared_ptr<Player> player, Level* level,
std::shared_ptr<ItemInstance> item, int x, int y,
int z, int face, Vec3* hit,
bool bTestUseOnly = false, bool* pbUsedItem = nullptr);
bool bTestUseOnly = false,
bool* pbUsedItem = nullptr);
virtual void attack(std::shared_ptr<Player> player,
std::shared_ptr<Entity> entity);

View File

@@ -13,11 +13,11 @@ class MobEffect;
// enablePreCompletion - If this is true, then the player can complete this
// task out of sequence.
// This stops us asking them to do
//things they have already done
// things they have already done
// constraints - A list of constraints which can be activated
// (as a whole).
// If they are active, then the
//constraints are removed when the task is completed
// constraints are removed when the task is completed
// areConstraintsEnabled- A flag which records whether or not we have added the
// constraints to the tutorial
class TutorialTask {