mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
update: tooltip conditions
This commit is contained in:
parent
7db76a0e6a
commit
a57f8f41bb
1 changed files with 17 additions and 22 deletions
|
|
@ -68,8 +68,6 @@ void GUI::updateTooltip(float delta) {
|
||||||
if (hover == nullptr || !hover->isInside(Events::cursor)) {
|
if (hover == nullptr || !hover->isInside(Events::cursor)) {
|
||||||
return resetTooltip();
|
return resetTooltip();
|
||||||
}
|
}
|
||||||
float mouseDelta = glm::length(Events::delta);
|
|
||||||
if (mouseDelta < 1.0f || tooltipTimer >= hover->getTooltipDelay()) {
|
|
||||||
if (tooltipTimer + delta >= hover->getTooltipDelay()) {
|
if (tooltipTimer + delta >= hover->getTooltipDelay()) {
|
||||||
auto label = std::dynamic_pointer_cast<gui::Label>(get("tooltip.label"));
|
auto label = std::dynamic_pointer_cast<gui::Label>(get("tooltip.label"));
|
||||||
const auto& text = hover->getTooltip();
|
const auto& text = hover->getTooltip();
|
||||||
|
|
@ -89,9 +87,6 @@ void GUI::updateTooltip(float delta) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tooltipTimer += delta;
|
tooltipTimer += delta;
|
||||||
} else {
|
|
||||||
resetTooltip();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Mouse related input and logic handling
|
/// @brief Mouse related input and logic handling
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue