diff options
author | David Walter Seikel | 2015-07-09 03:51:56 +1000 |
---|---|---|
committer | David Walter Seikel | 2015-07-09 03:51:56 +1000 |
commit | bfe20f0537c72191de2aa872d032b4233ef49ecf (patch) | |
tree | 4a0fe09070317813b33e5f66e969f876b5b13e50 | |
parent | Fix up yet another API break. (diff) | |
download | SledjHamr-bfe20f0537c72191de2aa872d032b4233ef49ecf.zip SledjHamr-bfe20f0537c72191de2aa872d032b4233ef49ecf.tar.gz SledjHamr-bfe20f0537c72191de2aa872d032b4233ef49ecf.tar.bz2 SledjHamr-bfe20f0537c72191de2aa872d032b4233ef49ecf.tar.xz |
Document crazy idea I had for implementing Skang's _123 via metatables.
-rw-r--r-- | docs/ClientHamr/README.GuiLua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ClientHamr/README.GuiLua b/docs/ClientHamr/README.GuiLua index 72f13f3..3d4bb1c 100644 --- a/docs/ClientHamr/README.GuiLua +++ b/docs/ClientHamr/README.GuiLua | |||
@@ -165,6 +165,15 @@ This could even allow relative placement as mentioned in the skang TODO - | |||
165 | 165 | ||
166 | foo = widget.label(0, "otherWidget+0.1", 0.5, 0, 'Text goes here") | 166 | foo = widget.label(0, "otherWidget+0.1", 0.5, 0, 'Text goes here") |
167 | 167 | ||
168 | While failing to fall asleep, I had another idea, though not sure how | ||
169 | feasible it is just yet. _123 could use a metatable thingy at the | ||
170 | lowest level, and just translates that to a value, the value being a | ||
171 | number. Or something hand wavey like that. lol | ||
172 | |||
173 | In skang.lua _M is the modules table, and it's a local, it's also a | ||
174 | proxy table. So _M's metatable's __index could check if it's a _123, | ||
175 | then return the 123 as the value. As a bonus, we could do arithmatic | ||
176 | via this metatable. | ||
168 | 177 | ||
169 | "widget" would be a table with functions for dealing with widgets. It | 178 | "widget" would be a table with functions for dealing with widgets. It |
170 | would include metatable stuff for widget set introspection. So | 179 | would include metatable stuff for widget set introspection. So |