Page 1 of 1

[b39-svn-5017] Minimalist UI does not load saved settings

Posted: Mon Apr 02, 2012 1:39 am
by johnnyzero
Looks like there was a regression in svn revision 4994. When the ability to reset the interface positions was added to the minimalist UI, the loading of saved UI information was broken. Luckily, the fix is very simple.

From a svn diff of game/modules/tome/class/uiset/Minimalist.lua in function _M:init():

Code: Select all

===================================================================
--- Minimalist.lua	(revision 4931)
+++ Minimalist.lua	(working copy)
@@ -186,25 +187,10 @@
 		mainicons = {x=0, y=0, name="Game Actions"},
 	}
 
+	self:resetPlaces()
+
 	local w, h = core.display.size()
 
-	local th = 52
-	if config.settings.tome.hotkey_icons then th = (4 + config.settings.tome.hotkey_icons_size) * config.settings.tome.hotkey_icons_rows end
-	local hup = h - th
-
-	self.places = {
-		player = {x=0, y=0, scale=1, a=1},
-		resources = {x=0, y=111, scale=1, a=1},
-		minimap = {x=w - 239, y=0, scale=1, a=1},
-		buffs = {x=w - 40, y=200, scale=1, a=1},
-		party = {x=pf_bg[6], y=0, scale=1, a=1},
-		gamelog = {x=0, y=hup - 210, w=math.floor(w/2), h=200, scale=1, a=1},
-		chatlog = {x=math.floor(w/2), y=hup - 210, w=math.floor(w/2), h=200, scale=1, a=1},
-		mainicons = {x=w - tb_bg[6] * 0.5, y=h - tb_bg[7] * 5 * 0.5 - 5, scale=1, a=1},
-		hotkeys = {x=10, y=h - th, w=w-60, h=th, scale=1, a=1},
-	}
-	table.merge(self.places, config.settings.tome.uiset_minimalist and config.settings.tome.uiset_minimalist.places or {}, true)
-
 	-- Adjsut to account for resolution change
 	if config.settings.tome.uiset_minimalist and config.settings.tome.uiset_minimalist.save_size then
 		local ow, oh = config.settings.tome.uiset_minimalist.save_size.w, config.settings.tome.uiset_minimalist.save_size.h
The table.merge(...) line seems to have been accidentally removed when the self.places initialization was moved to the resetPlaces() function.

Code: Select all

-	table.merge(self.places, config.settings.tome.uiset_minimalist and config.settings.tome.uiset_minimalist.places or {}, true)
Placing this line back in after the self:resetPlaces() call seems to fix the regression while keeping the improved functionality intact.

Re: [b39-svn-5017] Minimalist UI does not load saved setting

Posted: Mon Apr 09, 2012 8:25 pm
by darkgod
w00ps :) thanks!