mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-31 03:50:37 -07:00
VBify (#4255)
* Convert ocarina buttons & skip scarecrow song to VB * Move most of boss rush & rupee/key counters to VB * Move BossRush_HandleCompleteBoss to VB * Convert boss timestamps to VB * Move being able to open doors to VB * Convert Entrance_OverrideWeatherState to VB * Move boss souls to hook_handlers.cpp * Update hook_handlers.cpp * Move infinite upgrades to hook_handlers.cpp * Move skeleton key to hook_handlers.cpp * Move swim and child wallet to hook_handlers.cpp * Move ganons boss key to hook_handlers.cpp * Move triforce hunt to hook_handlers.cpp * Move randomizer sheik spawn to hook_handlers.cpp * Update BossRush.h * Convert spoiling items to VB * Move load game stuff to hook_handlers.cpp * Move warp song handling to hook_handlers.cpp * Convert being able to play bowling to VB * Move shooting gallery man handling to hook_handlers.cpp * Move spirit temple silver block removal to hook_handlers.cpp * Fix build * Move last beehive stuff to hook_handlers.cpp * Fix build * Add VB_CLOSE_PAUSE_MENU * Add VB_BE_ABLE_TO_SAVE * Add VB_RENDER_YES_ON_CONTINUE_PROMPT * Add VB_SPAWN_BLUE_WARP * Add VB_BLUE_WARP_ADULT_WARP_OUT * Add VB_BG_BREAKWALL_BREAK * Convert Saria stuff to VB * Remove now unused check * Add VB_GANON_HEAL_BEFORE_FIGHT * Update hook_handlers.cpp * Fix blue warp offsets * Fixes from review * Improve documentation * Update BossRush.cpp * Fix my stupidity * Fix #4327 * Update hook_handlers.cpp * Fix blue warps * Use ultralib types & clean header * Replace options amount macro with BR_OPTIONS_MAX * Remove unused includes * Remove accidental line doubling * Tweaks to boss rush (#6) * Update GameInteractor_HookTable.h --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
parent
7450cee0b2
commit
2822dfc3f3
45 changed files with 963 additions and 621 deletions
|
@ -5372,8 +5372,7 @@ void Interface_Draw(PlayState* play) {
|
|||
if (fullUi) {
|
||||
s16 PosX_RC;
|
||||
s16 PosY_RC;
|
||||
//when not having a wallet (or infinite money) in rando, don't calculate the ruppe icon
|
||||
if (!IS_RANDO || (Flags_GetRandomizerInf(RAND_INF_HAS_WALLET) && !Flags_GetRandomizerInf(RAND_INF_HAS_INFINITE_MONEY))) {
|
||||
if (GameInteractor_Should(VB_RENDER_RUPEE_COUNTER, true, NULL)) {
|
||||
// Rupee Icon
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DynamicWalletIcon"), 0)) {
|
||||
switch (CUR_UPG_VALUE(UPG_WALLET)) {
|
||||
|
@ -5444,14 +5443,10 @@ void Interface_Draw(PlayState* play) {
|
|||
PosX_RC = PosX_RC_ori;
|
||||
}
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor.r, rColor.g, rColor.b, interfaceCtx->magicAlpha);
|
||||
// Draw Rupee icon. Hide in Boss Rush.
|
||||
if (!IS_BOSS_RUSH) {
|
||||
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, PosX_RC, PosY_RC, 16, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, PosX_RC, PosY_RC, 16, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
//when having the skeleton key in rando, don't render the small key counter
|
||||
if (!Flags_GetRandomizerInf(RAND_INF_HAS_SKELETON_KEY)) {
|
||||
if (GameInteractor_Should(VB_RENDER_KEY_COUNTER, true, NULL)) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_FOREST_TEMPLE:
|
||||
case SCENE_FIRE_TEMPLE:
|
||||
|
@ -5467,7 +5462,6 @@ void Interface_Draw(PlayState* play) {
|
|||
case SCENE_GANONS_TOWER_COLLAPSE_INTERIOR:
|
||||
case SCENE_INSIDE_GANONS_CASTLE_COLLAPSE:
|
||||
case SCENE_TREASURE_BOX_SHOP:
|
||||
|
||||
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) {
|
||||
s16 X_Margins_SKC;
|
||||
s16 Y_Margins_SKC;
|
||||
|
@ -5533,49 +5527,47 @@ void Interface_Draw(PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
// Rupee Counter
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
if (GameInteractor_Should(VB_RENDER_RUPEE_COUNTER, true, NULL)) {
|
||||
// Rupee Counter
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
||||
if (gSaveContext.rupees == CUR_CAPACITY(UPG_WALLET)) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, interfaceCtx->magicAlpha);
|
||||
} else if (gSaveContext.rupees != 0) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
|
||||
} else {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->magicAlpha);
|
||||
}
|
||||
if (gSaveContext.rupees == CUR_CAPACITY(UPG_WALLET)) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, interfaceCtx->magicAlpha);
|
||||
} else if (gSaveContext.rupees != 0) {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha);
|
||||
} else {
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->magicAlpha);
|
||||
}
|
||||
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIMITIVE, 0);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0,
|
||||
PRIMITIVE, 0);
|
||||
|
||||
interfaceCtx->counterDigits[0] = interfaceCtx->counterDigits[1] = 0;
|
||||
interfaceCtx->counterDigits[2] = gSaveContext.rupees;
|
||||
interfaceCtx->counterDigits[0] = interfaceCtx->counterDigits[1] = 0;
|
||||
interfaceCtx->counterDigits[2] = gSaveContext.rupees;
|
||||
|
||||
if ((interfaceCtx->counterDigits[2] > 9999) || (interfaceCtx->counterDigits[2] < 0)) {
|
||||
interfaceCtx->counterDigits[2] &= 0xDDD;
|
||||
}
|
||||
if ((interfaceCtx->counterDigits[2] > 9999) || (interfaceCtx->counterDigits[2] < 0)) {
|
||||
interfaceCtx->counterDigits[2] &= 0xDDD;
|
||||
}
|
||||
|
||||
while (interfaceCtx->counterDigits[2] >= 100) {
|
||||
interfaceCtx->counterDigits[0]++;
|
||||
interfaceCtx->counterDigits[2] -= 100;
|
||||
}
|
||||
while (interfaceCtx->counterDigits[2] >= 100) {
|
||||
interfaceCtx->counterDigits[0]++;
|
||||
interfaceCtx->counterDigits[2] -= 100;
|
||||
}
|
||||
|
||||
while (interfaceCtx->counterDigits[2] >= 10) {
|
||||
interfaceCtx->counterDigits[1]++;
|
||||
interfaceCtx->counterDigits[2] -= 10;
|
||||
}
|
||||
while (interfaceCtx->counterDigits[2] >= 10) {
|
||||
interfaceCtx->counterDigits[1]++;
|
||||
interfaceCtx->counterDigits[2] -= 10;
|
||||
}
|
||||
|
||||
svar2 = rupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)];
|
||||
svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)];
|
||||
svar2 = rupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)];
|
||||
svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)];
|
||||
|
||||
// Draw Rupee Counter. Hide in Boss Rush and when not having a wallet in rando.
|
||||
if (!IS_BOSS_RUSH && (!IS_RANDO || Flags_GetRandomizerInf(RAND_INF_HAS_WALLET))) {
|
||||
for (svar1 = 0, svar3 = 16; svar1 < svar5; svar1++, svar2++, svar3 += 8) {
|
||||
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]),
|
||||
8, 16, PosX_RC + svar3, PosY_RC, 8, 16, 1 << 10, 1 << 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// Make sure item counts have black backgrounds
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue