Change to Thunderstore template

For easier publishing to both platforms
This commit is contained in:
okvdai
2023-06-07 19:15:14 +02:00
parent 739b265fab
commit ddfb34a9f8
16 changed files with 92 additions and 7 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

+7
View File
@@ -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": []
}
+80
View File
@@ -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.
@@ -21,10 +21,8 @@ bool function pulseRequestData(string givenURL, table parameterTable, string tab
table DecodedJSON = DecodeJSON(response.body) table DecodedJSON = DecodeJSON(response.body)
if ("map" in parameterTable) if ("map" in parameterTable)
{ {
table map string mapName = expect string(parameterTable["map"])
map[expect string(parameterTable["map"])] <- DecodedJSON pulseData[tablepath] <- {mapName = DecodedJSON}
pulsePrintt(tablepath)
pulseData[tablepath] <- map
} else { } else {
pulseData[tablepath] <- DecodedJSON pulseData[tablepath] <- DecodedJSON
} }
@@ -21,7 +21,7 @@ void function pulseGetData()
pulseRequestData(URL + URLpath[0], {["player"] = NSGetLocalPlayerUID()}, tablepath[0]) pulseRequestData(URL + URLpath[0], {["player"] = NSGetLocalPlayerUID()}, tablepath[0])
pulseRequestData(URL + URLpath[1], {["player"] = "!" + NSGetLocalPlayerUID()}, tablepath[1]) pulseRequestData(URL + URLpath[1], {["player"] = "!" + NSGetLocalPlayerUID()}, tablepath[1])
pulseRequestData(URL + URLpath[2], {["player"] = NSGetLocalPlayerUID()}, tablepath[2]) pulseRequestData(URL + URLpath[2], {["player"] = NSGetLocalPlayerUID()}, tablepath[2])
foreach (map in file.allMaps) foreach (string map in file.allMaps)
{ {
pulseRequestData(URL + URLpath[3], {["player"] = NSGetLocalPlayerUID(), ["map"] = map.slice(3)}, tablepath[3]) pulseRequestData(URL + URLpath[3], {["player"] = NSGetLocalPlayerUID(), ["map"] = map.slice(3)}, tablepath[3])
} }
@@ -191,7 +191,7 @@ 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 pulseData && modeName in pulseData[mapName] ) if (mapName in pulseData["gamemodesSeparated"])
{ {
float modePlayedTime = 0 float modePlayedTime = 0
modePlayedTime = float(pulseParse(mapName, "gamemodesSeparated", modeName, "kills")) modePlayedTime = float(pulseParse(mapName, "gamemodesSeparated", modeName, "kills"))
@@ -202,7 +202,7 @@ void function UpdateStatsForMap( string mapName )
} }
foreach (string key, array<int> value in customGamemodeList) foreach (string key, array<int> value in customGamemodeList)
{ {
if ( mapName in pulseData && key in pulseData[mapName]) if (mapName in pulseData["gamemodesSeparated"])
{ {
float modePlayedTime = 0 float modePlayedTime = 0
modePlayedTime = float(pulseParse(mapName, "gamemodesSeparated", key, "kills")) modePlayedTime = float(pulseParse(mapName, "gamemodesSeparated", key, "kills"))