• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

A dialog counter-bug system for GUI'ers

Status
Not open for further replies.
I was thinking of submitting this today after just making it. I know it is simple, but only about 5% if even that of wc3 know how to do this without using jass/vjass.

Let me view your opinions guys. :thumbs_up:

[trigger=]
DDfig
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Hashtable - Create a hashtable
Set DatTable = (Last created hashtable)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) controller) Equal to User
((Picked player) slot status) Equal to Is playing
Then - Actions
Set DDmax = 0
Player Group - Add (Picked player) to ActivePlayers
Dialog - Clear DDialog
Dialog - Change the title of DDialog to Selection
Set DDamountofplayers = (DDamountofplayers + 1)
Set DDmax = (DDmax + 1)
Dialog - Create a dialog button for DDialog labelled test
Hashtable - Save Handle Of(Last created dialog Button) as DDmax of (Player number of (Picked player)) in DatTable
Set DDmsg = test
Hashtable - Save DDmsg as DDmax of (Player number of (Picked player)) in DatTable
Set DDmax = (DDmax + 1)
Dialog - Create a dialog button for DDialog labelled test2
Hashtable - Save Handle Of(Last created dialog Button) as DDmax of (Player number of (Picked player)) in DatTable
Set DDmsg = test2
Hashtable - Save DDmsg as DDmax of (Player number of (Picked player)) in DatTable
Dialog - Show DDialog for (Picked player)
Else - Actions

[/trigger]

[trigger=]
DDstart
Events
Dialog - A dialog button is clicked for DDialog
Conditions
Actions
For each (Integer DDloop) from 1 to DDmax, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Clicked dialog button) Equal to (Load DDloop of (Player number of (Triggering player)) in DatTable)
Then - Actions
Player Group - Add (Triggering player) to AlreadyVoted
Set DDvotes = (DDvotes + 1)
Set DDmsg = (Load DDloop of (Player number of (Triggering player)) from DatTable)
Game - Display to (All players) the text: DDmsg
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DDvotes Less than (DDamountofplayers / 2)
Then - Actions
Trigger - Run DDmain <gen> (ignoring conditions)
Else - Actions
Player Group - Remove all players from AlreadyVoted
Else - Actions

[/trigger]

[trigger=]
DDmain
Events
Conditions
Actions
Player Group - Pick every player in ActivePlayers and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) is in AlreadyVoted) Equal to False
Then - Actions
Set DDmax = 0
Dialog - Clear DDialog
Dialog - Change the title of DDialog to Selection
Set DDmax = (DDmax + 1)
Set DDmsg = (Load DDmax of (Player number of (Picked player)) from DatTable)
Dialog - Create a dialog button for DDialog labelled DDmsg
Hashtable - Save Handle Of(Last created dialog Button) as DDmax of (Player number of (Picked player)) in DatTable
Set DDmax = (DDmax + 1)
Set DDmsg = (Load DDmax of (Player number of (Picked player)) from DatTable)
Dialog - Create a dialog button for DDialog labelled DDmsg
Hashtable - Save Handle Of(Last created dialog Button) as DDmax of (Player number of (Picked player)) in DatTable
Dialog - Show DDialog for (Picked player)
Else - Actions

[/trigger]

[trigger=]
DDStartNewMain
Events
Conditions
Actions
Player Group - Pick every player in ActivePlayers and do (Actions)
Loop - Actions
Hashtable - Clear all child hashtables of child (Player number of (Picked player)) in DatTable
Dialog - Clear DDialog
Dialog - Change the title of DDialog to Selection
Set DDamountofplayers = (DDamountofplayers + 1)
Set DDmax = (DDmax + 1)
Dialog - Create a dialog button for DDialog labelled test
Hashtable - Save Handle Of(Last created dialog Button) as DDmax of (Player number of (Picked player)) in DatTable
Set DDmsg = test
Hashtable - Save DDmsg as DDmax of (Player number of (Picked player)) in DatTable
Set DDmax = (DDmax + 1)
Dialog - Create a dialog button for DDialog labelled test2
Hashtable - Save Handle Of(Last created dialog Button) as DDmax of (Player number of (Picked player)) in DatTable
Set DDmsg = test2
Hashtable - Save DDmsg as DDmax of (Player number of (Picked player)) in DatTable
Dialog - Show DDialog for (Picked player)

[/trigger]
 

Attachments

  • DatDialog0.5.0.w3x
    18.7 KB · Views: 62
Level 12
Joined
Mar 13, 2012
Messages
1,121
I have no idea what a "counter-bug" system could be. To get an understanding before having to read those triggers or downloading the map you might add screenshots for convenience.
 
Bannar said:
Another worth noting bug, is fact that after using TriggerRegisterDialogButtonEvent, the GetClickedButton() native, will return null. Mentioned function requires specific button as argument and, blizz programmers assumed that retrival of actuall handle won't be needed in such case. Here, you have that opportunity, handle will be retrieved via trigger id.

Basically I made a GUI version of http://www.hiveworkshop.com/forums/submissions-414/system-dialog-button-254366/

If you don't use dialog's often you might have never noticed that it only works for whoever clicks it first.
 
Status
Not open for further replies.
Top