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:
parent
05229255f6
commit
6e9712f113
5 changed files with 60 additions and 23 deletions
|
@ -4438,6 +4438,11 @@ void Game::loadstats( mapclass& map, Graphics& dwgfx )
|
||||||
skipfakeload = atoi(pText);
|
skipfakeload = atoi(pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pKey == "notextoutline")
|
||||||
|
{
|
||||||
|
dwgfx.notextoutline = atoi(pText);
|
||||||
|
}
|
||||||
|
|
||||||
if (pKey == "flipButton")
|
if (pKey == "flipButton")
|
||||||
{
|
{
|
||||||
SDL_GameControllerButton newButton;
|
SDL_GameControllerButton newButton;
|
||||||
|
@ -4647,6 +4652,10 @@ void Game::savestats( mapclass& _map, Graphics& _dwgfx )
|
||||||
msg->LinkEndChild(new TiXmlText(tu.String((int) skipfakeload).c_str()));
|
msg->LinkEndChild(new TiXmlText(tu.String((int) skipfakeload).c_str()));
|
||||||
dataNode->LinkEndChild(msg);
|
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)
|
for (size_t i = 0; i < controllerButton_flip.size(); i += 1)
|
||||||
{
|
{
|
||||||
msg = new TiXmlElement("flipButton");
|
msg = new TiXmlElement("flipButton");
|
||||||
|
@ -7025,17 +7034,19 @@ void Game::createmenu( std::string t )
|
||||||
menuoptionsactive[0] = true;
|
menuoptionsactive[0] = true;
|
||||||
menuoptions[1] = "screen effects";
|
menuoptions[1] = "screen effects";
|
||||||
menuoptionsactive[1] = true;
|
menuoptionsactive[1] = true;
|
||||||
menuoptions[2] = "invincibility";
|
menuoptions[2] = "text outline";
|
||||||
menuoptionsactive[2] = true;
|
menuoptionsactive[2] = true;
|
||||||
menuoptions[3] = "slowdown";
|
menuoptions[3] = "invincibility";
|
||||||
menuoptionsactive[3] = true;
|
menuoptionsactive[3] = true;
|
||||||
menuoptions[4] = "load screen";
|
menuoptions[4] = "slowdown";
|
||||||
menuoptionsactive[4] = true;
|
menuoptionsactive[4] = true;
|
||||||
menuoptions[5] = "return";
|
menuoptions[5] = "load screen";
|
||||||
menuoptionsactive[5] = true;
|
menuoptionsactive[5] = true;
|
||||||
nummenuoptions = 6;
|
menuoptions[6] = "return";
|
||||||
menuxoff = -40;
|
menuoptionsactive[6] = true;
|
||||||
menuyoff = 16;
|
nummenuoptions = 7;
|
||||||
|
menuxoff = -60;
|
||||||
|
menuyoff = 0;
|
||||||
}
|
}
|
||||||
else if(t == "controller")
|
else if(t == "controller")
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,7 @@ Graphics::Graphics()
|
||||||
|
|
||||||
showcutscenebars = false;
|
showcutscenebars = false;
|
||||||
cutscenebarspos = 0;
|
cutscenebarspos = 0;
|
||||||
|
notextoutline = false;
|
||||||
|
|
||||||
flipmode = false;
|
flipmode = false;
|
||||||
setflipmode = false;
|
setflipmode = false;
|
||||||
|
@ -380,6 +381,8 @@ void Graphics::bprint( int x, int y, std::string t, int r, int g, int b, bool ce
|
||||||
{
|
{
|
||||||
|
|
||||||
//printmask(x, y, t, cen);
|
//printmask(x, y, t, cen);
|
||||||
|
if (!notextoutline)
|
||||||
|
{
|
||||||
Print(x, y - 1, t, 0, 0, 0, cen);
|
Print(x, y - 1, t, 0, 0, 0, cen);
|
||||||
if (cen)
|
if (cen)
|
||||||
{
|
{
|
||||||
|
@ -393,6 +396,7 @@ void Graphics::bprint( int x, int y, std::string t, int r, int g, int b, bool ce
|
||||||
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+1, t, 0, 0, 0, cen);
|
||||||
|
}
|
||||||
|
|
||||||
Print(x, y, t, r, g, b, cen);
|
Print(x, y, t, r, g, b, cen);
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,6 +216,7 @@ public:
|
||||||
|
|
||||||
bool flipmode;
|
bool flipmode;
|
||||||
bool setflipmode;
|
bool setflipmode;
|
||||||
|
bool notextoutline;
|
||||||
point tl;
|
point tl;
|
||||||
//buffer objects. //TODO refactor buffer objects
|
//buffer objects. //TODO refactor buffer objects
|
||||||
SDL_Surface* backBuffer;
|
SDL_Surface* backBuffer;
|
||||||
|
|
|
@ -713,6 +713,13 @@ SDL_assert(0 && "Remove open level dir");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (game.currentmenuoption == 2)
|
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
|
//invincibility
|
||||||
if (!map.invincibility)
|
if (!map.invincibility)
|
||||||
|
@ -726,20 +733,20 @@ SDL_assert(0 && "Remove open level dir");
|
||||||
}
|
}
|
||||||
music.playef(11, 10);
|
music.playef(11, 10);
|
||||||
}
|
}
|
||||||
else if (game.currentmenuoption == 3)
|
else if (game.currentmenuoption == 4)
|
||||||
{
|
{
|
||||||
//change game speed
|
//change game speed
|
||||||
game.createmenu("setslowdown2");
|
game.createmenu("setslowdown2");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
music.playef(11, 10);
|
music.playef(11, 10);
|
||||||
}
|
}
|
||||||
else if (game.currentmenuoption == 4)
|
else if (game.currentmenuoption == 5)
|
||||||
{
|
{
|
||||||
// toggle fake load screen
|
// toggle fake load screen
|
||||||
game.skipfakeload = !game.skipfakeload;
|
game.skipfakeload = !game.skipfakeload;
|
||||||
music.playef(11, 10);
|
music.playef(11, 10);
|
||||||
}
|
}
|
||||||
else if (game.currentmenuoption == 5)
|
else if (game.currentmenuoption == 6)
|
||||||
{
|
{
|
||||||
//back
|
//back
|
||||||
music.playef(11, 10);
|
music.playef(11, 10);
|
||||||
|
|
|
@ -496,6 +496,20 @@ void titlerender(Graphics& dwgfx, mapclass& map, Game& game, entityclass& obj, U
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (game.currentmenuoption == 2)
|
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.bigprint( -1, 40, "Invincibility", tr, tg, tb, true);
|
||||||
dwgfx.Print( -1, 75, "Provided to help disabled gamers", 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);
|
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.bigprint( -1, 40, "Game Speed", tr, tg, tb, true);
|
||||||
dwgfx.Print( -1, 75, "May be useful for disabled gamers", 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);
|
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);
|
dwgfx.bigprint(-1, 30, "Fake Load Screen", tr, tg, tb, true);
|
||||||
if (game.skipfakeload)
|
if (game.skipfakeload)
|
||||||
|
|
Loading…
Reference in a new issue