added param text_color

pull/58/head
FlightlessMango 4 years ago
parent d39bcd2cdb
commit 8bf8723ad5

@ -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;
}

@ -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<unsigned *, 9> colors = {
std::array<unsigned *, 10> colors = {
&params->crosshair_color,
&params->cpu_color,
&params->gpu_color,
@ -378,6 +380,7 @@ parse_overlay_config(struct overlay_params *params,
&params->io_color,
&params->background_color,
&params->frametime_color,
&params->text_color,
};
for (auto color : colors){

@ -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;

Loading…
Cancel
Save