Add param table_columns

pull/400/head
FlightlessMango 4 years ago
parent ce6a87823b
commit 44d5546ba5

@ -187,6 +187,7 @@ Parameters that are enabled by default have to be explicitly disabled. These (cu
| `cpu_load_value` | Set the values for medium and high load e.g `cpu_load_value=50,90` |
| `cellpadding_y` | Set the vertical cellpadding, default is `-0.085` |
| `frametime` | Display frametime next to fps text |
| `table_columns` | Set the number of table columns for ImGui, defaults to 3 |
Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_size=32`

@ -104,6 +104,7 @@ position=top-left
### Hud dimensions
# width=
# height=
# table_columns
### Hud transparency / alpha
background_alpha=0.5

@ -345,6 +345,7 @@ parse_font_glyph_ranges(const char *str)
#define parse_permit_upload(s) parse_unsigned(s)
#define parse_no_small_font(s) parse_unsigned(s) != 0
#define parse_cellpadding_y(s) parse_float(s)
#define parse_table_columns(s) parse_unsigned(s)
#define parse_cpu_color(s) parse_color(s)
#define parse_gpu_color(s) parse_color(s)
@ -643,7 +644,8 @@ parse_overlay_config(struct overlay_params *params,
255);
}
params->tableCols = 3;
if (!params->table_columns)
params->table_columns = 3;
if (!params->font_size) {
params->font_size = 24;

@ -116,6 +116,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_CUSTOM(gpu_load_color) \
OVERLAY_PARAM_CUSTOM(cpu_load_color) \
OVERLAY_PARAM_CUSTOM(cellpadding_y) \
OVERLAY_PARAM_CUSTOM(table_columns) \
enum overlay_param_position {
LAYER_POSITION_TOP_LEFT,
@ -179,7 +180,7 @@ struct overlay_params {
std::vector<unsigned> gpu_load_value;
std::vector<unsigned> cpu_load_value;
unsigned media_player_color;
unsigned tableCols;
unsigned table_columns;
bool no_small_font;
float font_size, font_scale;
float font_size_text;

@ -953,7 +953,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
if (!params.no_display){
ImGui::Begin("Main", &open, ImGuiWindowFlags_NoDecoration);
ImGui::BeginTable("hud", params.tableCols, ImGuiTableFlags_NoClipX);
ImGui::BeginTable("hud", params.table_columns, ImGuiTableFlags_NoClipX);
HUDElements.place = 0;
for (auto& func : HUDElements.ordered_functions){
func.first();

Loading…
Cancel
Save