Implemented control tutorial toggle

This commit is contained in:
Hyper 2024-11-04 12:46:58 +00:00
parent fa5fc9aae7
commit 4bf576ab1c
6 changed files with 65 additions and 2 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include "SWA/Camera/Camera.h"
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
#include "SWA/Player/Character/EvilSonic/EvilSonic.h"
#include "SWA/Player/Character/EvilSonic/EvilSonicContext.h"
#include "SWA/System/ApplicationDocument.h"

View file

@ -1,6 +1,7 @@
#pragma once
#include "SWA.inl"
#include "SWA/Player/Character/EvilSonic/Hud/EvilHudGuide.h"
namespace SWA::Player
{
@ -11,7 +12,12 @@ namespace SWA::Player
be<float> m_DarkGaiaEnergy;
SWA_INSERT_PADDING(0x138);
be<uint32_t> m_AnimationID;
SWA_INSERT_PADDING(0x104);
SWA_INSERT_PADDING(0x38);
be<float> m_UnkHudGuideF32;
be<uint32_t> m_UnkHudGuideU32;
SWA_INSERT_PADDING(0x18);
be<EGuideType> m_GuideType;
SWA_INSERT_PADDING(0xA8);
be<uint32_t> m_OutOfControlCount;
};
}

View file

@ -0,0 +1,29 @@
#pragma once
#include "SWA.inl"
namespace SWA::Player
{
enum EGuideAction : uint32_t
{
eGuideAction_Single,
eGuideAction_Chain
};
enum EGuideType : uint32_t
{
eGuideType_A,
eGuideType_B,
eGuideType_X,
eGuideType_Y
};
class CEvilHudGuide
{
public:
SWA_INSERT_PADDING(0x14D);
bool m_IsShown;
bool m_IsVisible;
EGuideType m_GuideType;
};
}

View file

@ -9,6 +9,7 @@ public:
CONFIG_DEFINE_ENUM("System", ELanguage, Language, ELanguage::English);
CONFIG_DEFINE("System", bool, Hints, true);
CONFIG_DEFINE("System", bool, ControlTutorial, true);
CONFIG_DEFINE_ENUM("System", EScoreBehaviour, ScoreBehaviour, EScoreBehaviour::CheckpointReset);
CONFIG_DEFINE("System", bool, UnleashOutOfControlDrain, true);
CONFIG_DEFINE("System", bool, WerehogHubTransformVideo, true);

View file

@ -100,7 +100,7 @@ PPC_FUNC(sub_8245F048)
if (!pGameDocument)
return;
printf("Resetting score to %d\n", m_lastCheckpointScore);
printf("[*] Resetting score to %d\n", m_lastCheckpointScore);
pGameDocument->m_pMember->m_Score = m_lastCheckpointScore;
}
@ -202,6 +202,19 @@ bool DisableHintsMidAsmHook()
return !Config::Hints;
}
bool DisableControlTutorialMidAsmHook()
{
return !Config::ControlTutorial;
}
bool DisableEvilControlTutorialMidAsmHook(PPCRegister& r4, PPCRegister& r5)
{
if (Config::ControlTutorial)
return true;
return r4.u32 == 1 && r5.u32 == 1;
}
void SetXButtonHomingMidAsmHook(PPCRegister& r30)
{
r30.u32 = Config::XButtonHoming;

View file

@ -122,6 +122,19 @@ name = "DisableHintsMidAsmHook"
address = 0x827A2E34
jump_address_on_true = 0x827A2E4C
# Disable navigation volumes
[[midasm_hook]]
name = "DisableControlTutorialMidAsmHook"
address = 0x827AA5EC
jump_address_on_true = 0x827AA604
# Disable Werehog button prompts
[[midasm_hook]]
name = "DisableEvilControlTutorialMidAsmHook"
address = 0x823A4FF0
registers = ["r4", "r5"]
return_on_false = true
[[midasm_hook]]
name = "SetXButtonHomingMidAsmHook"
address = 0x8237AC88