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

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

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

@ -668,7 +668,7 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
HUDElements.place = 0;
for (auto& func : HUDElements.ordered_functions){
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();
func.first();
HUDElements.place += 1;

Loading…
Cancel
Save