- Joined
- Nov 30, 2007
- Messages
- 1,202
I've fixed the most pressing issues with the upload now (v0.97). I also added more GUI support, including GUI-Plugin (trigger wrappers).
New update:
Added another example use case in the form of votekick.
_________________________________________
How advisable is it to use [vJASS] - Observables to refresh the Menu rather than periodically doing it? The menu would subscribe to the options and refresh when they change state (Currently the window is refreshed every 0.5 seconds while it remains open, regardless of any changes). I'm struggling also with how to take into account hidden buttons, as that is done locally. Which means option 11 could be the first option for one player on window 2, but for another it could be 14 given how many options have beenn hidden... This means that the only way I see for how to take this into account is to loop from index 0 until all 12 options have been shown... It's a mess and I need some help here.
Another possible solution is to just have the options fixed at their index leaving gaps if they are hidden, but that could lead to scenarios where entire windows are empty.
-
On Events
-
Events
-
Game - SBM_event becomes Equal to 1.00
-
Game - SBM_event becomes Equal to 2.00
-
Game - SBM_event becomes Equal to 3.00
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SBM_event Equal to 1.00
-
-
Then - Actions
-
Game - Display to (All players) the text: ((Name of SBM_player) + ( selected menu + ((String(SBM_menuKey)) + (, option + (String(SBM_optionKey))))))
-
Skip remaining actions
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SBM_event Equal to 2.00
-
-
Then - Actions
-
Game - Display to (All players) the text: ((Name of SBM_player) + ( open + ((String(SBM_menuKey)) + <Empty String>)))
-
Skip remaining actions
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SBM_event Equal to 3.00
-
-
Then - Actions
-
Game - Display to (All players) the text: ((Name of SBM_player) + ( closed + ((String(SBM_menuKey)) + <Empty String>)))
-
Skip remaining actions
-
-
Else - Actions
-
-
-
-
Creating a menu
-
Events
-
Time - Elapsed game time is 0.00 seconds
-
-
Conditions
-
Actions
-
-------- Creating a Menu --------
-
Set SBM_GUI_title = Example Menu
-
Trigger - Run CreateSpellMenu <gen> (ignoring conditions)
-
Set exampleMenu = SBM_GUI_lastCreatedMenu
-
-------- Creating an option 1 --------
-
Set SBM_GUI_label = Option 1
-
Set SBM_GUI_index = 0
-
Set SBM_GUI_text = Say Hello...
-
Set SBM_GUI_menu = exampleMenu
-
Set SBM_GUI_btn = ReplaceableTextures\CommandButtons\BTNControlMagic.blp
-
Set SBM_GUI_disbtn = ReplaceableTextures\CommandButtons\DISBTNControlMagic.blp
-
Trigger - Run AddSpellOption <gen> (ignoring conditions)
-
Set exampleOptions[0] = SBM_GUI_lastCreatedOption
-
-
-
How to Open
-
Events
-
Player - Player 1 (Red) skips a cinematic sequence
-
-
Conditions
-
Actions
-
Set SBM_player = (Triggering player)
-
Set SBM_GUI_menu = exampleMenu
-
Trigger - Run OpenMenu <gen> (ignoring conditions)
-
-
-
How to Destroy
-
Events
-
Player - Player 1 (Red) types a chat message containing -destroy as An exact match
-
-
Conditions
-
Actions
-
Set SBM_GUI_menu = exampleMenu
-
Trigger - Run DestroyMenu <gen> (ignoring conditions)
-
Set SBM_GUI_menu = 0
-
-
-
Option selection
-
Events
-
Game - SBM_event becomes Equal to 1.00
-
-
Conditions
-
SBM_menuKey Equal to exampleMenu
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
SBM_optionKey Equal to exampleOptions[0]
-
-
Then - Actions
-
-------- do stuff --------
-
Game - Display to (All players) the text: Hello World!
-
Skip remaining actions
-
-
Else - Actions
-
-
-
New update:
- Fixed a bug with closeMenu not working
- When a menu closes the selection will return to what it was before
- Added votekick menu as an additional example
- Fixed a bug with the SpellMenu not being deallocated when destroy was called
- Fixed a bug in which the next button could be hidden due to disabled option at slot 11 covering it.
- Added start and end cooldown event registration.
- Changed how callbacks were registrated for faster setup.
- Fixed a bug where options weren't deallocated once removed from the menu.
- Added method refresh to spell menu so that the menu can be manually changed in case the properties change independant of player selection
- Now updates the menu for all players currently viewing it whenever an option is selected
- Added real events for option selection, menu open and menu close.
- Player related data is now removed from SpellOptionsMenu upon leaving the game
- showWindow(player, index) is now public so that the window can be changed from outside
- Added GUI plugin for additional support
- Added static if to include/exclude some GUI variables from the library
- When a menu closes the selection will return to what it was before
- Added votekick menu as an additional example
- Fixed a bug with the SpellMenu not being deallocated when destroy was called
- Fixed a bug in which the next button could be hidden due to disabled option at slot 11 covering it.
- Added start and end cooldown event registration.
- Changed how callbacks were registrated for faster setup.
- Fixed a bug where options weren't deallocated once removed from the menu.
- Added method refresh to spell menu so that the menu can be manually changed in case the properties change independant of player selection
- Now updates the menu for all players currently viewing it whenever an option is selected
- Added real events for option selection, menu open and menu close.
- Player related data is now removed from SpellOptionsMenu upon leaving the game
- showWindow(player, index) is now public so that the window can be changed from outside
- Added GUI plugin for additional support
- Added static if to include/exclude some GUI variables from the library
Added another example use case in the form of votekick.
_________________________________________
How advisable is it to use [vJASS] - Observables to refresh the Menu rather than periodically doing it? The menu would subscribe to the options and refresh when they change state (Currently the window is refreshed every 0.5 seconds while it remains open, regardless of any changes). I'm struggling also with how to take into account hidden buttons, as that is done locally. Which means option 11 could be the first option for one player on window 2, but for another it could be 14 given how many options have beenn hidden... This means that the only way I see for how to take this into account is to loop from index 0 until all 12 options have been shown... It's a mess and I need some help here.
Another possible solution is to just have the options fixed at their index leaving gaps if they are hidden, but that could lead to scenarios where entire windows are empty.
Last edited: