Merge pull request #2563 from ab9rf/5005-reveal

enable reveal for v50
develop
Myk 2023-01-06 12:48:26 -08:00 committed by GitHub
commit 394cc1a193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 6 deletions

@ -151,7 +151,7 @@ dfhack_plugin(pathable pathable.cpp LINK_LIBRARIES lua)
#add_subdirectory(remotefortressreader) #add_subdirectory(remotefortressreader)
#dfhack_plugin(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename) #dfhack_plugin(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename)
#add_subdirectory(rendermax) #add_subdirectory(rendermax)
#dfhack_plugin(reveal reveal.cpp LINK_LIBRARIES lua) dfhack_plugin(reveal reveal.cpp LINK_LIBRARIES lua)
#dfhack_plugin(search search.cpp) #dfhack_plugin(search search.cpp)
#dfhack_plugin(seedwatch seedwatch.cpp) #dfhack_plugin(seedwatch seedwatch.cpp)
#dfhack_plugin(showmood showmood.cpp) #dfhack_plugin(showmood showmood.cpp)

@ -12,6 +12,7 @@
#include "modules/World.h" #include "modules/World.h"
#include "modules/MapCache.h" #include "modules/MapCache.h"
#include "modules/Gui.h" #include "modules/Gui.h"
#include "modules/Screen.h"
#include "df/block_square_event_frozen_liquidst.h" #include "df/block_square_event_frozen_liquidst.h"
#include "df/construction.h" #include "df/construction.h"
@ -184,16 +185,18 @@ command_result reveal(color_ostream &out, vector<string> & params)
else if(params[i] == "help" || params[i] == "?") else if(params[i] == "help" || params[i] == "?")
return CR_WRONG_USAGE; return CR_WRONG_USAGE;
} }
auto& con = out;
if(params.size() && params[0] == "hell") if(params.size() && params[0] == "hell")
{ {
no_hell = false; no_hell = false;
} }
if(params.size() && params[0] == "demon") if(params.size() && params[0] == "demon")
{ {
no_hell = false; con.printerr("`reveal demon` is currently disabled to prevent a hang due to a bug in the base game\n");
pause = false; return CR_FAILURE;
//no_hell = false;
//pause = false;
} }
auto & con = out;
if(revealed != NOT_REVEALED) if(revealed != NOT_REVEALED)
{ {
con.printerr("Map is already revealed or this is a different map.\n"); con.printerr("Map is already revealed or this is a different map.\n");
@ -256,9 +259,16 @@ command_result reveal(color_ostream &out, vector<string> & params)
revealed = DEMON_REVEALED; revealed = DEMON_REVEALED;
} }
is_active = nopause_state || (revealed == REVEALED); is_active = nopause_state || (revealed == REVEALED);
con.print("Map revealed.\n"); bool graphics_mode = Screen::inGraphicsMode();
con.print("Map revealed.\n\n");
if (graphics_mode) {
con.print("Note that in graphics mode, tiles that are not adjacent to open\n"
"space will not render but can still be examined by hovering over\n"
"them with the mouse. Switching to text mode (in the game settings)\n"
"will allow the display the revealed tiles.\n\n");
}
if(!no_hell) if(!no_hell)
con.print("Unpausing can unleash the forces of hell, so it has been temporarily disabled.\n"); con.print("Unpausing can unleash the forces of hell, so it has been temporarily disabled.\n\n");
con.print("Run 'unreveal' to revert to previous state.\n"); con.print("Run 'unreveal' to revert to previous state.\n");
return CR_OK; return CR_OK;
} }