mudgangster

Log | Files | Refs

commit 9843803b151a673e80802de6ff93e8b3ca84ba72
parent bf8e9ba4bf7e429d04909a29df35436960522003
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat, 29 Sep 2012 21:12:58 +0100

Added mud.enable/disable for mass enabling/disabling

Diffstat:
utils.lua | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/utils.lua b/utils.lua @@ -164,6 +164,30 @@ function mud.printr( str, fg, bg, bold ) mud.drawMain() end +function mud.enable( ... ) + local things = { ... } + + if type( things[ 1 ] ) == "table" then + things = things[ 1 ] + end + + for _, thing in ipairs( things ) do + thing:enable() + end +end + +function mud.disable( ... ) + local things = { ... } + + if type( things[ 1 ] ) == "table" then + things = things[ 1 ] + end + + for _, thing in ipairs( things ) do + thing:enable() + end +end + local ColourSequences = { d = 0, r = 31,