summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--kamek_pal.x6
-rw-r--r--src/koopatlas/hud.cpp48
-rw-r--r--src/koopatlas/hud.h7
3 files changed, 54 insertions, 7 deletions
diff --git a/kamek_pal.x b/kamek_pal.x
index 02bc004..4955575 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -734,6 +734,7 @@ SECTIONS {
findTextBoxByName__Q23m2d17EmbedLayoutBase_cCFPCc = 0x80007320;
findPictureByName__Q23m2d17EmbedLayoutBase_cCFPCc = 0x800073D0;
findWindowByName__Q23m2d17EmbedLayoutBase_cCFPCc = 0x80007470;
+
__ct__Q23m2d13EmbedLayout_cFv = 0x800C89A0;
__dt__Q23m2d13EmbedLayout_cFv = 0x800C89F0;
loadArc__Q23m2d13EmbedLayout_cFPCcb = 0x800C8D00;
@@ -745,9 +746,14 @@ SECTIONS {
disableAllAnimations__Q23m2d13EmbedLayout_cFv = 0x800C95F0;
isAnimOn__Q23m2d13EmbedLayout_cFi = 0x800C9700;
isAnyAnimOn__Q23m2d13EmbedLayout_cFv = 0x800C9730;
+ setLangStrings__Q23m2d13EmbedLayout_cFPPCcPCiii = 0x800C9010;
free__Q23m2d13EmbedLayout_cFv = 0x800C9A20;
execAnimations__Q23m2d13EmbedLayout_cFv = 0x800C9650;
+
attachArc__Q23m2d8ResAcc_cFPvPCc = 0x801637A0;
+
+ setSpeed__Q23m2d11FrameCtrl_cFf = 0x80163920;
+
scheduleForDrawing__Q23m2d6Base_cFv = 0x80163990;
RenderEffects__Fii = 0x80093F10;
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp
index bdd51b0..b7e40d2 100644
--- a/src/koopatlas/hud.cpp
+++ b/src/koopatlas/hud.cpp
@@ -16,17 +16,19 @@ dWMHud_c::dWMHud_c() {
layoutLoaded = false;
}
+enum WMHudAnimation {
+ SHOW_LIVES = 0,
+ SHOW_HEADER,
+ SHOW_FOOTER
+};
+
int dWMHud_c::onCreate() {
if (!layoutLoaded) {
- bool gotFile = layout.loadArc("maphud.arc", false);
+ bool gotFile = layout.loadArc("MapHUD.arc", false);
if (!gotFile)
return false;
- //static const char *brlanNames[3] = {"maphud_hitbutton.brlan", "maphud_in.brlan", "maphud_out.brlan"};
- static const char *brlanNames[5] = {"maphud_hitbutton.brlan", "bottom_in.brlan", "bottom_out.brlan", "top_in.brlan", "top_out.brlan"};
- static const char *groupNames[6] = {"B01_Button", "B02_Button", "A00_Window", "A00_Window", "A01_Window", "A01_Window"};
-
bool output = layout.build("maphud.brlyt");
if (!IsWideScreen()) {
@@ -39,10 +41,19 @@ int dWMHud_c::onCreate() {
layout.layout.rootPane->scale.y = 0.7711f;
}
- layout.loadAnimations(brlanNames, 5);
- layout.loadGroups(groupNames, (int[6]){0, 0, 1, 2, 3, 4}, 6);
+ static const char *brlanNames[2] = {"MapHUD_ShowMain.brlan", "MapHUD_ShowHeader.brlan"};
+ static const char *groupNames[3] = {"G_Lives", "G_Header", "G_Footer"};
+
+ layout.loadAnimations(brlanNames, 2);
+ layout.loadGroups(groupNames, (int[3]){0, 1, 0}, 3);
layout.disableAllAnimations();
+ layout.enableNonLoopAnim(SHOW_LIVES);
+ layout.enableNonLoopAnim(SHOW_FOOTER);
+
+ static const char *tbNames[2] = {"MenuButtonInfo", "ItemsButtonInfo"};
+ layout.setLangStrings(tbNames, (int[2]){12, 15}, 4, 2);
+
layoutLoaded = true;
}
@@ -51,11 +62,17 @@ int dWMHud_c::onCreate() {
int dWMHud_c::onDelete() {
+ if (!layoutLoaded)
+ return true;
+
return layout.free();
}
int dWMHud_c::onExecute() {
+ if (!layoutLoaded)
+ return true;
+
layout.execAnimations();
layout.update();
@@ -64,8 +81,25 @@ int dWMHud_c::onExecute() {
int dWMHud_c::onDraw() {
+ if (!layoutLoaded)
+ return true;
+
layout.scheduleForDrawing();
return true;
}
+
+
+
+void dWMHud_c::playShowHeaderAnim() {
+ layout.enableNonLoopAnim(SHOW_HEADER);
+}
+
+void dWMHud_c::playHideHeaderAnim() {
+ if (layout.isAnimOn(SHOW_HEADER)) {
+ layout.enableNonLoopAnim(SHOW_HEADER, true);
+ }
+ layout.grpHandlers[SHOW_HEADER].frameCtrl.flags = 2; // NO_LOOP | REVERSE
+}
+
diff --git a/src/koopatlas/hud.h b/src/koopatlas/hud.h
index ac7b81e..87f731b 100644
--- a/src/koopatlas/hud.h
+++ b/src/koopatlas/hud.h
@@ -17,6 +17,13 @@ class dWMHud_c : public dBase_c {
static dWMHud_c *build();
static dWMHud_c *instance;
+
+
+ bool showingHeader;
+
+
+ void playShowHeaderAnim();
+ void playHideHeaderAnim();
};
#endif