redesign preloadcontent
This commit is contained in:
parent
eef8aa42f2
commit
edda872f5f
@ -142,6 +142,10 @@ private reliable client function ClientSync(class<KFWeaponDefinition> WeapDef, o
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
AddItems.AddItem(WeapDef);
|
AddItems.AddItem(WeapDef);
|
||||||
|
if (PreloadContent)
|
||||||
|
{
|
||||||
|
Helper.static.PreloadWeapon(WeapDef);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Recieved = RemoveItems.Length + AddItems.Length;
|
Recieved = RemoveItems.Length + AddItems.Length;
|
||||||
@ -176,11 +180,6 @@ private simulated reliable client function SyncFinished()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Helper.static.ModifyTrader(KFGRI, RemoveItems, AddItems, ReplaceMode);
|
Helper.static.ModifyTrader(KFGRI, RemoveItems, AddItems, ReplaceMode);
|
||||||
|
|
||||||
if (PreloadContent)
|
|
||||||
{
|
|
||||||
Helper.static.PreloadContent(AddItems);
|
|
||||||
}
|
|
||||||
|
|
||||||
ShowReadyButton();
|
ShowReadyButton();
|
||||||
|
|
||||||
|
@ -52,18 +52,24 @@ public static simulated function ModifyTrader(
|
|||||||
KFGRI.TraderItems = TraderItems;
|
KFGRI.TraderItems = TraderItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function PreloadContent(Array<class<KFWeaponDefinition> > WeapDefs)
|
public static simulated function PreloadContent(Array<class<KFWeaponDefinition> > WeapDefs)
|
||||||
|
{
|
||||||
|
local class<KFWeaponDefinition> WeapDef;
|
||||||
|
|
||||||
|
foreach WeapDefs(WeapDef)
|
||||||
|
{
|
||||||
|
PreloadWeapon(WeapDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static simulated function PreloadWeapon(class<KFWeaponDefinition> WeapDef)
|
||||||
{
|
{
|
||||||
local class<KFWeapon> KFW;
|
local class<KFWeapon> KFW;
|
||||||
local int Index;
|
|
||||||
|
|
||||||
for (Index = 0; Index < WeapDefs.Length; Index++)
|
KFW = class<KFWeapon> (DynamicLoadObject(WeapDef.default.WeaponClassPath, class'Class'));
|
||||||
|
if (KFW != None)
|
||||||
{
|
{
|
||||||
KFW = class<KFWeapon> (DynamicLoadObject(WeapDefs[Index].default.WeaponClassPath, class'Class'));
|
class'KFWeapon'.static.TriggerAsyncContentLoad(KFW);
|
||||||
if (KFW != None)
|
|
||||||
{
|
|
||||||
class'KFWeapon'.static.TriggerAsyncContentLoad(KFW);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user