2017-10-20 07:02:53 +00:00
|
|
|
class ExtMenu_Inventory extends KFGFxMenu_Inventory;
|
|
|
|
|
|
|
|
function bool IsItemActive(int ItemDefinition)
|
|
|
|
{
|
|
|
|
local class<KFWeaponDefinition> WeaponDef;
|
|
|
|
local int ItemIndex;
|
|
|
|
|
|
|
|
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (ItemIndex == INDEX_NONE)
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (WeaponDef != none)
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
return class'ExtWeaponSkinList'.Static.IsSkinEquip(WeaponDef, ItemDefinition, ExtPlayerController(KFPC));
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-11-28 20:04:55 +00:00
|
|
|
function Callback_Equip(int ItemDefinition)
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
local class<KFWeaponDefinition> WeaponDef;
|
|
|
|
local int ItemIndex;
|
|
|
|
|
|
|
|
ItemIndex = class'ExtWeaponSkinList'.default.Skins.Find('Id', ItemDefinition);
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (ItemIndex == INDEX_NONE)
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
WeaponDef = class'ExtWeaponSkinList'.default.Skins[ItemIndex].WeaponDef;
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (WeaponDef != none)
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
2020-11-28 20:12:58 +00:00
|
|
|
if (IsItemActive(ItemDefinition))
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, 0, ExtPlayerController(KFPC));
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (class'WorldInfo'.static.IsConsoleBuild())
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
Manager.CachedProfile.ClearWeaponSkin(WeaponDef.default.WeaponClassPath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
class'ExtWeaponSkinList'.Static.SaveWeaponSkin(WeaponDef, ItemDefinition, ExtPlayerController(KFPC));
|
2020-11-28 20:12:58 +00:00
|
|
|
if (class'WorldInfo'.static.IsConsoleBuild())
|
2017-10-20 07:02:53 +00:00
|
|
|
{
|
|
|
|
Manager.CachedProfile.SaveWeaponSkin(WeaponDef.default.WeaponClassPath, ItemDefinition);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InitInventory();
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2017-10-20 07:02:53 +00:00
|
|
|
}
|