HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

End Game Dialog.

09-25-2007, 09:54 PM#1
cohadar
call CustomDefeatBJ( Player(0), "Defeat!" )

gives a bunch of shitty options like restart game, reduce difficulty and similar.
I want it to just have OK button, how do I do that?

Same for Victory.. I don't want that continue playing stupidity.
09-25-2007, 10:02 PM#2
Dark.Revenant
Open up a custom dialog with an "OK" button. Upon clicking that "OK", instantly end the game w/o dialog.
09-25-2007, 10:12 PM#3
cohadar
ahh there is one:
native EndGame takes boolean doScoreScreen returns nothing

I was for some reason under the impression that endgame is hardcoded into that dialogs. (wouldn't be much of a surprise from blizz if it was so...)


EDIT:

Does call EndGame(true) ends game for all players?
a.k.a do I need to use local player here?

Is this OK?
Collapse JASS:

function EndGameDialogHandler takes nothing returns nothing
    if (GetLocalPlayer() == GetTriggerPlayer()) then
        call EndGame(true)
    endif
endfunction
09-26-2007, 07:03 AM#4
Pyrogasm
I believe so, yes.
09-26-2007, 09:10 AM#5
Anitarf
A little searching goes a long way.

Moral: CustomDefeatBJ only gives you the shitty options if you play in single player. RemovePlayer seems to split the game, since CustomDefeatQuitBJ calls EndGame without using GetLocalPlayer.