# Set Purchase Group State
Grammar — Set the state of purchaseGroup to state
Flags —Native
|Action
Sets the visibility state for the specified purchase group.
# Arguments
int
<preset::PurchaseGroup> — Purchase Groupint
<preset::PurchaseGroupState2> — State
Returns — void
native void PurchaseGroupSetState(
int inPurchaseGroupId,
int inState,
);
# Related
Category: Story / Tech Purchase Panel / Purchase Groups
- Create Purchase Group —
int
<preset::PurchaseGroup> — PurchaseGroupCreate - Last Created Purchase Group —
int
<preset::PurchaseGroup> — PurchaseGroupLastCreated - Destroy Purchase Group —
void
— PurchaseGroupDestroy - Destroy All Purchase Groups —
void
— PurchaseGroupDestroyAll - Set Purchase Group Name —
void
— PurchaseGroupSetNameText - Set Purchase Group Tooltip —
void
— PurchaseGroupSetTooltipText - Set Purchase Group Slot —
void
— PurchaseGroupSetSlot - Set Purchase Group Unit —
void
— PurchaseGroupSetUnitLink - Set Purchase Group Icon —
void
— PurchaseGroupSetIconFilePath - Set Purchase Group Players —
void
— PurchaseGroupSetPlayerGroup - Set Purchase Group State —
void
— PurchaseGroupSetState
# Examples
campaigns/libertystory.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7692
}
else {
PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseCategoryStateHidden);
}
}
campaigns/libertystory.sc2campaign — base.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.sc2campaign — base.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;