diff --git a/game/engines/default/engine/ui/Dialog.lua b/game/engines/default/engine/ui/Dialog.lua index e5320c17d01c24e6b4644739782c8c367491ef2a..ed376c10b66f90dafbee80a6253fcebce999607d 100644 --- a/game/engines/default/engine/ui/Dialog.lua +++ b/game/engines/default/engine/ui/Dialog.lua @@ -396,27 +396,30 @@ function _M:setupUI(resizex, resizey, on_resize, addmw, addmh) for i, ui in ipairs(self.uis) do if not ui.absolute then + if ui.top and type(ui.top) == "table" then ui.top = self.ui_by_ui[ui.top].top + self.ui_by_ui[ui.top].ui.h + padding end + if ui.bottom and type(ui.bottom) == "table" then ui.bottom = self.ui_by_ui[ui.bottom].bottom + self.ui_by_ui[ui.bottom].ui.h + padding end + if ui.left and type(ui.left) == "table" then ui.left = self.ui_by_ui[ui.left].left + self.ui_by_ui[ui.left].ui.w + padding end + if ui.right and type(ui.right) == "table" then ui.right = self.ui_by_ui[ui.right].right + self.ui_by_ui[ui.right].ui.w + padding end + if ui.top then mh = math.max(mh, ui.top + ui.ui.h + (ui.padding_h or 0)) elseif ui.bottom then addh = math.max(addh, ui.bottom + ui.ui.h + (ui.padding_h or 0)) end - end -- print("ui", ui.left, ui.right, ui.ui.w) - if not ui.absolute then if ui.left then mw = math.max(mw, ui.left + ui.ui.w + (ui.padding_w or 0)) elseif ui.right then addw = math.max(addw, ui.right + ui.ui.w + (ui.padding_w or 0)) end end end -- print("===", mw, addw) - mw = mw + addw + 5 * 2 + (addmw or 0) + mw = mw + addw + 5 * 2 + (addmw or 0) + padding -- print("===", mw, addw) local tw, th = 0, 0 if self.title then tw, th = self.font_bold:size(self.title) end mw = math.max(tw + 6, mw) - mh = mh + addh + 5 + 22 + 3 + (addmh or 0) + th + mh = mh + addh + 5 + 22 + 3 + (addmh or 0) + th + padding if on_resize then on_resize(resizex and mw or self.w, resizey and mh or self.h) end self:resize(resizex and mw or self.w, resizey and mh or self.h) diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua index e7d09f4b7525e2e6a140d2fe15566b8c1a0afbfe..9f9de4ce7f64ee4a77b4cd61e3a0f296276c0267 100644 --- a/game/modules/tome/dialogs/Birther.lua +++ b/game/modules/tome/dialogs/Birther.lua @@ -938,7 +938,7 @@ function _M:loadPremadeUI() local sel = nil local sep = Separator.new{dir="horizontal", size=400} local desc = TextzoneList.new{width=220, height=400} - local list = List.new{width=600 - desc.w - sep.w, list=lss, height=400, + local list = List.new{width=350, list=lss, height=400, fct=function(item) local oldsel, oldscroll = list.sel, list.scroll if sel == item then self:loadPremade(sel) game:unregisterDialog(d) end @@ -966,8 +966,8 @@ function _M:loadPremadeUI() d:loadUI{ {left=0, top=0, ui=list}, - {left=list.w, top=0, ui=sep}, - {left=sep, right=0, top=0, ui=desc}, + {left=list, top=0, ui=sep}, + {right=0, top=0, ui=desc}, {left=0, bottom=0, ui=load}, {right=0, bottom=0, ui=del},