Skip to content

Commit

Permalink
Fix GetTeam + Add Multiple variables + Prevent crash when config file…
Browse files Browse the repository at this point in the history
… is null
  • Loading branch information
Arubinu committed Apr 28, 2022
1 parent b7afe50 commit 5a5a34d
Show file tree
Hide file tree
Showing 11 changed files with 5,816 additions and 38 deletions.
20 changes: 19 additions & 1 deletion RocketStats/Languages.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ enum LangStringId {
LANG_DEATH,
LANG_DEATHMATCH,
LANG_DEATHCUMUL,
LANG_SHOTS,
LANG_MISCS,
LANG_ASSISTS,
LANG_GOALS,
LANG_SAVES,
LANG_DROPSHOT,
LANG_BOOST,

LANG_FILE_TITLE,
Expand All @@ -110,6 +116,12 @@ enum LangStringId {
LANG_FILE_DEATH,
LANG_FILE_DEATHMATCH,
LANG_FILE_DEATHCUMUL,
LANG_FILE_SHOTS,
LANG_FILE_MISCS,
LANG_FILE_ASSISTS,
LANG_FILE_GOALS,
LANG_FILE_SAVES,
LANG_FILE_DROPSHOT,
LANG_FILE_BOOST,

LANG_HIDE_TITLE,
Expand All @@ -130,5 +142,11 @@ enum LangStringId {
LANG_HIDE_DEMOLITIONSCUMUL,
LANG_HIDE_DEATH,
LANG_HIDE_DEATHMATCH,
LANG_HIDE_DEATHCUMUL
LANG_HIDE_DEATHCUMUL,
LANG_HIDE_SHOTS,
LANG_HIDE_MISCS,
LANG_HIDE_ASSISTS,
LANG_HIDE_GOALS,
LANG_HIDE_SAVES,
LANG_HIDE_DROPSHOT
};
1,040 changes: 1,024 additions & 16 deletions RocketStats/Managements/FileManagement.cpp

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions RocketStats/Managements/GameManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ TeamWrapper RocketStats::GetTeam(bool opposing)
}
}
}

TeamWrapper team(NULL);
return team;
}

ImColor RocketStats::GetTeamColor(TeamWrapper team)
Expand Down
15 changes: 14 additions & 1 deletion RocketStats/Managements/OverlayManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ bool RocketStats::ChangeTheme(int idx)

// Read the JSON file including the settings of the chosen theme
theme_config = ReadJSON("RocketStats_themes/" + theme.name + "/config.json");
cvarManager->log(nlohmann::to_string(theme_config));
if (!theme_config.is_null())
cvarManager->log(nlohmann::to_string(theme_config));

if (theme_config.is_object())
{
Expand Down Expand Up @@ -297,6 +298,12 @@ void RocketStats::RefreshVars()
SetCVar("rs_file_death", rs_file_death);
SetCVar("rs_file_deathm", rs_file_deathm);
SetCVar("rs_file_deathc", rs_file_deathc);
SetCVar("rs_file_shots", rs_file_shots);
SetCVar("rs_file_miscs", rs_file_miscs);
SetCVar("rs_file_assists", rs_file_assists);
SetCVar("rs_file_goals", rs_file_goals);
SetCVar("rs_file_saves", rs_file_saves);
SetCVar("rs_file_dropshot", rs_file_dropshot);
SetCVar("rs_file_boost", rs_file_boost);

SetCVar("rs_hide_games", rs_hide_games);
Expand All @@ -317,6 +324,12 @@ void RocketStats::RefreshVars()
SetCVar("rs_hide_death", rs_hide_death);
SetCVar("rs_hide_deathm", rs_hide_deathm);
SetCVar("rs_hide_deathc", rs_hide_deathc);
SetCVar("rs_hide_shots", rs_hide_shots);
SetCVar("rs_hide_miscs", rs_hide_miscs);
SetCVar("rs_hide_assists", rs_hide_assists);
SetCVar("rs_hide_goals", rs_hide_goals);
SetCVar("rs_hide_saves", rs_hide_saves);
SetCVar("rs_hide_dropshot", rs_hide_dropshot);
}

Element RocketStats::CalculateElement(json& element, Options& options, bool& check)
Expand Down
Loading

0 comments on commit 5a5a34d

Please sign in to comment.