1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 05:58:30 +02:00

Add an accessibility option to be able to see through the roomname

This is the variable dwgfx.translucentroomname and <translucentroomname>
in unlock.vvv.

This lets you see through the black background of the roomname at the
bottom of the screen, i.e. it makes the roomname background translucent.
So you can see if someone decides to hide pesky spikes there.
This commit is contained in:
Info Teddy 2020-01-24 20:43:04 -08:00 committed by Ethan Lee
parent c49ae404af
commit df83c2d494
6 changed files with 58 additions and 4 deletions

View File

@ -4443,6 +4443,11 @@ void Game::loadstats( mapclass& map, Graphics& dwgfx )
dwgfx.notextoutline = atoi(pText);
}
if (pKey == "translucentroomname")
{
dwgfx.translucentroomname = atoi(pText);
}
if (pKey == "flipButton")
{
SDL_GameControllerButton newButton;
@ -4656,6 +4661,10 @@ void Game::savestats( mapclass& _map, Graphics& _dwgfx )
msg->LinkEndChild(new TiXmlText(tu.String((int) _dwgfx.notextoutline).c_str()));
dataNode->LinkEndChild(msg);
msg = new TiXmlElement("translucentroomname");
msg->LinkEndChild(new TiXmlText(tu.String((int) _dwgfx.translucentroomname).c_str()));
dataNode->LinkEndChild(msg);
for (size_t i = 0; i < controllerButton_flip.size(); i += 1)
{
msg = new TiXmlElement("flipButton");
@ -7042,11 +7051,13 @@ void Game::createmenu( std::string t )
menuoptionsactive[4] = true;
menuoptions[5] = "load screen";
menuoptionsactive[5] = true;
menuoptions[6] = "return";
menuoptions[6] = "room name bg";
menuoptionsactive[6] = true;
nummenuoptions = 7;
menuxoff = -60;
menuyoff = 0;
menuoptions[7] = "return";
menuoptionsactive[7] = true;
nummenuoptions = 8;
menuxoff = -85;
menuyoff = -10;
}
else if(t == "controller")
{

View File

@ -122,6 +122,8 @@ Graphics::Graphics()
trinketg = 0;
trinketb = 0;
warprect = SDL_Rect();
translucentroomname = false;
}
Graphics::~Graphics()

View File

@ -277,6 +277,7 @@ public:
int warpskip, warpfcol, warpbcol;
bool translucentroomname;
};
#endif /* GRAPHICS_H */

View File

@ -746,6 +746,12 @@ SDL_assert(0 && "Remove open level dir");
music.playef(11, 10);
}
else if (game.currentmenuoption == 6)
{
// toggle translucent roomname BG
dwgfx.translucentroomname = !dwgfx.translucentroomname;
music.playef(11, 10);
}
else if (game.currentmenuoption == 7)
{
//back
music.playef(11, 10);

View File

@ -3447,6 +3447,14 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent
{
if(ed.roomnamehide<12) ed.roomnamehide++;
}
if (dwgfx.translucentroomname)
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 127);
}
else
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 255);
}
dwgfx.footerrect.y = 230+ed.roomnamehide;
SDL_BlitSurface(dwgfx.footerbuffer, NULL, dwgfx.backBuffer, &dwgfx.footerrect);
dwgfx.Print(5,231+ed.roomnamehide,ed.level[ed.levx+(ed.maxwidth*ed.levy)].roomname, 196, 196, 255 - help.glow, true);

View File

@ -553,6 +553,16 @@ void titlerender(Graphics& dwgfx, mapclass& map, Game& game, entityclass& obj, U
else
dwgfx.Print(-1, 75, "Fake loading screen is ON", tr, tg, tb, true);
}
else if (game.currentmenuoption == 6)
{
dwgfx.bigprint(-1, 30, "Room Name BG", tr, tg, tb, true);
dwgfx.Print( -1, 75, "Lets you see through what is behind", tr, tg, tb, true);
dwgfx.Print( -1, 85, "the name at the bottom of the screen.", tr, tg, tb, true);
if (dwgfx.translucentroomname)
dwgfx.Print(-1, 105, "Room name background is TRANSLUCENT", tr/2, tg/2, tb/2, true);
else
dwgfx.Print(-1, 105, "Room name background is OPAQUE", tr, tg, tb, true);
}
}
else if (game.currentmenuname == "playint1" || game.currentmenuname == "playint2")
{
@ -1552,6 +1562,14 @@ void gamerender(Graphics& dwgfx, mapclass& map, Game& game, entityclass& obj, Ut
if(map.extrarow==0 || (map.custommode && map.roomname!=""))
{
if (dwgfx.translucentroomname)
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 127);
}
else
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 255);
}
dwgfx.footerrect.y = 230;
SDL_BlitSurface(dwgfx.footerbuffer, NULL, dwgfx.backBuffer, &dwgfx.footerrect);
@ -2809,6 +2827,14 @@ void towerrender(Graphics& dwgfx, Game& game, mapclass& map, entityclass& obj, U
}
if (dwgfx.translucentroomname)
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 127);
}
else
{
SDL_SetSurfaceAlphaMod(dwgfx.footerbuffer, 255);
}
dwgfx.footerrect.y = 230;
SDL_BlitSurface(dwgfx.footerbuffer, NULL, dwgfx.backBuffer, &dwgfx.footerrect);
dwgfx.Print(5, 231, map.roomname, 196, 196, 255 - help.glow, true);