From 49114d1abe4e2bf4d4cd9424525640da793e44cf Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 13 Jan 2024 21:41:04 -0800 Subject: [PATCH] more explanation of what is happening and better handling of gui/reveal hell --- docs/gui/reveal.rst | 7 ++++--- gui/reveal.lua | 25 ++++++++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/gui/reveal.rst b/docs/gui/reveal.rst index a909d7119d..caf450c4a8 100644 --- a/docs/gui/reveal.rst +++ b/docs/gui/reveal.rst @@ -26,6 +26,7 @@ Examples ``gui/reveal`` Reveal all "normal" terrain, but keep areas with late-game surprises hidden. ``gui/reveal hell`` - Fully reveal adamantine spires, gemstone pillars, and the underworld. Note - that keeping these areas unrevealed when you exit `gui/reveal` will trigger - all the surprise events immediately. + Fully reveal adamantine spires, gemstone pillars, and the underworld. The + game cannot be unpaused with these features revealed, so the choice to keep + the map unrevealed when you close `gui/reveal` is disabled when this option + is specified. diff --git a/gui/reveal.lua b/gui/reveal.lua index 7d05c31a48..8df7777459 100644 --- a/gui/reveal.lua +++ b/gui/reveal.lua @@ -1,8 +1,7 @@ --@ module = true +local dialogs = require('gui.dialogs') local gui = require('gui') -local guidm = require('gui.dwarfmode') -local utils = require('utils') local widgets = require('gui.widgets') -- @@ -12,24 +11,40 @@ local widgets = require('gui.widgets') Reveal = defclass(Reveal, widgets.Window) Reveal.ATTRS { frame_title='Reveal', - frame={w=29, h=10, r=2, t=18}, + frame={w=32, h=14, r=2, t=18}, autoarrange_subviews=true, autoarrange_gap=1, + hell=DEFAULT_NIL, } function Reveal:init() + if self.hell then + self.frame.h = 15 + end + self:addviews{ widgets.WrappedLabel{ text_to_wrap='The map is revealed. The game will be force paused until you close this window.', }, + widgets.WrappedLabel{ + text_to_wrap='Areas with event triggers are kept hidden to avoid spoilers.', + text_pen=COLOR_YELLOW, + visible=not self.hell, + }, + widgets.WrappedLabel{ + text_to_wrap='Areas with event triggers have been revealed. The map must be hidden again before unpausing.', + text_pen=COLOR_RED, + visible=self.hell, + }, widgets.ToggleHotkeyLabel{ view_id='unreveal', key='CUSTOM_SHIFT_R', - label='Unreveal on close', + label='Restore map on close:', options={ {label='Yes', value=true, pen=COLOR_GREEN}, {label='No', value=false, pen=COLOR_RED}, }, + enabled=not self.hell, }, } end @@ -53,7 +68,7 @@ function RevealScreen:init() end dfhack.run_command(command) - self:addviews{Reveal{}} + self:addviews{Reveal{hell=self.hell}} end function RevealScreen:onDismiss()