Skip to content

Commit

Permalink
Merge pull request #1252 from myk002/myk_embark_overlay
Browse files Browse the repository at this point in the history
[gui/settings-manager] fix position of settings restored message
  • Loading branch information
myk002 authored Aug 2, 2024
2 parents 2705531 + a956c02 commit 819bcbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Template for new versions:
- `gui/unit-info-viewer`: correctly display skill levels when rust is involved
- `timestream`: fix dwarves spending too long eating and drinking
- `locate-ore`: fix sometimes selecting an incorrect tile when there are multiple mineral veins in a single map block
- `gui/settings-manager`: fix position of "settings restored" message on embark when the player has no saved embark profiles
- `build-now`: fix error when building buildings that (in previous DF versions) required the architecture labor
- `prioritize`: fix incorrect loading of persisted data on some OS types
- `list-waves`: no longer gets confused by units that leave the map and then return (e.g. squads who go out on raids)
Expand Down
10 changes: 8 additions & 2 deletions gui/settings-manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ DifficultyEmbarkNotificationOverlay.ATTRS {
default_pos={x=75, y=18},
viewscreens='setupdwarfgame/Default',
default_enabled=true,
frame={w=23, h=3},
frame={w=25, h=3},
}

function DifficultyEmbarkNotificationOverlay:init()
self:addviews{
widgets.Panel{
frame={t=0, w=25},
frame={h=3, b=0, w=25},
frame_style=gui.FRAME_MEDIUM,
frame_background=gui.CLEAR_PEN,
subviews={
Expand All @@ -197,6 +197,12 @@ function DifficultyEmbarkNotificationOverlay:preUpdateLayout(parent_rect)
self.frame.w = parent_rect.width - (self.frame.l or (self.default_pos.x - 1))
end

function DifficultyEmbarkNotificationOverlay:render(dc)
local scr = dfhack.gui.getDFViewscreen(true)
self.frame.h = #scr.embark_profile == 0 and 11 or 3
DifficultyEmbarkNotificationOverlay.super.render(self, dc)
end

local last_scr_type
dfhack.onStateChange[GLOBAL_KEY] = function(sc)
if sc ~= SC_VIEWSCREEN_CHANGED then return end
Expand Down

0 comments on commit 819bcbf

Please sign in to comment.