From 779e159512a6506c2c07c43a893b206db4e33b6a Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Fri, 6 Jan 2023 13:56:19 -0600 Subject: [PATCH 1/2] 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 --- plugins/CMakeLists.txt | 2 +- plugins/reveal.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index ac3f0f95a..319600439 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -151,7 +151,7 @@ dfhack_plugin(pathable pathable.cpp LINK_LIBRARIES lua) #add_subdirectory(remotefortressreader) #dfhack_plugin(rename rename.cpp LINK_LIBRARIES lua PROTOBUFS rename) #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(seedwatch seedwatch.cpp) #dfhack_plugin(showmood showmood.cpp) diff --git a/plugins/reveal.cpp b/plugins/reveal.cpp index 8d76bd54b..e5ed7aa4e 100644 --- a/plugins/reveal.cpp +++ b/plugins/reveal.cpp @@ -12,6 +12,7 @@ #include "modules/World.h" #include "modules/MapCache.h" #include "modules/Gui.h" +#include "modules/Screen.h" #include "df/block_square_event_frozen_liquidst.h" #include "df/construction.h" @@ -184,16 +185,18 @@ command_result reveal(color_ostream &out, vector & params) else if(params[i] == "help" || params[i] == "?") return CR_WRONG_USAGE; } + auto& con = out; if(params.size() && params[0] == "hell") { no_hell = false; } if(params.size() && params[0] == "demon") { - no_hell = false; - pause = false; + con.printerr("`reveal demon` is currently disabled to prevent a hang due to a bug in the base game\n"); + return CR_FAILURE; + //no_hell = false; + //pause = false; } - auto & con = out; if(revealed != NOT_REVEALED) { con.printerr("Map is already revealed or this is a different map.\n"); @@ -256,7 +259,14 @@ command_result reveal(color_ostream &out, vector & params) revealed = DEMON_REVEALED; } is_active = nopause_state || (revealed == REVEALED); + bool graphics_mode = Screen::inGraphicsMode(); con.print("Map revealed.\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"); + } if(!no_hell) con.print("Unpausing can unleash the forces of hell, so it has been temporarily disabled.\n"); con.print("Run 'unreveal' to revert to previous state.\n"); From 5e9ddd9a366bfb6b70a7bc6ba4725b5572408efd Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Fri, 6 Jan 2023 14:34:59 -0600 Subject: [PATCH 2/2] reveal: vertical whitespaec --- plugins/reveal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/reveal.cpp b/plugins/reveal.cpp index e5ed7aa4e..4a05f061f 100644 --- a/plugins/reveal.cpp +++ b/plugins/reveal.cpp @@ -260,15 +260,15 @@ command_result reveal(color_ostream &out, vector & params) } is_active = nopause_state || (revealed == REVEALED); bool graphics_mode = Screen::inGraphicsMode(); - con.print("Map revealed.\n"); + 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"); + "will allow the display the revealed tiles.\n\n"); } 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"); return CR_OK; }