Set sane default members on Hoverable

This commit is contained in:
2024-12-04 15:05:07 -05:00
parent e8eb018959
commit 936c1902d0
2 changed files with 6 additions and 17 deletions

View File

@@ -33,10 +33,10 @@ namespace JUI
void Update(const Vector2& m_pos, float delta);
virtual void SetTooltip(const std::string& content, float delay) {}
protected:
Tooltip* tooltip;
float tooltip_threshold;
float tooltip_limit;
bool hovered;
bool hover_debounce;
Tooltip* tooltip = nullptr;
float tooltip_threshold = 0.f;
float tooltip_limit = 0.125f;
bool hovered = false;
bool hover_debounce = false;
};
}

View File

@@ -14,23 +14,12 @@ void JUI::Hoverable::Update(const Vector2 &m_pos, float delta) {
if (tooltip != nullptr)
{
//if (IsHovered())
//{
// tooltip_threshold += delta;
//}
//if (tooltip_threshold > tooltip_limit)
//{
if (IsHovered())
{
if (IsHovered()) {
tooltip->Visible(true);
tooltip->Position(UDim2::FromPixels(m_pos.x, m_pos.y));
} else {
tooltip->Visible(false);
}
//} else
// tooltip->Visible(false);
}