Initial #14
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
|
||||
global function InitViewStatsMenu
|
||||
|
||||
struct{
|
||||
array<string> allMaps
|
||||
} file
|
||||
|
||||
void function InitViewStatsMenu()
|
||||
{
|
||||
var menu = GetMenu( "ViewStatsMenu" )
|
||||
@@ -37,6 +41,10 @@ void function InitViewStatsMenu()
|
||||
|
||||
void function OnViewStats_Open()
|
||||
{
|
||||
foreach(elemNum in file.allMaps){
|
||||
string mapName = expect string(file.allMaps[ elemNum ])
|
||||
getGamemodeStatsFromToneAPI(mapName)
|
||||
}
|
||||
GetWeaponStatsFromToneAPI()
|
||||
GetMapStatsFromToneAPI()
|
||||
UI_SetPresentationType( ePresentationType.DEFAULT )
|
||||
|
||||
@@ -141,6 +141,8 @@ void function UpdateStatsForMap( string mapName )
|
||||
|
||||
Hud_SetText( Hud_GetChild( file.menu, "WeaponName" ), GetMapDisplayName( mapName ) )
|
||||
|
||||
getGamemodeStatsFromToneAPI(mapName)
|
||||
|
||||
// Image
|
||||
var imageElem = Hud_GetRui( Hud_GetChild( file.menu, "WeaponImageLarge" ) )
|
||||
RuiSetImage( imageElem, "basicImage", GetMapImageForMapName( mapName ) )
|
||||
@@ -178,13 +180,19 @@ void function UpdateStatsForMap( string mapName )
|
||||
array<string> gameModesArray = GetPersistenceEnumAsArray( "gameModes" )
|
||||
|
||||
array<PieChartEntry> modes
|
||||
foreach ( modeName in gameModesArray )
|
||||
int enumCount = PersistenceGetEnumCount( "gameModes" )
|
||||
for ( int modeId = 0; modeId < enumCount; modeId++ )
|
||||
{
|
||||
float modePlayedTime = GetGameStatForMapAndModeFloat( "hoursPlayed", mapName, modeName )
|
||||
if ( modePlayedTime > 0 )
|
||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||
string modeName = PersistenceGetEnumItemNameForIndex( "gameModes", modeId )
|
||||
if ( modeName in globalToneAPIGamemodeData )
|
||||
{
|
||||
float modePlayedTime = float(globalToneAPIGamemodeData[modeName])
|
||||
print(modePlayedTime)
|
||||
if ( modePlayedTime > 0 ) {
|
||||
AddPieChartEntry( modes, GameMode_GetName( modeName ), modePlayedTime, GetGameModeDisplayColor( modeName ) )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const MAX_MODE_ROWS = 8
|
||||
|
||||
if ( modes.len() > 0 )
|
||||
|
||||
Reference in New Issue
Block a user