Scorpio

Scorpio

349k Downloads

__Config__ generates bugged UI for Size

BannZay opened this issue ยท 5 comments

commented

occured in Wow 3.4.0 (with all other addons disabled) using Scorpio v164 or v163

Following code generates UI paragraph that is bugged (constantly grows up):

Scorpio "SimpleTest" "1.0.0"

function OnLoad()
  _Addon:SetSavedVariable("ScorpioTest_DB") 
    :UseConfigPanel()
end

__Config__(_Config, { width = Number, height = Number }, { width = 0, height = 0}) 
function RandomProperty(value) 
end

image

commented

Strangely, could be a new feature for base frame's OnSizeChanged, I'll check it tonight.

if you want try, you can open the Scorpio/Modules/UI/Layoutmanager.lua, goto line 118, find self.OnSizeChanged = self.OnSizeChanged + RefreshLayout, comment it out.

commented

From what I see it happens to custom objects and Size but works with boolean and RangeValue.
And when it is bugged it constantly calls handler with different observable (it has the same value if I call GetValue)

Work for:

__Config__(_Config, "size", RangeValue[{30, 600, 1}], 100)
__Config__(_Config, true)

Bugged for:

__Config__(_Config, "size", Size, { width = 0, height = 0}) 
__Config__(_Config, { width = Number, height = Number }, { width = 0, height = 0}) 

if you want try, you can open the Scorpio/Modules/UI/Layoutmanager.lua, goto line 118, find self.OnSizeChanged = self.OnSizeChanged + RefreshLayout, comment it out.

This change did not affect described behaviour, still broken.

commented

Not sure how helpfull it is but from my observations:
When I open ui menu the value of the item being constantly updated.

Code used:

Scorpio "SimpleTest" "1.0.0"

function OnLoad()
  _Addon:SetSavedVariable("ScorpioTest_DB") 
    :UseConfigPanel()
end

__Config__(_Config, "size", Size, { width = 40, height = 40}) 
function RandomProperty(value) 
	if value ~= nil then
		print("tbl:", value, "width:", value.width, "height", value.height)
	end
end

Result:

image

commented

Ah, the WLK use a different skin for inputbox, I forget add a fixed size for WLK version, I'll upload a new version soon to fix that.

The value be nil when you use a default value is also a bug, also will be fixed in the next version

commented

Thank you!