Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui/settings-manager] fix position of settings restored message #1252

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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