- Joined
- Jun 30, 2008
- Messages
- 580
JASS:
library GameInit initializer GameInitialization
globals
//**************************************************************//
// Constants //
//**************************************************************//
constant integer MAX_PLAYERS = 9
constant real TIMER_TIMEOUT = 0.04
//
//**************************************************************//
// Variables
integer CurrentPlayers
dialog array StartDialog[MAX_PLAYERS]
button array NewCharacterButton[MAX_PLAYERS]
//
//**************************************************************//
endglobals
private function LoadPlayers takes nothing returns nothing
local integer loop1 = 0
call BJDebugMsg("LoadRun")
loop
exitwhen loop1 > MAX_PLAYERS
call BJDebugMsg("Loop #"+I2S(loop1))
if (GetPlayerController(Player(loop1)) == MAP_CONTROL_USER ) then
set CurrentPlayers = CurrentPlayers+1
set StartDialog[loop1] = DialogCreate()
set NewCharacterButton[loop1] = DialogAddButton(StartDialog[loop1], "New Character", 0)
endif
set loop1 = loop1+1
endloop
set loop1 = 0
call BJDebugMsg("LoadExecuted")
call BJDebugMsg(I2S(CurrentPlayers))
endfunction
private function NewSelection takes nothing returns nothing
local CHARDATA temp = CHARDATA.create(GetTriggerPlayer())
call temp.ActivateCharacter(CreateUnit(GetTriggerPlayer(), 'CHAR', GetRectCenterX(gg_rct_Start), GetRectCenterY(gg_rct_Start), 0))
endfunction
private function GameInitialization takes nothing returns nothing
local trigger t = CreateTrigger()
local integer loop1 = 0
call TriggerRegisterTimerEventSingle( t, 0.01 )
call TriggerAddAction(t, function LoadPlayers)
set t = CreateTrigger()
loop
exitwhen loop1 > MAX_PLAYERS
call TriggerRegisterDialogButtonEvent(t, NewCharacterButton[loop1])
call TriggerAddAction(t, function NewSelection)
set loop1 = loop1+1
endloop
// Environment Setup
call FogEnableOff( )
call FogMaskEnableOff( )
call SetSkyModel("Environment\\Sky\\Sky\\SkyLight.mdl")
endfunction
endlibrary
The dialog wont come up, any idea why?