1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Unhardcode textbox colors in textbox arguments

There's a few places where textboxes are constructed through code, but
they pass in the color's RGB values in manually. This commit
unhardcodes most of them them, replacing them with a color lookup.

The ones that weren't changed are special cases, like `175, 174, 174`.
This commit is contained in:
AllyTally 2023-03-18 19:11:49 -03:00 committed by Misa Elizabeth Kai
parent bd34af32de
commit efa1bad449
7 changed files with 101 additions and 86 deletions

View file

@ -6,7 +6,6 @@
#include <SDL.h>
#include <string>
#include <vector>
#include <map>
class CustomEntity
{

View file

@ -707,7 +707,7 @@ void Game::remaining_textbox(void)
SDL_strlcpy(buffer, loc::gettext("All Crew Members Rescued!"), sizeof(buffer));
}
graphics.createtextboxflipme(buffer, -1, 128 + 16, 174, 174, 174);
graphics.createtextboxflipme(buffer, -1, 128 + 16, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxpad(2, 2);
graphics.textboxcenterx();
@ -722,7 +722,7 @@ void Game::actionprompt_textbox(void)
"button:but",
vformat_button(ActionSet_InGame, Action_InGame_ACTION)
);
graphics.createtextboxflipme(buffer, -1, 196, 164, 164, 255);
graphics.createtextboxflipme(buffer, -1, 196, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxpad(1, 1);
graphics.textboxcenterx();
@ -737,7 +737,7 @@ void Game::savetele_textbox(void)
if (savetele())
{
graphics.createtextboxflipme(loc::gettext("Game Saved"), -1, 12, 174, 174, 174);
graphics.createtextboxflipme(loc::gettext("Game Saved"), -1, 12, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxpad(3, 3);
graphics.textboxcenterx();
@ -745,7 +745,7 @@ void Game::savetele_textbox(void)
}
else
{
graphics.createtextboxflipme(loc::gettext("ERROR: Could not save game!"), -1, 12, 255, 60, 60);
graphics.createtextboxflipme(loc::gettext("ERROR: Could not save game!"), -1, 12, TEXT_COLOUR("red"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxpad(1, 1);
@ -833,14 +833,14 @@ void Game::updatestate(void)
advancetext = true;
hascontrol = false;
setstate(3);
graphics.createtextbox("To do: write quick", 50, 80, 164, 164, 255);
graphics.createtextbox("To do: write quick", 50, 80, TEXT_COLOUR("cyan"));
graphics.addline("intro to story!");
graphics.textboxprintflags(PR_FONT_8X8);
//Oh no! what happen to rest of crew etc crash into dimension
break;
case 4:
//End of opening cutscene for now
graphics.createtextbox(BUTTONGLYPHS_get_wasd_text(), -1, 195, 174, 174, 174);
graphics.createtextbox(BUTTONGLYPHS_get_wasd_text(), -1, 195, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(4);
graphics.textboxcentertext();
@ -881,7 +881,7 @@ void Game::updatestate(void)
vformat_button(ActionSet_InGame, Action_InGame_Map)
);
graphics.createtextbox(buffer, -1, 155, 174, 174, 174);
graphics.createtextbox(buffer, -1, 155, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(4);
graphics.textboxcentertext();
@ -974,7 +974,7 @@ void Game::updatestate(void)
"floorceiling:str, crewmate:str",
floorceiling, crewmate
);
graphics.createtextbox(loc::gettext(english), -1, 3, 174, 174, 174);
graphics.createtextbox(loc::gettext(english), -1, 3, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxpadtowidth(36*8);
@ -1004,7 +1004,7 @@ void Game::updatestate(void)
default:
english = "You can't continue to the next room until they are safely across.";
}
graphics.createtextbox(loc::gettext(english), -1, 3, 174, 174, 174);
graphics.createtextbox(loc::gettext(english), -1, 3, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxpadtowidth(36*8);
@ -1047,7 +1047,7 @@ void Game::updatestate(void)
"floorceiling:str, crewmate:str",
floorceiling, crewmate
);
graphics.createtextbox(loc::gettext(english), -1, 3, 174, 174, 174);
graphics.createtextbox(loc::gettext(english), -1, 3, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxpadtowidth(36*8);
@ -1086,7 +1086,7 @@ void Game::updatestate(void)
obj.removetrigger(17);
if (BUTTONGLYPHS_keyboard_is_active())
{
graphics.createtextbox(loc::gettext("If you prefer, you can press UP or DOWN instead of ACTION to flip."), -1, 187, 174, 174, 174);
graphics.createtextbox(loc::gettext("If you prefer, you can press UP or DOWN instead of ACTION to flip."), -1, 187, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -1129,7 +1129,7 @@ void Game::updatestate(void)
"button:but",
vformat_button(ActionSet_InGame, Action_InGame_ACTION)
);
graphics.createtextbox(buffer, -1, 25, 174, 174, 174);
graphics.createtextbox(buffer, -1, 25, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(4);
graphics.textboxcentertext();
@ -1475,7 +1475,7 @@ void Game::updatestate(void)
case 50:
music.playef(15);
graphics.createtextbox(loc::gettext("Help! Can anyone hear this message?"), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("Help! Can anyone hear this message?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
incstate();
@ -1483,7 +1483,7 @@ void Game::updatestate(void)
break;
case 51:
music.playef(15);
graphics.createtextbox(loc::gettext("Verdigris? Are you out there? Are you ok?"), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("Verdigris? Are you out there? Are you ok?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
incstate();
@ -1491,7 +1491,7 @@ void Game::updatestate(void)
break;
case 52:
music.playef(15);
graphics.createtextbox(loc::gettext("Please help us! We've crashed and need assistance!"), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("Please help us! We've crashed and need assistance!"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
incstate();
@ -1499,7 +1499,7 @@ void Game::updatestate(void)
break;
case 53:
music.playef(15);
graphics.createtextbox(loc::gettext("Hello? Anyone out there?"), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("Hello? Anyone out there?"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
incstate();
@ -1507,7 +1507,7 @@ void Game::updatestate(void)
break;
case 54:
music.playef(15);
graphics.createtextbox(loc::gettext("This is Doctor Violet from the D.S.S. Souleye! Please respond!"), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("This is Doctor Violet from the D.S.S. Souleye! Please respond!"), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
incstate();
@ -1515,7 +1515,7 @@ void Game::updatestate(void)
break;
case 55:
music.playef(15);
graphics.createtextbox(loc::gettext("Please... Anyone..."), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("Please... Anyone..."), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
incstate();
@ -1523,7 +1523,7 @@ void Game::updatestate(void)
break;
case 56:
music.playef(15);
graphics.createtextbox(loc::gettext("Please be alright, everyone..."), 5, 8, 255, 134, 255);
graphics.createtextbox(loc::gettext("Please be alright, everyone..."), 5, 8, TEXT_COLOUR("purple"));
graphics.textboxcommsrelay();
graphics.textboxtimer(60);
setstate(50);
@ -1748,7 +1748,7 @@ void Game::updatestate(void)
}
break;
case 104:
graphics.createtextbox("I'm glad you're ok!", 135, 152, 164, 164, 255);
graphics.createtextbox("I'm glad you're ok!", 135, 152, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
@ -1772,7 +1772,7 @@ void Game::updatestate(void)
}
break;
case 108:
graphics.createtextbox("Don't worry! I have a", 125, 152, 164, 164, 255);
graphics.createtextbox("Don't worry! I have a", 125, 152, TEXT_COLOUR("cyan"));
graphics.addline("teleporter key!");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
@ -1788,7 +1788,7 @@ void Game::updatestate(void)
obj.entities[i].tile = 0;
obj.entities[i].state = 1;
}
graphics.createtextbox("Follow me!", 185, 154, 164, 164, 255);
graphics.createtextbox("Follow me!", 185, 154, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
@ -1870,7 +1870,7 @@ void Game::updatestate(void)
advancetext = true;
hascontrol = false;
graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, 255, 255, 134);
graphics.createtextbox("Captain! You're ok!", 60-10, 90-40, TEXT_COLOUR("yellow"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(14);
@ -1878,7 +1878,7 @@ void Game::updatestate(void)
}
case 124:
{
graphics.createtextbox("I've found a teleporter, but", 60-20, 90 - 40, 255, 255, 134);
graphics.createtextbox("I've found a teleporter, but", 60-20, 90 - 40, TEXT_COLOUR("yellow"));
graphics.addline("I can't get it to go anywhere...");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
@ -1887,14 +1887,14 @@ void Game::updatestate(void)
break;
}
case 126:
graphics.createtextbox("I can help with that!", 125, 152-40, 164, 164, 255);
graphics.createtextbox("I can help with that!", 125, 152-40, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
graphics.textboxactive();
break;
case 128:
graphics.createtextbox("I have the teleporter", 130, 152-35, 164, 164, 255);
graphics.createtextbox("I have the teleporter", 130, 152-35, TEXT_COLOUR("cyan"));
graphics.addline("codex for our ship!");
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
@ -1904,7 +1904,7 @@ void Game::updatestate(void)
case 130:
{
graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, 255, 255, 134);
graphics.createtextbox("Yey! Let's go home!", 60-30, 90-35, TEXT_COLOUR("yellow"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(14);
@ -2003,7 +2003,7 @@ void Game::updatestate(void)
//Found a trinket!
advancetext = true;
incstate();
graphics.createtextboxflipme(loc::gettext("Congratulations!\n\nYou have found a shiny trinket!"), 50, 85, 174, 174, 174);
graphics.createtextboxflipme(loc::gettext("Congratulations!\n\nYou have found a shiny trinket!"), 50, 85, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
int h = graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -2030,7 +2030,7 @@ void Game::updatestate(void)
"n_trinkets:int, max_trinkets:int",
trinkets(), max_trinkets
);
graphics.createtextboxflipme(buffer, 50, 95+h, 174, 174, 174);
graphics.createtextboxflipme(buffer, 50, 95+h, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -2071,7 +2071,7 @@ void Game::updatestate(void)
//Found a crewmate!
advancetext = true;
incstate();
graphics.createtextboxflipme(loc::gettext("Congratulations!\n\nYou have found a lost crewmate!"), 50, 85, 174, 174, 174);
graphics.createtextboxflipme(loc::gettext("Congratulations!\n\nYou have found a lost crewmate!"), 50, 85, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
int h = graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -2080,7 +2080,7 @@ void Game::updatestate(void)
if(cl.numcrewmates()-crewmates()==0)
{
graphics.createtextboxflipme(loc::gettext("All crewmates rescued!"), 50, 95+h, 174, 174, 174);
graphics.createtextboxflipme(loc::gettext("All crewmates rescued!"), 50, 95+h, TEXT_COLOUR("gray"));
}
else
{
@ -2091,7 +2091,7 @@ void Game::updatestate(void)
"n_crew:int",
cl.numcrewmates()-crewmates()
);
graphics.createtextboxflipme(buffer, 50, 95+h, 174, 174, 174);
graphics.createtextboxflipme(buffer, 50, 95+h, TEXT_COLOUR("gray"));
}
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(4);
@ -2299,7 +2299,7 @@ void Game::updatestate(void)
case 2510:
advancetext = true;
hascontrol = false;
graphics.createtextbox("Hello?", 125+24, 152-20, 164, 164, 255);
graphics.createtextbox("Hello?", 125+24, 152-20, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
@ -2308,7 +2308,7 @@ void Game::updatestate(void)
case 2512:
advancetext = true;
hascontrol = false;
graphics.createtextbox("Is anyone there?", 125+8, 152-24, 164, 164, 255);
graphics.createtextbox("Is anyone there?", 125+8, 152-24, TEXT_COLOUR("cyan"));
graphics.textboxprintflags(PR_FONT_8X8);
incstate();
music.playef(11);
@ -2849,7 +2849,7 @@ void Game::updatestate(void)
incstate();
setstatedelay(45+15);
graphics.createtextboxflipme(loc::gettext("All Crew Members Rescued!"), -1, 64, 0, 0, 0);
graphics.createtextboxflipme(loc::gettext("All Crew Members Rescued!"), -1, 64, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
char buffer[SCREEN_WIDTH_CHARS + 1];
timestringcenti(buffer, sizeof(buffer));
@ -2868,9 +2868,9 @@ void Game::updatestate(void)
"gamecomplete_n_trinkets:int",
trinkets()
);
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 84, 0,0,0);
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 84, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.createtextboxflipme(buffer, 180, 84, 0, 0, 0);
graphics.createtextboxflipme(buffer, 180, 84, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
break;
}
@ -2881,9 +2881,9 @@ void Game::updatestate(void)
const char* label = loc::gettext("Game Time:");
std::string tempstring = savetime;
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 96, 0,0,0);
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 96, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.createtextboxflipme(tempstring, 180, 96, 0, 0, 0);
graphics.createtextboxflipme(tempstring, 180, 96, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
break;
}
@ -2893,9 +2893,9 @@ void Game::updatestate(void)
setstatedelay(45);
const char* label = loc::gettext("Total Flips:");
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 123, 0,0,0);
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 123, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.createtextboxflipme(help.String(totalflips), 180, 123, 0, 0, 0);
graphics.createtextboxflipme(help.String(totalflips), 180, 123, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
break;
}
@ -2905,9 +2905,9 @@ void Game::updatestate(void)
setstatedelay(45+15);
const char* label = loc::gettext("Total Deaths:");
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 135, 0,0,0);
graphics.createtextboxflipme(label, 168-font::len(PR_FONT_INTERFACE, label), 135, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.createtextboxflipme(help.String(deathcounts), 180, 135, 0, 0, 0);
graphics.createtextboxflipme(help.String(deathcounts), 180, 135, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
break;
}
@ -2924,9 +2924,9 @@ void Game::updatestate(void)
"n_deaths:int",
hardestroomdeaths
);
graphics.createtextboxflipme(buffer, -1, 158, 0,0,0);
graphics.createtextboxflipme(buffer, -1, 158, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.createtextboxflipme(hardestroom, -1, 170, 0, 0, 0);
graphics.createtextboxflipme(hardestroom, -1, 170, TEXT_COLOUR("transparent"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
break;
}

View file

@ -18,6 +18,7 @@
#include "Music.h"
#include "RoomnameTranslator.h"
#include "Screen.h"
#include "Script.h"
#include "UtilityClass.h"
#include "VFormat.h"
#include "Vlogging.h"
@ -929,7 +930,8 @@ void Graphics::drawgui(void)
{
y = 240 - y - 8*sc;
}
font::print((sc==2 ? PR_2X : PR_1X) | PR_CEN, -1, y, translation, 164, 164, 255);
SDL_Color color = TEXT_COLOUR("cyan");
font::print((sc==2 ? PR_2X : PR_1X) | PR_CEN, -1, y, translation, color.r, color.g, color.b);
}
else
{
@ -1420,11 +1422,8 @@ void Graphics::textboxadjust(void)
void Graphics::createtextboxreal(
const std::string& t,
int xp,
int yp,
int r,
int g,
int b,
int xp, int yp,
int r, int g, int b,
bool flipme
) {
m = textboxes.size();
@ -1445,22 +1444,32 @@ void Graphics::createtextboxreal(
void Graphics::createtextbox(
const std::string& t,
int xp,
int yp,
int r,
int g,
int b
int xp, int yp,
SDL_Color color
) {
createtextboxreal(t, xp, yp, color.r, color.g, color.b, false);
}
void Graphics::createtextbox(
const std::string& t,
int xp, int yp,
int r, int g, int b
) {
createtextboxreal(t, xp, yp, r, g, b, false);
}
void Graphics::createtextboxflipme(
const std::string& t,
int xp,
int yp,
int r,
int g,
int b
int xp, int yp,
SDL_Color color
) {
createtextboxreal(t, xp, yp, color.r, color.g, color.b, true);
}
void Graphics::createtextboxflipme(
const std::string& t,
int xp, int yp,
int r, int g, int b
) {
createtextboxreal(t, xp, yp, r, g, b, true);
}

View file

@ -69,28 +69,29 @@ public:
void createtextboxreal(
const std::string& t,
int xp,
int yp,
int r,
int g,
int b,
int xp, int yp,
int r, int g, int b,
bool flipme
);
void createtextbox(
const std::string& t,
int xp,
int yp,
int r,
int g,
int b
int xp, int yp,
SDL_Color color
);
void createtextbox(
const std::string& t,
int xp, int yp,
int r, int g, int b
);
void createtextboxflipme(
const std::string& t,
int xp,
int yp,
int r,
int g,
int b
int xp, int yp,
SDL_Color color
);
void createtextboxflipme(
const std::string& t,
int xp, int yp,
int r, int g, int b
);
void textboxcenterx(void);

View file

@ -9,6 +9,7 @@
#include "Localization.h"
#include "LocalizationMaint.h"
#include "Map.h"
#include "Script.h"
#include "UtilityClass.h"
#include "VFormat.h"
@ -252,14 +253,14 @@ namespace roomname_translator
{
if (loc::save_roomname_explanation_to_files(map.custommode, game.roomx, game.roomy, explanation))
{
graphics.createtextboxflipme(success_message, -1, 176, 174, 174, 174);
graphics.createtextboxflipme(success_message, -1, 176, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_8X8);
graphics.textboxcenterx();
graphics.textboxtimer(25);
}
else
{
graphics.createtextboxflipme("ERROR: Could not save to all langs!", -1, 176, 255, 60, 60);
graphics.createtextboxflipme("ERROR: Could not save to all langs!", -1, 176, TEXT_COLOUR("red"));
graphics.textboxprintflags(PR_FONT_8X8);
graphics.textboxcenterx();
graphics.textboxtimer(50);
@ -270,14 +271,14 @@ namespace roomname_translator
{
if (loc::save_roomname_to_file(loc::lang, map.custommode, game.roomx, game.roomy, translation, NULL))
{
graphics.createtextboxflipme("Translation saved!", -1, 176, 174, 174, 174);
graphics.createtextboxflipme("Translation saved!", -1, 176, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_8X8);
graphics.textboxcenterx();
graphics.textboxtimer(25);
}
else
{
graphics.createtextboxflipme("ERROR: Could not save!", -1, 144, 255, 60, 60);
graphics.createtextboxflipme("ERROR: Could not save!", -1, 144, TEXT_COLOUR("red"));
graphics.addline("");
graphics.addline("1) Do the language files exist?");
graphics.addline("2) Make sure there is no \"lang\"");
@ -341,7 +342,7 @@ namespace roomname_translator
{
if (loc::lang == "en")
{
graphics.createtextboxflipme("ERROR: Can't add EN-EN translation", -1, 176, 255, 60, 60);
graphics.createtextboxflipme("ERROR: Can't add EN-EN translation", -1, 176, TEXT_COLOUR("red"));
graphics.textboxprintflags(PR_FONT_8X8);
graphics.textboxcenterx();
graphics.textboxtimer(50);

View file

@ -57,6 +57,7 @@ scriptclass::scriptclass(void)
void scriptclass::add_default_colours(void)
{
textbox_colours["player"] = graphics.getRGB(164, 164, 255);
textbox_colours["cyan"] = graphics.getRGB(164, 164, 255);
textbox_colours["red"] = graphics.getRGB(255, 60, 60);
textbox_colours["green"] = graphics.getRGB(144, 255, 144);
@ -1742,7 +1743,7 @@ void scriptclass::run(void)
graphics.textboxremovefast();
graphics.createtextboxflipme(loc::gettext("Congratulations!\n\nYou have found a shiny trinket!"), 50, 85, 174, 174, 174);
graphics.createtextboxflipme(loc::gettext("Congratulations!\n\nYou have found a shiny trinket!"), 50, 85, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
int h = graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -1769,7 +1770,7 @@ void scriptclass::run(void)
"n_trinkets:int, max_trinkets:int",
game.trinkets(), max_trinkets
);
graphics.createtextboxflipme(buffer, 50, 95+h, 174, 174, 174);
graphics.createtextboxflipme(buffer, 50, 95+h, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -1792,7 +1793,7 @@ void scriptclass::run(void)
graphics.textboxremovefast();
graphics.createtextbox(loc::gettext("Congratulations!\n\nYou have found the secret lab!"), 50, 85, 174, 174, 174);
graphics.createtextbox(loc::gettext("Congratulations!\n\nYou have found the secret lab!"), 50, 85, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(2);
graphics.textboxcentertext();
@ -1814,7 +1815,7 @@ void scriptclass::run(void)
{
graphics.textboxremovefast();
graphics.createtextbox(loc::gettext("The secret lab is separate from the rest of the game. You can now come back here at any time by selecting the new SECRET LAB option in the play menu."), 50, 85, 174, 174, 174);
graphics.createtextbox(loc::gettext("The secret lab is separate from the rest of the game. You can now come back here at any time by selecting the new SECRET LAB option in the play menu."), 50, 85, TEXT_COLOUR("gray"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxwrap(0);
graphics.textboxcenterx();

View file

@ -9,7 +9,11 @@
#define filllines(lines) commands.insert(commands.end(), lines, lines + SDL_arraysize(lines))
#ifdef SCRIPT_DEFINITION
#define TEXT_COLOUR(a) textbox_colours[a]
#else
#define TEXT_COLOUR(a) script.textbox_colours[a]
#endif
struct Script
{