From 1b77ff4abdbcc9247cecb25c9843288613c4c1a0 Mon Sep 17 00:00:00 2001
From: Alexander Sedov <alex0player@gmail.com>
Date: Tue, 16 Dec 2014 16:20:02 +0300
Subject: [PATCH] Fixed various similar dialogs

---
 game/modules/tome/dialogs/ShowIngredients.lua | 5 +++--
 game/modules/tome/dialogs/ShowLore.lua        | 7 ++++---
 game/modules/tome/dialogs/ShowStore.lua       | 7 ++++---
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/game/modules/tome/dialogs/ShowIngredients.lua b/game/modules/tome/dialogs/ShowIngredients.lua
index 88584c6484..b42a31e368 100644
--- a/game/modules/tome/dialogs/ShowIngredients.lua
+++ b/game/modules/tome/dialogs/ShowIngredients.lua
@@ -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()
diff --git a/game/modules/tome/dialogs/ShowLore.lua b/game/modules/tome/dialogs/ShowLore.lua
index be0df5e30a..a764cd598f 100644
--- a/game/modules/tome/dialogs/ShowLore.lua
+++ b/game/modules/tome/dialogs/ShowLore.lua
@@ -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()
diff --git a/game/modules/tome/dialogs/ShowStore.lua b/game/modules/tome/dialogs/ShowStore.lua
index f968db31e2..af347a1fac 100644
--- a/game/modules/tome/dialogs/ShowStore.lua
+++ b/game/modules/tome/dialogs/ShowStore.lua
@@ -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
-- 
GitLab