# Game Menu Item Selected

Grammar — Player player selected gameMenuItem|Game Menu Item on the Game Menu Dialog
FlagsNative | Event

This event fires when a player selects an item on the Game Menu Dialog. Use “Game Menu Item Selected” to get the menu item that the player selected.

# Arguments

Returns — void

native void TriggerAddEventGameMenuItemSelected(
	trigger t,
	int player,
	int gameMenuIndex,
);

# Event parameters

Category: UI / Game Menu

# Examples

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tarcade.sc2map/MapScript.galaxy:8337

void gt_PlayAgainClicked_Init () {
    gt_PlayAgainClicked = TriggerCreate("gt_PlayAgainClicked_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayAgainClicked, c_playerAny, c_gameMenuDialogGenericButton1);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tarcade.sc2map/MapScript.galaxy:8358

void gt_QuitClicked_Init () {
    gt_QuitClicked = TriggerCreate("gt_QuitClicked_Func");
    TriggerAddEventGameMenuItemSelected(gt_QuitClicked, c_playerAny, c_gameMenuDialogGenericButton2);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tarcade.sc2map/MapScript.galaxy:8378

void gt_ReturnToGameClicked_Init () {
    gt_ReturnToGameClicked = TriggerCreate("gt_ReturnToGameClicked_Func");
    TriggerAddEventGameMenuItemSelected(gt_ReturnToGameClicked, c_playerAny, c_gameMenuDialogReturnToGameplayButton);
}

campaigns/liberty.sc2campaignbase.sc2maps/maps/campaign/tstory01.sc2map/MapScript.galaxy:17517

void gt_PlayerQuitsStorymode_Init () {
    gt_PlayerQuitsStorymode = TriggerCreate("gt_PlayerQuitsStorymode_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayerQuitsStorymode, c_playerAny, c_gameMenuDialogQuitButton);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tarcade.sc2mapMapScript.galaxy:8337

void gt_PlayAgainClicked_Init () {
    gt_PlayAgainClicked = TriggerCreate("gt_PlayAgainClicked_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayAgainClicked, c_playerAny, c_gameMenuDialogGenericButton1);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tarcade.sc2mapMapScript.galaxy:8358

void gt_QuitClicked_Init () {
    gt_QuitClicked = TriggerCreate("gt_QuitClicked_Func");
    TriggerAddEventGameMenuItemSelected(gt_QuitClicked, c_playerAny, c_gameMenuDialogGenericButton2);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tarcade.sc2mapMapScript.galaxy:8378

void gt_ReturnToGameClicked_Init () {
    gt_ReturnToGameClicked = TriggerCreate("gt_ReturnToGameClicked_Func");
    TriggerAddEventGameMenuItemSelected(gt_ReturnToGameClicked, c_playerAny, c_gameMenuDialogReturnToGameplayButton);
}

campaigns/liberty.sc2campaign/base.sc2maps/maps/campaign/tstory01.sc2mapMapScript.galaxy:17517

void gt_PlayerQuitsStorymode_Init () {
    gt_PlayerQuitsStorymode = TriggerCreate("gt_PlayerQuitsStorymode_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayerQuitsStorymode, c_playerAny, c_gameMenuDialogQuitButton);
}

campaigns/swarmstoryutil.sc2modbase.sc2data/Lib281DEC45.galaxy:5848

void lib281DEC45_gt_ZSS_StoryModeMenuQuit_Init () {
    lib281DEC45_gt_ZSS_StoryModeMenuQuit = TriggerCreate("lib281DEC45_gt_ZSS_StoryModeMenuQuit_Func");
    TriggerAddEventGameMenuItemSelected(lib281DEC45_gt_ZSS_StoryModeMenuQuit, c_playerAny, c_gameMenuDialogQuitButton);
}

campaigns/voidstory.sc2campaignbase.sc2data/TriggerLibs/VoidCampaignStoryLib.galaxy:5011

void libVCST_gt_PS_StoryModeMenuQuit_Init () {
    libVCST_gt_PS_StoryModeMenuQuit = TriggerCreate("libVCST_gt_PS_StoryModeMenuQuit_Func");
    TriggerAddEventGameMenuItemSelected(libVCST_gt_PS_StoryModeMenuQuit, c_playerAny, c_gameMenuDialogQuitButton);
}

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmap/MapScript.galaxy:4444

void gt_PlayerExitEarly_Init () {
    gt_PlayerExitEarly = TriggerCreate("gt_PlayerExitEarly_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayerExitEarly, c_playerAny, c_gameMenuDialogQuitButton);
}

mods/heroes.stormmodbase.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialmapmechanics.stormmap/MapScript.galaxy:1224

void gt_PlayerExitEarly_Init () {
    gt_PlayerExitEarly = TriggerCreate("gt_PlayerExitEarly_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayerExitEarly, c_playerAny, c_gameMenuDialogQuitButton);
}

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorial01.stormmapMapScript.galaxy:4444

void gt_PlayerExitEarly_Init () {
    gt_PlayerExitEarly = TriggerCreate("gt_PlayerExitEarly_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayerExitEarly, c_playerAny, c_gameMenuDialogQuitButton);
}

mods/heroes.stormmod/base.stormmaps/maps/heroes/singleplayermaps/startingexperience/tutorialmapmechanics.stormmapMapScript.galaxy:1224

void gt_PlayerExitEarly_Init () {
    gt_PlayerExitEarly = TriggerCreate("gt_PlayerExitEarly_Func");
    TriggerAddEventGameMenuItemSelected(gt_PlayerExitEarly, c_playerAny, c_gameMenuDialogQuitButton);
}

mods/missionpacks/novacampaign.sc2modbase.sc2data/LibNCST.galaxy:4374

void libNCST_gt_NS_StoryModeMenuQuit_Init () {
    libNCST_gt_NS_StoryModeMenuQuit = TriggerCreate("libNCST_gt_NS_StoryModeMenuQuit_Func");
    TriggerAddEventGameMenuItemSelected(libNCST_gt_NS_StoryModeMenuQuit, c_playerAny, c_gameMenuDialogQuitButton);
}

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:29776

    libCOMI_gt_CM_AbortMission = TriggerCreate("libCOMI_gt_CM_AbortMission_Func");
    TriggerAddEventAbortMission(libCOMI_gt_CM_AbortMission, c_playerAny);
    TriggerAddEventGameMenuItemSelected(libCOMI_gt_CM_AbortMission, c_playerAny, c_gameMenuDialogQuitButton);
}