[(there may be this already, but I searched and I couldn't find anything.)]
I try to create a dialog( I am new to jass, learning it), and I try to have 2 triggers in 1 (2 event registers).
Don't mind about the debugmsg's, they will be replaced with functions later.
What I'm acctually wondering is if you can have multiple event functions in 1 trigger.
I try to create a dialog( I am new to jass, learning it), and I try to have 2 triggers in 1 (2 event registers).
JASS:
globals
dialog dial
button array diabut
unit target
endglobals
function buttonclicked takes nothing returns nothing
local effect heal
call BJDebugMsg("gunnar")
call DialogDisplay(Player(0), dial, false)
if (GetClickedButton() == diabut[1]) then
call BJDebugMsg("blab")
call AddSpecialEffectTarget("Abilities\\Spells\\Human\\Heal\\HealTarget.mdl", target, "overhead")
set heal = GetLastCreatedEffectBJ()
call TriggerSleepAction(2)
endif
call DestroyEffectBJ(heal)
endfunction
function dialogaction takes nothing returns nothing
set target = GetEnteringUnit()
set dial = DialogCreate()
call DialogSetMessage(dial, "test")
call DialogAddButtonBJ(dial, "Heal hero")
set diabut[1] = GetLastCreatedButtonBJ()
call DialogAddButtonBJ(dial, "Nevermind.")
set diabut[2] = GetLastCreatedButtonBJ()
call DialogDisplay(Player(0), dial, true)
endfunction
//===========================================================================
function InitTrig_Dialog takes nothing returns nothing
local trigger trig = CreateTrigger()
local trigger trig1 = CreateTrigger()
call TriggerRegisterDialogEventBJ(trig1, dial)
call TriggerRegisterEnterRectSimple(trig, gg_rct_Region_001)
call TriggerAddAction(trig1, function buttonclicked)
call TriggerAddAction(trig, function dialogaction)
endfunction
Don't mind about the debugmsg's, they will be replaced with functions later.
What I'm acctually wondering is if you can have multiple event functions in 1 trigger.