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 THIS
AFTER THIS FUNCTION
ADD THIS ENTERY ONE
IN FrontEndWarZ.h
AFTER THIS
ADD THIS
AFTER THIS
ADD THIS
FLASH PART
BY @lukasccb
Q:What is this?
A:
Lets start!
In FrontEndWarZ.CPP
AFTER THIS
Code:
gfxMovie.RegisterEventHandler("eventMarketplaceActive", MAKE_CALLBACK(eventMarketplaceActive));
ADD THIS
Code:
gfxMovie.RegisterEventHandler("eventMoveAllItems", MAKE_CALLBACK(eventMoveAllItems));
AFTER THIS FUNCTION
Code:
void FrontendWarZ::OnDonateToServerSuccess()
ADD THIS ENTERY ONE
Code:
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;
}
IN FrontEndWarZ.h
AFTER THIS
Code:
void eventOpenURL(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
ADD THIS
Code:
void eventMoveAllItems(r3dScaleformMovie* pMovie, const Scaleform::GFx::Value* args, unsigned argCount);
Code:
void OnRequestGCTransactionSuccess();
ADD THIS
Code:
static unsigned int WINAPI as_MoveAllItemsThread(void* in_data);
void OnMoveAllItemsSucessfully();
FLASH PART
BY @lukasccb
Last edited:

