ID:159524
 
Hey.

You know in the skin if you edit the window, under the options tab, it says "Command to run when window is closed"?

Well, I can't get it to run any command. No matter what it says its not valid when its used in-game.

The proc is mob/proc/Show_Windows() for instance. I just put "Show_Windows" in the "Command to run when window is closed" bar but it does nothing when the window is closed except say it is an unidentified command.

What is the proper way to do it?

The window's ID is "Text", its the output for the game. It is a seperate window than the main window. I want people to be able to stretch it and minimize it but not close it, but if you uncheck the "can close" box for the window minimize goes away, and I can't have that. So instead that forces me to make sure that when you close the window, it just comes back up by calling Show_Windows(), which will use winshow to show the Text menu once more.

Also, I think that it is a byond bug that when you uncheck the "Can close" box, "minimize" disappears automatically against your will.
You can't run a proc in an interface command. You have to use a verb.
That'd be quite an exploit if you could arbitrarily execute any proc through interface elements. Rather, commands there work the same as any other commands Dream Seeker uses and sends to the server - they instruct the server to try executing a verb (which has to be currently available, accessible and be used with correct arguments). It works the same way as a command you'd run manually through an input control.

So, hidden verbs/aliases are used, and another method is to override client/Command() to parse and intercept commands. For example:
client/verb/PressButton(button as text)
set hidden = 1 //doesn't show up in info controls etc
switch(button)
if("punch") src.mob.Punch()
if("kick") src.mob.Kick()
//simple example

Then you'd set the commands pressbutton "punch" and pressbutton "kick" for your buttons.
In response to Kaioken
Uh, ok, I don't claim to understand most of that but I thought this code followed those rules:

client/verb/Show_Windows()
set hidden=1
winshow(src,"Text",1)
winshow(src,"Stats",1)


In the "Command to run when this window is closed" box I put "Show_Windows". When I run the game and close the window, it says "Close_Windows is an unrecognized or inaccessible verb"

Why isn't this working in simple terms? Thanks
In response to Dragonn
Underscores are replaced by spaces so "Show_Windows" is actually "Show Windows". In accessing verbs, spaces are used to separate the verb name and the arguments. To have a working command input, spaces within the verb name should be replaced by dashes("-").

That means the command that you should input is "Show-Windows".