[[*]] is the default argument supplied to a verb.
[[value]] is the parameter of the element that the verb is triggered from (macro, map, window, menu, etc)
[[element.value]] is an arbitrary access of any parameter of any element.
[[..value]] is the arbitrary access of the parent element's parameter the verb is triggered from.
Since verbs are sent from the client-side, this would effectively remove the need to do a winget() immediately following a verb. This could be used to prevent client->server->client->server->client communication for maintaining ui elements in DM.
Basically, if you need to know something about a ui element when calling a verb, you have to trigger the verb, calling client->server. Then you have to perform a winget(), which makes the chain now client->server->client->server, then send a winset() to make your final changes, completing the cycle as: client->server->client->server->client.
With the ability to send the values as embedded arguments the moment the verb is triggered and parsed on the client, the chain would become:
client->server for the verb call and argument parse bit, then the processing and winset() would result in a total chain of client->server->client. Better, no?
ID:2142520
Sep 2 2016, 9:10 pm (Edited on Sep 3 2016, 10:09 am)
|
|||||||
Resolved
| |||||||
Sep 3 2016, 4:17 am
|
|
[[time]] would be great to have as well for getting correct movement timings, especially at low tickrates.
|
Dang, I can't believe I never commented on this. Might make a good last-minute 513 addition.
|
Question on formatting: Currently I have some very rudimentary checking to see if the [[expression]] is already inside quotes or not. In non-quoted mode, a string or color gets quotes put around it, numbers are left alone, and position/size values get split into two space-separated numbers for easy verb parsing.
Is this reasonable or should I do it a different way? And currently the quote detection is literally just checking for " on both sides of the double brackets. |
That seems entirely reasonable. So if I get the gist of what you are saying, is that if my command text is:
onResized [[mainwnd.size]] The correct verb argument format would be: mob ? |
Yep, that's right.
I'm not sure if my quote parsing ought to be more robust or not. |
Honestly, I'd leave the user room to hang themselves, but splitting the compound strings into separate args is a huge boilerplate remover.
|
Lummox JR resolved issue with message:
Wingets can now be embedded into skin commands like map.on-show, button.command, etc., by using [[id.parameter]]. This is similar to the [[*]] syntax supported for some other specialty commands. If the embedded winget is surrounded on both sides by double-quote characters, the text will be escaped (newlines turned to \n, etc.); otherwise, it will be left alone. |