ID:1051101
 
Redundant
Applies to:Dream Maker
Status: Redundant

This feature has already been implemented, or is already achievable with existing methods.
Hey there, I have a little request regarding Interface commands. In a type of situation where I'm using radio buttons to select things in the interface, I'm making a huge mess out of calling Commands when the button is getting checked.

Currently, only verbs can be used in the interface commands, but as far as I see I can't pass information through to a verb the same as I can a proc. This means for each of the things I want to do, I have to create a new verb for it. This isn't very efficient at all.

If we could use procs as a command as well, it would simplify this a ton. I'm sure there are workarounds, so it's not a major issue, just a convenience.
You can pass values to verbs in macros/interface commands. It's just not as safe as procs, because users can call the verbs with whatever value they want.

client/verb/say(t as text) world << "[key]: [t]"

// interface button
text: Say Hello!
command: say "Hello!"

client
var radio_choice
var valid_radio_choices[] = list("a", "b", "c")

verb/radio(choice as text)
if(choice in valid_radio_choices)
radio_choice = choice

verb/complete_choice()
src << "You've chosen option <b>[radio_choice]</b>!"
// radios:
command: radio "a"
command: radio "b"
command: radio "c"
Kitsueki wrote:
... but as far as I see I can't pass information through to a verb the same as I can a proc.

You can.

mob
Login()
.=..()
chat("Hello World")

verb
chat(msg as text)
world << "[src]: [msg]"


He's talking about calling a verb, and calling the verb with something like "Hello World" from the interface itself, in his case he is setting a command to run when a checkbox is checked & un-checked.

Anyways I see it as a limitation you can't use procs the same as verbs inside an interface file, because I don't want even hidden verbs to be accessible when fully typed, but I still need something for the interface to call, which apparentally can only be hidden verbs, when I don't want them accessible, ever, even if the proc name is known or verb name is known...

I only want the pre-built methods to work...the way it's supposed to work.
Nadrew resolved issue (Redundant)
In response to Superbike32
The interface exists and operates on the client. It is not trustworthy or secure. If you don't want someone to use a verb, you need to take it away from them (verbs -= /mob/verb/temporaryVerb) or add checks so that it is only usable when valid (if(!condition) return).

Allowing users to execute procedures would be a step in the completely opposite direction in terms of security ;)