# Last Created Purchase Category

Grammar — Last created purchase category
FlagsNative | Function

Returns the last purchase category created using “Create Purchase Category”.

Returns — int<preset::PurchaseCategory>

native int PurchaseCategoryLastCreated();

Category: Story / Tech Purchase Panel / Purchase Categories

# Examples

campaigns/libertystory.sc2campaignbase.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.sc2campaignbase.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]);
        }