Skip to content

Commit

Permalink
hudelements: fix exec not appearing on the same line as custom_text
Browse files Browse the repository at this point in the history
  • Loading branch information
flightlessmango committed Sep 12, 2023
1 parent d75afd6 commit 53ee227
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/hud_elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion src/overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 53ee227

Please sign in to comment.