diff --git a/exemple/elasticScrollFrame.lua b/exemple/elasticScrollFrame.lua index 2135a49..e244c92 100644 --- a/exemple/elasticScrollFrame.lua +++ b/exemple/elasticScrollFrame.lua @@ -1,5 +1,5 @@ local Quad = require(game.ReplicatedStorage:WaitForChild "Quad"); ---@module Quad.src -local _ = Quad.init "IosUI"; local round,class,mount,store,event,advancedTween = _.round,_.class,_.mount,_.store,_.event,_.advancedTween; +local _ = Quad.init "IosUI"; local round,class,mount,store,event,tween = _.round,_.class,_.mount,_.store,_.event,_.tween; -- init quad local scrollFrame = class.extend(); @@ -25,14 +25,14 @@ button.Text = nil; local image = class "ImageLabel"; -- tween for moving -local out = advancedTween.EasingDirections.Out; -local exp2 = advancedTween.EasingFunctions.Exp2; +local out = tween.EasingDirections.Out; +local exp2 = tween.EasingFunctions.Exp2; local tweenData = { Time = tweenTime; Direction = out; EasingFunction = exp2; }; -local runTween = advancedTween.RunTween; +local runTween = tween.RunTween; -- user input service local userInputService = game:GetService "UserInputService"; diff --git a/src/class.lua b/src/class.lua index b3aeec1..b49e326 100644 --- a/src/class.lua +++ b/src/class.lua @@ -22,7 +22,7 @@ function module.init(shared) local mount = shared.mount; ---@module "src.mount" local getHolder = mount.getHolder; local mountf = mount.mount; - local advancedTween = shared.advancedTween; ---@module "src.libs.AdvancedTween" + local advancedTween = shared.tween; ---@module "src.libs.AdvancedTween" local round = shared.round; ---@module "src.libs.round" local function setProperty(item,index,value,ClassName) @@ -99,7 +99,7 @@ function module.init(shared) local tstore = value.store; local rawKey = value.key; local set = tstore[rawKey]; - if type(set) ~= "nil" or (rawKey:match(",") and with) then + if set ~= nil or (rawKey:match(",") and with) then if with then set = with(tstore,set,value.key,item); end @@ -141,7 +141,7 @@ function module.init(shared) elseif indexType == "string" then -- prop set setProperty(item,index,value,ClassName); - elseif indexType == "number" then -- object + elseif indexType == "number" and valueType ~= "boolean" then -- object -- child object mountf(item,((iprop == 1) and value or value:Clone()),holder); end diff --git a/src/init.lua b/src/init.lua index 0cb4043..b4aa313 100644 --- a/src/init.lua +++ b/src/init.lua @@ -43,7 +43,7 @@ function module.init(id) this.require = require; this.round = type(round) == "table" and round; - this.advancedTween = type(advancedTween) == "table" and advancedTween; + this.tween = type(advancedTween) == "table" and advancedTween; this.event = event.init(this); this.store = store.init(this); this.mount = mount.init(this); diff --git a/src/store.lua b/src/store.lua index 6a764ae..8a271f5 100644 --- a/src/store.lua +++ b/src/store.lua @@ -117,7 +117,11 @@ function module.init(shared) local store = {}; local storeIdSpace = {}; function store:__index(key) - return self.__self[key] or store[key]; + local this = self.__self[key]; + if this ~= nil then + return this; + end + return store[key]; end function store:__newindex(key,value) self.__self[key] = value; @@ -146,7 +150,7 @@ function module.init(shared) end function store:default(key,value) local old = self[key]; - if type(old) == "nil" then + if old == nil then self[key] = value; return; end diff --git a/testScript.client.lua b/testScript.client.lua index 8c7d3b2..0b62f15 100644 --- a/testScript.client.lua +++ b/testScript.client.lua @@ -1,4 +1,4 @@ local Quad = require(game.ReplicatedStorage:WaitForChild "Quad"); ---@module "src" -local _ = Quad.init(); local class,mount,store,event,advancedTween = _.class,_.mount,_.store,_.event,_.advancedTween; +local _ = Quad.init(); local class,mount,store,event,tween = _.class,_.mount,_.store,_.event,_.tween;