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

Fixed inventory dialogs.

parent 86562232
No related branches found
No related tags found
1 merge request!64Steamtech UI fix
......@@ -41,6 +41,8 @@ function _M:init(title, equip_actor, filter, action, on_select, inven_actor)
self.c_main_set = Tab.new{title="Main Set", default=not equip_actor.off_weapon_slots, fct=function() end, on_change=function(s) if s then self:switchSets("main") end end}
self.c_off_set = Tab.new{title="Off Set", default=equip_actor.off_weapon_slots, fct=function() end, on_change=function(s) if s then self:switchSets("off") end end}
local vsep = Separator.new{dir="horizontal", size=self.ih - 10}
-- Add tooltips
self.on_select = function(item)
if item.last_display_x and item.object then
......@@ -84,7 +86,7 @@ function _M:init(title, equip_actor, filter, action, on_select, inven_actor)
end
}
self.c_inven = Inventory.new{actor=inven_actor, inven=inven_actor:getInven("INVEN"), width=self.iw - 20 - self.c_doll.w, height=self.ih - 10, filter=filter,
self.c_inven = Inventory.new{actor=inven_actor, inven=inven_actor:getInven("INVEN"), width=self.iw - vsep.w - self.c_doll.w, height=self.ih - 10, filter=filter,
default_last_tabs = "all",
fct=function(item, sel, button, event) self:use(item, button, event) end,
select=function(item, sel) self:select(item) end,
......@@ -101,7 +103,7 @@ function _M:init(title, equip_actor, filter, action, on_select, inven_actor)
{left=self.c_main_set, top=0, ui=self.c_off_set},
{left=0, top=self.c_main_set, ui=self.c_doll},
{right=0, top=0, ui=self.c_inven},
{left=self.c_doll.w, top=5, ui=Separator.new{dir="horizontal", size=self.ih - 10}},
{left=self.c_doll.w, top=5, ui=vsep},
}
self:triggerHook{"EquipInvenDialog:makeUI", uis=uis}
......
......@@ -41,14 +41,15 @@ function _M:init(title, actor, filter, action)
on_select=function(ui, inven, item, o) self:select{item=item, object=o} end
}
self.c_desc = TextzoneList.new{width=self.iw - 20 - self.c_doll.w, height=self.ih, no_color_bleed=true}
local vsep = Separator.new{dir="horizontal", size=self.ih - 10}
self.c_desc = TextzoneList.new{width=self.iw - self.c_doll.w - vsep.w, height=self.ih, no_color_bleed=true}
self:loadUI{
{left=0, top=0, ui=self.c_main_set},
{left=self.c_main_set, top=0, ui=self.c_off_set},
{left=0, top=self.c_main_set, ui=self.c_doll},
{right=0, top=0, ui=self.c_desc},
{left=self.c_doll.w, top=5, ui=Separator.new{dir="horizontal", size=self.ih - 10}},
{left=self.c_doll, top=5, ui=vsep},
{left=vsep, right=0, top=0, ui=self.c_desc},
}
self:setFocus(self.c_doll)
self:setupUI()
......
......@@ -33,9 +33,10 @@ function _M:init(title, inven, filter, action, actor)
self.actor = actor
Dialog.init(self, title or "Inventory", math.max(800, game.w * 0.8), math.max(600, game.h * 0.8))
self.c_desc = TextzoneList.new{scrollbar = true, width=math.floor(self.iw / 2 - 10), height=self.ih}
local vsep = Separator.new{dir="horizontal", size=self.ih - 10}
self.c_desc = TextzoneList.new{scrollbar = true, width=math.floor(self.iw / 2 - vsep.w / 2), height=self.ih}
self.c_inven = Inventory.new{actor=actor, inven=inven, filter=filter, width=math.floor(self.iw / 2 - 10), height=self.ih - 10,
self.c_inven = Inventory.new{actor=actor, inven=inven, filter=filter, width=math.floor(self.iw / 2 - vsep.w / 2), height=self.ih - 10,
fct=function(item, sel, button, event) self:use(item, button, event) end,
select=function(item, force) self:select(item, force) end,
select_tab=function(item) self:select(item) end,
......@@ -55,7 +56,7 @@ function _M:init(title, inven, filter, action, actor)
self:loadUI{
{left=0, top=0, ui=self.c_inven},
{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_inven)
self:setupUI()
......
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