KF2-CustomTraderInventory/CTI/Classes/OfficialWeapons.uc
GenZmeY 48d9e1c60e v1.4.0
- added WeaponClass check at config loading stage;
- added DLC unlock without replacing KFGFxMoviePlayer_Manager;
- redesigned UnlockDLC - now it is flexibly configured;
- updated logger and some messages in the log;
- added parameter bOfficialWeaponsList allowing you;
  to have an up-to-date list of all official weapons in the config;
- optimized weapon preload: official weapon models are skipped now.
2022-07-18 20:27:51 +03:00

44 lines
953 B
Ucode

class OfficialWeapons extends Object
config(CTI);
const Trader = class'Trader';
const DefaultComment = "Auto-generated list of official weapons for your convenience, copy-paste ready";
var private config String Comment;
var private config Array<String> Item;
private delegate int ByName(String A, String B)
{
return A > B ? -1 : 0;
}
public static function Update(bool Enabled)
{
local Array<class<KFWeaponDefinition> > KFWeapDefs;
local class<KFWeaponDefinition> KFWeapDef;
if (!Enabled) return;
KFWeapDefs = Trader.static.GetTraderWeapDefs();
if (default.Item.Length != KFWeapDefs.Length || default.Comment != DefaultComment)
{
default.Comment = DefaultComment;
default.Item.Length = 0;
foreach KFWeapDefs(KFWeapDef)
{
default.Item.AddItem(KFWeapDef.GetPackageName() $ "." $ KFWeapDef);
}
default.Item.Sort(ByName);
StaticSaveConfig();
}
}
defaultproperties
{
}