1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-11-06 03:09:41 +01:00

Summary changes

This commit is contained in:
NyakoFox 2024-04-11 10:25:52 -03:00
parent 8f1bc82343
commit ac0079077d
2 changed files with 62 additions and 33 deletions

View file

@ -7434,6 +7434,12 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
option(loc::gettext("continue from quicksave")); option(loc::gettext("continue from quicksave"));
option(loc::gettext("return")); option(loc::gettext("return"));
menuyoff = 20; menuyoff = 20;
auto_buttons = false;
touch::create_menu_button(17, 65 - 20 - 32, 286, 90, "", 0);
touch::create_menu_button(17, 65 - 20 + 64, 286, 90, "", 1);
touch::create_menu_button(17, 65 - 20 + 160, 286, 26, loc::gettext("return"), 2);
break; break;
case Menu::startnodeathmode: case Menu::startnodeathmode:
option(loc::gettext("disable cutscenes")); option(loc::gettext("disable cutscenes"));

View file

@ -33,6 +33,8 @@ static int tr;
static int tg; static int tg;
static int tb; static int tb;
static bool dont_render_buttons;
struct MapRenderData struct MapRenderData
{ {
int zoom; int zoom;
@ -198,6 +200,38 @@ static inline void draw_skip_message()
); );
} }
static void draw_summary(Game::Summary* summary, int offset)
{
font::print(
PR_CEN, -1, 80 - 20 + offset,
loc::gettext_roomname_special(map.currentarea(summary->saverx, summary->savery)),
25, 255 - (help.glow / 2), 255 - (help.glow / 2)
);
for (int i = 0; i < 6; i++)
{
graphics.drawcrewman(169 - (3 * 42) + (i * 42), 95 - 20 + offset, i, summary->crewstats[i], true);
}
font::print(
0, 59, 132 - 20 + offset,
game.giventimestring(
summary->hours,
summary->minutes,
summary->seconds
),
255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)
);
char buffer[SCREEN_WIDTH_CHARS + 1];
vformat_buf(buffer, sizeof(buffer),
loc::gettext("{savebox_n_trinkets|wordy}"),
"savebox_n_trinkets:int",
summary->trinkets
);
font::print(PR_RIGHT, 262, 132 - 20 + offset, buffer, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2));
graphics.draw_sprite(34, 126 - 20 + offset, 50, graphics.col_clock);
graphics.draw_sprite(270, 126 - 20 + offset, 22, graphics.col_trinket);
}
static void menurender(void) static void menurender(void)
{ {
@ -1401,52 +1435,37 @@ static void menurender(void)
{ {
const char* title = NULL; const char* title = NULL;
struct Game::Summary* summary = NULL; struct Game::Summary* summary = NULL;
struct Game::Summary* telesummary = &game.last_telesave;
struct Game::Summary* quicksummary = &game.last_quicksave;
switch (game.currentmenuoption) switch (game.currentmenuoption)
{ {
case 0: case 0:
title = loc::gettext("Tele Save"); title = loc::gettext("Tele Save");
summary = &game.last_telesave; summary = telesummary;
break; break;
case 1: case 1:
title = loc::gettext("Quick Save"); title = loc::gettext("Quick Save");
summary = &game.last_quicksave; summary = quicksummary;
break; break;
} }
if (summary != NULL) if (key.using_touch)
{ {
graphics.drawpixeltextbox(17, 65-20, 286, 90, 65, 185, 207); dont_render_buttons = true;
touch::render_buttons(tr, tg, tb, true);
font::print(PR_2X | PR_CEN, -1, 20, title, tr, tg, tb); draw_summary(telesummary, -32 + 6);
font::print( draw_summary(quicksummary, 64 + 6);
PR_CEN, -1, 80-20,
loc::gettext_roomname_special(map.currentarea(summary->saverx, summary->savery)), font::print(PR_CEN | PR_BOR, -1, 32 - 16 + 2, loc::gettext("Tele Save"), 196, 196, 255 - help.glow);
25, 255 - (help.glow / 2), 255 - (help.glow / 2) font::print(PR_CEN | PR_BOR, -1, 128 - 16 + 2, loc::gettext("Quick Save"), 196, 196, 255 - help.glow);
);
for (int i = 0; i < 6; i++)
{
graphics.drawcrewman(169-(3*42)+(i*42), 95-20, i, summary->crewstats[i], true);
} }
font::print( else if (summary != NULL)
0, 59, 132-20, {
game.giventimestring( graphics.drawpixeltextbox(17, 65 - 20, 286, 90, 65, 185, 207);
summary->hours, font::print(PR_2X | PR_CEN, -1, 20, title, tr, tg, tb);
summary->minutes, draw_summary(summary, 0);
summary->seconds
),
255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2)
);
char buffer[SCREEN_WIDTH_CHARS + 1];
vformat_buf(buffer, sizeof(buffer),
loc::gettext("{savebox_n_trinkets|wordy}"),
"savebox_n_trinkets:int",
summary->trinkets
);
font::print(PR_RIGHT, 262, 132-20, buffer, 255 - (help.glow / 2), 255 - (help.glow / 2), 255 - (help.glow / 2));
graphics.draw_sprite(34, 126-20, 50, graphics.col_clock);
graphics.draw_sprite(270, 126-20, 22, graphics.col_trinket);
} }
break; break;
} }
@ -1938,6 +1957,7 @@ static void menurender(void)
void titlerender(void) void titlerender(void)
{ {
dont_render_buttons = false;
graphics.clear(); graphics.clear();
if (!game.menustart) if (!game.menustart)
{ {
@ -1990,9 +2010,12 @@ void titlerender(void)
if(tb>255) tb=255; if(tb>255) tb=255;
if (key.using_touch) if (key.using_touch)
{
if (!dont_render_buttons)
{ {
touch::render_buttons(tr, tg, tb); touch::render_buttons(tr, tg, tb);
} }
}
else else
{ {
graphics.drawmenu(tr, tg, tb, game.currentmenuname); graphics.drawmenu(tr, tg, tb, game.currentmenuname);