From 3120fae43605653a7259847018f9b2902e4be0c0 Mon Sep 17 00:00:00 2001 From: okvdai <108829133+okvdai@users.noreply.github.com> Date: Thu, 20 Apr 2023 18:36:25 +0200 Subject: [PATCH] Fix menu_stats_overview.nut --- mod/scripts/vscripts/pulse.gnut | 2 +- .../vscripts/ui/menu_stats_overview.nut | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/mod/scripts/vscripts/pulse.gnut b/mod/scripts/vscripts/pulse.gnut index 09f1408..6a7f254 100644 --- a/mod/scripts/vscripts/pulse.gnut +++ b/mod/scripts/vscripts/pulse.gnut @@ -1,7 +1,7 @@ global function GetStatsFromToneAPI global function getWeaponKillsFromToneApi -table globalToneAPIKillData = {} +global table globalToneAPIKillData = {} void function GetStatsFromToneAPI() { diff --git a/mod/scripts/vscripts/ui/menu_stats_overview.nut b/mod/scripts/vscripts/ui/menu_stats_overview.nut index 9c80dac..ab14cc3 100644 --- a/mod/scripts/vscripts/ui/menu_stats_overview.nut +++ b/mod/scripts/vscripts/ui/menu_stats_overview.nut @@ -311,22 +311,10 @@ function UpdateViewStatsOverviewMenu() SetStatsLabelValue( file.menu, "Last10GamesPVPValue", [ "#STATS_KD_VALUE", kdratiopvp_match_average ] ) PlotKDPointsOnGraph( file.menu, 1, kdratiopvp_match, lifetimeAveragePVP ) - int totalPilotKills = 0 + var totalPilotKills = 0 - array allWeapons = [] - - allWeapons.extend( GetVisibleItemsOfType( eItemTypes.PILOT_PRIMARY ) ) - allWeapons.extend( GetVisibleItemsOfType( eItemTypes.PILOT_SECONDARY ) ) - allWeapons.extend( GetVisibleItemsOfType( eItemTypes.TITAN_PRIMARY ) ) - allWeapons.extend( GetVisibleItemsOfType( eItemTypes.TITAN_ORDNANCE ) ) - allWeapons.extend( GetVisibleItemsOfType( eItemTypes.TITAN_ANTIRODEO ) ) - allWeapons.extend( GetVisibleItemsOfType( eItemTypes.TITAN_SPECIAL ) ) - - foreach (weapon in allWeapons) { - string weaponName = weapon.ref - print(weaponName) - totalPilotKills += getWeaponKillsFromToneApi(weapon.ref) - print(totalPilotKills) + foreach (var key, var value in globalToneAPIKillData) { + totalPilotKills += value } /////////////////////////