# Selected Purchase Category

Grammar — Purchase category selected by player player
FlagsNative | Function

Returns the purchase category that the specified player currently has selected.

# Arguments

  • int — Player

Returns — int<preset::PurchaseCategory>

native int PurchaseGetSelectedPurchaseCategory(
	int inPlayer,
);

Category: Story / Tech Purchase Panel / Interaction

# Examples

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:6831

    libCamp_gf_HideStoryUI(false, false);
    UISetFrameVisible(PlayerGroupAll(), c_syncFrameTypePurchasePanel, true);
    if ((PurchaseGetSelectedPurchaseCategory(1) == c_invalidPurchaseCategoryId)) {
        PurchaseSetSelectedPurchaseCategory(PlayerGroupAll(), libCamp_gv_tS_TechCategory_UI[(libCamp_ge_StoryTechCategory_StoryTechCategoryInfantry)]);
    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:12664

    }

    lv_tech = PurchaseGetSelectedPurchaseCategory(1);
    PurchaseCategorySetState(PurchaseGetSelectedPurchaseCategory(1), c_purchaseCategoryStateEnabled);
    PurchaseCategorySetNameText(libCamp_gv_tS_TechCategory_UI[(lv_tech)], (libCamp_gv_tS_TechCategoryName[(lv_tech)] + StringToText("")));

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:12665


    lv_tech = PurchaseGetSelectedPurchaseCategory(1);
    PurchaseCategorySetState(PurchaseGetSelectedPurchaseCategory(1), c_purchaseCategoryStateEnabled);
    PurchaseCategorySetNameText(libCamp_gv_tS_TechCategory_UI[(lv_tech)], (libCamp_gv_tS_TechCategoryName[(lv_tech)] + StringToText("")));
    return true;