Allow multiple instances of custom_text_center and custom_text

pull/443/head
Alessandro Toia 4 years ago
parent 05c09e3fdf
commit c4925ac83e

@ -516,21 +516,20 @@ void HudElements::show_fps_limit(){
}
void HudElements::custom_text_center(){
if (!HUDElements.params->custom_text_center.empty()){
ImGui::TableNextRow();
ImGui::PushFont(HUDElements.sw_stats->font1);
std::string text = HUDElements.params->custom_text_center;
center_text(text);
ImGui::TextColored(HUDElements.colors.text, "%s",text.c_str());
std::string value = HUDElements.ordered_functions[HUDElements.place].second;
center_text(value);
ImGui::TextColored(HUDElements.colors.text, "%s",value.c_str());
ImGui::NewLine();
ImGui::PopFont();
}
}
void HudElements::custom_text(){
ImGui::TableNextRow();
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::TextColored(HUDElements.colors.text, "%s",HUDElements.params->custom_text.c_str());
std::string value = HUDElements.ordered_functions[HUDElements.place].second;
ImGui::TextColored(HUDElements.colors.text, "%s",value.c_str());
ImGui::PopFont();
}

@ -62,6 +62,8 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(resolution) \
OVERLAY_PARAM_BOOL(show_fps_limit) \
OVERLAY_PARAM_BOOL(fps_color_change) \
OVERLAY_PARAM_BOOL(custom_text_center) \
OVERLAY_PARAM_BOOL(custom_text) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_folder) \
OVERLAY_PARAM_CUSTOM(output_file) \
@ -125,8 +127,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_CUSTOM(table_columns) \
OVERLAY_PARAM_CUSTOM(blacklist) \
OVERLAY_PARAM_CUSTOM(autostart_log) \
OVERLAY_PARAM_CUSTOM(custom_text_center) \
OVERLAY_PARAM_CUSTOM(custom_text) \
enum overlay_param_position {
LAYER_POSITION_TOP_LEFT,

Loading…
Cancel
Save