add battery, fps_limit and resolution to legacy layout

control
FlightlessMango 3 years ago
parent 37d8c75c78
commit a50bbbac22

@ -502,29 +502,33 @@ void HudElements::media_player(){
} }
void HudElements::resolution(){ void HudElements::resolution(){
ImGui::TableNextRow(); ImGui::TableNextColumn(); if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_resolution]){
unsigned res_width = ImGui::GetIO().DisplaySize.x; ImGui::TableNextRow(); ImGui::TableNextColumn();
unsigned res_height = ImGui::GetIO().DisplaySize.y; unsigned res_width = ImGui::GetIO().DisplaySize.x;
ImGui::PushFont(HUDElements.sw_stats->font1); unsigned res_height = ImGui::GetIO().DisplaySize.y;
ImGui::TextColored(HUDElements.colors.engine, "Resolution"); ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TableNextColumn(); ImGui::TextColored(HUDElements.colors.engine, "Resolution");
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width * 1.3, "%ix%i", res_width, res_height); ImGui::TableNextColumn();
ImGui::PopFont(); right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width * 1.3, "%ix%i", res_width, res_height);
ImGui::PopFont();
}
} }
void HudElements::show_fps_limit(){ void HudElements::show_fps_limit(){
int fps = 0; if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_show_fps_limit]){
double frame_time = (double)fps_limit_stats.targetFrameTime.count()/1000000; int fps = 0;
if (frame_time == 0.0){ double frame_time = (double)fps_limit_stats.targetFrameTime.count()/1000000;
return; fps = (1 / frame_time) *1000;
if (frame_time == 0.0){
fps = 0;
}
ImGui::TableNextRow(); ImGui::TableNextColumn();
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TextColored(HUDElements.colors.engine, "%s","FPS limit");
ImGui::TableNextColumn();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%i", fps);
ImGui::PopFont();
} }
fps = (1 / frame_time) *1000;
ImGui::TableNextRow(); ImGui::TableNextColumn();
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TextColored(HUDElements.colors.engine, "%s","FPS limit");
ImGui::TableNextColumn();
right_aligned_text(HUDElements.colors.text, HUDElements.ralign_width, "%i", fps);
ImGui::PopFont();
} }
void HudElements::custom_text_center(){ void HudElements::custom_text_center(){
@ -795,6 +799,7 @@ void HudElements::legacy_elements(){
ordered_functions.push_back({io_stats, value}); ordered_functions.push_back({io_stats, value});
ordered_functions.push_back({vram, value}); ordered_functions.push_back({vram, value});
ordered_functions.push_back({ram, value}); ordered_functions.push_back({ram, value});
ordered_functions.push_back({battery, value});
ordered_functions.push_back({fps, value}); ordered_functions.push_back({fps, value});
ordered_functions.push_back({engine_version, value}); ordered_functions.push_back({engine_version, value});
ordered_functions.push_back({gpu_name, value}); ordered_functions.push_back({gpu_name, value});
@ -802,9 +807,11 @@ void HudElements::legacy_elements(){
ordered_functions.push_back({arch, value}); ordered_functions.push_back({arch, value});
ordered_functions.push_back({wine, value}); ordered_functions.push_back({wine, value});
ordered_functions.push_back({frame_timing, value}); ordered_functions.push_back({frame_timing, value});
ordered_functions.push_back({media_player, value});
ordered_functions.push_back({gamemode, value}); ordered_functions.push_back({gamemode, value});
ordered_functions.push_back({vkbasalt, value}); ordered_functions.push_back({vkbasalt, value});
ordered_functions.push_back({show_fps_limit, value});
ordered_functions.push_back({resolution, value});
ordered_functions.push_back({media_player, value});
} }
void HudElements::update_exec(){ void HudElements::update_exec(){

Loading…
Cancel
Save