mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-08-13 17:03:47 -04:00
06fd7f662a
* Added DPad support to file selection and pause screens * Wrap changes behind CVar * Fix merge conflict for real * Remove unnecessary const_cast * Fixed transparent texture making framebuffers also transparent in D3D11. (#84) This happened with the Mirror Shield in the inventory screen preview. * Add save editor * Added DPad support to file selection and pause screens * Fixing rebase conflict * Remove unnecessary const_cast Co-authored-by: MaikelChan <maikelchan88@gmail.com> Co-authored-by: rozlette <Rozelette@users.noreply.github.com>
36 lines
1.4 KiB
C
36 lines
1.4 KiB
C
#include "z_kaleido_scope.h"
|
|
|
|
static s16 D_8082A6E0[] = { 100, 255 };
|
|
|
|
void KaleidoScope_UpdatePrompt(GlobalContext* globalCtx) {
|
|
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
|
Input* input = &globalCtx->state.input[0];
|
|
s8 relStickX = input->rel.stick_x;
|
|
s16 step;
|
|
bool dpad = CVar_GetS32("gDpadPauseName", 0);
|
|
|
|
if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x10)) {
|
|
if ((pauseCtx->promptChoice == 0) && ((relStickX >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)))) {
|
|
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
|
pauseCtx->promptChoice = 4;
|
|
} else if ((pauseCtx->promptChoice != 0) && ((relStickX <= -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT)))) {
|
|
Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
|
pauseCtx->promptChoice = 0;
|
|
}
|
|
|
|
step = ABS(VREG(61) - D_8082A6E0[VREG(62)]) / VREG(63);
|
|
if (VREG(61) >= D_8082A6E0[VREG(62)]) {
|
|
VREG(61) -= step;
|
|
} else {
|
|
VREG(61) += step;
|
|
}
|
|
|
|
VREG(63)--;
|
|
if (VREG(63) == 0) {
|
|
VREG(61) = D_8082A6E0[VREG(62)];
|
|
VREG(63) = VREG(60) + VREG(62);
|
|
VREG(62) ^= 1;
|
|
}
|
|
}
|
|
}
|