- add more descriptive error messages to get/set handlers
- add MicroMenu module (may not be 100% complete yet)
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user