Merge pull request #696 from kevlahnota/master

clear holdToolTip
This commit is contained in:
Anthony Calosa
2022-06-14 14:08:47 +08:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -117,6 +117,7 @@ public class RewardScene extends UIScene {
public void loadRewards(Array<Reward> newRewards, Type type, ShopActor shopActor) {
RewardActor.clearHoldToolTip();
this.type = type;
doneClicked = false;

View File

@@ -44,7 +44,7 @@ import static forge.adventure.util.Paths.ITEMS_ATLAS;
*/
public class RewardActor extends Actor implements Disposable, ImageFetcher.Callback {
Tooltip<Image> tooltip;
HoldTooltip holdTooltip;
static HoldTooltip holdTooltip;
Reward reward;
ShaderProgram shaderGrayscale = Forge.getGraphics().getShaderGrayscale();
@@ -59,7 +59,7 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
boolean clicked = false;
boolean sold = false;
boolean flipOnClick;
private boolean hover;
private static boolean hover;
public static int renderedCount = 0; //Counter for cards that require rendering a preview.
static final ImageFetcher fetcher = GuiBase.getInterface().getImageFetcher();
@@ -267,6 +267,14 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
public boolean isFlipped() {
return (clicked && flipProcess >= 1);
}
public static void clearHoldToolTip() {
if (holdTooltip != null) {
try {
hover = false;
holdTooltip.tooltip_actor.remove();
} catch (Exception e){}
}
}
public void flip() {
if (clicked)