From e5a3dd82b8f394b3c2d1c59671fa0ef50b4dd620 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 3 Jan 2024 18:58:36 -0500 Subject: [PATCH] Removed Tooltips#hideAll and shown Seq --- arc-core/src/arc/scene/ui/Tooltip.java | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arc-core/src/arc/scene/ui/Tooltip.java b/arc-core/src/arc/scene/ui/Tooltip.java index 2534de98..3c95c9fd 100644 --- a/arc-core/src/arc/scene/ui/Tooltip.java +++ b/arc-core/src/arc/scene/ui/Tooltip.java @@ -8,7 +8,6 @@ import arc.scene.*; import arc.scene.event.*; import arc.scene.ui.layout.*; -import arc.struct.*; import arc.util.*; import arc.util.Timer.*; @@ -159,13 +158,11 @@ public void hide(){ */ public static class Tooltips{ private static Tooltips instance; - final Seq shown = new Seq<>(); /** Default text tooltip provider. */ public Func textProvider = text -> new Tooltip(t -> t.add(text)); /** - * Seconds from when an element is hovered to when the tooltip is shown. Default is 2. Call {@link #hideAll()} after changing to - * reset internal state. + * Seconds from when an element is hovered to when the tooltip is shown. Default is 2. */ public float initialTime = 2; /** Once a tooltip is shown, this is used instead of {@link #initialTime}. Default is 0. */ @@ -176,8 +173,6 @@ public static class Tooltips{ public boolean enabled = true; /** If false, tooltips will be shown without animations. Default is true. */ public boolean animations = false; - /** The maximum width. The label will wrap if needed. Default is Integer.MAX_VALUE. */ - public float maxWidth = Integer.MAX_VALUE; /** The distance from the mouse position to offset the tooltip element. Default is 15,19. */ public float offsetX = 15, offsetY = 19; /** @@ -204,7 +199,6 @@ public void run(){ if(stage == null) return; stage.add(showTooltip.container); showTooltip.container.toFront(); - shown.add(showTooltip); showTooltip.container.clearActions(); showAction(showTooltip); @@ -258,7 +252,6 @@ public void hide(Tooltip tooltip){ showTooltip = null; showTask.cancel(); if(tooltip.container.hasParent()){ - shown.remove(tooltip, true); hideAction(tooltip); resetTask.cancel(); Timer.schedule(resetTask, resetTime); @@ -281,17 +274,6 @@ protected void hideAction(Tooltip tooltip){ .addAction(sequence(parallel(alpha(0.2f, 0.2f, fade), scaleTo(0.05f, 0.05f, 0.2f, Interp.fade)), remove())); } - public void hideAll(){ - resetTask.cancel(); - showTask.cancel(); - time = initialTime; - showTooltip = null; - - for(Tooltip tooltip : shown) - tooltip.hide(); - shown.clear(); - } - /** Shows all tooltips on hover without a delay for {@link #resetTime} seconds. */ public void instant(){ time = 0;