mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-10 04:33:15 +00:00
imgui: Displays FPS color based on FPS (#2437)
This commit is contained in:
parent
82cacec8eb
commit
bdf4a5249d
3 changed files with 20 additions and 0 deletions
|
@ -259,7 +259,19 @@ void L::DrawAdvanced() {
|
|||
|
||||
void L::DrawSimple() {
|
||||
const float frameRate = DebugState.Framerate;
|
||||
if (Config::fpsColor()) {
|
||||
if (frameRate < 10) {
|
||||
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.0f, 0.0f, 1.0f)); // Red
|
||||
} else if (frameRate >= 10 && frameRate < 20) {
|
||||
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.5f, 0.0f, 1.0f)); // Orange
|
||||
} else {
|
||||
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); // White
|
||||
}
|
||||
} else {
|
||||
PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); // White
|
||||
}
|
||||
Text("%d FPS (%.1f ms)", static_cast<int>(std::round(frameRate)), 1000.0f / frameRate);
|
||||
PopStyleColor();
|
||||
}
|
||||
|
||||
static void LoadSettings(const char* line) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue