Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FrontendWarZ::eventBuyItem(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount)
- {
- mStore_BuyItemID = args[0].GetUInt(); // legsID
- mStore_BuyPrice = args[1].GetInt();
- mStore_BuyPriceGD = args[2].GetInt();
- //mStore_BuyPriceSC = args[3].GetInt();
- if(gUserProfile.ProfileData.GameDollars < mStore_BuyPriceGD || gUserProfile.ProfileData.GamePoints < mStore_BuyPrice /*|| gUserProfile.ProfileData.GameCells < mStore_BuyPriceSC*/)
- {
- Scaleform::GFx::Value var[2];
- var[0].SetString(gLangMngr.getString("NotEnougMoneyToBuyItem"));
- var[1].SetBoolean(true);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- return;
- }
- const BaseItemConfig* itemConfig = g_pWeaponArmory->getAccountItemConfig(mStore_BuyItemID);
- if(itemConfig && itemConfig->category == storecat_LootBox)
- {
- if(gUserProfile.haveFreeInventorySlot(false) == false)
- {
- Scaleform::GFx::Value var[2];
- var[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace"));
- var[1].SetBoolean(true);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- return;
- }
- Scaleform::GFx::Value var[2];
- var[0].SetString(gLangMngr.getString("OneMomentPlease"));
- var[1].SetBoolean(false);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- StartAsyncOperation(&FrontendWarZ::as_BuyLootBoxThread, &FrontendWarZ::OnBuyLootBoxSuccess);
- }
- else
- {
- if(gUserProfile.haveFreeInventorySlot(false) == false)
- {
- Scaleform::GFx::Value var[2];
- var[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace"));
- var[1].SetBoolean(true);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- return;
- }
- Scaleform::GFx::Value var[2];
- var[0].SetString(gLangMngr.getString("OneMomentPlease"));
- var[1].SetBoolean(false);
- gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
- StartAsyncOperation(&FrontendWarZ::as_BuyItemThread, &FrontendWarZ::OnBuyItemSuccess);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement