Skip to content
Snippets Groups Projects
Commit 1b77ff4a authored by Alex Ksandra's avatar Alex Ksandra
Browse files

Fixed various similar dialogs

parent b32abc2b
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,8 @@ function _M:init(party)
self:generateList()
self.c_list = ListColumns.new{width=math.floor(self.iw / 2 - 10), height=self.ih - 10, scrollbar=true, sortable=true, columns={
local vsep = Separator.new{dir="horizontal", size=self.ih - 10}
self.c_list = ListColumns.new{width=math.floor(self.iw / 2 - vsep.w / 2), height=self.ih - 10, scrollbar=true, sortable=true, columns={
{name="Ingredient", width=50, display_prop="name", sort="name"},
{name="Category", width=30, display_prop="cat", sort="cat"},
{name="Quantity", width=20, display_prop="nb", sort="nb"},
......@@ -44,7 +45,7 @@ function _M:init(party)
self:loadUI{
{left=0, top=0, ui=self.c_list},
{right=0, top=0, ui=self.c_desc},
{hcenter=0, top=5, ui=Separator.new{dir="horizontal", size=self.ih - 10}},
{hcenter=0, top=5, ui=vsep},
}
self:setFocus(self.c_list)
self:setupUI()
......
......@@ -35,11 +35,12 @@ function _M:init(title, actor)
Dialog.init(self, (title or "Lore").." ("..nb.."/"..total..")", game.w * 0.8, game.h * 0.8)
self.c_desc = TextzoneList.new{width=math.floor(self.iw / 2 - 10), scrollbar=true, height=self.ih}
local vsep = Separator.new{dir="horizontal", size=self.ih - 10}
self.c_desc = TextzoneList.new{width=math.floor(self.iw / 2 - vsep.w / 2), scrollbar=true, height=self.ih}
self:generateList()
self.c_list = ListColumns.new{width=math.floor(self.iw / 2 - 10), height=self.ih - 10, scrollbar=true, sortable=true, columns={
self.c_list = ListColumns.new{width=math.floor(self.iw / 2 - vsep.w / 2), height=self.ih - 10, scrollbar=true, sortable=true, columns={
{name="", width={40,"fixed"}, display_prop="order", sort="order"},
{name="Lore", width=60, display_prop="name", sort="name"},
{name="Category", width=40, display_prop="cat", sort="cat"},
......@@ -48,7 +49,7 @@ function _M:init(title, actor)
self:loadUI{
{left=0, top=0, ui=self.c_list},
{right=0, top=0, ui=self.c_desc},
{hcenter=0, top=5, ui=Separator.new{dir="horizontal", size=self.ih - 10}},
{hcenter=0, top=5, ui=vsep},
}
self:setFocus(self.c_list)
self:setupUI()
......
......@@ -44,7 +44,8 @@ function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, ac
if i then self.faction_image = {i:glTexture()} end
end
self.c_inven = Inventory.new{actor=actor_actor, inven=actor_inven, filter=actor_filter, width=math.floor(self.iw / 2 - 10), height=self.ih - 10,
local vsep = Separator.new{dir="horizontal", size=self.ih - 10}
self.c_inven = Inventory.new{actor=actor_actor, inven=actor_inven, filter=actor_filter, width=math.floor(self.iw / 2 - vsep.w / 2), height=self.ih - 10,
columns={
{name="", width={20,"fixed"}, display_prop="char", sort="id"},
{name="", width={24,"fixed"}, display_prop="object", direct_draw=function(item, x, y) item.object:toScreen(nil, x+4, y, 16, 16) end},
......@@ -80,7 +81,7 @@ function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, ac
return 0, 0, 0, 0, 0, 0
end
self.c_store = Inventory.new{actor=store_actor, inven=store_inven, filter=store_filter, width=math.floor(self.iw / 2 - 10), height=self.ih - 10, tabslist=false,
self.c_store = Inventory.new{actor=store_actor, inven=store_inven, filter=store_filter, width=math.floor(self.iw / 2 - vsep.w / 2), height=self.ih - 10, tabslist=false,
columns={
{name="", width={20,"fixed"}, display_prop="char", sort="id"},
{name="", width={24,"fixed"}, display_prop="object", direct_draw=direct_draw},
......@@ -97,7 +98,7 @@ function _M:init(title, store_inven, actor_inven, store_filter, actor_filter, ac
self:loadUI{
{left=0, top=0, ui=self.c_store},
{right=0, top=0, ui=self.c_inven},
{hcenter=0, top=5, ui=Separator.new{dir="horizontal", size=self.ih - 10}},
{hcenter=0, top=5, ui=vsep},
}
self.c_inven.c_inven.on_focus_change = function(ui_self, status) if status == true then self:select(ui_self.list[ui_self.sel]) end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment