Hello, I was planning on creating a module for my muck I play where I would use simple buttons, based off the button code I found in the forum here:
http://gammon.com.au/forum/?id=9359
This is a plugin however, and I was hoping to create a class module for Button where I can use it to create a much of buttons, and enable them and disable them as I click through them.
For instance, a menu might start off with 3 buttons: spells, skills, and actions. You could click the spells button and the three buttons would become disabled, and replaced with 4 new buttons, Home (return to the first three), Torch, Cure, and Fire, for example.
It's been many years since I've used Mushclient and so I'm trying to get back into it, but after searching around for creating a class for Mushclient, I'm not entirely sure how to do this.
Can someone point me to a post somewhere that discusses this?
~Ash
So far I have a class started and it looks like this:
http://gammon.com.au/forum/?id=9359
This is a plugin however, and I was hoping to create a class module for Button where I can use it to create a much of buttons, and enable them and disable them as I click through them.
For instance, a menu might start off with 3 buttons: spells, skills, and actions. You could click the spells button and the three buttons would become disabled, and replaced with 4 new buttons, Home (return to the first three), Torch, Cure, and Fire, for example.
It's been many years since I've used Mushclient and so I'm trying to get back into it, but after searching around for creating a class for Mushclient, I'm not entirely sure how to do this.
Can someone point me to a post somewhere that discusses this?
~Ash
So far I have a class started and it looks like this:
function Button:new (enabled, icon, tooltip, send, cooldown, sound)
self.enabled = enabled, -- displays only when enabled
self.icon = icon, -- icon image
self.tooltip = tooltip, -- tooltip help text
self.send = send, -- what to send
self.cooldown = cooldown,-- cooldown time in seconds
self.sound = sound, -- sound to play when cast
local Enable = function ()
self.enabled = true
end
local Disable = function ()
self.enabled = false
end
end