Secondary map popup window updates time while active
This commit is contained in:
parent
fb360b1e41
commit
757ed7054d
@ -41,6 +41,7 @@ enum MapPopUp_Themes_BW
|
||||
|
||||
// static functions
|
||||
static void Task_MapNamePopUpWindow(u8 taskId);
|
||||
static void UpdateSecondaryPopUpWindow(u8 secondaryPopUpWindowId);
|
||||
static void ShowMapNamePopUpWindow(void);
|
||||
static void LoadMapNamePopUpWindowBg(void);
|
||||
|
||||
@ -423,6 +424,7 @@ static void Task_MapNamePopUpWindow(u8 taskId)
|
||||
break;
|
||||
case STATE_WAIT:
|
||||
// Wait while the window is fully onscreen.
|
||||
UpdateSecondaryPopUpWindow(GetSecondaryPopUpWindowId());
|
||||
if (++task->tOnscreenTimer > 120)
|
||||
{
|
||||
task->tOnscreenTimer = 0;
|
||||
@ -500,6 +502,20 @@ void HideMapNamePopUpWindow(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void UpdateSecondaryPopUpWindow(u8 secondaryPopUpWindowId)
|
||||
{
|
||||
u8 mapDisplayHeader[24];
|
||||
u8 *withoutPrefixPtr = &(mapDisplayHeader[0]);
|
||||
|
||||
if (OW_POPUP_BW_TIME_MODE != OW_POPUP_BW_TIME_NONE)
|
||||
{
|
||||
RtcCalcLocalTime();
|
||||
FormatDecimalTimeWithoutSeconds(withoutPrefixPtr, gLocalTime.hours, gLocalTime.minutes, OW_POPUP_BW_TIME_MODE == OW_POPUP_BW_TIME_24_HR);
|
||||
AddTextPrinterParameterized(secondaryPopUpWindowId, FONT_SMALL, mapDisplayHeader, GetStringRightAlignXOffset(FONT_SMALL, mapDisplayHeader, DISPLAY_WIDTH) - 5, 8, TEXT_SKIP_DRAW, NULL);
|
||||
}
|
||||
CopyWindowToVram(secondaryPopUpWindowId, COPYWIN_FULL);
|
||||
}
|
||||
|
||||
static void ShowMapNamePopUpWindow(void)
|
||||
{
|
||||
u8 mapDisplayHeader[24];
|
||||
@ -550,16 +566,8 @@ static void ShowMapNamePopUpWindow(void)
|
||||
if (OW_POPUP_GENERATION == GEN_5)
|
||||
{
|
||||
AddTextPrinterParameterized(mapNamePopUpWindowId, FONT_SHORT, mapDisplayHeader, 8, 2, TEXT_SKIP_DRAW, NULL);
|
||||
|
||||
if (OW_POPUP_BW_TIME_MODE != OW_POPUP_BW_TIME_NONE)
|
||||
{
|
||||
RtcCalcLocalTime();
|
||||
FormatDecimalTimeWithoutSeconds(withoutPrefixPtr, gLocalTime.hours, gLocalTime.minutes, OW_POPUP_BW_TIME_MODE == OW_POPUP_BW_TIME_24_HR);
|
||||
AddTextPrinterParameterized(secondaryPopUpWindowId, FONT_SMALL, mapDisplayHeader, GetStringRightAlignXOffset(FONT_SMALL, mapDisplayHeader, DISPLAY_WIDTH) - 5, 8, TEXT_SKIP_DRAW, NULL);
|
||||
}
|
||||
|
||||
CopyWindowToVram(mapNamePopUpWindowId, COPYWIN_FULL);
|
||||
CopyWindowToVram(secondaryPopUpWindowId, COPYWIN_FULL);
|
||||
UpdateSecondaryPopUpWindow(secondaryPopUpWindowId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user