Code: Select all
set mydialog = DialogCreate()
call DialogSetMessage(mydialog,"You now have 30 seconds\n to vote on game modes")
set mybuttons[0]=DialogAddButton(mydialog,"Don't Care",13)
set mybuttons[1]=DialogAddButton(mydialog,"Normal Mode",78)
set mybuttons[2]=DialogAddButton(mydialog,"Nuke Mode",75)
set mybuttons[3]=DialogAddButton(mydialog,"Space Mode",83)
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[0])
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[1])
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[2])
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[3])
Code: Select all
function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[0])
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[1])
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[2])
call TriggerRegisterDialogButtonEvent( TrigDialogClick, mybuttons[3])//Dunno why you're doing the buttonevents, You can //do call TriggerRegisterDialogEvent( TrigDialogClick, mydialog ) and it works just fine
call TriggerAddAction( Whatever function you want, then in that function just do a button check (if b == GetClickedButton) ) and do actions
endfunction
Code: Select all
function dialoginit takes nothing returns nothing
The only problem I can point out in your "example" would be the trigger itself, you're doing...
[code] set mydialog = DialogCreate()
call DialogSetMessage(mydialog,"You now have 30 seconds\n to vote on game modes")
set mybuttons[0]=DialogAddButton(mydialog,"Don't Care",13)
set mybuttons[1]=DialogAddButton(mydialog,"Normal Mode",78)
set mybuttons[2]=DialogAddButton(mydialog,"Nuke Mode",75)
set mybuttons[3]=DialogAddButton(mydialog,"Space Mode",83)
loop
exitwhen i>5
call DialogDisplay( Player(i), mydialog, true)
set i=i+1
endloop
endfunction