Skip to content

Commit

Permalink
more explanation of what is happening
Browse files Browse the repository at this point in the history
and better handling of gui/reveal hell
  • Loading branch information
myk002 committed Jan 14, 2024
1 parent 089f07f commit 49114d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
7 changes: 4 additions & 3 deletions docs/gui/reveal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
25 changes: 20 additions & 5 deletions gui/reveal.lua
Original file line number Diff line number Diff line change
@@ -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')

--
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit 49114d1

Please sign in to comment.