# Last Created Purchase Category
Grammar — Last created purchase category
Flags —Native
|Function
Returns the last purchase category created using “Create Purchase Category”.
Returns — int
<preset::PurchaseCategory>
native int PurchaseCategoryLastCreated();
# 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:7586
if ((libCamp_gv_tS_TechCategoryID[lv_index] != libCamp_ge_StoryTechCategory_StoryTechCategoryNone) && (libCamp_gv_tS_TechCategory_UI[lv_index] == c_invalidPurchaseCategoryId)) {
PurchaseCategoryCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategorySlot[lv_index]);
libCamp_gv_tS_TechCategory_UI[lv_index] = PurchaseCategoryLastCreated();
PurchaseCategorySetNameText(PurchaseCategoryLastCreated(), libCamp_gv_tS_TechCategoryName[lv_index]);
}
campaigns/libertystory.sc2campaign — base.sc2data/TriggerLibs/CampaignLib.galaxy:7587
PurchaseCategoryCreate(PlayerGroupAll(), libCamp_gv_tS_TechCategorySlot[lv_index]);
libCamp_gv_tS_TechCategory_UI[lv_index] = PurchaseCategoryLastCreated();
PurchaseCategorySetNameText(PurchaseCategoryLastCreated(), libCamp_gv_tS_TechCategoryName[lv_index]);
}