class OfficialWeapons extends Object config(LTI); 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 Item; private delegate int ByName(String A, String B) { return A > B ? -1 : 0; } public static function Update(bool Enabled) { local Array > KFWeapDefs; local class 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 { }