# Set Purchase Category State
Grammar — Set the state of purchaseCategory to state
Flags —Native
|Action
Sets the visibility state for the specified purchase category.
# Arguments
int
<preset::PurchaseCategory> — Purchase Categoryint
<preset::PurchaseSubGroupState> — State
Returns — void
native void PurchaseCategorySetState(
int inPurchaseCategoryId,
int inState,
);
# Related
Category: Story / Tech Purchase Panel / Purchase Categories
- Create Purchase Category —
int
<preset::PurchaseCategory> — PurchaseCategoryCreate - Last Created Purchase Category —
int
<preset::PurchaseCategory> — PurchaseCategoryLastCreated - Destroy Purchase Category —
void
— PurchaseCategoryDestroy - Destroy All Purchase Categories —
void
— PurchaseCategoryDestroyAll - Set Purchase Category Name —
void
— PurchaseCategorySetNameText - Set Purchase Category Slot —
void
— PurchaseCategorySetSlot - Set Purchase Category Players —
void
— PurchaseCategorySetPlayerGroup - Set Purchase Category State —
void
— PurchaseCategorySetState
# Examples
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7699
}
if ((lv_slot > 0)) {
PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[(lv_indexCategory)], c_purchaseCategoryStateEnabled);
}
else {
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7702
}
else {
PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[(lv_indexCategory)], c_purchaseCategoryStateHidden);
}
auto8062DA62_i = auto8062DA62_i + 1;
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7818
if ((libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] > -1)) {
if ((libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] > 0)) {
PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[lv_categoryIndex], c_purchaseCategoryStateNew);
}
else {
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7821
}
else {
PurchaseCategorySetState(libCamp_gv_tS_TechCategory_UI[lv_categoryIndex], c_purchaseCategoryStateEnabled);
}
}
campaigns/libertystory.sc2campaign — base.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;