Add mention of how the callback is used
This commit is contained in:
parent
5ea86d86fa
commit
4a554a4409
1 changed files with 9 additions and 0 deletions
|
|
@ -128,6 +128,15 @@ Now we see that the Baz option has a description attached that's separate from i
|
||||||
Baz: Look at this one: the best option.
|
Baz: Look at this one: the best option.
|
||||||
Qux
|
Qux
|
||||||
|
|
||||||
|
Once the player makes a selection - let's say, 'Foo' - the menu will terminate and call
|
||||||
|
your specified callback with the selection, like so:
|
||||||
|
|
||||||
|
callback(TEST_MENU, caller, 0, "Foo")
|
||||||
|
|
||||||
|
The index of the selection is given along with a string containing the selection's key.
|
||||||
|
That way, if you have two selections in the menu with the same key, you can still
|
||||||
|
differentiate between them.
|
||||||
|
|
||||||
And that's all there is to it! For simple branching-tree selections, using this system is
|
And that's all there is to it! For simple branching-tree selections, using this system is
|
||||||
much easier than manually creating EvMenu nodes. It also makes generating menus with dynamic
|
much easier than manually creating EvMenu nodes. It also makes generating menus with dynamic
|
||||||
options much easier - since the source of the menu tree is just a string, you could easily
|
options much easier - since the source of the menu tree is just a string, you could easily
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue