mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-19 12:08:34 +01:00
Use window constants in wallclock
This commit is contained in:
parent
77c3163cf0
commit
7449525428
@ -55,25 +55,28 @@ static void SpriteCB_AMIndicator(struct Sprite *sprite);
|
|||||||
#define PALTAG_WALL_CLOCK_MALE 0x1000
|
#define PALTAG_WALL_CLOCK_MALE 0x1000
|
||||||
#define PALTAG_WALL_CLOCK_FEMALE 0x1001
|
#define PALTAG_WALL_CLOCK_FEMALE 0x1001
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
PERIOD_AM,
|
PERIOD_AM,
|
||||||
PERIOD_PM,
|
PERIOD_PM,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
enum {
|
||||||
{
|
|
||||||
MOVE_NONE,
|
MOVE_NONE,
|
||||||
MOVE_BACKWARD,
|
MOVE_BACKWARD,
|
||||||
MOVE_FORWARD,
|
MOVE_FORWARD,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
WIN_MSG,
|
||||||
|
WIN_BUTTON_LABEL,
|
||||||
|
};
|
||||||
|
|
||||||
static const u32 sHand_Gfx[] = INCBIN_U32("graphics/wallclock/hand.4bpp.lz");
|
static const u32 sHand_Gfx[] = INCBIN_U32("graphics/wallclock/hand.4bpp.lz");
|
||||||
static const u16 sTextPrompt_Pal[] = INCBIN_U16("graphics/wallclock/text_prompt.gbapal"); // for "Cancel" or "Confirm"
|
static const u16 sTextPrompt_Pal[] = INCBIN_U16("graphics/wallclock/text_prompt.gbapal"); // for "Cancel" or "Confirm"
|
||||||
|
|
||||||
static const struct WindowTemplate sWindowTemplates[] =
|
static const struct WindowTemplate sWindowTemplates[] =
|
||||||
{
|
{
|
||||||
{
|
[WIN_MSG] = {
|
||||||
.bg = 0,
|
.bg = 0,
|
||||||
.tilemapLeft = 3,
|
.tilemapLeft = 3,
|
||||||
.tilemapTop = 17,
|
.tilemapTop = 17,
|
||||||
@ -82,7 +85,7 @@ static const struct WindowTemplate sWindowTemplates[] =
|
|||||||
.paletteNum = 14,
|
.paletteNum = 14,
|
||||||
.baseBlock = 512
|
.baseBlock = 512
|
||||||
},
|
},
|
||||||
{
|
[WIN_BUTTON_LABEL] = {
|
||||||
.bg = 2,
|
.bg = 2,
|
||||||
.tilemapLeft = 24,
|
.tilemapLeft = 24,
|
||||||
.tilemapTop = 16,
|
.tilemapTop = 16,
|
||||||
@ -717,8 +720,8 @@ void CB2_StartWallClock(void)
|
|||||||
|
|
||||||
WallClockInit();
|
WallClockInit();
|
||||||
|
|
||||||
AddTextPrinterParameterized(1, FONT_NORMAL, gText_Confirm3, 0, 1, 0, NULL);
|
AddTextPrinterParameterized(WIN_BUTTON_LABEL, FONT_NORMAL, gText_Confirm3, 0, 1, 0, NULL);
|
||||||
PutWindowTilemap(1);
|
PutWindowTilemap(WIN_BUTTON_LABEL);
|
||||||
ScheduleBgCopyTilemapToVram(2);
|
ScheduleBgCopyTilemapToVram(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,8 +768,8 @@ void CB2_ViewWallClock(void)
|
|||||||
|
|
||||||
WallClockInit();
|
WallClockInit();
|
||||||
|
|
||||||
AddTextPrinterParameterized(1, FONT_NORMAL, gText_Cancel4, 0, 1, 0, NULL);
|
AddTextPrinterParameterized(WIN_BUTTON_LABEL, FONT_NORMAL, gText_Cancel4, 0, 1, 0, NULL);
|
||||||
PutWindowTilemap(1);
|
PutWindowTilemap(WIN_BUTTON_LABEL);
|
||||||
ScheduleBgCopyTilemapToVram(2);
|
ScheduleBgCopyTilemapToVram(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -829,9 +832,9 @@ static void Task_SetClock_HandleInput(u8 taskId)
|
|||||||
|
|
||||||
static void Task_SetClock_AskConfirm(u8 taskId)
|
static void Task_SetClock_AskConfirm(u8 taskId)
|
||||||
{
|
{
|
||||||
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x250, 0x0d);
|
DrawStdFrameWithCustomTileAndPalette(WIN_MSG, FALSE, 0x250, 0x0d);
|
||||||
AddTextPrinterParameterized(0, FONT_NORMAL, gText_IsThisTheCorrectTime, 0, 1, 0, NULL);
|
AddTextPrinterParameterized(WIN_MSG, FONT_NORMAL, gText_IsThisTheCorrectTime, 0, 1, 0, NULL);
|
||||||
PutWindowTilemap(0);
|
PutWindowTilemap(WIN_MSG);
|
||||||
ScheduleBgCopyTilemapToVram(0);
|
ScheduleBgCopyTilemapToVram(0);
|
||||||
CreateYesNoMenu(&sWindowTemplate_ConfirmYesNo, 0x250, 0x0d, 1);
|
CreateYesNoMenu(&sWindowTemplate_ConfirmYesNo, 0x250, 0x0d, 1);
|
||||||
gTasks[taskId].func = Task_SetClock_HandleConfirmInput;
|
gTasks[taskId].func = Task_SetClock_HandleConfirmInput;
|
||||||
@ -848,8 +851,8 @@ static void Task_SetClock_HandleConfirmInput(u8 taskId)
|
|||||||
case 1: // NO
|
case 1: // NO
|
||||||
case MENU_B_PRESSED:
|
case MENU_B_PRESSED:
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
ClearStdWindowAndFrameToTransparent(0, FALSE);
|
ClearStdWindowAndFrameToTransparent(WIN_MSG, FALSE);
|
||||||
ClearWindowTilemap(0);
|
ClearWindowTilemap(WIN_MSG);
|
||||||
gTasks[taskId].func = Task_SetClock_HandleInput;
|
gTasks[taskId].func = Task_SetClock_HandleInput;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user