From 8bf8723ad522ecd96ab39906e5734d8fdc913f9d Mon Sep 17 00:00:00 2001 From: FlightlessMango Date: Wed, 11 Mar 2020 06:20:18 +0100 Subject: [PATCH] added param text_color --- src/overlay.cpp | 3 ++- src/overlay_params.cpp | 5 ++++- src/overlay_params.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/overlay.cpp b/src/overlay.cpp index 0ff7669b..abb802c9 100644 --- a/src/overlay.cpp +++ b/src/overlay.cpp @@ -1074,7 +1074,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2& ImGui::TableNextCell(); right_aligned_text(char_width * 4, "%i", gpu_info.temp); ImGui::SameLine(0, 1.0f); - ImGui::TextColored(ImVec4(1.0, 1.0, 1.0, 1.0), "°C"); + ImGui::Text("°C"); } if (params.enabled[OVERLAY_PARAM_ENABLED_gpu_core_clock]){ ImGui::TableNextCell(); @@ -1949,6 +1949,7 @@ void imgui_custom_style(struct overlay_params& params){ ImGuiStyle& style = ImGui::GetStyle(); style.Colors[ImGuiCol_PlotLines] = ImGui::ColorConvertU32ToFloat4(params.frametime_color); style.Colors[ImGuiCol_WindowBg] = ImGui::ColorConvertU32ToFloat4(params.background_color); + style.Colors[ImGuiCol_Text] = ImGui::ColorConvertU32ToFloat4(params.text_color); style.CellPadding.y = -2; } diff --git a/src/overlay_params.cpp b/src/overlay_params.cpp index 364f9d46..c91a719a 100644 --- a/src/overlay_params.cpp +++ b/src/overlay_params.cpp @@ -166,6 +166,7 @@ parse_str(const char *str) #define parse_io_color(s) parse_color(s) #define parse_frametime_color(s) parse_color(s) #define parse_background_color(s) parse_color(s) +#define parse_text_color(s) parse_color(s) static bool parse_help(const char *str) @@ -320,6 +321,7 @@ parse_overlay_config(struct overlay_params *params, params->io_color = strtol("a491d3", NULL, 16); params->frametime_color = strtol("00ff00", NULL, 16); params->background_color = strtol("020202", NULL, 16); + params->text_color = strtol("ffffff", NULL, 16); // first pass with env var if (env) @@ -368,7 +370,7 @@ parse_overlay_config(struct overlay_params *params, // Command buffer gets reused and timestamps cause hangs for some reason, force off for now params->enabled[OVERLAY_PARAM_ENABLED_gpu_timing] = false; // Convert from 0xRRGGBB to ImGui's format - std::array colors = { + std::array colors = { ¶ms->crosshair_color, ¶ms->cpu_color, ¶ms->gpu_color, @@ -378,6 +380,7 @@ parse_overlay_config(struct overlay_params *params, ¶ms->io_color, ¶ms->background_color, ¶ms->frametime_color, + ¶ms->text_color, }; for (auto color : colors){ diff --git a/src/overlay_params.h b/src/overlay_params.h index 0b060498..6b220a24 100644 --- a/src/overlay_params.h +++ b/src/overlay_params.h @@ -91,6 +91,7 @@ extern "C" { OVERLAY_PARAM_CUSTOM(frametime_color) \ OVERLAY_PARAM_CUSTOM(background_color) \ OVERLAY_PARAM_CUSTOM(io_color) \ + OVERLAY_PARAM_CUSTOM(text_color) \ OVERLAY_PARAM_CUSTOM(alpha) \ OVERLAY_PARAM_CUSTOM(help) @@ -126,7 +127,7 @@ struct overlay_params { unsigned height; int offset_x, offset_y; unsigned vsync; - unsigned crosshair_color, cpu_color, gpu_color, vram_color, ram_color, engine_color, io_color, frametime_color, background_color; + unsigned crosshair_color, cpu_color, gpu_color, vram_color, ram_color, engine_color, io_color, frametime_color, background_color, text_color; unsigned tableCols; float font_size; float background_alpha, alpha;