Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 779e159

Browse files
committed
enable reveal
`reveal demon` is disabled due to double popup bug `reveal` also has guidance text that appears if the player is in graphics mode explaining the limitations of the new renderer
1 parent 9de09ac commit 779e159

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

plugins/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ dfhack_plugin(pathable pathable.cpp LINK_LIBRARIES lua)
151151
#add_subdirectory(remotefortressreader)
152152
#dfhack_plugin(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename)
153153
#add_subdirectory(rendermax)
154-
#dfhack_plugin(reveal reveal.cpp LINK_LIBRARIES lua)
154+
dfhack_plugin(reveal reveal.cpp LINK_LIBRARIES lua)
155155
#dfhack_plugin(search search.cpp)
156156
#dfhack_plugin(seedwatch seedwatch.cpp)
157157
#dfhack_plugin(showmood showmood.cpp)

plugins/reveal.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "modules/World.h"
1313
#include "modules/MapCache.h"
1414
#include "modules/Gui.h"
15+
#include "modules/Screen.h"
1516

1617
#include "df/block_square_event_frozen_liquidst.h"
1718
#include "df/construction.h"
@@ -184,16 +185,18 @@ command_result reveal(color_ostream &out, vector<string> & params)
184185
else if(params[i] == "help" || params[i] == "?")
185186
return CR_WRONG_USAGE;
186187
}
188+
auto& con = out;
187189
if(params.size() && params[0] == "hell")
188190
{
189191
no_hell = false;
190192
}
191193
if(params.size() && params[0] == "demon")
192194
{
193-
no_hell = false;
194-
pause = false;
195+
con.printerr("`reveal demon` is currently disabled to prevent a hang due to a bug in the base game\n");
196+
return CR_FAILURE;
197+
//no_hell = false;
198+
//pause = false;
195199
}
196-
auto & con = out;
197200
if(revealed != NOT_REVEALED)
198201
{
199202
con.printerr("Map is already revealed or this is a different map.\n");
@@ -256,7 +259,14 @@ command_result reveal(color_ostream &out, vector<string> & params)
256259
revealed = DEMON_REVEALED;
257260
}
258261
is_active = nopause_state || (revealed == REVEALED);
262+
bool graphics_mode = Screen::inGraphicsMode();
259263
con.print("Map revealed.\n");
264+
if (graphics_mode) {
265+
con.print("Note that in graphics mode, tiles that are not adjacent to open\n"
266+
"space will not render but can still be examined by hovering over\n"
267+
"them with the mouse. Switching to text mode (in the game settings)\n"
268+
"will allow the display the revealed tiles.\n");
269+
}
260270
if(!no_hell)
261271
con.print("Unpausing can unleash the forces of hell, so it has been temporarily disabled.\n");
262272
con.print("Run 'unreveal' to revert to previous state.\n");

0 commit comments

Comments
 (0)