Modify popup message
This commit is contained in:
parent
398b9f4b99
commit
9b2fc5f14c
2 changed files with 18 additions and 8 deletions
6
assets.h
6
assets.h
|
@ -40,12 +40,12 @@ static const char *LCR_texts[] =
|
||||||
"sound",
|
"sound",
|
||||||
"save repl",
|
"save repl",
|
||||||
"exit",
|
"exit",
|
||||||
|
|
||||||
#define LCR_TEXTS_LOADING 10
|
#define LCR_TEXTS_LOADING 10
|
||||||
"loading",
|
"loading",
|
||||||
|
|
||||||
#define LCR_TEXTS_SAVED 11
|
#define LCR_TEXTS_SAVED 11
|
||||||
"saved"
|
"saved",
|
||||||
|
#define LCR_TEXTS_FAIL 12
|
||||||
|
"failed"
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LCR_VERSION "0.1d"
|
#define LCR_VERSION "0.1d"
|
||||||
|
|
20
game.h
20
game.h
|
@ -1056,14 +1056,22 @@ void LCR_gameTimeToStr(uint32_t timeMS, char *str)
|
||||||
|
|
||||||
void LCR_gameDrawPopupMessage(void)
|
void LCR_gameDrawPopupMessage(void)
|
||||||
{
|
{
|
||||||
int textH = LCR_rendererComputeTextHeight(5);
|
#define TEXT_SIZE 5
|
||||||
int textW = LCR_rendererComputeTextWidth(LCR_game.popupStr,5);
|
#define OFFSET_V (LCR_EFFECTIVE_RESOLUTION_Y / 6)
|
||||||
|
#define TEXT_PAD (LCR_EFFECTIVE_RESOLUTION_Y / 64)
|
||||||
|
|
||||||
LCR_rendererDrawRect((LCR_EFFECTIVE_RESOLUTION_X - textW) / 2 - 6,4,
|
int textH = LCR_rendererComputeTextHeight(TEXT_SIZE);
|
||||||
textW + 12,textH + 8,0xffff,1);
|
int textW = LCR_rendererComputeTextWidth(LCR_game.popupStr,TEXT_SIZE);
|
||||||
|
|
||||||
|
LCR_rendererDrawRect((LCR_EFFECTIVE_RESOLUTION_X - textW - 2 * TEXT_PAD) / 2,
|
||||||
|
OFFSET_V,textW + 2 * TEXT_PAD,textH + 2 * TEXT_PAD,0xffff,1);
|
||||||
|
|
||||||
LCR_rendererDrawText(LCR_game.popupStr,(LCR_EFFECTIVE_RESOLUTION_X - textW)
|
LCR_rendererDrawText(LCR_game.popupStr,(LCR_EFFECTIVE_RESOLUTION_X - textW)
|
||||||
/ 2,8,0x0300,5);
|
/ 2,OFFSET_V + TEXT_PAD,0x0300,TEXT_SIZE);
|
||||||
|
|
||||||
|
#undef TEXT_PAD
|
||||||
|
#undef OFFSET_V
|
||||||
|
#undef TEXT_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
void LCR_gameDraw3DView(void)
|
void LCR_gameDraw3DView(void)
|
||||||
|
@ -1343,6 +1351,8 @@ void LCR_gameHandleInput(void)
|
||||||
case 3:
|
case 3:
|
||||||
if (LCR_game.statePrev == LCR_GAME_STATE_RUN_FINISHED)
|
if (LCR_game.statePrev == LCR_GAME_STATE_RUN_FINISHED)
|
||||||
LCR_gameSaveReplay();
|
LCR_gameSaveReplay();
|
||||||
|
else
|
||||||
|
LCR_gamePopupMessage(LCR_texts[LCR_TEXTS_FAIL]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue