From 61eff23d8965d228ebf62e36b9b100e151900812 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Mon, 15 Jul 2024 22:57:29 -0700 Subject: [PATCH] Moved menu defines to header file Added FRLG signpost border Started working on LoadSignPostWindowFrameGfx --- graphics/text_window/signpost.png | Bin 0 -> 219 bytes include/menu.h | 7 +++++++ src/menu.c | 6 ------ src/script.c | 2 +- src/text_window.c | 8 ++++---- 5 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 graphics/text_window/signpost.png diff --git a/graphics/text_window/signpost.png b/graphics/text_window/signpost.png new file mode 100644 index 0000000000000000000000000000000000000000..a37c7d17c4a73d12d8b5394dea0950293ea801fd GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^8bGYT!VDxQHLDu~DT4r?5ZB_fOaA}=pOlnz_3GJY z9321m7Awr*nDT9kVbIwnN5283&YryoM9;o~7+J;DcCYzn0QIJMx;TbtOiWHtVEpjk zol*Wk)BlSMAs={z8aV$sirMfB+kDUa{w~yEL-qIF<{SsF?=Ej-34edj+=Nw->Hq%# zwIA~%9P4tLBIdHNM9A=o9O>a=W7C<~ru9Q!twU9D0cV}UjAIuV7%py!nV|a3jvZ(t NgQu&X%Q~loCIEb?Sgim6 literal 0 HcmV?d00001 diff --git a/include/menu.h b/include/menu.h index fac4ef1b65..42bd69d45c 100644 --- a/include/menu.h +++ b/include/menu.h @@ -5,6 +5,13 @@ #include "text.h" #include "window.h" +#define DLG_WINDOW_PALETTE_NUM 15 +#define DLG_WINDOW_BASE_TILE_NUM 0x200 +#define STD_WINDOW_PALETTE_NUM 14 +#define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) +#define STD_WINDOW_BASE_TILE_NUM 0x214 + + #define MENU_NOTHING_CHOSEN -2 #define MENU_B_PRESSED -1 diff --git a/src/menu.c b/src/menu.c index ff1970c3f1..1012a6b290 100644 --- a/src/menu.c +++ b/src/menu.c @@ -23,12 +23,6 @@ #include "config/overworld.h" #include "constants/songs.h" -#define DLG_WINDOW_PALETTE_NUM 15 -#define DLG_WINDOW_BASE_TILE_NUM 0x200 -#define STD_WINDOW_PALETTE_NUM 14 -#define STD_WINDOW_PALETTE_SIZE PLTT_SIZEOF(10) -#define STD_WINDOW_BASE_TILE_NUM 0x214 - struct MenuInfoIcon { u8 width; diff --git a/src/script.c b/src/script.c index 6188b5070c..98d679cd9f 100644 --- a/src/script.c +++ b/src/script.c @@ -509,7 +509,7 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize) void SetWalkingIntoSignVars(void) { - gWalkAwayFromSignpostTimer = 6; + gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; sMsgBoxIsCancelable = TRUE; } diff --git a/src/text_window.c b/src/text_window.c index d1e604d343..3cc3f7d47b 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -82,6 +82,8 @@ static const struct TilesPal sWindowFrames[WINDOW_FRAMES_COUNT] = {sTextWindowFrame20_Gfx, sTextWindowFrame20_Pal} }; +const u16 gSignpostWindow_Gfx[] = INCBIN_U16("graphics/text_window/signpost.4bpp"); + // code const struct TilesPal *GetWindowFrameTilesPal(u8 id) { @@ -199,8 +201,6 @@ void LoadUserWindowBorderGfxOnBg(u8 bg, u16 destOffset, u8 palOffset) void LoadSignPostWindowFrameGfx(void) { - // TODO signpost msgbox frames - //LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gUnknown_8470B0C, 0x260, destOffset); - //LoadPalette(GetWindowFrameTilesPal(1), palIdx, 32); - LoadMessageBoxAndBorderGfx(); + LoadBgTiles(GetWindowAttribute(0, WINDOW_BG), gSignpostWindow_Gfx, 0x260, DLG_WINDOW_BASE_TILE_NUM); + LoadPalette(GetTextWindowPalette(1), BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM), PLTT_SIZE_4BPP); }