inner reg refer fixing
This commit is contained in:
parent
e1ef8a5dda
commit
58821a6921
2 changed files with 11 additions and 0 deletions
|
|
@ -117,9 +117,13 @@ function module.init(shared)
|
|||
end
|
||||
local tween = value.tvalue;
|
||||
local from = value.fvalue;
|
||||
local add = value.avalue;
|
||||
|
||||
-- adding event function
|
||||
local function regFn(_,newValue,key)
|
||||
if add then
|
||||
newValue = newValue + add;
|
||||
end
|
||||
if from then
|
||||
newValue = from[newValue];
|
||||
end
|
||||
|
|
|
|||
|
|
@ -110,6 +110,9 @@ function module.init(shared)
|
|||
from = function (s,value)
|
||||
return setmetatable({fvalue = value},{__index = s});
|
||||
end;
|
||||
add = function (s,value)
|
||||
return setmetatable({avalue = value},{__index = s});
|
||||
end;
|
||||
};
|
||||
registerClass.__index = registerClass;
|
||||
|
||||
|
|
@ -133,6 +136,10 @@ function module.init(shared)
|
|||
end
|
||||
end
|
||||
function store:__call(key,func)
|
||||
local last = self.__self[key];
|
||||
if last and type(last) == "table" and getmetatable(last) == registerClass then
|
||||
return last;
|
||||
end
|
||||
local register = self.__reg[key];
|
||||
if not register then
|
||||
register = setmetatable({
|
||||
|
|
|
|||
Loading…
Reference in a new issue