This is the Client Source Part to Move all items to Global Inventory!
Q:What is this?
A:
Lets start!
In FrontEndWarZ.CPP
AFTER THIS
ADD THISCode:gfxMovie.RegisterEventHandler("eventMarketplaceActive", MAKE_CALLBACK(eventMarketplaceActive));
AFTER THIS FUNCTIONCode:gfxMovie.RegisterEventHandler("eventMoveAllItems", MAKE_CALLBACK(eventMoveAllItems));
ADD THIS ENTERY ONECode:void FrontendWarZ::OnDonateToServerSuccess()
IN FrontEndWarZ.hCode:void FrontendWarZ::eventMoveAllItems(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount) { //move all items from backpack to inventory const wiCharDataFull& slot = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID]; if(!(slot.GameFlags & wiCharDataFull::GAMEFLAG_NearPostBox)) return; int itemsToMove = 0; for(int i=8; i < slot.BackpackSize; ++i) { const wiInventoryItem& wi = slot.Items[i]; if(wi.itemID > 0) { itemsToMove++; } } if(itemsToMove) { if((gUserProfile.ProfileData.NumItems + itemsToMove) > wiUserProfile::INVENTORY_SIZE_LIMIT) { Scaleform::GFx::Value vars[3]; vars[0].SetString(gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace")); vars[1].SetBoolean(true); vars[2].SetString("$ERROR"); gfxMovie.Invoke("_root.api.showInfoMsg", vars, 3); return; } } else { 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_MoveAllItemsThread, &FrontendWarZ::OnMoveAllItemsSucessfully); } unsigned int WINAPI FrontendWarZ::as_MoveAllItemsThread(void* in_data) { r3dThreadAutoInstallCrashHelper crashHelper; FrontendWarZ* This = (FrontendWarZ*)in_data; This->DelayServerRequest(); int BackpackSlot = 0; int Quantity = 0; int apiCode = 0; const wiCharDataFull& slot = gUserProfile.ProfileData.ArmorySlots[gUserProfile.SelectedCharID]; for(int i=8; i < slot.BackpackSize; ++i) { const wiInventoryItem& wi = slot.Items[i]; if(wi.itemID > 0) { BackpackSlot = i; Quantity = wi.quantity; apiCode = gUserProfile.ApiBackpackToInventory(BackpackSlot, Quantity); } } if(apiCode != 0) { if(apiCode == 7) { This->SetAsyncError(0, gLangMngr.getString("GameSessionHasNotClosedYet")); } else if(apiCode == 9) { This->SetAsyncError(0, gLangMngr.getString("InGameUI_ErrorMsg_NoInventorySpace")); } else if(apiCode == 6) { return 1; } else { This->SetAsyncError(apiCode, gLangMngr.getString("BackpackToInventoryFail")); } return 0; } return 1; } void FrontendWarZ::OnMoveAllItemsSucessfully() { Scaleform::GFx::Value var[8]; gfxMovie.Invoke("_root.api.clearBackpack", ""); int slot = gUserProfile.SelectedCharID; addBackpackItems(gUserProfile.ProfileData.ArmorySlots[slot], slot); updateInventoryAndSkillItems(); updateSurvivorTotalWeight(slot); gfxMovie.Invoke("_root.api.hideInfoMsg", ""); gfxMovie.Invoke("_root.api.backpackToInventorySuccess", ""); return; }
AFTER THIS
ADD THISCode:void eventOpenURL(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
AFTER THISCode:void eventMoveAllItems(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
ADD THISCode:void OnRequestGCTransactionSuccess();
FLASH PARTCode:static unsigned int WINAPI as_MoveAllItemsThread(void* in_data); void OnMoveAllItemsSucessfully();
BY @lukasccb




Reply With Quote![[Tutorial] Move all items to Global Inventory - Source code Part](http://ragezone.com/hyper728.png)

