Make use of pie chart #14
This commit is contained in:
@@ -8,7 +8,7 @@ global function getMapKillFromToneAPI
|
|||||||
global function getMapDeathFromToneAPI
|
global function getMapDeathFromToneAPI
|
||||||
global function getMapDistFromToneAPI
|
global function getMapDistFromToneAPI
|
||||||
global function getMapMDistFromToneAPI
|
global function getMapMDistFromToneAPI
|
||||||
global function getGamemodeStatsFromToneAPI
|
global function fetchGamemodeStatsFromToneAPI
|
||||||
|
|
||||||
global table globalToneAPIKillData = {}
|
global table globalToneAPIKillData = {}
|
||||||
global table globalToneAPIDeathData = {}
|
global table globalToneAPIDeathData = {}
|
||||||
@@ -93,9 +93,8 @@ void function GetMapStatsFromToneAPI()
|
|||||||
NSHttpRequest(getMapStats, onSuccess, onFailure)
|
NSHttpRequest(getMapStats, onSuccess, onFailure)
|
||||||
}
|
}
|
||||||
|
|
||||||
void function getGamemodeStatsFromToneAPI(string mapName)
|
void function fetchGamemodeStatsFromToneAPI(string mapName)
|
||||||
{
|
{
|
||||||
print(prefix + "test")
|
|
||||||
mapGamemodeEntries = 0
|
mapGamemodeEntries = 0
|
||||||
string mapNameSliced = mapName.slice(3)
|
string mapNameSliced = mapName.slice(3)
|
||||||
HttpRequest getMapGamemodeStats
|
HttpRequest getMapGamemodeStats
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void function OnViewStats_Open()
|
|||||||
{
|
{
|
||||||
foreach(elemNum in file.allMaps){
|
foreach(elemNum in file.allMaps){
|
||||||
string mapName = expect string(file.allMaps[ elemNum ])
|
string mapName = expect string(file.allMaps[ elemNum ])
|
||||||
getGamemodeStatsFromToneAPI(mapName)
|
fetchGamemodeStatsFromToneAPI(mapName)
|
||||||
}
|
}
|
||||||
GetWeaponStatsFromToneAPI()
|
GetWeaponStatsFromToneAPI()
|
||||||
GetMapStatsFromToneAPI()
|
GetMapStatsFromToneAPI()
|
||||||
|
|||||||
@@ -54,13 +54,12 @@ void function OnViewStatsWeapons_Open()
|
|||||||
|
|
||||||
Grid_InitPage( file.menu, file.gridData )
|
Grid_InitPage( file.menu, file.gridData )
|
||||||
Hud_SetFocused( Grid_GetButtonForElementNumber( file.menu, 0 ) )
|
Hud_SetFocused( Grid_GetButtonForElementNumber( file.menu, 0 ) )
|
||||||
UpdateStatsForMap( file.allMaps[ 0 ] )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool function MapButton_Init( var button, int elemNum )
|
bool function MapButton_Init( var button, int elemNum )
|
||||||
{
|
{
|
||||||
string mapName = file.allMaps[ elemNum ]
|
string mapName = file.allMaps[ elemNum ]
|
||||||
|
UpdateStatsForMap( mapName )
|
||||||
asset mapImage = GetMapImageForMapName( mapName )
|
asset mapImage = GetMapImageForMapName( mapName )
|
||||||
|
|
||||||
var rui = Hud_GetRui( button )
|
var rui = Hud_GetRui( button )
|
||||||
@@ -141,8 +140,7 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
|
|
||||||
Hud_SetText( Hud_GetChild( file.menu, "WeaponName" ), GetMapDisplayName( mapName ) )
|
Hud_SetText( Hud_GetChild( file.menu, "WeaponName" ), GetMapDisplayName( mapName ) )
|
||||||
|
|
||||||
//Put this elsewhere, user needs to click twice for it to work
|
fetchGamemodeStatsFromToneAPI(mapName)
|
||||||
getGamemodeStatsFromToneAPI(mapName)
|
|
||||||
|
|
||||||
// Image
|
// Image
|
||||||
var imageElem = Hud_GetRui( Hud_GetChild( file.menu, "WeaponImageLarge" ) )
|
var imageElem = Hud_GetRui( Hud_GetChild( file.menu, "WeaponImageLarge" ) )
|
||||||
@@ -183,9 +181,9 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
array<PieChartEntry> modes
|
array<PieChartEntry> modes
|
||||||
int enumCount = PersistenceGetEnumCount( "gameModes" )
|
int enumCount = PersistenceGetEnumCount( "gameModes" )
|
||||||
table< string, array<int> > customGamemodeList = {
|
table< string, array<int> > customGamemodeList = {
|
||||||
sns = [123, 12, 1, 255],
|
sns = [255, 178, 102, 255],
|
||||||
fw = [0, 1, 12, 255],
|
fw = [147, 204, 57, 255],
|
||||||
gg = [234, 32, 1, 255]
|
gg = [14, 87, 132, 255]
|
||||||
}
|
}
|
||||||
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
||||||
{
|
{
|
||||||
@@ -194,7 +192,6 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
{
|
{
|
||||||
float modePlayedTime = 0
|
float modePlayedTime = 0
|
||||||
modePlayedTime = float(globalToneAPIGamemodeMapData[mapName][modeName])
|
modePlayedTime = float(globalToneAPIGamemodeMapData[mapName][modeName])
|
||||||
print("[PULSE] modePlayedTime " + modePlayedTime + " | modename " + modeName)
|
|
||||||
if ( modePlayedTime > 0 ) {
|
if ( modePlayedTime > 0 ) {
|
||||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||||
}
|
}
|
||||||
@@ -206,10 +203,8 @@ void function UpdateStatsForMap( string mapName )
|
|||||||
{
|
{
|
||||||
float modePlayedTime = 0
|
float modePlayedTime = 0
|
||||||
modePlayedTime = float(globalToneAPIGamemodeMapData[mapName][key])
|
modePlayedTime = float(globalToneAPIGamemodeMapData[mapName][key])
|
||||||
print("[PULSE] modePlayedTime " + modePlayedTime + " | modename " + key)
|
|
||||||
if ( modePlayedTime > 0 ) {
|
if ( modePlayedTime > 0 ) {
|
||||||
AddPieChartEntry( modes, key, modePlayedTime, value)
|
AddPieChartEntry( modes, key, modePlayedTime, value)
|
||||||
print("CUSTOM GAMEMODE DATA FUNCTION CALLED")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user