# Set Purchase Group State

Grammar — Set the state of purchaseGroup to state
FlagsNative | Action

Sets the visibility state for the specified purchase group.

# Arguments

Returns — void

native void PurchaseGroupSetState(
	int inPurchaseGroupId,
	int inState,
);

Category: Story / Tech Purchase Panel / Purchase Groups

# Examples

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

            if ((lv_indexGroup != libCamp_ge_StoryTechGroup_StoryTechGroupNone) && (libCamp_gv_tS_TechGroup_UI[lv_groupIndex] != c_invalidPurchaseGroupId) && (libCamp_gv_tS_TechGroupCategoryID[lv_groupIndex] == lv_indexCategory)) {
                if ((libCamp_gf_TS_StoryTechGroupUIUnlocked(lv_indexGroup) == true)) {
                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseCategoryStateEnabled);
                    lv_slot += 1;
                    PurchaseGroupSetSlot(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_slot);

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

                    lv_slot += 1;
                    PurchaseGroupSetSlot(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_slot);
                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseGroupStateNew);
                    libCamp_gv_tSX_TechGroup_UI_New[lv_groupIndex] = true;
                    PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], libCamp_gv_tS_TechGroupUnitType[lv_groupIndex]);

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

                }
                else {
                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseCategoryStateHidden);
                }
            }

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

            if ((libCamp_gv_tSX_TechGroup_UI_New[lv_groupID] == true)) {
                libCamp_gv_tSX_TechGroup_UI_New[lv_groupID] = false;
                PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupID], c_purchaseGroupStateEnabled);
                libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] -= 1;
            }

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

        lv_tech = libCamp_gf_TechPurchasableTechID(PurchaseGetSelectedPurchaseItem(1));
        lv_groupID = (libCamp_gv_tS_Tech_GroupID[(lv_tech)]);
        PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupID], c_purchaseGroupStateEnabled);
        if ((libCamp_gv_tSX_Tech_Status[(lv_tech)] == libCamp_ge_StoryTechStates_TechNew)) {
            libCamp_gv_tSX_Tech_Status[(lv_tech)] = libCamp_ge_StoryTechStates_TechAvailable;