diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index ca63357f..b1f76234 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -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") { diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index 542b8f64..7afc923b 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -122,6 +122,8 @@ Graphics::Graphics() trinketg = 0; trinketb = 0; warprect = SDL_Rect(); + + translucentroomname = false; } Graphics::~Graphics() diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index 44ccc17b..717a79fd 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -277,6 +277,7 @@ public: int warpskip, warpfcol, warpbcol; + bool translucentroomname; }; #endif /* GRAPHICS_H */ diff --git a/desktop_version/src/Input.cpp b/desktop_version/src/Input.cpp index c595dd24..91b6ff16 100644 --- a/desktop_version/src/Input.cpp +++ b/desktop_version/src/Input.cpp @@ -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); diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 1a044215..e49063e5 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -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); diff --git a/desktop_version/src/titlerender.cpp b/desktop_version/src/titlerender.cpp index 2e2b1a69..ff9ea1ab 100644 --- a/desktop_version/src/titlerender.cpp +++ b/desktop_version/src/titlerender.cpp @@ -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);