diff --git a/include/omath/hud/entity_overlay_widgets.hpp b/include/omath/hud/entity_overlay_widgets.hpp index 0a4b3e6..248100e 100644 --- a/include/omath/hud/entity_overlay_widgets.hpp +++ b/include/omath/hud/entity_overlay_widgets.hpp @@ -99,11 +99,17 @@ namespace omath::hud::widget template Centered(W) -> Centered; + /// Empty gap that advances the side cursor without drawing. + struct Spacer + { + float size; + }; + // ── Side widget variant ─────────────────────────────────────────────────── struct None { }; ///< No-op placeholder — used by widget::when for disabled elements. - using SideWidget = std::variant>; + using SideWidget = std::variant, Spacer>; // ── Side containers ─────────────────────────────────────────────────────── // Storing std::initializer_list is safe here: the backing array diff --git a/source/hud/entity_overlay.cpp b/source/hud/entity_overlay.cpp index 1165136..ff60295 100644 --- a/source/hud/entity_overlay.cpp +++ b/source/hud/entity_overlay.cpp @@ -509,6 +509,10 @@ namespace omath::hud { add_right_label(w.child.color, w.child.offset, w.child.outlined, w.child.text); }, + [this](const widget::Spacer& w) + { + m_text_cursor_right.x += w.size; + }, }, child); } @@ -538,6 +542,10 @@ namespace omath::hud { add_left_label(w.child.color, w.child.offset, w.child.outlined, w.child.text); }, + [this](const widget::Spacer& w) + { + m_text_cursor_left.x -= w.size; + }, }, child); } @@ -567,6 +575,10 @@ namespace omath::hud { add_centered_top_label(w.child.color, w.child.offset, w.child.outlined, w.child.text); }, + [this](const widget::Spacer& w) + { + m_text_cursor_top.y -= w.size; + }, }, child); } @@ -596,6 +608,10 @@ namespace omath::hud add_centered_bottom_label(w.child.color, w.child.offset, w.child.outlined, w.child.text); }, + [this](const widget::Spacer& w) + { + m_text_cursor_bottom.y += w.size; + }, }, child); }