@@ -78,3 +78,16 @@ Found a bug? Make an issue on GitHub [here.](https://github.com/ToneAPI/pulse/is
|
|||||||
The Tone API is NOT used by every server, view a list of supported servers [here.](https://tone.sleepycat.date/v2/client/servers)
|
The Tone API is NOT used by every server, view a list of supported servers [here.](https://tone.sleepycat.date/v2/client/servers)
|
||||||
|
|
||||||
Pulse is very much a W.I.P as of right now, features may be missing/nonfunctional.
|
Pulse is very much a W.I.P as of right now, features may be missing/nonfunctional.
|
||||||
|
|
||||||
|
## CHANGELOG
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary> pulse v2.0.0 "Demeter" </summary>
|
||||||
|
|
||||||
|
- Switched to Thunderstore template on the GitHub site for easier development.
|
||||||
|
- General code rewrite - lots of improvements for easier development. Rewrite includes:
|
||||||
|
- common code file, for better code readability and ease of development,
|
||||||
|
- new parser, allowing for better expandability and faster data processing (and much simpler implementation, unlike the hellspawn that was the previous `getFromToneAPI` function),
|
||||||
|
- new request function, more compact and simple than previous iterations,
|
||||||
|
- other functions that simplify the code and make it easier to read / develop
|
||||||
|
</details>
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"name": "Pulse",
|
||||||
|
"description": "Pulse is a clientside mod for Titanfall 2 letting you view killstats collected by the Tone API using the otherwise non-functional Stats tab.",
|
||||||
|
"version_number": "2.0.0",
|
||||||
|
"website_url": "https://github.com/ToneAPI/pulse",
|
||||||
|
"dependencies": []
|
||||||
|
}
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
global function pulseInit
|
|
||||||
global function GetStatsFromToneAPI
|
|
||||||
global function getFromToneAPI
|
|
||||||
global function fetchGamemodeStatsFromToneAPI
|
|
||||||
|
|
||||||
global table pulseData = {}
|
|
||||||
global table< table > globalToneAPIGamemodeMapData = {}
|
|
||||||
|
|
||||||
global string prefix = "\x1b[38;2;255;178;102m[PULSE]\x1b[0m "
|
|
||||||
|
|
||||||
string HTTPrequestURL = "default"
|
|
||||||
string currentVersion = "default"
|
|
||||||
int mapGamemodeEntries = 0
|
|
||||||
|
|
||||||
struct {
|
|
||||||
array<string> allMaps
|
|
||||||
} file
|
|
||||||
|
|
||||||
void function pulseInit()
|
|
||||||
{
|
|
||||||
HTTPrequestURL = GetConVarString("ToneURL")
|
|
||||||
currentVersion = "v" + GetConVarString("MajorVersion") + "." + GetConVarString("MinorVersion") + "." + GetConVarString("PatchVersion")
|
|
||||||
HttpRequest getVersion
|
|
||||||
getVersion.method = HttpRequestMethod.GET
|
|
||||||
getVersion.url = GetConVarString("VersionURL")
|
|
||||||
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response)
|
|
||||||
{
|
|
||||||
table JSONDecoded = DecodeJSON(response.body)
|
|
||||||
if (JSONDecoded["Major"] == GetConVarString("MajorVersion") && JSONDecoded["Minor"] == GetConVarString("MinorVersion") && JSONDecoded["Patch"] == GetConVarString("PatchVersion")) {
|
|
||||||
print(prefix + currentVersion + " has been loaded and is up to date.")
|
|
||||||
} else {
|
|
||||||
print(prefix + currentVersion + " has been loaded. Recommend updating to latest version: v" + JSONDecoded["Major"] + "." + JSONDecoded["Minor"] + "." + JSONDecoded["Patch"] + ".")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void functionref(HttpRequestFailure) onFailure = void function(HttpRequestFailure failure)
|
|
||||||
{
|
|
||||||
print(prefix + currentVersion + " has been loaded and has encountered an error getting latest version data.")
|
|
||||||
}
|
|
||||||
NSHttpRequest(getVersion, onSuccess, onFailure)
|
|
||||||
}
|
|
||||||
|
|
||||||
void function GetStatsFromToneAPI()
|
|
||||||
{
|
|
||||||
string UID = NSGetLocalPlayerUID()
|
|
||||||
array <string> allHttpRequests = ["/weapons", "/weapons", "/gamemodes", "/maps"]
|
|
||||||
array <string> allHttpParameters = [UID, "!" + UID, UID, UID]
|
|
||||||
array <string> keyValues = ["weaponsLocal", "weaponsGlobal", "gamemodes", "maps"]
|
|
||||||
for (int i; i < allHttpRequests.len(); i++) {
|
|
||||||
HttpRequest getStats
|
|
||||||
getStats.method = HttpRequestMethod.GET
|
|
||||||
getStats.url = HTTPrequestURL + allHttpRequests[i]
|
|
||||||
getStats.queryParameters["player"] <- [allHttpParameters[i]]
|
|
||||||
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response) : (i, allHttpRequests, keyValues)
|
|
||||||
{
|
|
||||||
table DecodedJSON = DecodeJSON(response.body)
|
|
||||||
table keyandvalues = {}
|
|
||||||
foreach (var key, var value in DecodedJSON) {
|
|
||||||
table values = expect table(value)
|
|
||||||
keyandvalues[string(key)] <- values
|
|
||||||
}
|
|
||||||
pulseData[keyValues[i]] <- keyandvalues
|
|
||||||
print(prefix + "has succeeded in getting stats for " + allHttpRequests[i].slice(1))
|
|
||||||
}
|
|
||||||
void functionref(HttpRequestFailure) onFailure = void function(HttpRequestFailure failure) : (i, allHttpRequests)
|
|
||||||
{
|
|
||||||
print(prefix + "has encountered an error getting stats for " + allHttpRequests[i].slice(1))
|
|
||||||
}
|
|
||||||
NSHttpRequest(getStats, onSuccess, onFailure)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void function fetchGamemodeStatsFromToneAPI(string mapName)
|
|
||||||
{
|
|
||||||
mapGamemodeEntries = 0
|
|
||||||
string mapNameSliced = mapName.slice(3)
|
|
||||||
HttpRequest getMapGamemodeStats
|
|
||||||
getMapGamemodeStats.method = HttpRequestMethod.GET
|
|
||||||
getMapGamemodeStats.url = HTTPrequestURL + "/gamemodes"
|
|
||||||
getMapGamemodeStats.queryParameters["map"] <- [mapNameSliced]
|
|
||||||
getMapGamemodeStats.queryParameters["player"] <- [NSGetLocalPlayerUID()]
|
|
||||||
void functionref(HttpRequestResponse) onSuccess = void function(HttpRequestResponse response):(mapName)
|
|
||||||
{
|
|
||||||
table JSONForConversion = DecodeJSON(response.body)
|
|
||||||
table mapData = {}
|
|
||||||
foreach (var gamemode, var value in JSONForConversion) {
|
|
||||||
table test = expect table(value)
|
|
||||||
mapData[string(gamemode)] <- test.kills
|
|
||||||
mapGamemodeEntries += 1
|
|
||||||
}
|
|
||||||
|
|
||||||
globalToneAPIGamemodeMapData[mapName] <- mapData
|
|
||||||
|
|
||||||
print(prefix + "Map gamemode data has been processed with a total of " + string(mapGamemodeEntries) + " entries.")
|
|
||||||
}
|
|
||||||
|
|
||||||
void functionref(HttpRequestFailure) onFailure = void function(HttpRequestFailure failure)
|
|
||||||
{
|
|
||||||
print(prefix + "Encountered an error getting map gamemode data...")
|
|
||||||
}
|
|
||||||
|
|
||||||
NSHttpRequest(getMapGamemodeStats, onSuccess, onFailure)
|
|
||||||
}
|
|
||||||
|
|
||||||
int function getFromToneAPI(string parameter, string key, string value){
|
|
||||||
|
|
||||||
if (key == "maps") {
|
|
||||||
parameter = parameter.slice(3)
|
|
||||||
}
|
|
||||||
if (key in pulseData) {
|
|
||||||
table keyandvalTable = expect table(pulseData[key])
|
|
||||||
// look to array keyValues for possible values for key
|
|
||||||
if (parameter in keyandvalTable) {
|
|
||||||
table valTable = expect table(keyandvalTable[parameter])
|
|
||||||
return expect int(valTable[value])
|
|
||||||
// possible values for parameter: kills, deaths, deaths_while_equipped, total_distance, max_distance
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
|
|
||||||
global function InitViewStatsMenu
|
|
||||||
|
|
||||||
struct{
|
|
||||||
array<string> allMaps
|
|
||||||
} file
|
|
||||||
|
|
||||||
void function InitViewStatsMenu()
|
|
||||||
{
|
|
||||||
var menu = GetMenu( "ViewStatsMenu" )
|
|
||||||
|
|
||||||
AddMenuEventHandler( menu, eUIEvent.MENU_OPEN, OnViewStats_Open )
|
|
||||||
|
|
||||||
var button = Hud_GetChild( menu, "BtnOverview" )
|
|
||||||
SetButtonRuiText( button, Localize( "#STATS_OVERVIEW" ) )
|
|
||||||
AddButtonEventHandler( button, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "ViewStats_Overview_Menu" ) ) )
|
|
||||||
|
|
||||||
button = Hud_GetChild( menu, "BtnTime" )
|
|
||||||
SetButtonRuiText( button, Localize( "#STATS_TIME" ) )
|
|
||||||
AddButtonEventHandler( button, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "ViewStats_Time_Menu" ) ) )
|
|
||||||
|
|
||||||
button = Hud_GetChild( menu, "BtnPilotWeapons" )
|
|
||||||
SetButtonRuiText( button, Localize( "#STATS_PILOT_WEAPONS" ) )
|
|
||||||
AddButtonEventHandler( button, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "ViewStats_Weapons_Menu" ) ) )
|
|
||||||
|
|
||||||
button = Hud_GetChild( menu, "BtnTitans" )
|
|
||||||
SetButtonRuiText( button, Localize( "#STATS_TITANS" ) )
|
|
||||||
AddButtonEventHandler( button, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "ViewStats_Titans_Menu" ) ) )
|
|
||||||
|
|
||||||
button = Hud_GetChild( menu, "BtnMaps" )
|
|
||||||
SetButtonRuiText( button, Localize( "#STATS_MAPS" ) )
|
|
||||||
AddButtonEventHandler( button, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "ViewStats_Maps_Menu" ) ) )
|
|
||||||
|
|
||||||
button = Hud_GetChild( menu, "BtnMisc" )
|
|
||||||
SetButtonRuiText( button, Localize( "#STATS_MISC" ) )
|
|
||||||
AddButtonEventHandler( button, UIE_CLICK, AdvanceMenuEventHandler( GetMenu( "ViewStats_Misc_Menu" ) ) )
|
|
||||||
|
|
||||||
AddMenuFooterOption( menu, BUTTON_A, "#A_BUTTON_SELECT" )
|
|
||||||
AddMenuFooterOption( menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" )
|
|
||||||
}
|
|
||||||
|
|
||||||
void function OnViewStats_Open()
|
|
||||||
{
|
|
||||||
foreach(elemNum in file.allMaps){
|
|
||||||
string mapName = expect string(file.allMaps[ elemNum ])
|
|
||||||
fetchGamemodeStatsFromToneAPI(mapName)
|
|
||||||
}
|
|
||||||
GetStatsFromToneAPI()
|
|
||||||
UI_SetPresentationType( ePresentationType.DEFAULT )
|
|
||||||
|
|
||||||
//UpdateViewStatsKillsMenu()
|
|
||||||
//UpdateViewStatsDistanceMenu()
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
# Pulse
|
||||||
|
|
||||||
|
Pulse is a clientside mod for [TF|2 + Northstar](https://github.com/R2Northstar/Northstar) letting you view killstats collected by [the Tone API](https://toneapi.github.io/ToneAPI_webclient/) using the otherwise non-functional `Stats` tab.
|
||||||
|
|
||||||
|
## Currently, features include:
|
||||||
|
- mostly functional `Overview` tab,
|
||||||
|
- functional `Time` tab,
|
||||||
|
- Pilot weapon data displayed in `Pilot Weapons` tab,
|
||||||
|
- Titan kills displayed in `Titans` tab,
|
||||||
|
- functional `Maps` tab,
|
||||||
|
- real-time updates.
|
||||||
|
|
||||||
|
Want to know what we have planned for future updates? See [here.](https://github.com/ToneAPI/pulse/projects?query=is%3Aopen)
|
||||||
|
|
||||||
|
Found a bug? Make an issue on GitHub [here.](https://github.com/ToneAPI/pulse/issues/new)
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Features, more in-depth:</summary>
|
||||||
|
|
||||||
|
### `Overview`
|
||||||
|
- Most Kills - shows the weapon with most accumulated kills.
|
||||||
|
- Nemesis Weapon - shows the weapon that has killed you the most.
|
||||||
|
- Most Effective - shows weapon with the highest K/D ratio.
|
||||||
|
- Kill/Death Ratio - shows the overall K/D ratio of player compared to global K/D.
|
||||||
|
- Kills as Pilot - shows general kill data for player as Pilot, visualised in the table below:
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| Pilots |Shows **ALL KILLS** accumulated by player as Pilot. Differentiating Pilot and Titan kills will come in a later Tone API update.|
|
||||||
|
| Titans |Non-functional, see line above.|
|
||||||
|
| AI kills |Non-functional, Tone API does not collect AI kill data.|
|
||||||
|
| Pilot melee kills |Shows only melee kills accumulated by player as Pilot.|
|
||||||
|
| Pilot executions |Shows only executions accumulated by player as Pilot.|
|
||||||
|
|
||||||
|
- Kills as Titan - shows general kill data for player as Titan, visualised in the table below:
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|--------------------|------------------------------------------------------|
|
||||||
|
| Pilots |Shows **ALL KILLS** accumulated by player as Titan. Differentiating Pilot and Titan kills will come in a later Tone API update.|
|
||||||
|
| Titans |Non-functional, see line above.|
|
||||||
|
| Titan executions |Shows only executions accumulated by player as Titan.|
|
||||||
|
| Pilots meleed |Shows only melee kills accumulated by player as Titan.|
|
||||||
|
| Pilot roadkills |Shows only roadkills accumulated by player as Titan.|
|
||||||
|
|
||||||
|
- Upper statbox values have been zeroed out, these don't yet work and are set to 0 to avoid confusion.
|
||||||
|
|
||||||
|
### `Time`
|
||||||
|
|
||||||
|
- Kills by Class shows kills by Pilot and Titan on a piechart.
|
||||||
|
- Kills by Titan shows kills by all Titan classes on a piechart.
|
||||||
|
- Kills by Gamemode shows kills on each gamemode played on a piechart.
|
||||||
|
|
||||||
|
### `Pilot Weapons`
|
||||||
|
|
||||||
|
- shows total accumulated kills per weapon under Total Kills.
|
||||||
|
- shows deaths with given weapon equipped under Deaths with Weapon.
|
||||||
|
|
||||||
|
### `Titans`
|
||||||
|
|
||||||
|
- shows total accumulated kills per Titan under Total Kills.
|
||||||
|
|
||||||
|
### `Maps`
|
||||||
|
|
||||||
|
- Player Map Stats - shows general data for player on chosen map, visualised in the table below:
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
|-----------------------|------------------------------------------------------- |
|
||||||
|
| Kills on Map |Shows all kills accumulated by player on chosen map.|
|
||||||
|
| Deaths on Map |Shows all deaths accumulated by player on chosen map.|
|
||||||
|
| Total Shot Distance |Shows total distance of kills accumulated by player on chosen map.|
|
||||||
|
| Maximum Shot Distance |Shows highest distance kill by player on chosen map.|
|
||||||
|
|
||||||
|
- Kills by Gamemode - piechart showing all kills (in percent) on chosen map by gamemode.
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## DISCLAIMER
|
||||||
|
|
||||||
|
The Tone API is NOT used by every server, view a list of supported servers [here.](https://tone.sleepycat.date/v2/client/servers)
|
||||||
|
|
||||||
|
Pulse is very much a W.I.P as of right now, features may be missing/nonfunctional.
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"Name": "ToneAPI.pulse",
|
"Name": "ToneAPI.pulse",
|
||||||
"Description": "Displays Tone API kill data in the Stats tab.",
|
"Description": "Displays Tone API kill data in the Stats tab.",
|
||||||
"Version": "1.2.2",
|
"Version": "2.0.0",
|
||||||
"LoadPriority": 1,
|
"LoadPriority": 1,
|
||||||
"ConVars": [
|
"ConVars": [
|
||||||
{
|
{
|
||||||
@@ -11,27 +11,19 @@
|
|||||||
{
|
{
|
||||||
"Name": "VersionURL",
|
"Name": "VersionURL",
|
||||||
"DefaultValue": "https://raw.githubusercontent.com/ToneAPI/pulse/main/version.json"
|
"DefaultValue": "https://raw.githubusercontent.com/ToneAPI/pulse/main/version.json"
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "MajorVersion",
|
|
||||||
"DefaultValue": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "MinorVersion",
|
|
||||||
"DefaultValue": "2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Name": "PatchVersion",
|
|
||||||
"DefaultValue": "2"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Scripts": [
|
"Scripts": [
|
||||||
{
|
{
|
||||||
"Path": "pulse.gnut",
|
"Path":"pulse-common-func.gnut",
|
||||||
"RunOn": "UI",
|
"RunOn":"UI"
|
||||||
"UICallback": {
|
},
|
||||||
"After": "pulseInit"
|
{
|
||||||
}
|
"Path": "pulse.gnut",
|
||||||
|
"RunOn": "UI",
|
||||||
|
"UICallback": {
|
||||||
|
"After": "pulseInit"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
globalize_all_functions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
global string pulsePrefix
|
||||||
|
table withMapName = {}
|
||||||
|
void function pulsePrefixSet() //Sets our prefix
|
||||||
|
{
|
||||||
|
pulsePrefix = format("\x1b[38;2;%i;%i;%im[PULSE]\x1b[0m", 255, 178, 102)
|
||||||
|
}
|
||||||
|
|
||||||
|
void function pulsePrintt(string content) //Prints whatever we want printed with given prefix (by standard [PULSE]).
|
||||||
|
{
|
||||||
|
printt(format("%s " + content, pulsePrefix))
|
||||||
|
}
|
||||||
|
|
||||||
|
bool function pulseRequestData(string givenURL, table parameterTable, string tablepath) //Gets data from API (see ToneURL within mod.json) and puts it into one table for processing.
|
||||||
|
{
|
||||||
|
table<string, array<string> > requestTable
|
||||||
|
pulsePrintt(tablepath)
|
||||||
|
void functionref (HttpRequestResponse) onSuccess = void function(HttpRequestResponse response) : (parameterTable, requestTable, tablepath)
|
||||||
|
{
|
||||||
|
table DecodedJSON = DecodeJSON(response.body)
|
||||||
|
if ("map" in parameterTable)
|
||||||
|
{
|
||||||
|
string mapName = expect string(parameterTable["map"])
|
||||||
|
withMapName[mapName] <- DecodedJSON
|
||||||
|
pulseData[tablepath] <- withMapName
|
||||||
|
} else {
|
||||||
|
pulseData[tablepath] <- DecodedJSON
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void functionref (HttpRequestFailure) onFailure = void function(HttpRequestFailure failure)
|
||||||
|
{
|
||||||
|
pulsePrintt("Something went wrong while getting data.")
|
||||||
|
}
|
||||||
|
foreach (key, value in parameterTable)
|
||||||
|
{
|
||||||
|
requestTable[string(key)] <- [string(value)]
|
||||||
|
}
|
||||||
|
return NSHttpGet(givenURL, requestTable, onSuccess, onFailure)
|
||||||
|
}
|
||||||
|
|
||||||
|
int function pulseParse(...) //Returns data from our pulseData table.
|
||||||
|
{
|
||||||
|
table parser = pulseData
|
||||||
|
int result = 0
|
||||||
|
for (int i; i < vargc; i++) {
|
||||||
|
if (i < expect int(vargc) - 1) {
|
||||||
|
if (expect string (vargv[i]) in parser) {
|
||||||
|
parser = expect table(parser[expect string(vargv[i])])
|
||||||
|
} else {break}
|
||||||
|
} else {
|
||||||
|
result = expect int(parser[expect string(vargv[i])])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
global function pulseInit
|
||||||
|
global function pulseGetData
|
||||||
|
|
||||||
|
global table pulseData = {}
|
||||||
|
|
||||||
|
struct {
|
||||||
|
array<string> allMaps
|
||||||
|
} file
|
||||||
|
|
||||||
|
void function pulseInit()
|
||||||
|
{
|
||||||
|
pulsePrefixSet()
|
||||||
|
file.allMaps = GetPrivateMatchMaps()
|
||||||
|
pulsePrintt("Initialized.")
|
||||||
|
}
|
||||||
|
|
||||||
|
void function pulseGetData()
|
||||||
|
{
|
||||||
|
string URL = GetConVarString("ToneURL")
|
||||||
|
array <string> URLpath = ["/weapons", "/weapons", "/gamemodes", "/gamemodes", "/maps"]
|
||||||
|
array <string> tablepath = ["weaponsLocal", "weaponsGlobal", "gamemodesAll", "gamemodesSeparated", "maps"]
|
||||||
|
pulseRequestData(URL + URLpath[0], {["player"] = NSGetLocalPlayerUID()}, tablepath[0])
|
||||||
|
pulseRequestData(URL + URLpath[1], {["player"] = "!" + NSGetLocalPlayerUID()}, tablepath[1])
|
||||||
|
pulseRequestData(URL + URLpath[2], {["player"] = NSGetLocalPlayerUID()}, tablepath[2])
|
||||||
|
foreach (map in file.allMaps)
|
||||||
|
{
|
||||||
|
pulseRequestData(URL + URLpath[3], {["player"] = NSGetLocalPlayerUID(), ["map"] = map.slice(3)}, tablepath[3])
|
||||||
|
}
|
||||||
|
pulseRequestData(URL + URLpath[4], {["player"] = NSGetLocalPlayerUID()}, tablepath[4])
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
+8
-10
@@ -140,8 +140,6 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
|
|
||||||
Hud_SetText( Hud_GetChild( file.menu, "WeaponName" ), GetMapDisplayName( mapName ) )
|
Hud_SetText( Hud_GetChild( file.menu, "WeaponName" ), GetMapDisplayName( mapName ) )
|
||||||
|
|
||||||
fetchGamemodeStatsFromToneAPI(mapName)
|
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
var imageElem = Hud_GetRui( Hud_GetChild( file.menu, "WeaponImageLarge" ) )
|
var imageElem = Hud_GetRui( Hud_GetChild( file.menu, "WeaponImageLarge" ) )
|
||||||
RuiSetImage( imageElem, "basicImage", GetMapImageForMapName( mapName ) )
|
RuiSetImage( imageElem, "basicImage", GetMapImageForMapName( mapName ) )
|
||||||
@@ -155,16 +153,16 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
//SetStatBoxDisplay( Hud_GetChild( file.menu, "Stat3" ), Localize( "#STATS_GAMES_PLAYED" ), gamesPlayed )
|
//SetStatBoxDisplay( Hud_GetChild( file.menu, "Stat3" ), Localize( "#STATS_GAMES_PLAYED" ), gamesPlayed )
|
||||||
|
|
||||||
SetStatsLabelValue( file.menu, "KillsLabel0", "KILLS ON MAP" )
|
SetStatsLabelValue( file.menu, "KillsLabel0", "KILLS ON MAP" )
|
||||||
SetStatsLabelValue( file.menu, "KillsValue0", getFromToneAPI(mapName, "maps", "kills") )
|
SetStatsLabelValue( file.menu, "KillsValue0", pulseParse("maps", mapName.slice(3), "kills") )
|
||||||
|
|
||||||
SetStatsLabelValue( file.menu, "KillsLabel1", "DEATHS ON MAP" )
|
SetStatsLabelValue( file.menu, "KillsLabel1", "DEATHS ON MAP" )
|
||||||
SetStatsLabelValue( file.menu, "KillsValue1", getFromToneAPI(mapName, "maps", "deaths") )
|
SetStatsLabelValue( file.menu, "KillsValue1", pulseParse("maps", mapName.slice(3), "deaths") )
|
||||||
|
|
||||||
SetStatsLabelValue( file.menu, "KillsLabel2", "TOTAL SHOT DISTANCE" )
|
SetStatsLabelValue( file.menu, "KillsLabel2", "TOTAL SHOT DISTANCE" )
|
||||||
SetStatsLabelValue( file.menu, "KillsValue2", string(int((1.905 * float(getFromToneAPI(mapName, "maps", "total_distance") ) ) )/100) + "m" )
|
SetStatsLabelValue( file.menu, "KillsValue2", string(int((1.905 * float(pulseParse("maps", mapName.slice(3), "total_distance") ) ) )/100) + "m" )
|
||||||
|
|
||||||
SetStatsLabelValue( file.menu, "KillsLabel3", "MAXIMUM SHOT DISTANCE" )
|
SetStatsLabelValue( file.menu, "KillsLabel3", "MAXIMUM SHOT DISTANCE" )
|
||||||
SetStatsLabelValue( file.menu, "KillsValue3", string(int((1.905 * float(getFromToneAPI(mapName, "maps", "max_distance") ) ) )/100) + "m" )
|
SetStatsLabelValue( file.menu, "KillsValue3", string(int((1.905 * float(pulseParse("maps", mapName.slice(3), "max_distance") ) ) )/100) + "m" )
|
||||||
|
|
||||||
SetStatsLabelValue( file.menu, "KillsLabel4", "--" )
|
SetStatsLabelValue( file.menu, "KillsLabel4", "--" )
|
||||||
SetStatsLabelValue( file.menu, "KillsValue4", "--" )
|
SetStatsLabelValue( file.menu, "KillsValue4", "--" )
|
||||||
@@ -193,10 +191,10 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
||||||
{
|
{
|
||||||
string modeName = PersistenceGetEnumItemNameForIndex( "gameModes", modeId )
|
string modeName = PersistenceGetEnumItemNameForIndex( "gameModes", modeId )
|
||||||
if ( mapName in globalToneAPIGamemodeMapData && modeName in globalToneAPIGamemodeMapData[mapName] )
|
if (mapName.slice(3) in pulseData["gamemodesSeparated"])
|
||||||
{
|
{
|
||||||
float modePlayedTime = 0
|
float modePlayedTime = 0
|
||||||
modePlayedTime = float(globalToneAPIGamemodeMapData[mapName][modeName])
|
modePlayedTime = float(pulseParse("gamemodesSeparated", mapName.slice(3), modeName, "kills"))
|
||||||
if ( modePlayedTime > 0 ) {
|
if ( modePlayedTime > 0 ) {
|
||||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||||
}
|
}
|
||||||
@@ -204,10 +202,10 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
}
|
}
|
||||||
foreach (string key, array<int> value in customGamemodeList)
|
foreach (string key, array<int> value in customGamemodeList)
|
||||||
{
|
{
|
||||||
if ( mapName in globalToneAPIGamemodeMapData && key in globalToneAPIGamemodeMapData[mapName])
|
if (mapName.slice(3) in pulseData["gamemodesSeparated"])
|
||||||
{
|
{
|
||||||
float modePlayedTime = 0
|
float modePlayedTime = 0
|
||||||
modePlayedTime = float(globalToneAPIGamemodeMapData[mapName][key])
|
modePlayedTime = float(pulseParse("gamemodesSeparated", mapName.slice(3), key, "kills"))
|
||||||
if ( modePlayedTime > 0 ) {
|
if ( modePlayedTime > 0 ) {
|
||||||
AddPieChartEntry( modes, customGamemodeNames[key], modePlayedTime, value)
|
AddPieChartEntry( modes, customGamemodeNames[key], modePlayedTime, value)
|
||||||
}
|
}
|
||||||
+14
-14
@@ -52,7 +52,7 @@ void function GetTitanKills( string titanName )
|
|||||||
|
|
||||||
foreach ( weaponRef in file.titanStatLoadout[ titanName ])
|
foreach ( weaponRef in file.titanStatLoadout[ titanName ])
|
||||||
{
|
{
|
||||||
titanKillData[weaponRef] <- getFromToneAPI(weaponRef, "weaponsLocal", "kills")
|
titanKillData[weaponRef] <- pulseParse("weaponsLocal", weaponRef, "kills")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ function UpdateViewStatsOverviewMenu()
|
|||||||
if (key in titanKillData) {
|
if (key in titanKillData) {
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
killsAsPilot += getFromToneAPI(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, "KillsAsPilotValue0" ), string( killsAsPilot ) )
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue1" ), string( GetPlayerStatInt( player, "kills_stats", "titanKillsAsPilot" ) ) )
|
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, "KillsAsPilotValue2" ), string( GetPlayerStatInt( player, "kills_stats", "totalNPC" ) ) )
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue3" ), string( getFromToneAPI("pilot_emptyhanded", "weaponsLocal", "kills") ) )
|
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue3" ), string( pulseParse("weaponsLocal", "pilot_emptyhanded", "kills") ) )
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsPilotValue4" ), string( getFromToneAPI("human_execution", "weaponsLocal", "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" ) ) )
|
// Hud_SetText( GetElem( file.menu, "KillsAsPilotValue5" ), string( GetPlayerStatInt( player, "kills_stats", "titanFallKill" ) ) )
|
||||||
|
|
||||||
var titanMeleeKills = 0
|
var titanMeleeKills = 0
|
||||||
titanMeleeKills += getFromToneAPI("titan_punch_ion", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_ion", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("titan_punch_scorch", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_scorch", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("titan_punch_northstar", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_northstar", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("titan_sword", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_sword", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("titan_punch_tone", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_tone", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("titan_punch_legion", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_legion", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("titan_punch_vanguard", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "titan_punch_vanguard", "kills")
|
||||||
titanMeleeKills += getFromToneAPI("auto_titan_melee", "weaponsLocal", "kills")
|
titanMeleeKills += pulseParse("weaponsLocal", "auto_titan_melee", "kills")
|
||||||
|
|
||||||
var titanExecutions = getFromToneAPI("titan_execution", "weaponsLocal", "kills")
|
var titanExecutions = pulseParse("weaponsLocal", "titan_execution", "kills")
|
||||||
|
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue0" ), string( killsAsTitan ) )
|
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, "KillsAsTitanValue1" ), string( GetPlayerStatInt( player, "kills_stats", "titanKillsAsTitan" ) ) )
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue2" ), string( titanExecutions ) )
|
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue2" ), string( titanExecutions ) )
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue3" ), string( titanMeleeKills ) )
|
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue3" ), string( titanMeleeKills ) )
|
||||||
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue4" ), string( getFromToneAPI("damagedef_titan_step", "weaponsLocal", "kills") ) )
|
Hud_SetText( GetElem( file.menu, "KillsAsTitanValue4" ), string( pulseParse("weaponsLocal", "damagedef_titan_step", "kills") ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
function PlotKDPointsOnGraph( menu, graphIndex, values, dottedAverage )
|
function PlotKDPointsOnGraph( menu, graphIndex, values, dottedAverage )
|
||||||
+5
-5
@@ -49,7 +49,7 @@ float function GetTitanKills( string titanName)
|
|||||||
float weaponKills = 0
|
float weaponKills = 0
|
||||||
foreach ( weaponRef in file.titanStatLoadout[ titanName ])
|
foreach ( weaponRef in file.titanStatLoadout[ titanName ])
|
||||||
{
|
{
|
||||||
weaponKills += float(getFromToneAPI(weaponRef, "weaponsLocal", "kills"))
|
weaponKills += float(pulseParse("weaponsLocal", weaponRef, "kills"))
|
||||||
}
|
}
|
||||||
return weaponKills
|
return weaponKills
|
||||||
}
|
}
|
||||||
@@ -160,10 +160,10 @@ void function UpdateViewStatsTimeMenu()
|
|||||||
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
||||||
{
|
{
|
||||||
string modeName = PersistenceGetEnumItemNameForIndex( "gameModes", modeId )
|
string modeName = PersistenceGetEnumItemNameForIndex( "gameModes", modeId )
|
||||||
if ( getFromToneAPI(modeName, "gamemodes", "kills") != 0 )
|
if ( pulseParse("gamemodesAll", modeName, "kills") != 0 )
|
||||||
{
|
{
|
||||||
float modePlayedTime = 0
|
float modePlayedTime = 0
|
||||||
modePlayedTime = float(getFromToneAPI(modeName, "gamemodes", "kills"))
|
modePlayedTime = float(pulseParse("gamemodesAll", modeName, "kills"))
|
||||||
if ( modePlayedTime > 0 ) {
|
if ( modePlayedTime > 0 ) {
|
||||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||||
}
|
}
|
||||||
@@ -171,10 +171,10 @@ void function UpdateViewStatsTimeMenu()
|
|||||||
}
|
}
|
||||||
foreach (string key, array<int> value in customGamemodeList)
|
foreach (string key, array<int> value in customGamemodeList)
|
||||||
{
|
{
|
||||||
if ( getFromToneAPI(key, "gamemodes", "kills") != 0 )
|
if ( pulseParse("gamemodesAll", key, "kills") != 0 )
|
||||||
{
|
{
|
||||||
float modePlayedTime = 0
|
float modePlayedTime = 0
|
||||||
modePlayedTime = float(getFromToneAPI(key, "gamemodes", "kills"))
|
modePlayedTime = float(pulseParse("gamemodesAll", key, "kills"))
|
||||||
if ( modePlayedTime > 0 ) {
|
if ( modePlayedTime > 0 ) {
|
||||||
AddPieChartEntry( modes, customGamemodeNames[key], modePlayedTime, value)
|
AddPieChartEntry( modes, customGamemodeNames[key], modePlayedTime, value)
|
||||||
}
|
}
|
||||||
+1
-1
@@ -175,7 +175,7 @@ void function UpdateStatsForTitan( string titanRef, int loadoutIndex )
|
|||||||
int aiKills
|
int aiKills
|
||||||
foreach ( weaponRef in file.titanStatLoadout[ titanRef ] )
|
foreach ( weaponRef in file.titanStatLoadout[ titanRef ] )
|
||||||
{
|
{
|
||||||
totalKills += getFromToneAPI(weaponRef, "weaponsLocal", "kills")
|
totalKills += pulseParse("weaponsLocal", weaponRef, "kills")
|
||||||
pilotKills += GetPlayerStatInt( player, "weapon_kill_stats", "pilots", weaponRef )
|
pilotKills += GetPlayerStatInt( player, "weapon_kill_stats", "pilots", weaponRef )
|
||||||
titanKills += GetPlayerStatInt( player, "weapon_kill_stats", "titansTotal", weaponRef )
|
titanKills += GetPlayerStatInt( player, "weapon_kill_stats", "titansTotal", weaponRef )
|
||||||
aiKills += GetPlayerStatInt( player, "weapon_kill_stats", "ai", weaponRef )
|
aiKills += GetPlayerStatInt( player, "weapon_kill_stats", "ai", weaponRef )
|
||||||
+5
-5
@@ -338,7 +338,7 @@ table<string, table> function GetOverviewWeaponData()
|
|||||||
if ( !PersistenceEnumValueIsValid( "loadoutWeaponsAndAbilities", weaponName ) )
|
if ( !PersistenceEnumValueIsValid( "loadoutWeaponsAndAbilities", weaponName ) )
|
||||||
continue
|
continue
|
||||||
|
|
||||||
int val = getFromToneAPI(weaponName, "weaponsLocal", "kills")
|
int val = pulseParse("weaponsLocal", weaponName, "kills")
|
||||||
if ( val > Table[ "most_kills" ].val )
|
if ( val > Table[ "most_kills" ].val )
|
||||||
{
|
{
|
||||||
Table[ "most_kills" ].ref = weaponName
|
Table[ "most_kills" ].ref = weaponName
|
||||||
@@ -346,7 +346,7 @@ table<string, table> function GetOverviewWeaponData()
|
|||||||
Table[ "most_kills" ].val = val
|
Table[ "most_kills" ].val = val
|
||||||
}
|
}
|
||||||
|
|
||||||
int nval = getFromToneAPI(weaponName, "weaponsLocal", "deaths")
|
int nval = pulseParse("weaponsLocal", weaponName, "deaths")
|
||||||
if ( nval > Table[ "nemesis_weapon" ].val )
|
if ( nval > Table[ "nemesis_weapon" ].val )
|
||||||
{
|
{
|
||||||
Table[ "nemesis_weapon" ].ref = weaponName
|
Table[ "nemesis_weapon" ].ref = weaponName
|
||||||
@@ -357,9 +357,9 @@ table<string, table> function GetOverviewWeaponData()
|
|||||||
float kdval = 0
|
float kdval = 0
|
||||||
float kval = 0
|
float kval = 0
|
||||||
float dval = 0
|
float dval = 0
|
||||||
if( getFromToneAPI(weaponName, "weaponsLocal", "kills") != 0 && getFromToneAPI(weaponName, "weaponsLocal", "deaths_while_equipped") != 0){
|
if( pulseParse("weaponsLocal", weaponName, "kills") != 0 && pulseParse("weaponsLocal", weaponName, "deaths_while_equipped") != 0){
|
||||||
kval = float(getFromToneAPI(weaponName, "weaponsLocal", "kills"))
|
kval = float(pulseParse("weaponsLocal", weaponName, "kills"))
|
||||||
dval = float(getFromToneAPI(weaponName, "weaponsLocal", "deaths_while_equipped"))
|
dval = float(pulseParse("weaponsLocal", weaponName, "deaths_while_equipped"))
|
||||||
if (kval / dval > kdval){
|
if (kval / dval > kdval){
|
||||||
kdval = kval / dval
|
kdval = kval / dval
|
||||||
}
|
}
|
||||||
+3
-3
@@ -180,8 +180,8 @@ void function UpdateStatsForWeapon( string weaponRef )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Total Kills Stats
|
// Total Kills Stats
|
||||||
SetStatsLabelValue( file.menu, "KillsValue0", getFromToneAPI(weaponRef, "weaponsLocal", "kills") ) //Total kills
|
SetStatsLabelValue( file.menu, "KillsValue0", pulseParse("weaponsLocal", weaponRef, "kills") ) //Total kills
|
||||||
SetStatsLabelValue( file.menu, "KillsValue1", getFromToneAPI(weaponRef, "weaponsLocal", "kills") ) //Pilots
|
SetStatsLabelValue( file.menu, "KillsValue1", pulseParse("weaponsLocal", weaponRef, "kills") ) //Pilots
|
||||||
SetStatsLabelValue( file.menu, "KillsValue2", GetPlayerStatInt( player, "weapon_kill_stats", "titansTotal", weaponRef ) ) //Titans
|
SetStatsLabelValue( file.menu, "KillsValue2", GetPlayerStatInt( player, "weapon_kill_stats", "titansTotal", weaponRef ) ) //Titans
|
||||||
SetStatsLabelValue( file.menu, "KillsValue3", getFromToneAPI(weaponRef, "weaponsLocal", "deaths_while_equipped")) // Deaths with weapon
|
SetStatsLabelValue( file.menu, "KillsValue3", pulseParse("weaponsLocal", weaponRef, "deaths_while_equipped")) // Deaths with weapon
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"Major": "1",
|
|
||||||
"Minor": "2",
|
|
||||||
"Patch": "1"
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user