function MeleeVictoryDialogBJ takes player whichPlayer, boolean leftGame returns nothing
local trigger t = CreateTrigger()
local dialog d = DialogCreate()
local string formatString
// Display "player was victorious" or "player has left the game" message
if (leftGame) then
set formatString = GetLocalizedString( "PLAYER_LEFT_GAME" )
else
set formatString = GetLocalizedString( "PLAYER_VICTORIOUS" )
endif
call DisplayTimedTextFromPlayer(whichPlayer, 0, 0, 60, formatString)
call DialogSetMessage( d, GetLocalizedString( "GAMEOVER_VICTORY_MSG" ) )
call DialogAddButton( d, GetLocalizedString( "GAMEOVER_CONTINUE_GAME" ), GetLocalizedHotkey("GAMEOVER_CONTINUE_GAME") )
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddQuitButton( d, true, GetLocalizedString( "GAMEOVER_QUIT_GAME" ), GetLocalizedHotkey("GAMEOVER_QUIT_GAME") ) )
call DialogDisplay( whichPlayer, d, true )
call StartSoundForPlayerBJ( whichPlayer, bj_victoryDialogSound )
endfunction
//===========================================================================
function MeleeDefeatDialogBJ takes player whichPlayer, boolean leftGame returns nothing
local trigger t = CreateTrigger()
local dialog d = DialogCreate()
local string formatString
// Display "player was defeated" or "player has left the game" message
if (leftGame) then
set formatString = GetLocalizedString( "PLAYER_LEFT_GAME" )
else
set formatString = GetLocalizedString( "PLAYER_DEFEATED" )
endif
call DisplayTimedTextFromPlayer(whichPlayer, 0, 0, 60, formatString)
call DialogSetMessage( d, GetLocalizedString( "GAMEOVER_DEFEAT_MSG" ) )
// Only show the continue button if the game is not over and observers on death are allowed
if (not bj_meleeGameOver and IsMapFlagSet(MAP_OBSERVERS_ON_DEATH)) then
call DialogAddButton( d, GetLocalizedString( "GAMEOVER_CONTINUE_OBSERVING" ), GetLocalizedHotkey("GAMEOVER_CONTINUE_OBSERVING") )
endif
set t = CreateTrigger()
call TriggerRegisterDialogButtonEvent( t, DialogAddQuitButton( d, true, GetLocalizedString( "GAMEOVER_QUIT_GAME" ), GetLocalizedHotkey("GAMEOVER_QUIT_GAME") ) )
call DialogDisplay( whichPlayer, d, true )
call StartSoundForPlayerBJ( whichPlayer, bj_defeatDialogSound )
endfunction