ID:162973
 
I've been having quite a bit of trouble with skins today for some reason =S Before you say 'Lummox JR has a fantastic guide to skins' - I know, and I've read it through several times today.

At the moment I'm trying to make a Window Pop-up that has two buttons on it that are invisible. Some of the procs/verbs that cause it to show up may cause the buttons to become visible, and I want that specific proc/verb to be able to change what clicking on said buttons actually does. So far I have the Window popping up, and the buttons showing up correctly, but I can't get their command to do what I want it to do.

I have this so far.

var/obj/O = new()
O.icon = 'Items.dmi'
O.icon_state = "FlrScrl"
winshow(M, "Quest", 1)
M << output(null, "QuestIcon") //empties QuestOut1
M << output("<BIG>\icon[M.Quest]</BIG>", "QuestIcon")
M << output(null, "QuestOut1") //empties QuestOut1
M << output("[M.Quest.name]", "QuestOut1")
M << output(null, "QuestOut2") //empties QuestOut2
M << output("You found <NORM>\icon[O]</NORM>!! \n\
You found the Scroll of Power of Flair! \
If you read it you will become far more impressive!\
"
, "QuestOut2")
M << output("Read it?", "QuestOut2")
winset(M, "Button1", "is-visible = true")


How could I get clicking on Button1 to call "obj/Quest1/Clicker()" ?

~Ease~
Sorry I'm really stumped about this still. I rereread Lummox Jr's tutorial, and saw the part about an input automatically doing 'say' but I can't work out how it called that specific verb, and how to change it to a different one. I couldn't find any good examples/demos of buttons either.


~Ease~
To make controls disappear, set their is-visible parameter to false.
In response to Kaiochao2536
Yup, I've got that so far. I can control the visibility, I'm just struggling to work out how to call a proc/verb from clicking the buttons. Thanks for the help though!

~Ease~
Buttons and other command controls only have access to the verbs of the mob using the control. Probably the best way to do this would be to use 'set src in usr' in your Clicker() verb, and add the object Quest1 to the player's contents so they can get the Clicker verb. Then have the button's command call the Clicker verb by setting it's Command to "Clicker" in the dmf editor for the button.

~X
In response to Xooxer
Thanks Xooxer, you're a legend. Will Buttons every be able to call other verbs? It seems a little restricted. How hard could it be for them to allow Buttons to call things like "/obj/Thingy/SomeProc/proc()"? Perhaps a future feature?

~Ease~
In response to Ease
Ease wrote:
Thanks Xooxer, you're a legend. Will Buttons every be able to call other verbs? It seems a little restricted. How hard could it be for them to allow Buttons to call things like "/obj/Thingy/SomeProc/proc()"? Perhaps a future feature?

Well, the problem is that the player himself needs access to the command, which is why only verbs work. If a button coulod call an object's proc, then your players could too, since it's really them pressing the button and making the command call. So really, you'll probably never see this feature in the future. Nothing stopping you from calling the proc from a verb, though.

For more dynamic commands, you can use objects in the player's contents list that have various verbs attached to them, which you can easily add, take or check if the player has the object. This is a bit more complex, but the results can be pretty nifty.

~X