summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NewerProjectKP.yaml1
-rw-r--r--layouthax.yaml10
-rw-r--r--src/layouthax.cpp8
-rw-r--r--src/pregame.cpp16
4 files changed, 29 insertions, 6 deletions
diff --git a/NewerProjectKP.yaml b/NewerProjectKP.yaml
index 024e6cb..2aad64b 100644
--- a/NewerProjectKP.yaml
+++ b/NewerProjectKP.yaml
@@ -13,6 +13,7 @@ modules:
- processed/bugfixes.yaml
- processed/koopatlas.yaml
- processed/pregame.yaml
+ - processed/layouthax.yaml
- processed/animtiles.yaml
- processed/soundPlayer.yaml
- processed/bowserKey.yaml
diff --git a/layouthax.yaml b/layouthax.yaml
new file mode 100644
index 0000000..1c49950
--- /dev/null
+++ b/layouthax.yaml
@@ -0,0 +1,10 @@
+---
+source_files: [../src/layouthax.cpp]
+hooks:
+ - name: InsertPauseWindowText
+ src_addr_pal: 0x8015AC60
+ type: branch_insn
+ branch_type: b
+ target_func: 'InsertPauseWindowText'
+
+
diff --git a/src/layouthax.cpp b/src/layouthax.cpp
new file mode 100644
index 0000000..5e68f48
--- /dev/null
+++ b/src/layouthax.cpp
@@ -0,0 +1,8 @@
+#include <game.h>
+
+void LoadPregameStyleNameAndNumber(m2d::EmbedLayout_c *layout);
+extern "C" void InsertPauseWindowText(void *thing) {
+ m2d::EmbedLayout_c *el = (m2d::EmbedLayout_c*)(((u8*)thing)+0x70);
+ LoadPregameStyleNameAndNumber(el);
+}
+
diff --git a/src/pregame.cpp b/src/pregame.cpp
index 3a2e89c..0d8a78f 100644
--- a/src/pregame.cpp
+++ b/src/pregame.cpp
@@ -53,16 +53,15 @@ class PregameLytHandler {
extern char CurrentLevel;
extern char CurrentWorld;
-#include "fileload.h"
-void PregameLytHandler::hijack_loadLevelNumber() {
+void LoadPregameStyleNameAndNumber(m2d::EmbedLayout_c *layout) {
nw4r::lyt::TextBox
*LevelNumShadow, *LevelNum,
*LevelNameShadow, *LevelName;
- LevelNumShadow = layout.findTextBoxByName("LevelNumShadow");
- LevelNum = layout.findTextBoxByName("LevelNum");
- LevelNameShadow = layout.findTextBoxByName("LevelNameShadow");
- LevelName = layout.findTextBoxByName("LevelName");
+ LevelNumShadow = layout->findTextBoxByName("LevelNumShadow");
+ LevelNum = layout->findTextBoxByName("LevelNum");
+ LevelNameShadow = layout->findTextBoxByName("LevelNameShadow");
+ LevelName = layout->findTextBoxByName("LevelName");
// work out the thing now
dLevelInfo_c::entry_s *level = dLevelInfo_c::s_info.searchBySlot(CurrentWorld, CurrentLevel);
@@ -89,6 +88,11 @@ void PregameLytHandler::hijack_loadLevelNumber() {
LevelNameShadow->SetString(L"Not found in LevelInfo!");
LevelName->SetString(L"Not found in LevelInfo!");
}
+}
+
+#include "fileload.h"
+void PregameLytHandler::hijack_loadLevelNumber() {
+ LoadPregameStyleNameAndNumber(&layout);
nw4r::lyt::Picture *LevelSample;
LevelSample = layout.findPictureByName("LevelSample");