Fix custom Palette Idle action (#946)

* Palette Idle fixes

- Return to Idle only from palette editor action
- disallow cap toggles if cap is missing

* The Peachy review
This commit is contained in:
Cooliokid956 2025-10-21 12:02:53 -05:00 committed by GitHub
parent 3b5a1a3dcb
commit 98891b7334
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -10947,10 +10947,12 @@ void cutscene_palette_editor(struct Camera *c) {
return;
}
bool capMissing = !(m->flags & (MARIO_CAP_ON_HEAD | MARIO_CAP_IN_HAND));
// Press the Z bind to toggle cap
static bool pressed = false;
if (gInteractablePad.button & PAD_BUTTON_Z) {
if (!pressed && m->action == ACT_IDLE) {
if (!capMissing && !pressed && m->action == ACT_IDLE) {
set_mario_action(m, ACT_PALETTE_EDITOR_CAP, (m->flags & MARIO_CAP_ON_HEAD) != 0);
}
pressed = true;
@ -10962,8 +10964,10 @@ void cutscene_palette_editor(struct Camera *c) {
if (gDjuiPaletteToggle) {
djui_base_set_visible(
&gDjuiPaletteToggle->base,
m->action == ACT_IDLE ||
m->action == ACT_PALETTE_EDITOR_CAP
(
m->action == ACT_IDLE ||
m->action == ACT_PALETTE_EDITOR_CAP
) && !capMissing
);
}

View file

@ -1162,13 +1162,20 @@ s32 act_first_person(struct MarioState *m) {
}
s32 mario_exit_palette_editor(struct MarioState *m, struct Camera *c) {
if (!(m->flags & (MARIO_CAP_ON_HEAD | MARIO_CAP_IN_HAND))) {
return FALSE;
}
switch (c->paletteEditorCapState) {
case 0: return FALSE;
case 1: cutscene_put_cap_on(m); break;
case 2: cutscene_take_cap_off(m); break;
}
c->paletteEditorCapState = 0;
return set_mario_action(m, ACT_IDLE, 0);
if (m->action == ACT_PALETTE_EDITOR_CAP) {
set_mario_action(m, ACT_IDLE, 0);
}
return TRUE;
}
s32 act_palette_editor_cap(struct MarioState *m) {