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

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
johnnyzero
Thalore
Posts: 148
Joined: Tue Feb 28, 2012 6:36 am

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

#1 Post 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.

darkgod
Master of Eyal
Posts: 10751
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

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

#2 Post by darkgod »

w00ps :) thanks!
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply