summaryrefslogtreecommitdiff
path: root/plugins/reveal.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2012-03-11 22:25:30 +0100
committerPetr Mrázek2012-03-11 22:25:30 +0100
commit3b87f7bd3ad0d948211865cb2608ba75c35514bb (patch)
tree7c14d85f10632495147fc05f987dfdae9fd8d594 /plugins/reveal.cpp
parent32cc4c892889110644ebfeb5e4a2e5859bd057cf (diff)
downloaddfhack-3b87f7bd3ad0d948211865cb2608ba75c35514bb.tar.gz
dfhack-3b87f7bd3ad0d948211865cb2608ba75c35514bb.tar.bz2
dfhack-3b87f7bd3ad0d948211865cb2608ba75c35514bb.tar.xz
Add revforget command, lair plugin
revforget throws away data reveal keeps in order to be able to hide the revealed parts of the map lair allows marking the map as monster lair (or the opposite while using the 'reset' option)
Diffstat (limited to 'plugins/reveal.cpp')
-rw-r--r--plugins/reveal.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/reveal.cpp b/plugins/reveal.cpp
index ed9f1332..4109140d 100644
--- a/plugins/reveal.cpp
+++ b/plugins/reveal.cpp
@@ -62,6 +62,7 @@ command_result reveal(color_ostream &out, std::vector<std::string> & params);
command_result unreveal(color_ostream &out, std::vector<std::string> & params);
command_result revtoggle(color_ostream &out, std::vector<std::string> & params);
command_result revflood(color_ostream &out, std::vector<std::string> & params);
+command_result revforget(color_ostream &out, std::vector<std::string> & params);
command_result nopause(color_ostream &out, std::vector<std::string> & params);
DFHACK_PLUGIN("reveal");
@@ -73,6 +74,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <Plug
commands.push_back(PluginCommand("unreveal","Revert the map to its previous state.",unreveal));
commands.push_back(PluginCommand("revtoggle","Reveal/unreveal depending on state.",revtoggle));
commands.push_back(PluginCommand("revflood","Hide all, reveal all tiles reachable from cursor position.",revflood));
+ commands.push_back(PluginCommand("revforget", "Forget the current reveal data, allowing to use reveal again.",revforget));
commands.push_back(PluginCommand("nopause","Disable pausing (doesn't affect pause forced by reveal).",nopause));
return CR_OK;
}
@@ -466,3 +468,26 @@ command_result revflood(color_ostream &out, std::vector<std::string> & params)
delete MCache;
return CR_OK;
}
+
+command_result revforget(color_ostream &out, std::vector<std::string> & params)
+{
+ auto & con = out;
+ for(size_t i = 0; i < params.size();i++)
+ {
+ if(params[i] == "help" || params[i] == "?")
+ {
+ out.print("Forget the current reveal data, allowing to use reveal again.\n");
+ return CR_OK;
+ }
+ }
+ if(!revealed)
+ {
+ con.printerr("There's nothing to forget!\n");
+ return CR_FAILURE;
+ }
+ // give back memory.
+ hidesaved.clear();
+ revealed = NOT_REVEALED;
+ con.print("Reveal data forgotten!\n");
+ return CR_OK;
+}