- add more descriptive error messages to get/set handlers

- add MicroMenu module (may not be 100% complete yet)
This commit is contained in:
Hendrik Leppkes
2008-03-07 15:38:34 +00:00
parent 9afedb26f2
commit 177f03f29f
5 changed files with 130 additions and 6 deletions
+2 -2
View File
@@ -41,14 +41,14 @@ do
-- retrieves a valid bar object from the barregistry table
function getBar(id)
local bar = barregistry[tostring(id)]
assert(bar, "Invalid bar id in options table.")
assert(bar, ("Invalid bar id in options table. (%s)"):format(id))
return bar
end
-- calls a function on the bar
function callFunc(bar, type, option, ...)
local func = type .. (optionMap[option] or option)
assert(bar[func], "Invalid get/set function.")
assert(bar[func], ("Invalid get/set function %s in bar %s."):format(func, bar.id))
return bar[func](bar, ...)
end