diff --git a/docs/changelog.txt b/docs/changelog.txt index a78b14fc7..71bbd00a4 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -55,6 +55,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - `getplants`: ID values will now be accepted regardless of case -@ New borders for DFHack tool windows -- tell us what you think! - `gui/control-panel`: new global hotkey: tilde (Shift-backtick on most keyboards) +- Windows now display "PAUSE FORCED" on the lower border if the tool is forcing the game to pause ## Documentation -@ Quickstart guide has been updated with info on new window behavior and how to use the control panel diff --git a/library/lua/gui.lua b/library/lua/gui.lua index 061444f5d..9e69f961c 100644 --- a/library/lua/gui.lua +++ b/library/lua/gui.lua @@ -886,7 +886,7 @@ local BASE_FRAME = { title_pen = to_pen{ fg=COLOR_BLACK, bg=COLOR_GREY }, inactive_title_pen = to_pen{ fg=COLOR_GREY, bg=COLOR_BLACK }, signature_pen = to_pen{ fg=COLOR_GREY, bg=COLOR_BLACK }, - paused_pen = to_pen{tile=782, ch=216, fg=COLOR_GREY, bg=COLOR_BLACK}, + paused_pen = to_pen{fg=COLOR_RED, bg=COLOR_BLACK}, } local function make_frame(name, double_line) @@ -946,19 +946,8 @@ function paint_frame(dc,rect,style,title,inactive,pause_forced,resizable) end if pause_forced then - -- get the tiles for the activated pause symbol - local pause_texpos_ul = dfhack.screen.findGraphicsTile('INTERFACE_BITS', 18, 28) - local pause_texpos_ur = dfhack.screen.findGraphicsTile('INTERFACE_BITS', 19, 28) - local pause_texpos_ll = dfhack.screen.findGraphicsTile('INTERFACE_BITS', 18, 29) - local pause_texpos_lr = dfhack.screen.findGraphicsTile('INTERFACE_BITS', 19, 29) - if not pause_texpos_ul then - dscreen.paintTile(style.paused_pen, x2-1, y1) - else - dscreen.paintTile(style.paused_pen, x2-2, y1-1, nil, pause_texpos_ul) - dscreen.paintTile(style.paused_pen, x2-1, y1-1, nil, pause_texpos_ur) - dscreen.paintTile(style.paused_pen, x2-2, y1, nil, pause_texpos_ll) - dscreen.paintTile(style.paused_pen, x2-1, y1, nil, pause_texpos_lr) - end + dscreen.paintString(style.paused_pen or style.title_pen or pen, + x1+2, y2, ' PAUSE FORCED ') end end diff --git a/library/lua/gui/widgets.lua b/library/lua/gui/widgets.lua index 0696459cd..ce8e27ff5 100644 --- a/library/lua/gui/widgets.lua +++ b/library/lua/gui/widgets.lua @@ -271,26 +271,6 @@ local function Panel_on_double_click(self) Panel_update_frame(self, frame, true) end -local function panel_mouse_is_on_pause_icon(self) - local frame_rect = self.frame_rect - local x,y = dscreen.getMousePos() - return (x == frame_rect.x2-2 or x == frame_rect.x2-1) - and (y == frame_rect.y1-1 or y == frame_rect.y1) -end - -local function panel_has_pause_icon(self) - return self.parent_view and self.parent_view.force_pause -end - -function Panel:getMouseFramePos() - local x,y = Panel.super.getMouseFramePos(self) - if x then return x, y end - if panel_has_pause_icon(self) and panel_mouse_is_on_pause_icon(self) then - local frame_rect = self.frame_rect - return frame_rect.width - 3, 0 - end -end - function Panel:onInput(keys) if self.kbd_get_pos then if keys.SELECT or keys.LEAVESCREEN or keys._MOUSE_R_DOWN then