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
No related merge requests found
...@@ -41,6 +41,8 @@ function _M:init(title, equip_actor, filter, action, on_select, inven_actor) ...@@ -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_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} 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 -- Add tooltips
self.on_select = function(item) self.on_select = function(item)
if item.last_display_x and item.object then 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) ...@@ -84,7 +86,7 @@ function _M:init(title, equip_actor, filter, action, on_select, inven_actor)
end 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", default_last_tabs = "all",
fct=function(item, sel, button, event) self:use(item, button, event) end, fct=function(item, sel, button, event) self:use(item, button, event) end,
select=function(item, sel) self:select(item) 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) ...@@ -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=self.c_main_set, top=0, ui=self.c_off_set},
{left=0, top=self.c_main_set, ui=self.c_doll}, {left=0, top=self.c_main_set, ui=self.c_doll},
{right=0, top=0, ui=self.c_inven}, {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} self:triggerHook{"EquipInvenDialog:makeUI", uis=uis}
......
...@@ -41,14 +41,15 @@ function _M:init(title, actor, filter, action) ...@@ -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 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{ self:loadUI{
{left=0, top=0, ui=self.c_main_set}, {left=0, top=0, ui=self.c_main_set},
{left=self.c_main_set, top=0, ui=self.c_off_set}, {left=self.c_main_set, top=0, ui=self.c_off_set},
{left=0, top=self.c_main_set, ui=self.c_doll}, {left=0, top=self.c_main_set, ui=self.c_doll},
{right=0, top=0, ui=self.c_desc}, {left=self.c_doll, top=5, ui=vsep},
{left=self.c_doll.w, top=5, ui=Separator.new{dir="horizontal", size=self.ih - 10}}, {left=vsep, right=0, top=0, ui=self.c_desc},
} }
self:setFocus(self.c_doll) self:setFocus(self.c_doll)
self:setupUI() self:setupUI()
......
...@@ -33,9 +33,10 @@ function _M:init(title, inven, filter, action, actor) ...@@ -33,9 +33,10 @@ function _M:init(title, inven, filter, action, actor)
self.actor = actor self.actor = actor
Dialog.init(self, title or "Inventory", math.max(800, game.w * 0.8), math.max(600, game.h * 0.8)) 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, fct=function(item, sel, button, event) self:use(item, button, event) end,
select=function(item, force) self:select(item, force) end, select=function(item, force) self:select(item, force) end,
select_tab=function(item) self:select(item) end, select_tab=function(item) self:select(item) end,
...@@ -55,7 +56,7 @@ function _M:init(title, inven, filter, action, actor) ...@@ -55,7 +56,7 @@ function _M:init(title, inven, filter, action, actor)
self:loadUI{ self:loadUI{
{left=0, top=0, ui=self.c_inven}, {left=0, top=0, ui=self.c_inven},
{right=0, top=0, ui=self.c_desc}, {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:setFocus(self.c_inven)
self:setupUI() 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