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
|
||||
{
|
||||
AddItems.AddItem(WeapDef);
|
||||
if (PreloadContent)
|
||||
{
|
||||
Helper.static.PreloadWeapon(WeapDef);
|
||||
}
|
||||
}
|
||||
|
||||
Recieved = RemoveItems.Length + AddItems.Length;
|
||||
@ -177,11 +181,6 @@ private simulated reliable client function SyncFinished()
|
||||
|
||||
Helper.static.ModifyTrader(KFGRI, RemoveItems, AddItems, ReplaceMode);
|
||||
|
||||
if (PreloadContent)
|
||||
{
|
||||
Helper.static.PreloadContent(AddItems);
|
||||
}
|
||||
|
||||
ShowReadyButton();
|
||||
|
||||
SafeDestroy();
|
||||
|
@ -52,20 +52,26 @@ public static simulated function ModifyTrader(
|
||||
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 int Index;
|
||||
|
||||
for (Index = 0; Index < WeapDefs.Length; Index++)
|
||||
{
|
||||
KFW = class<KFWeapon> (DynamicLoadObject(WeapDefs[Index].default.WeaponClassPath, class'Class'));
|
||||
KFW = class<KFWeapon> (DynamicLoadObject(WeapDef.default.WeaponClassPath, class'Class'));
|
||||
if (KFW != None)
|
||||
{
|
||||
class'KFWeapon'.static.TriggerAsyncContentLoad(KFW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
defaultproperties
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user