Parser rewrite
This commit is contained in:
@@ -153,16 +153,16 @@ void function UpdateStatsForMap( string mapName )
|
||||
//SetStatBoxDisplay( Hud_GetChild( file.menu, "Stat3" ), Localize( "#STATS_GAMES_PLAYED" ), gamesPlayed )
|
||||
|
||||
SetStatsLabelValue( file.menu, "KillsLabel0", "KILLS ON MAP" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue0", pulseParse(mapName, "maps", "kills") )
|
||||
SetStatsLabelValue( file.menu, "KillsValue0", pulseParse("maps", mapName, "kills") )
|
||||
|
||||
SetStatsLabelValue( file.menu, "KillsLabel1", "DEATHS ON MAP" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue1", pulseParse(mapName, "maps", "deaths") )
|
||||
SetStatsLabelValue( file.menu, "KillsValue1", pulseParse("maps", mapName, "deaths") )
|
||||
|
||||
SetStatsLabelValue( file.menu, "KillsLabel2", "TOTAL SHOT DISTANCE" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue2", string(int((1.905 * float(pulseParse(mapName, "maps", "total_distance") ) ) )/100) + "m" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue2", string(int((1.905 * float(pulseParse("maps", mapName, "total_distance") ) ) )/100) + "m" )
|
||||
|
||||
SetStatsLabelValue( file.menu, "KillsLabel3", "MAXIMUM SHOT DISTANCE" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue3", string(int((1.905 * float(pulseParse(mapName, "maps", "max_distance") ) ) )/100) + "m" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue3", string(int((1.905 * float(pulseParse("maps", mapName, "max_distance") ) ) )/100) + "m" )
|
||||
|
||||
SetStatsLabelValue( file.menu, "KillsLabel4", "--" )
|
||||
SetStatsLabelValue( file.menu, "KillsValue4", "--" )
|
||||
@@ -194,7 +194,7 @@ void function UpdateStatsForMap( string mapName )
|
||||
if (mapName in pulseData["gamemodesSeparated"])
|
||||
{
|
||||
float modePlayedTime = 0
|
||||
modePlayedTime = float(pulseParse(mapName, "gamemodesSeparated", modeName, "kills"))
|
||||
modePlayedTime = float(pulseParse("gamemodesSeparated", mapName, modeName, "kills"))
|
||||
if ( modePlayedTime > 0 ) {
|
||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void function UpdateStatsForMap( string mapName )
|
||||
if (mapName in pulseData["gamemodesSeparated"])
|
||||
{
|
||||
float modePlayedTime = 0
|
||||
modePlayedTime = float(pulseParse(mapName, "gamemodesSeparated", key, "kills"))
|
||||
modePlayedTime = float(pulseParse("gamemodesSeparated", mapName, key, "kills"))
|
||||
if ( modePlayedTime > 0 ) {
|
||||
AddPieChartEntry( modes, customGamemodeNames[key], modePlayedTime, value)
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void function GetTitanKills( string titanName )
|
||||
|
||||
foreach ( weaponRef in file.titanStatLoadout[ titanName ])
|
||||
{
|
||||
titanKillData[weaponRef] <- pulseParse(weaponRef, "weaponsLocal", "kills")
|
||||
titanKillData[weaponRef] <- pulseParse("weaponsLocal", weaponRef, "kills")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ function UpdateViewStatsOverviewMenu()
|
||||
if (key in titanKillData) {
|
||||
continue
|
||||
} else {
|
||||
killsAsPilot += pulseParse(string(key), "weaponsLocal", "kills")
|
||||
killsAsPilot += pulseParse("weaponsLocal", string(key), "kills")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -407,27 +407,27 @@ function UpdateViewStatsOverviewMenu()
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue0" ), string( killsAsPilot ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue1" ), string( GetPlayerStatInt( player, "kills_stats", "titanKillsAsPilot" ) ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue2" ), string( GetPlayerStatInt( player, "kills_stats", "totalNPC" ) ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue3" ), string( pulseParse("pilot_emptyhanded", "weaponsLocal", "kills") ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue4" ), string( pulseParse("human_execution", "weaponsLocal", "kills") ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue3" ), string( pulseParse("weaponsLocal", "pilot_emptyhanded", "kills") ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue4" ), string( pulseParse("weaponsLocal", "human_execution", "kills") ) )
|
||||
// Hud_SetText( GetElem( file.menu, "KillsAsPilotValue5" ), string( GetPlayerStatInt( player, "kills_stats", "titanFallKill" ) ) )
|
||||
|
||||
var titanMeleeKills = 0
|
||||
titanMeleeKills += pulseParse("titan_punch_ion", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("titan_punch_scorch", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("titan_punch_northstar", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("titan_sword", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("titan_punch_tone", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("titan_punch_legion", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("titan_punch_vanguard", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("auto_titan_melee", "weaponsLocal", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_ion", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_scorch", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_northstar", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_sword", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_tone", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_legion", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_vanguard", "kills")
|
||||
titanMeleeKills += pulseParse("weaponsLocal", "auto_titan_melee", "kills")
|
||||
|
||||
var titanExecutions = pulseParse("titan_execution", "weaponsLocal", "kills")
|
||||
var titanExecutions = pulseParse("weaponsLocal", "titan_execution", "kills")
|
||||
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue0" ), string( killsAsTitan ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue1" ), string( GetPlayerStatInt( player, "kills_stats", "titanKillsAsTitan" ) ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue2" ), string( titanExecutions ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue3" ), string( titanMeleeKills ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue4" ), string( pulseParse("damagedef_titan_step", "weaponsLocal", "kills") ) )
|
||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue4" ), string( pulseParse("weaponsLocal", "damagedef_titan_step", "kills") ) )
|
||||
}
|
||||
|
||||
function PlotKDPointsOnGraph( menu, graphIndex, values, dottedAverage )
|
||||
|
||||
@@ -49,7 +49,7 @@ float function GetTitanKills( string titanName)
|
||||
float weaponKills = 0
|
||||
foreach ( weaponRef in file.titanStatLoadout[ titanName ])
|
||||
{
|
||||
weaponKills += float(pulseParse(weaponRef, "weaponsLocal", "kills"))
|
||||
weaponKills += float(pulseParse("weaponsLocal", weaponRef, "kills"))
|
||||
}
|
||||
return weaponKills
|
||||
}
|
||||
@@ -160,10 +160,10 @@ void function UpdateViewStatsTimeMenu()
|
||||
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
||||
{
|
||||
string modeName = PersistenceGetEnumItemNameForIndex( "gameModes", modeId )
|
||||
if ( pulseParse(modeName, "gamemodesAll", "kills") != 0 )
|
||||
if ( pulseParse("gamemodesAll", modeName, "kills") != 0 )
|
||||
{
|
||||
float modePlayedTime = 0
|
||||
modePlayedTime = float(pulseParse(modeName, "gamemodesAll", "kills"))
|
||||
modePlayedTime = float(pulseParse("gamemodesAll", modeName, "kills"))
|
||||
if ( modePlayedTime > 0 ) {
|
||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||
}
|
||||
@@ -171,10 +171,10 @@ void function UpdateViewStatsTimeMenu()
|
||||
}
|
||||
foreach (string key, array<int> value in customGamemodeList)
|
||||
{
|
||||
if ( pulseParse(key, "gamemodesAll", "kills") != 0 )
|
||||
if ( pulseParse("gamemodesAll", key, "kills") != 0 )
|
||||
{
|
||||
float modePlayedTime = 0
|
||||
modePlayedTime = float(pulseParse(key, "gamemodesAll", "kills"))
|
||||
modePlayedTime = float(pulseParse("gamemodesAll", key, "kills"))
|
||||
if ( modePlayedTime > 0 ) {
|
||||
AddPieChartEntry( modes, customGamemodeNames[key], modePlayedTime, value)
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ void function UpdateStatsForTitan( string titanRef, int loadoutIndex )
|
||||
int aiKills
|
||||
foreach ( weaponRef in file.titanStatLoadout[ titanRef ] )
|
||||
{
|
||||
totalKills += pulseParse(weaponRef, "weaponsLocal", "kills")
|
||||
totalKills += pulseParse("weaponsLocal", weaponRef, "kills")
|
||||
pilotKills += GetPlayerStatInt( player, "weapon_kill_stats", "pilots", weaponRef )
|
||||
titanKills += GetPlayerStatInt( player, "weapon_kill_stats", "titansTotal", weaponRef )
|
||||
aiKills += GetPlayerStatInt( player, "weapon_kill_stats", "ai", weaponRef )
|
||||
|
||||
@@ -338,7 +338,7 @@ table<string, table> function GetOverviewWeaponData()
|
||||
if ( !PersistenceEnumValueIsValid( "loadoutWeaponsAndAbilities", weaponName ) )
|
||||
continue
|
||||
|
||||
int val = pulseParse(weaponName, "weaponsLocal", "kills")
|
||||
int val = pulseParse("weaponsLocal", weaponName, "kills")
|
||||
if ( val > Table[ "most_kills" ].val )
|
||||
{
|
||||
Table[ "most_kills" ].ref = weaponName
|
||||
@@ -346,7 +346,7 @@ table<string, table> function GetOverviewWeaponData()
|
||||
Table[ "most_kills" ].val = val
|
||||
}
|
||||
|
||||
int nval = pulseParse(weaponName, "weaponsLocal", "deaths")
|
||||
int nval = pulseParse("weaponsLocal", weaponName, "deaths")
|
||||
if ( nval > Table[ "nemesis_weapon" ].val )
|
||||
{
|
||||
Table[ "nemesis_weapon" ].ref = weaponName
|
||||
@@ -357,9 +357,9 @@ table<string, table> function GetOverviewWeaponData()
|
||||
float kdval = 0
|
||||
float kval = 0
|
||||
float dval = 0
|
||||
if( pulseParse(weaponName, "weaponsLocal", "kills") != 0 && pulseParse(weaponName, "weaponsLocal", "deaths_while_equipped") != 0){
|
||||
kval = float(pulseParse(weaponName, "weaponsLocal", "kills"))
|
||||
dval = float(pulseParse(weaponName, "weaponsLocal", "deaths_while_equipped"))
|
||||
if( pulseParse("weaponsLocal", weaponName, "kills") != 0 && pulseParse("weaponsLocal", weaponName, "deaths_while_equipped") != 0){
|
||||
kval = float(pulseParse("weaponsLocal", weaponName, "kills"))
|
||||
dval = float(pulseParse("weaponsLocal", weaponName, "deaths_while_equipped"))
|
||||
if (kval / dval > kdval){
|
||||
kdval = kval / dval
|
||||
}
|
||||
|
||||
@@ -180,8 +180,8 @@ void function UpdateStatsForWeapon( string weaponRef )
|
||||
}
|
||||
|
||||
// Total Kills Stats
|
||||
SetStatsLabelValue( file.menu, "KillsValue0", pulseParse(weaponRef, "weaponsLocal", "kills") ) //Total kills
|
||||
SetStatsLabelValue( file.menu, "KillsValue1", pulseParse(weaponRef, "weaponsLocal", "kills") ) //Pilots
|
||||
SetStatsLabelValue( file.menu, "KillsValue0", pulseParse("weaponsLocal", weaponRef, "kills") ) //Total kills
|
||||
SetStatsLabelValue( file.menu, "KillsValue1", pulseParse("weaponsLocal", weaponRef, "kills") ) //Pilots
|
||||
SetStatsLabelValue( file.menu, "KillsValue2", GetPlayerStatInt( player, "weapon_kill_stats", "titansTotal", weaponRef ) ) //Titans
|
||||
SetStatsLabelValue( file.menu, "KillsValue3", pulseParse(weaponRef, "weaponsLocal", "deaths_while_equipped")) // Deaths with weapon
|
||||
SetStatsLabelValue( file.menu, "KillsValue3", pulseParse("weaponsLocal", weaponRef, "deaths_while_equipped")) // Deaths with weapon
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user