remove DLC and HRG
This commit is contained in:
parent
19d360ed46
commit
65dc9f537b
@ -1,7 +1,7 @@
|
|||||||
class LTI extends Info
|
class LTI extends Info
|
||||||
config(LTI);
|
config(LTI);
|
||||||
|
|
||||||
const LatestVersion = 1;
|
const LatestVersion = 2;
|
||||||
|
|
||||||
const CfgRemoveItems = class'RemoveItems';
|
const CfgRemoveItems = class'RemoveItems';
|
||||||
const CfgOfficialWeapons = class'OfficialWeapons';
|
const CfgOfficialWeapons = class'OfficialWeapons';
|
||||||
@ -71,6 +71,8 @@ private function PreInit()
|
|||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
`Log_Info("Config created");
|
`Log_Info("Config created");
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
|
||||||
case MaxInt:
|
case MaxInt:
|
||||||
`Log_Info("Config updated to version" @ LatestVersion);
|
`Log_Info("Config updated to version" @ LatestVersion);
|
||||||
break;
|
break;
|
||||||
@ -139,7 +141,13 @@ private function PostInit()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Trader.static.ModifyTrader(KFGRI, RemoveItems, CfgRemoveItems.default.bAll, LogLevel);
|
Trader.static.ModifyTrader(
|
||||||
|
KFGRI,
|
||||||
|
RemoveItems,
|
||||||
|
CfgRemoveItems.default.bAll,
|
||||||
|
CfgRemoveItems.default.bHRG,
|
||||||
|
CfgRemoveItems.default.bDLC,
|
||||||
|
LogLevel);
|
||||||
|
|
||||||
ReadyToSync = true;
|
ReadyToSync = true;
|
||||||
|
|
||||||
@ -185,7 +193,9 @@ public function bool CreateRepInfo(Controller C)
|
|||||||
Self,
|
Self,
|
||||||
LogLevel,
|
LogLevel,
|
||||||
RemoveItems,
|
RemoveItems,
|
||||||
CfgRemoveItems.default.bAll);
|
CfgRemoveItems.default.bAll,
|
||||||
|
CfgRemoveItems.default.bHRG,
|
||||||
|
CfgRemoveItems.default.bDLC);
|
||||||
|
|
||||||
RepInfos.AddItem(RepInfo);
|
RepInfos.AddItem(RepInfo);
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public function AddMutator(Mutator Mut)
|
|||||||
if (Mut == Self) return;
|
if (Mut == Self) return;
|
||||||
|
|
||||||
if (Mut.Class == Class)
|
if (Mut.Class == Class)
|
||||||
Mut.Destroy();
|
LTIMut(Mut).SafeDestroy();
|
||||||
else
|
else
|
||||||
Super.AddMutator(Mut);
|
Super.AddMutator(Mut);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ var private LTI LTI;
|
|||||||
var private E_LogLevel LogLevel;
|
var private E_LogLevel LogLevel;
|
||||||
var private Array<class<KFWeaponDefinition> > RemoveItems;
|
var private Array<class<KFWeaponDefinition> > RemoveItems;
|
||||||
var private bool ReplaceMode;
|
var private bool ReplaceMode;
|
||||||
|
var private bool RemoveHRG;
|
||||||
|
var private bool RemoveDLC;
|
||||||
|
|
||||||
var private int Recieved;
|
var private int Recieved;
|
||||||
var private int SyncSize;
|
var private int SyncSize;
|
||||||
@ -27,7 +29,7 @@ var private int WaitingGRI;
|
|||||||
replication
|
replication
|
||||||
{
|
{
|
||||||
if (bNetInitial && Role == ROLE_Authority)
|
if (bNetInitial && Role == ROLE_Authority)
|
||||||
LogLevel, ReplaceMode, SyncSize;
|
LogLevel, ReplaceMode, RemoveHRG, RemoveDLC, SyncSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
public simulated function bool SafeDestroy()
|
||||||
@ -41,7 +43,9 @@ public function PrepareSync(
|
|||||||
LTI _LTI,
|
LTI _LTI,
|
||||||
E_LogLevel _LogLevel,
|
E_LogLevel _LogLevel,
|
||||||
Array<class<KFWeaponDefinition> > _RemoveItems,
|
Array<class<KFWeaponDefinition> > _RemoveItems,
|
||||||
bool _ReplaceMode)
|
bool _ReplaceMode,
|
||||||
|
bool _RemoveHRG,
|
||||||
|
bool _RemoveDLC)
|
||||||
{
|
{
|
||||||
`Log_Trace();
|
`Log_Trace();
|
||||||
|
|
||||||
@ -49,6 +53,8 @@ public function PrepareSync(
|
|||||||
LogLevel = _LogLevel;
|
LogLevel = _LogLevel;
|
||||||
RemoveItems = _RemoveItems;
|
RemoveItems = _RemoveItems;
|
||||||
ReplaceMode = _ReplaceMode;
|
ReplaceMode = _ReplaceMode;
|
||||||
|
RemoveHRG = _RemoveHRG;
|
||||||
|
RemoveDLC = _RemoveDLC;
|
||||||
SyncSize = RemoveItems.Length;
|
SyncSize = RemoveItems.Length;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +222,7 @@ private simulated reliable client function ClientSyncFinished()
|
|||||||
NotificationRightText = "";
|
NotificationRightText = "";
|
||||||
NotificationPercent = 0;
|
NotificationPercent = 0;
|
||||||
|
|
||||||
Trader.static.ModifyTrader(KFGRI, RemoveItems, ReplaceMode, LogLevel);
|
Trader.static.ModifyTrader(KFGRI, RemoveItems, ReplaceMode, RemoveHRG, RemoveDLC, LogLevel);
|
||||||
`Log_Debug("ClientSyncFinished: Trader.static.ModifyTrader");
|
`Log_Debug("ClientSyncFinished: Trader.static.ModifyTrader");
|
||||||
|
|
||||||
ClearTimer(nameof(KeepNotification));
|
ClearTimer(nameof(KeepNotification));
|
||||||
|
@ -3,6 +3,8 @@ class RemoveItems extends Object
|
|||||||
config(LTI);
|
config(LTI);
|
||||||
|
|
||||||
var public config bool bAll;
|
var public config bool bAll;
|
||||||
|
var public config bool bHRG;
|
||||||
|
var public config bool bDLC;
|
||||||
var private config Array<String> Item;
|
var private config Array<String> Item;
|
||||||
|
|
||||||
public static function InitConfig(int Version, int LatestVersion)
|
public static function InitConfig(int Version, int LatestVersion)
|
||||||
@ -12,6 +14,10 @@ public static function InitConfig(int Version, int LatestVersion)
|
|||||||
case `NO_CONFIG:
|
case `NO_CONFIG:
|
||||||
ApplyDefault();
|
ApplyDefault();
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
default.bHRG = false;
|
||||||
|
default.bDLC = false;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,6 +30,8 @@ public static function InitConfig(int Version, int LatestVersion)
|
|||||||
private static function ApplyDefault()
|
private static function ApplyDefault()
|
||||||
{
|
{
|
||||||
default.bAll = false;
|
default.bAll = false;
|
||||||
|
default.bHRG = false;
|
||||||
|
default.bDLC = false;
|
||||||
default.Item.Length = 0;
|
default.Item.Length = 0;
|
||||||
default.Item.AddItem("KFGame.KFWeapDef_9mmDual");
|
default.Item.AddItem("KFGame.KFWeapDef_9mmDual");
|
||||||
}
|
}
|
||||||
@ -43,6 +51,15 @@ public static function Array<class<KFWeaponDefinition> > Load(E_LogLevel LogLeve
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (default.bHRG)
|
||||||
|
{
|
||||||
|
`Log_Info("Remove all HRG items");
|
||||||
|
}
|
||||||
|
if (default.bDLC)
|
||||||
|
{
|
||||||
|
`Log_Info("Remove all DLC items");
|
||||||
|
}
|
||||||
|
|
||||||
foreach default.Item(ItemRaw, Line)
|
foreach default.Item(ItemRaw, Line)
|
||||||
{
|
{
|
||||||
ItemWeapDef = class<KFWeaponDefinition>(DynamicLoadObject(ItemRaw, class'Class'));
|
ItemWeapDef = class<KFWeaponDefinition>(DynamicLoadObject(ItemRaw, class'Class'));
|
||||||
|
@ -69,6 +69,8 @@ public static simulated function ModifyTrader(
|
|||||||
KFGameReplicationInfo KFGRI,
|
KFGameReplicationInfo KFGRI,
|
||||||
Array<class<KFWeaponDefinition> > RemoveItems,
|
Array<class<KFWeaponDefinition> > RemoveItems,
|
||||||
bool ReplaceMode,
|
bool ReplaceMode,
|
||||||
|
bool RemoveHRG,
|
||||||
|
bool RemoveDLC,
|
||||||
E_LogLevel LogLevel)
|
E_LogLevel LogLevel)
|
||||||
{
|
{
|
||||||
local KFGFxObject_TraderItems TraderItems;
|
local KFGFxObject_TraderItems TraderItems;
|
||||||
@ -86,7 +88,9 @@ public static simulated function ModifyTrader(
|
|||||||
foreach TraderItems.SaleItems(Item)
|
foreach TraderItems.SaleItems(Item)
|
||||||
{
|
{
|
||||||
if (Item.WeaponDef != None
|
if (Item.WeaponDef != None
|
||||||
&& RemoveItems.Find(Item.WeaponDef) == INDEX_NONE)
|
&& RemoveItems.Find(Item.WeaponDef) == INDEX_NONE
|
||||||
|
&& (!RemoveHRG || (RemoveHRG && InStr(Item.WeaponDef, "_HRG", true) == INDEX_NONE))
|
||||||
|
&& (!RemoveDLC || (RemoveDLC && Item.WeaponDef.default.SharedUnlockId == SCU_None)))
|
||||||
{
|
{
|
||||||
WeapDefs.AddItem(Item.WeaponDef);
|
WeapDefs.AddItem(Item.WeaponDef);
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,9 @@ Unfortunately I can't do anything about it because it's a game problem (not muta
|
|||||||
[*]Set [b]bOfficialWeaponsList=True[/b] to have an auto-updated list of all official weapons in the config (for a convenient copy-paste).
|
[*]Set [b]bOfficialWeaponsList=True[/b] to have an auto-updated list of all official weapons in the config (for a convenient copy-paste).
|
||||||
[*]Use [b][LTI.RemoveItems][/b] to remove items from the trader inventory.
|
[*]Use [b][LTI.RemoveItems][/b] to remove items from the trader inventory.
|
||||||
example: [b]Item=KFGame.KFWeapDef_Mac10[/b] will remove MAC10 from sale.
|
example: [b]Item=KFGame.KFWeapDef_Mac10[/b] will remove MAC10 from sale.
|
||||||
|
|
||||||
|
[*]Set [b]bHRG=True[/b] to remove HRG items.
|
||||||
|
[*]Set [b]bDLC=True[/b] to remove DLC items.
|
||||||
[/list]
|
[/list]
|
||||||
|
|
||||||
[h1]Sources[/h1]
|
[h1]Sources[/h1]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user