This commit is contained in:
세젤귀 고양이들 2022-01-06 23:24:19 +09:00
parent ff36d8a744
commit b59a3b2586
5 changed files with 15 additions and 11 deletions

View file

@ -1,5 +1,5 @@
local Quad = require(game.ReplicatedStorage:WaitForChild "Quad"); ---@module Quad.src 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 -- init quad
local scrollFrame = class.extend(); local scrollFrame = class.extend();
@ -25,14 +25,14 @@ button.Text = nil;
local image = class "ImageLabel"; local image = class "ImageLabel";
-- tween for moving -- tween for moving
local out = advancedTween.EasingDirections.Out; local out = tween.EasingDirections.Out;
local exp2 = advancedTween.EasingFunctions.Exp2; local exp2 = tween.EasingFunctions.Exp2;
local tweenData = { local tweenData = {
Time = tweenTime; Time = tweenTime;
Direction = out; Direction = out;
EasingFunction = exp2; EasingFunction = exp2;
}; };
local runTween = advancedTween.RunTween; local runTween = tween.RunTween;
-- user input service -- user input service
local userInputService = game:GetService "UserInputService"; local userInputService = game:GetService "UserInputService";

View file

@ -22,7 +22,7 @@ function module.init(shared)
local mount = shared.mount; ---@module "src.mount" local mount = shared.mount; ---@module "src.mount"
local getHolder = mount.getHolder; local getHolder = mount.getHolder;
local mountf = mount.mount; 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 round = shared.round; ---@module "src.libs.round"
local function setProperty(item,index,value,ClassName) local function setProperty(item,index,value,ClassName)
@ -99,7 +99,7 @@ function module.init(shared)
local tstore = value.store; local tstore = value.store;
local rawKey = value.key; local rawKey = value.key;
local set = tstore[rawKey]; 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 if with then
set = with(tstore,set,value.key,item); set = with(tstore,set,value.key,item);
end end
@ -141,7 +141,7 @@ function module.init(shared)
elseif indexType == "string" then elseif indexType == "string" then
-- prop set -- prop set
setProperty(item,index,value,ClassName); setProperty(item,index,value,ClassName);
elseif indexType == "number" then -- object elseif indexType == "number" and valueType ~= "boolean" then -- object
-- child object -- child object
mountf(item,((iprop == 1) and value or value:Clone()),holder); mountf(item,((iprop == 1) and value or value:Clone()),holder);
end end

View file

@ -43,7 +43,7 @@ function module.init(id)
this.require = require; this.require = require;
this.round = type(round) == "table" and round; 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.event = event.init(this);
this.store = store.init(this); this.store = store.init(this);
this.mount = mount.init(this); this.mount = mount.init(this);

View file

@ -117,7 +117,11 @@ function module.init(shared)
local store = {}; local store = {};
local storeIdSpace = {}; local storeIdSpace = {};
function store:__index(key) 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 end
function store:__newindex(key,value) function store:__newindex(key,value)
self.__self[key] = value; self.__self[key] = value;
@ -146,7 +150,7 @@ function module.init(shared)
end end
function store:default(key,value) function store:default(key,value)
local old = self[key]; local old = self[key];
if type(old) == "nil" then if old == nil then
self[key] = value; self[key] = value;
return; return;
end end

View file

@ -1,4 +1,4 @@
local Quad = require(game.ReplicatedStorage:WaitForChild "Quad"); ---@module "src" 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;