Skip to content

Commit 98daa27

Browse files
DeaTh-Ghyperbx
andauthored
Added exceptions for specific hint messages being allowed/blocked by the Hints option (#462)
* Fix Windmill Isle Act 1 (Night) chip 'hint' not being shown * code style adjustments * Fix Apotos entrance gate first time Chip hint appearing with hints disabled --------- Co-authored-by: Hyper <34012267+hyperbx@users.noreply.github.com>
1 parent 0b16633 commit 98daa27

5 files changed

Lines changed: 60 additions & 7 deletions

File tree

UnleashedRecomp/api/SWA.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
#include "SWA/Inspire/InspireTextureAnimationInfo.h"
8787
#include "SWA/Inspire/InspireTextureOverlay.h"
8888
#include "SWA/Inspire/InspireTextureOverlayInfo.h"
89+
#include "SWA/Message/MsgRequestHelp.h"
8990
#include "SWA/Menu/MenuWindowBase.h"
9091
#include "SWA/Movie/MovieDisplayer.h"
9192
#include "SWA/Movie/MovieManager.h"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include <SWA.inl>
4+
5+
namespace SWA::Message
6+
{
7+
class MsgRequestHelp
8+
{
9+
public:
10+
SWA_INSERT_PADDING(0x1C);
11+
Hedgehog::Base::CSharedString m_Name;
12+
};
13+
}

UnleashedRecomp/patches/misc_patches.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,42 @@ PPC_FUNC(sub_82586698)
108108

109109
__imp__sub_82586698(ctx, base);
110110
}
111+
112+
// SWA::CObjHint::MsgNotifyObjectEvent::Impl
113+
// Disable only certain hints from hint volumes.
114+
// This hook should be used to allow hint volumes specifically to also prevent them from affecting the player.
115+
PPC_FUNC_IMPL(__imp__sub_82736E80);
116+
PPC_FUNC(sub_82736E80)
117+
{
118+
// GroupID parameter text
119+
auto* groupId = (const char*)(base + PPC_LOAD_U32(ctx.r3.u32 + 0x100));
120+
121+
if (!Config::Hints)
122+
{
123+
// WhiteIsland_ACT1_001 (Windmill Isle Act 1 Night, Start)
124+
// Your friend went off that way, Sonic. Quick, let's go after him!
125+
if (strcmp(groupId, "WhiteIsland_ACT1_001") != 0)
126+
return;
127+
}
128+
129+
__imp__sub_82736E80(ctx, base);
130+
}
131+
132+
// SWA::CHelpWindow::MsgRequestHelp::Impl
133+
// Disable only certain hints from other sequences.
134+
// This hook should be used to block hint messages from unknown sources.
135+
PPC_FUNC_IMPL(__imp__sub_824C1E60);
136+
PPC_FUNC(sub_824C1E60)
137+
{
138+
auto pMsgRequestHelp = (SWA::Message::MsgRequestHelp*)(base + ctx.r4.u32);
139+
140+
if (!Config::Hints)
141+
{
142+
// s10d_mykETF_c_navi (Town Mykonos Entrance, First Entry)
143+
// Looks like we can get to a bunch of places in the village from here!
144+
if (strcmp(pMsgRequestHelp->m_Name.c_str(), "s10d_mykETF_c_navi") == 0)
145+
return;
146+
}
147+
148+
__imp__sub_824C1E60(ctx, base);
149+
}

UnleashedRecompLib/config/SWA.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,18 @@ jump_address = 0x82468EE0
106106
name = "ResetScoreOnRestartMidAsmHook"
107107
address = 0x82304374
108108

109-
# Disable hint volumes
110-
[[midasm_hook]]
111-
name = "DisableHintsMidAsmHook"
112-
address = 0x827A2504
113-
jump_address_on_true = 0x827A251C
114-
115109
# Disable hint rings
116110
[[midasm_hook]]
117111
name = "DisableHintsMidAsmHook"
118112
address = 0x827A2E34
119113
jump_address_on_true = 0x827A2E4C
120114

115+
# Disable Tornado Defense hints
116+
[[midasm_hook]]
117+
name = "DisableHintsMidAsmHook"
118+
address = 0x82AF52BC
119+
jump_address_on_true = 0x82AF52E4
120+
121121
# Disable Egg Dragoon hint "V_WHG_083" ("That lit-up part on the bottom looks fishy. I'll try aiming for that.")
122122
[[midasm_hook]]
123123
name = "DisableHintsMidAsmHook"

UnleashedRecompResources

0 commit comments

Comments
 (0)