aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/GuiLua/skang.lua
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-04-03 04:55:39 +1000
committerDavid Walter Seikel2014-04-03 04:55:39 +1000
commitdf9de7fa2f7ed4380fc0a653f91a634fdf393859 (patch)
treef80b6a32772e205739c8bce8033acb7c390d71ae /ClientHamr/GuiLua/skang.lua
parentPut all the Thing stuff inside the Thing definition. (diff)
downloadSledjHamr-df9de7fa2f7ed4380fc0a653f91a634fdf393859.zip
SledjHamr-df9de7fa2f7ed4380fc0a653f91a634fdf393859.tar.gz
SledjHamr-df9de7fa2f7ed4380fc0a653f91a634fdf393859.tar.bz2
SledjHamr-df9de7fa2f7ed4380fc0a653f91a634fdf393859.tar.xz
Minor proxy table clean ups.
Diffstat (limited to 'ClientHamr/GuiLua/skang.lua')
-rw-r--r--ClientHamr/GuiLua/skang.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/ClientHamr/GuiLua/skang.lua b/ClientHamr/GuiLua/skang.lua
index b1ed581..6cbec8c 100644
--- a/ClientHamr/GuiLua/skang.lua
+++ b/ClientHamr/GuiLua/skang.lua
@@ -438,8 +438,6 @@ local Mum =
438{ 438{
439__index = function (parent, key) 439__index = function (parent, key)
440 -- This only works for keys that don't exist. By definition a value of nil means it doesn't exist. 440 -- This only works for keys that don't exist. By definition a value of nil means it doesn't exist.
441 -- TODO - Java skang called isValid() on get(). On the other hand, doesn't seem to call it on set(), but calls it on append().
442 -- Ah, it was doing isValid() on setStufflet().
443 441
444 -- First see if this is a Thing. 442 -- First see if this is a Thing.
445 local metaMum, thingy = getStuffed(parent, key) 443 local metaMum, thingy = getStuffed(parent, key)
@@ -478,10 +476,13 @@ __newindex = function (parent, key, value)
478 if 'table' == type(oldValue) then 476 if 'table' == type(oldValue) then
479 oldMum = getmetatable(oldValue) 477 oldMum = getmetatable(oldValue)
480 if oldMum then 478 if oldMum then
481 -- TODO - This SHOULD work, but doesn't. 479 -- TODO - This SHOULD work, but doesn't -
482 --setmetatable(value, oldMum) 480 --setmetatable(value, oldMum)
483 -- Instead we do this - 481 -- Instead we do this -
484 -- TODO - This wont clear out any values in the old table that are not in the new table. Should it? 482 -- Clear out any values in the old table.
483 for k, v in pairs(oldMum.__values) do
484 oldMum.__values[k] = nil
485 end
485 for k, v in pairs(value) do 486 for k, v in pairs(value) do
486 local newK = oldMum.__self.stuff[k] 487 local newK = oldMum.__self.stuff[k]
487 if newK then newK = newK.names[1] else newK = k end 488 if newK then newK = newK.names[1] else newK = k end
@@ -506,7 +507,7 @@ __newindex = function (parent, key, value)
506end, 507end,
507 508
508__call = function (func, ...) 509__call = function (func, ...)
509 return thingasm(func, ...) -- (func, {...}) 510 return thingasm(func, ...)
510end, 511end,
511 512
512} 513}