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

Add text outline as an accessibility option

This commit is contained in:
Ethan Lee 2020-01-17 12:37:53 -05:00
parent 05229255f6
commit 6e9712f113
5 changed files with 60 additions and 23 deletions

View file

@ -4438,6 +4438,11 @@ void Game::loadstats( mapclass& map, Graphics& dwgfx )
skipfakeload = atoi(pText);
}
if (pKey == "notextoutline")
{
dwgfx.notextoutline = atoi(pText);
}
if (pKey == "flipButton")
{
SDL_GameControllerButton newButton;
@ -4647,6 +4652,10 @@ void Game::savestats( mapclass& _map, Graphics& _dwgfx )
msg->LinkEndChild(new TiXmlText(tu.String((int) skipfakeload).c_str()));
dataNode->LinkEndChild(msg);
msg = new TiXmlElement("notextoutline");
msg->LinkEndChild(new TiXmlText(tu.String((int) _dwgfx.notextoutline).c_str()));
dataNode->LinkEndChild(msg);
for (size_t i = 0; i < controllerButton_flip.size(); i += 1)
{
msg = new TiXmlElement("flipButton");
@ -7025,17 +7034,19 @@ void Game::createmenu( std::string t )
menuoptionsactive[0] = true;
menuoptions[1] = "screen effects";
menuoptionsactive[1] = true;
menuoptions[2] = "invincibility";
menuoptions[2] = "text outline";
menuoptionsactive[2] = true;
menuoptions[3] = "slowdown";
menuoptions[3] = "invincibility";
menuoptionsactive[3] = true;
menuoptions[4] = "load screen";
menuoptions[4] = "slowdown";
menuoptionsactive[4] = true;
menuoptions[5] = "return";
menuoptions[5] = "load screen";
menuoptionsactive[5] = true;
nummenuoptions = 6;
menuxoff = -40;
menuyoff = 16;
menuoptions[6] = "return";
menuoptionsactive[6] = true;
nummenuoptions = 7;
menuxoff = -60;
menuyoff = 0;
}
else if(t == "controller")
{

View file

@ -31,6 +31,7 @@ Graphics::Graphics()
showcutscenebars = false;
cutscenebarspos = 0;
notextoutline = false;
flipmode = false;
setflipmode = false;
@ -380,19 +381,22 @@ void Graphics::bprint( int x, int y, std::string t, int r, int g, int b, bool ce
{
//printmask(x, y, t, cen);
Print(x, y - 1, t, 0, 0, 0, cen);
if (cen)
if (!notextoutline)
{
//TODO find different
PrintOff(-1, y, t, 0, 0, 0, cen);
PrintOff(1, y, t, 0, 0, 0, cen);
Print(x, y - 1, t, 0, 0, 0, cen);
if (cen)
{
//TODO find different
PrintOff(-1, y, t, 0, 0, 0, cen);
PrintOff(1, y, t, 0, 0, 0, cen);
}
else
{
Print(x -1, y, t, 0, 0, 0, cen);
Print(x +1, y, t, 0, 0, 0, cen);
}
Print(x, y+1, t, 0, 0, 0, cen);
}
else
{
Print(x -1, y, t, 0, 0, 0, cen);
Print(x +1, y, t, 0, 0, 0, cen);
}
Print(x, y+1, t, 0, 0, 0, cen);
Print(x, y, t, r, g, b, cen);
}

View file

@ -216,6 +216,7 @@ public:
bool flipmode;
bool setflipmode;
bool notextoutline;
point tl;
//buffer objects. //TODO refactor buffer objects
SDL_Surface* backBuffer;

View file

@ -713,6 +713,13 @@ SDL_assert(0 && "Remove open level dir");
}
}
else if (game.currentmenuoption == 2)
{
//disable text outline
dwgfx.notextoutline = !dwgfx.notextoutline;
game.savestats(map, dwgfx);
music.playef(11, 10);
}
else if (game.currentmenuoption == 3)
{
//invincibility
if (!map.invincibility)
@ -726,20 +733,20 @@ SDL_assert(0 && "Remove open level dir");
}
music.playef(11, 10);
}
else if (game.currentmenuoption == 3)
else if (game.currentmenuoption == 4)
{
//change game speed
game.createmenu("setslowdown2");
map.nexttowercolour();
music.playef(11, 10);
}
else if (game.currentmenuoption == 4)
else if (game.currentmenuoption == 5)
{
// toggle fake load screen
game.skipfakeload = !game.skipfakeload;
music.playef(11, 10);
}
else if (game.currentmenuoption == 5)
else if (game.currentmenuoption == 6)
{
//back
music.playef(11, 10);

View file

@ -496,6 +496,20 @@ void titlerender(Graphics& dwgfx, mapclass& map, Game& game, entityclass& obj, U
}
}
else if (game.currentmenuoption == 2)
{
dwgfx.bigprint( -1, 40, "Text Outline", tr, tg, tb, true);
dwgfx.Print( -1, 75, "Disables outline on game text", tr, tg, tb, true);
// FIXME: Maybe do an outlined print instead? -flibit
if (!dwgfx.notextoutline)
{
dwgfx.Print( -1, 85, "Text outlines are ON.", tr, tg, tb, true);
}
else
{
dwgfx.Print( -1, 85, "Text outlines are OFF.", tr/2, tg/2, tb/2, true);
}
}
else if (game.currentmenuoption == 3)
{
dwgfx.bigprint( -1, 40, "Invincibility", tr, tg, tb, true);
dwgfx.Print( -1, 75, "Provided to help disabled gamers", tr, tg, tb, true);
@ -509,7 +523,7 @@ void titlerender(Graphics& dwgfx, mapclass& map, Game& game, entityclass& obj, U
dwgfx.Print( -1, 105, "Invincibility is off.", tr/2, tg/2, tb/2, true);
}
}
else if (game.currentmenuoption == 3)
else if (game.currentmenuoption == 4)
{
dwgfx.bigprint( -1, 40, "Game Speed", tr, tg, tb, true);
dwgfx.Print( -1, 75, "May be useful for disabled gamers", tr, tg, tb, true);
@ -531,7 +545,7 @@ void titlerender(Graphics& dwgfx, mapclass& map, Game& game, entityclass& obj, U
dwgfx.Print( -1, 105, "Game speed is at 40%", tr, tg, tb, true);
}
}
else if (game.currentmenuoption == 4)
else if (game.currentmenuoption == 5)
{
dwgfx.bigprint(-1, 30, "Fake Load Screen", tr, tg, tb, true);
if (game.skipfakeload)