blob: fe4dc02c0973eece03add93468405f0c02e6e298 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#include "2s2h/GameInteractor/GameInteractor.h"
#include "libultraship/libultraship.h"
extern "C" {
#include "variables.h"
extern u8 sPlaybackState;
}
void RegisterFasterSongPlayback() {
static uint32_t onPlayerUpdate = 0;
GameInteractor::Instance->UnregisterGameHookForID<GameInteractor::OnActorUpdate>(onPlayerUpdate);
onPlayerUpdate = 0;
if (!CVarGetInteger("gEnhancements.Songs.FasterSongPlayback", 0)) {
return;
}
onPlayerUpdate =
GameInteractor::Instance->RegisterGameHookForID<GameInteractor::OnActorUpdate>(ACTOR_PLAYER, [](Actor* actor) {
if (gPlayState->msgCtx.msgMode >= MSGMODE_SONG_PLAYED && gPlayState->msgCtx.msgMode <= MSGMODE_17) {
if (gPlayState->msgCtx.stateTimer > 1) {
gPlayState->msgCtx.stateTimer = 1;
}
gPlayState->msgCtx.ocarinaSongEffectActive = 0;
sPlaybackState = 0;
}
});
}
|