i am using the following code to create a dialog with 2 buttons: 1 to create a unit, 1 to close the dialog
when i hit escape (the event to open the dialog), the screen freezes and gets a bit darker (similiar to when you press F9-F12), but the dialog doesnt show up
EDIT: when i remove the line call DialogSetMessage(Spawn, "Spawn?"), then it works
when i hit escape (the event to open the dialog), the screen freezes and gets a bit darker (similiar to when you press F9-F12), but the dialog doesnt show up
EDIT: when i remove the line call DialogSetMessage(Spawn, "Spawn?"), then it works
JASS:
library SpawnDialog initializer init
globals
private dialog Spawn = DialogCreate()
private button SiegeTank = DialogAddButton(Spawn, "Siege Tank", 0)
private button Cancel = DialogAddButton(Spawn, "Cancel", 0)
endglobals
function SpawnSiegeTank takes nothing returns nothing
call CreateUnitAtLoc(Player(0), 'h007',GetRandomLocInRect(bj_mapInitialPlayableArea), GetRandomReal(0, 360) )
endfunction
function ShowSpawnDialog takes nothing returns nothing
call DialogDisplay(Player(0), Spawn, true)
endfunction
function init takes nothing returns nothing
local trigger trig1 = CreateTrigger()
local trigger trig2 = CreateTrigger()
call DialogSetMessage(Spawn, "Spawn?")
call TriggerRegisterDialogButtonEvent(trig1, SiegeTank)
call TriggerAddAction(trig1, function SpawnSiegeTank)
call TriggerRegisterPlayerEvent(trig2, Player(0), EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction(trig2, function ShowSpawnDialog)
set trig1 = null
set trig2 = null
endfunction
endlibrary