test
This commit is contained in:
parent
ff36d8a744
commit
b59a3b2586
5 changed files with 15 additions and 11 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue