hudelements: fix exec not appearing on the same line as custom_text

pull/1042/merge
FlightlessMango 9 months ago
parent d75afd6b7a
commit 53ee2275e4

@ -818,8 +818,12 @@ void HudElements::custom_text_center(){
void HudElements::custom_text(){ void HudElements::custom_text(){
ImguiNextColumnFirstItem(); ImguiNextColumnFirstItem();
ImGui::PushFont(HUDElements.sw_stats->font1); ImGui::PushFont(HUDElements.sw_stats->font1);
const std::string& value = HUDElements.ordered_functions[HUDElements.place].second; const char* value;
HUDElements.TextColored(HUDElements.colors.text, "%s",value.c_str()); if (size_t(HUDElements.place) < HUDElements.ordered_functions.size())
value = HUDElements.ordered_functions[HUDElements.place].second.c_str();
else
return;
HUDElements.TextColored(HUDElements.colors.text, "%s",value);
ImGui::PopFont(); ImGui::PopFont();
} }

@ -668,7 +668,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
HUDElements.place = 0; HUDElements.place = 0;
for (auto& func : HUDElements.ordered_functions){ for (auto& func : HUDElements.ordered_functions){
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(-3,-3)); ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, ImVec2(-3,-3));
if(!params.enabled[OVERLAY_PARAM_ENABLED_horizontal]) if(!params.enabled[OVERLAY_PARAM_ENABLED_horizontal] && func.first != HudElements::_exec)
ImGui::TableNextRow(); ImGui::TableNextRow();
func.first(); func.first();
HUDElements.place += 1; HUDElements.place += 1;

Loading…
Cancel
Save