Add resolution param

pull/430/head
FlightlessMango 4 years ago
parent ed0c7a344d
commit c8d68be476

@ -194,6 +194,7 @@ Parameters that are enabled by default have to be explicitly disabled. These (cu
| `frametime` | Display frametime next to fps text |
| `table_columns` | Set the number of table columns for ImGui, defaults to 3 |
| `blacklist` | Add a program to the blacklist. e.g `blacklist=vkcube,WatchDogs2.exe` |
| `resolution` | Display the current resolution |
Example: `MANGOHUD_CONFIG=cpu_temp,gpu_temp,position=top-right,height=500,font_size=32`
Because comma is also used as option delimiter and needs to be escaped for values with a backslash, you can use `+` like `MANGOHUD_CONFIG=fps_limit=60+30+0` instead.

@ -56,6 +56,9 @@ frame_timing
### Display the current system time
# time
### Display the current resolution
# resolution
### Time formatting examples
# time_format = %H:%M
# time_format = [ %T %F ]

@ -471,6 +471,17 @@ void HudElements::media_player(){
#endif
}
void HudElements::resolution(){
ImGui::TableNextRow();
unsigned res_width = ImGui::GetIO().DisplaySize.x;
unsigned res_height = ImGui::GetIO().DisplaySize.y;
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TextColored(HUDElements.colors.engine, "Resolution");
ImGui::TableNextCell();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width * 1.3, "%ix%i", res_width, res_height);
ImGui::PopFont();
}
void HudElements::graphs(){
ImGui::TableNextRow();
ImGui::Dummy(ImVec2(0.0f, real_font_size.y));
@ -610,6 +621,7 @@ void HudElements::sort_elements(std::pair<std::string, std::string> option){
if (param == "wine") { ordered_functions.push_back({wine, value}); }
if (param == "frame_timing") { ordered_functions.push_back({frame_timing, value}); }
if (param == "media_player") { ordered_functions.push_back({media_player, value}); }
if (param == "resolution") { ordered_functions.push_back({resolution, value}); }
if (param == "graphs"){
if (!HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_graphs])
HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_graphs] = true;

@ -11,6 +11,7 @@ class HudElements{
struct overlay_params *params;
float ralign_width;
float old_scale;
float res_width, res_height;
bool is_vulkan;
int place;
std::vector<std::pair<std::string, std::string>> options;
@ -38,6 +39,7 @@ class HudElements{
static void wine();
static void frame_timing();
static void media_player();
static void resolution();
static void graphs();
void convert_colors(struct overlay_params& params);

@ -59,6 +59,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(legacy_layout) \
OVERLAY_PARAM_BOOL(cpu_mhz) \
OVERLAY_PARAM_BOOL(frametime) \
OVERLAY_PARAM_BOOL(resolution) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_folder) \
OVERLAY_PARAM_CUSTOM(output_file) \

Loading…
Cancel
Save