fix refresh rect

This commit is contained in:
sonil 2022-10-24 16:01:53 +08:00
parent bd6db5ba7c
commit b4da17df58
2 changed files with 15 additions and 9 deletions

View File

@ -59,12 +59,7 @@ static bool gDisplayMonitorInitialized = false;
// The rectangle that display monitor occupies in the main interface window.
//
// 0x518510
static const Rect gDisplayMonitorRect = {
DISPLAY_MONITOR_X,
DISPLAY_MONITOR_Y,
DISPLAY_MONITOR_X + DISPLAY_MONITOR_WIDTH - 1,
DISPLAY_MONITOR_Y + DISPLAY_MONITOR_HEIGHT - 1,
};
static Rect gDisplayMonitorRect;
// 0x518520
static int gDisplayMonitorScrollDownButton = -1;
@ -106,6 +101,13 @@ static int gConsoleFilePrintCount = 0;
int displayMonitorInit()
{
if (!gDisplayMonitorInitialized) {
gDisplayMonitorRect = {
DISPLAY_MONITOR_X,
DISPLAY_MONITOR_Y,
DISPLAY_MONITOR_X + DISPLAY_MONITOR_WIDTH - 1,
DISPLAY_MONITOR_Y + DISPLAY_MONITOR_HEIGHT - 1,
};
int oldFont = fontGetCurrent();
fontSetCurrent(DISPLAY_MONITOR_FONT);

View File

@ -161,7 +161,7 @@ static int gSingleAttackButton = -1;
static int gInterfaceCurrentHand = HAND_LEFT;
// 0x518F7C
static const Rect gInterfaceBarMainActionRect = { 267 + 160, 26, 455 + 160, 93 };
static Rect gInterfaceBarMainActionRect;
// 0x518F8C
static int gChangeHandsButton = -1;
@ -172,7 +172,7 @@ static bool gInterfaceBarEndButtonsIsVisible = false;
// Combat mode curtains rect.
//
// 0x518FA0
static const Rect gInterfaceBarEndButtonsRect = { 580 + 160, 38, 637 + 160, 96 };
static Rect gInterfaceBarEndButtonsRect;
// 0x518FB0
static int gEndTurnButton = -1;
@ -181,7 +181,7 @@ static int gEndTurnButton = -1;
static int gEndCombatButton = -1;
// 0x518FD4
static const Rect gInterfaceBarActionPointsBarRect = { 316 + 160, 14, 406 + 160, 19 };
static Rect gInterfaceBarActionPointsBarRect;
// 0x518FE8
static IndicatorDescription gIndicatorDescriptions[INDICATOR_COUNT] = {
@ -356,6 +356,10 @@ int interfaceInit()
CustomInterfaceBarInit();
gInterfaceBarActionPointsBarRect = { 316 + ifaceOffset, 14, 406 + ifaceOffset, 19 };
gInterfaceBarEndButtonsRect = { 580 + ifaceOffset, 38, 637 + ifaceOffset, 96 };
gInterfaceBarMainActionRect = { 267 + ifaceOffset, 26, 455 + ifaceOffset, 93 };
gInterfaceBarInitialized = 1;
int interfaceBarWindowX = (screenGetWidth() - gInterfaceBarWidth) / 2;