From 903cfc811ce87599af8f7a1a0e812a1fed80e5d4 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Sat, 4 Jan 2025 15:40:12 -0600 Subject: [PATCH] Added an option to restore the old boost gauge and fixed coin --- include/hud.h | 14 ++++++ port/assets/textures/hud/sBoostGaugeArrow0 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow1 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow2 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow3 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow4 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow5 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow6 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow7 | Bin 0 -> 2128 bytes port/assets/textures/hud/sBoostGaugeArrow8 | Bin 0 -> 2128 bytes src/port/mods/PortEnhancements.c | 50 +++++++++++++++++++++ src/port/ui/ImguiUI.cpp | 4 ++ 12 files changed, 68 insertions(+) create mode 100644 include/hud.h create mode 100644 port/assets/textures/hud/sBoostGaugeArrow0 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow1 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow2 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow3 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow4 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow5 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow6 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow7 create mode 100644 port/assets/textures/hud/sBoostGaugeArrow8 diff --git a/include/hud.h b/include/hud.h new file mode 100644 index 00000000..924fce64 --- /dev/null +++ b/include/hud.h @@ -0,0 +1,14 @@ +#pragma once + +#include "gfx.h" +#include "sf64object.h" + +static const ALIGN_ASSET(2) char sBoostGaugeArrow0[] = "__OTR__assets/textures/hud/sBoostGaugeArrow0"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow1[] = "__OTR__assets/textures/hud/sBoostGaugeArrow1"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow2[] = "__OTR__assets/textures/hud/sBoostGaugeArrow2"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow3[] = "__OTR__assets/textures/hud/sBoostGaugeArrow3"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow4[] = "__OTR__assets/textures/hud/sBoostGaugeArrow4"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow5[] = "__OTR__assets/textures/hud/sBoostGaugeArrow5"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow6[] = "__OTR__assets/textures/hud/sBoostGaugeArrow6"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow7[] = "__OTR__assets/textures/hud/sBoostGaugeArrow7"; +static const ALIGN_ASSET(2) char sBoostGaugeArrow8[] = "__OTR__assets/textures/hud/sBoostGaugeArrow8"; \ No newline at end of file diff --git a/port/assets/textures/hud/sBoostGaugeArrow0 b/port/assets/textures/hud/sBoostGaugeArrow0 new file mode 100644 index 0000000000000000000000000000000000000000..775d711ac92fb6127c13d39c1ef976551e12fbaa GIT binary patch literal 2128 zcmZQzU|@)F4eb^ELTd2KgG`{z3~HG` zi7Oy(Am0R-eh`g6yl}}<&xH5Yd*5$e3xw}+*@a6S596p$mune92Y?J6wg)U%#H@LNe+Xp>p}V;t|#693=9w#z(`!- Vgijo%cWpL4RikpFAuw`7006hFmMH)L literal 0 HcmV?d00001 diff --git a/port/assets/textures/hud/sBoostGaugeArrow1 b/port/assets/textures/hud/sBoostGaugeArrow1 new file mode 100644 index 0000000000000000000000000000000000000000..42e7dab9d61bab6c1a1141a0707106ce0a889a6f GIT binary patch literal 2128 zcmZQzU|@)F4e-(*1 zVUQRdsA?cOdzM0IR5`*th_0yXikx0k!R+^h^&qQ&=r5kD$eAojj(!FPP`GVfyHpcm k60+IEu_5}vojNbuA3yR)F7dTsyR)MeIlZQWO?Zz>C3bO$tswo$l3@0F?CNlfZe0)3N3Q!B7?475 Z{Z8hk1SUOy!+_zwp7{D)s| zR6i&L@P`p@SxD%SZvv(Izwf>G{oK}T-=A0Gb|Y??t!t6sd)(@9$!uK@(!W#_VhS!* zxWw1K2k9%GtH>F39c%)LE`ZpY9SzsN9+yqH#3AnQS-LhGWEL(}xW%`=hnN6y32t?` WWxzT?p-7_Naho_QGa3TJD+B;n2bA{! literal 0 HcmV?d00001 diff --git a/port/assets/textures/hud/sBoostGaugeArrow5 b/port/assets/textures/hud/sBoostGaugeArrow5 new file mode 100644 index 0000000000000000000000000000000000000000..627b511be23073446c437b37ee22e836b66f3f21 GIT binary patch literal 2128 zcmZQzU|@)F4e()9wA2@3*!EsrE9Z6W)Y_cS=H9}5ECFS aL6#ww4b}+?MH2l^toftrMnhnzhX4RDo0bm% literal 0 HcmV?d00001 diff --git a/port/assets/textures/hud/sBoostGaugeArrow6 b/port/assets/textures/hud/sBoostGaugeArrow6 new file mode 100644 index 0000000000000000000000000000000000000000..304c22813fdc12c6ee256cd8650567420c5e0555 GIT binary patch literal 2128 zcmZQzU|@)F4ezb*Y}j^ zW?-O9KSVdVp+}i+nA<6}ogDpZv$w84xAorl?|aG7y>%@N?)~__n)I08x*nu|sV2k} zQuVKW57JjWSCKP28f?OQ(oBHZnk=cv8Fd}ZUQe2S1_p=;JxhV12y_Xly21LvApkLl Wbp22ltOtc7Il4#njE2DQ4*>vR;*%W! literal 0 HcmV?d00001 diff --git a/port/assets/textures/hud/sBoostGaugeArrow7 b/port/assets/textures/hud/sBoostGaugeArrow7 new file mode 100644 index 0000000000000000000000000000000000000000..e389976d919585568b650c918d081a5a4c57164a GIT binary patch literal 2128 zcmZQzU|@)F4eLyP=%x=4%s?j((^K S>p|g2y6vMnMnhmEga821F_cXJ literal 0 HcmV?d00001 diff --git a/port/assets/textures/hud/sBoostGaugeArrow8 b/port/assets/textures/hud/sBoostGaugeArrow8 new file mode 100644 index 0000000000000000000000000000000000000000..2db15458ebdd3c0fde1063f9171ea93db367b822 GIT binary patch literal 2128 zcmZQzU|@)F4eSaTlkRhJb+66dx_;~0Yg@nXg_%H#-CNhf;NFiA6G+j`zyQ&`R1-uWD<;+7 z5Z&3)ik!uBLF{wIcollected) { item->state = 1; + item->timer_48 = 0; gGoldRingCount[0]++; if (gGoldRingCount[0] == 3) { Object_PlayerSfx(gPlayer[item->playerNum].sfxSource, NA_SE_SHIELD_UPGRADE, item->playerNum); @@ -252,6 +254,51 @@ void OnItemGoldRingUpdate(ObjectUpdateEvent* event){ } } +static const char* sBoostGaugeArrow[] = { + sBoostGaugeArrow0, + sBoostGaugeArrow1, + sBoostGaugeArrow2, + sBoostGaugeArrow3, + sBoostGaugeArrow4, + sBoostGaugeArrow5, + sBoostGaugeArrow6, + sBoostGaugeArrow7, + sBoostGaugeArrow8, +}; + +void OnBoostGaugeDraw(IEvent* event){ + bool restore = CVarGetInteger("gRestoreOldBoostGauge", 0) == 1; + + if(!restore){ + return; + } + + event->cancelled = true; + u8 step = MIN(8, (u8) ((gPlayer[0].boostMeter / 90.0f) * ARRAY_COUNT(sBoostGaugeArrow))); + f32 x = 70; + f32 y = 30; + + RCP_SetupDL(&gMasterDisp, SETUPDL_76_POINT); + gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); + Lib_TextureRect_CI8(&gMasterDisp, D_1012290, D_10126B0, 48, 22, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH - x), y, 1.0f, 1.0f); + Lib_TextureRect_CI8(&gMasterDisp, D_10126F0, D_1012750, 24, 4, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH - (x - 9)), y + 3, 1.0f, 1.0f); + Lib_TextureRect_RGBA16(&gMasterDisp, sBoostGaugeArrow[step], 32, 32, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH - (x - 6)), y - 1, 0.9f, 0.9f); +} + +void OnBombCounterDraw(IEvent* ev){ + bool restore = CVarGetInteger("gRestoreOldBoostGauge", 0) == 1; + if(!restore){ + return; + } + + ev->cancelled = true; + HUD_BombCounter_Draw(253.0f, 18.0f); +} + +void OnLivesCounterDraw(IEvent* ev){ + ev->cancelled = CVarGetInteger("gRestoreOldBoostGauge", 0) == 1; +} + void PortEnhancements_Init() { PortEnhancements_Register(); @@ -259,6 +306,9 @@ void PortEnhancements_Init() { REGISTER_LISTENER(DisplayPostUpdateEvent, OnDisplayUpdatePost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(GamePostUpdateEvent, OnGameUpdatePost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(PlayerPostUpdateEvent, OnPlayerUpdatePost, EVENT_PRIORITY_NORMAL); + REGISTER_LISTENER(DrawBoostGaugeHUDEvent, OnBoostGaugeDraw, EVENT_PRIORITY_NORMAL); + REGISTER_LISTENER(DrawLivesCounterHUDEvent, OnLivesCounterDraw, EVENT_PRIORITY_NORMAL); + REGISTER_LISTENER(DrawBombCounterHUDEvent, OnBombCounterDraw, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(ObjectUpdateEvent, OnItemGoldRingUpdate, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(ObjectDrawPostSetupEvent, OnItemGoldRingDraw, EVENT_PRIORITY_NORMAL); diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 5cb3133e..49fe8e2f 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -473,6 +473,10 @@ void DrawEnhancementsMenu() { .tooltip = "Restores the beta coin that got replaced with the gold ring" }); + UIWidgets::CVarCheckbox("Beta: Restore old boost gauge", "gRestoreOldBoostGauge", { + .tooltip = "Restores the old boost gauge that was seen on some beta footage" + }); + ImGui::EndMenu(); }