Browse Source

Add missing lists to templates component

pull/8/head
Anton Tarasenko 2 years ago
parent
commit
f388480ef8
  1. 31
      sources/Gameplay/KF1Frontend/Trading/KF1_TemplatesComponent.uc

31
sources/Gameplay/KF1Frontend/Trading/KF1_TemplatesComponent.uc

@ -33,6 +33,7 @@ var private array<Text> berserkerWeaponsList;
var private array<Text> firebugWeaponsList; var private array<Text> firebugWeaponsList;
var private array<Text> demolitionWeaponsList; var private array<Text> demolitionWeaponsList;
var private array<Text> neutralWeaponsList; var private array<Text> neutralWeaponsList;
var private array<Text> toolWeaponsList;
protected function Finalizer() protected function Finalizer()
{ {
@ -45,6 +46,7 @@ protected function Finalizer()
_.memory.FreeMany(firebugWeaponsList); _.memory.FreeMany(firebugWeaponsList);
_.memory.FreeMany(demolitionWeaponsList); _.memory.FreeMany(demolitionWeaponsList);
_.memory.FreeMany(neutralWeaponsList); _.memory.FreeMany(neutralWeaponsList);
_.memory.FreeMany(toolWeaponsList);
_.memory.FreeMany(availableWeaponLists); _.memory.FreeMany(availableWeaponLists);
if (allWeaponsList.length > 0) { if (allWeaponsList.length > 0) {
allWeaponsList.length = 0; allWeaponsList.length = 0;
@ -76,6 +78,9 @@ protected function Finalizer()
if (availableWeaponLists.length > 0) { if (availableWeaponLists.length > 0) {
availableWeaponLists.length = 0; availableWeaponLists.length = 0;
} }
if (toolWeaponsList.length > 0) {
toolWeaponsList.length = 0;
}
listsAreReady = false; listsAreReady = false;
} }
@ -97,15 +102,19 @@ private function BuildKFWeaponLists()
firebugWeaponsList = MakeWeaponList(kfLevelRules.fireItemForSale); firebugWeaponsList = MakeWeaponList(kfLevelRules.fireItemForSale);
demolitionWeaponsList = MakeWeaponList(kfLevelRules.demoItemForSale); demolitionWeaponsList = MakeWeaponList(kfLevelRules.demoItemForSale);
neutralWeaponsList = MakeWeaponList(kfLevelRules.neutItemForSale); neutralWeaponsList = MakeWeaponList(kfLevelRules.neutItemForSale);
availableWeaponLists[0] = _.text.FromString("all weapons"); toolWeaponsList[0] = _.text.FromString("kfmod.syringe");
availableWeaponLists[1] = _.text.FromString("trading weapons"); toolWeaponsList[1] = _.text.FromString("kfmod.welder");
availableWeaponLists[2] = _.text.FromString("medic weapons"); availableWeaponLists[0] = _.text.FromString("all weapons");
availableWeaponLists[3] = _.text.FromString("support weapons"); availableWeaponLists[1] = _.text.FromString("trading weapons");
availableWeaponLists[4] = _.text.FromString("sharpshooter weapons"); availableWeaponLists[2] = _.text.FromString("medic weapons");
availableWeaponLists[5] = _.text.FromString("commando weapons"); availableWeaponLists[3] = _.text.FromString("support weapons");
availableWeaponLists[6] = _.text.FromString("firebug weapons"); availableWeaponLists[4] = _.text.FromString("sharpshooter weapons");
availableWeaponLists[7] = _.text.FromString("demolition weapons"); availableWeaponLists[5] = _.text.FromString("commando weapons");
availableWeaponLists[8] = _.text.FromString("neutral weapons"); availableWeaponLists[6] = _.text.FromString("firebug weapons");
availableWeaponLists[7] = _.text.FromString("firebug weapons");
availableWeaponLists[8] = _.text.FromString("demolition weapons");
availableWeaponLists[9] = _.text.FromString("tools");
availableWeaponLists[10] = _.text.FromString("neutral weapons");
listsAreReady = true; listsAreReady = true;
} }
@ -157,6 +166,7 @@ public function bool ItemListExists(Text listName)
if (listNameAsString == "berserker weapons") return true; if (listNameAsString == "berserker weapons") return true;
if (listNameAsString == "firebug weapons") return true; if (listNameAsString == "firebug weapons") return true;
if (listNameAsString == "demolition weapons") return true; if (listNameAsString == "demolition weapons") return true;
if (listNameAsString == "tools") return true;
if (listNameAsString == "neutral weapons") return true; if (listNameAsString == "neutral weapons") return true;
return false; return false;
@ -198,6 +208,9 @@ public function array<Text> GetItemList(Text listName)
if (listNameAsString == "demolition weapons") { if (listNameAsString == "demolition weapons") {
return CopyList(demolitionWeaponsList); return CopyList(demolitionWeaponsList);
} }
if (listNameAsString == "tools") {
return CopyList(toolWeaponsList);
}
if (listNameAsString == "neutral weapons") { if (listNameAsString == "neutral weapons") {
return CopyList(neutralWeaponsList); return CopyList(neutralWeaponsList);
} }

Loading…
Cancel
Save