Set sane default members on Hoverable
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user