Add new param 'core_load_change' to change colors of cpu core load depending on load %

pull/430/head
Alessandro Toia 4 years ago
parent 3df142da5d
commit ed0c7a344d

@ -189,6 +189,7 @@ Parameters that are enabled by default have to be explicitly disabled. These (cu
| `cpu_load_change` | Changes the color of the CPU load depending on load | | `cpu_load_change` | Changes the color of the CPU load depending on load |
| `cpu_load_color` | Set the colors for the gpu load change low,medium and high. e.g `cpu_load_color=0000FF,00FFFF,FF00FF` | | `cpu_load_color` | Set the colors for the gpu load change low,medium and high. e.g `cpu_load_color=0000FF,00FFFF,FF00FF` |
| `cpu_load_value` | Set the values for medium and high load e.g `cpu_load_value=50,90` | | `cpu_load_value` | Set the values for medium and high load e.g `cpu_load_value=50,90` |
| `core_load_change` | Changes the colors of cpu core loads, uses the same data from `cpu_load_value` and `cpu_load_change` |
| `cellpadding_y` | Set the vertical cellpadding, default is `-0.085` | | `cellpadding_y` | Set the vertical cellpadding, default is `-0.085` |
| `frametime` | Display frametime next to fps text | | `frametime` | Display frametime next to fps text |
| `table_columns` | Set the number of table columns for ImGui, defaults to 3 | | `table_columns` | Set the number of table columns for ImGui, defaults to 3 |

@ -85,6 +85,7 @@ position=top-left
### Display the current CPU load & frequency for each core ### Display the current CPU load & frequency for each core
# core_load # core_load
# core_load_change
### IO read and write for the app (not system) ### IO read and write for the app (not system)
# io_read # io_read

@ -231,10 +231,28 @@ void HudElements::core_load(){
ImGui::TextColored(HUDElements.colors.cpu,"%i", i); ImGui::TextColored(HUDElements.colors.cpu,"%i", i);
ImGui::PopFont(); ImGui::PopFont();
ImGui::TableNextCell(); ImGui::TableNextCell();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%i", int(cpuData.percent)); auto text_color = HUDElements.colors.text;
ImGui::SameLine(0, 1.0f); if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_core_load_change]){
ImGui::Text("%%"); int cpu_load_percent = int(cpuData.percent);
ImGui::TableNextCell(); struct LOAD_DATA cpu_data = {
HUDElements.colors.cpu_load_low,
HUDElements.colors.cpu_load_med,
HUDElements.colors.cpu_load_high,
HUDElements.params->cpu_load_value[0],
HUDElements.params->cpu_load_value[1]
};
auto load_color = change_on_load_temp(cpu_data, cpu_load_percent);
right_aligned_text(load_color, HUDElements.ralign_width, "%d", cpu_load_percent);
ImGui::SameLine(0, 1.0f);
ImGui::TextColored(load_color, "%%");
ImGui::TableNextCell();
}
else {
right_aligned_text(text_color, HUDElements.ralign_width, "%i", int(cpuData.percent));
ImGui::SameLine(0, 1.0f);
ImGui::Text("%%");
ImGui::TableNextCell();
}
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%i", cpuData.mhz); right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%i", cpuData.mhz);
ImGui::SameLine(0, 1.0f); ImGui::SameLine(0, 1.0f);
ImGui::PushFont(HUDElements.sw_stats->font1); ImGui::PushFont(HUDElements.sw_stats->font1);

@ -536,6 +536,7 @@ parse_overlay_config(struct overlay_params *params,
params->enabled[OVERLAY_PARAM_ENABLED_wine] = false; params->enabled[OVERLAY_PARAM_ENABLED_wine] = false;
params->enabled[OVERLAY_PARAM_ENABLED_gpu_load_change] = false; params->enabled[OVERLAY_PARAM_ENABLED_gpu_load_change] = false;
params->enabled[OVERLAY_PARAM_ENABLED_cpu_load_change] = false; params->enabled[OVERLAY_PARAM_ENABLED_cpu_load_change] = false;
params->enabled[OVERLAY_PARAM_ENABLED_core_load_change] = false;
params->enabled[OVERLAY_PARAM_ENABLED_legacy_layout] = true; params->enabled[OVERLAY_PARAM_ENABLED_legacy_layout] = true;
params->enabled[OVERLAY_PARAM_ENABLED_frametime] = true; params->enabled[OVERLAY_PARAM_ENABLED_frametime] = true;
params->fps_sampling_period = 500000; /* 500ms */ params->fps_sampling_period = 500000; /* 500ms */

@ -54,6 +54,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(wine) \ OVERLAY_PARAM_BOOL(wine) \
OVERLAY_PARAM_BOOL(gpu_load_change) \ OVERLAY_PARAM_BOOL(gpu_load_change) \
OVERLAY_PARAM_BOOL(cpu_load_change) \ OVERLAY_PARAM_BOOL(cpu_load_change) \
OVERLAY_PARAM_BOOL(core_load_change) \
OVERLAY_PARAM_BOOL(graphs) \ OVERLAY_PARAM_BOOL(graphs) \
OVERLAY_PARAM_BOOL(legacy_layout) \ OVERLAY_PARAM_BOOL(legacy_layout) \
OVERLAY_PARAM_BOOL(cpu_mhz) \ OVERLAY_PARAM_BOOL(cpu_mhz) \

Loading…
Cancel
Save