mta: clear hint arrow when leaving enchantment and alchemist room

This commit is contained in:
Adam
2021-06-04 16:13:34 -04:00
parent ab5d90fdca
commit 559410b537
2 changed files with 16 additions and 0 deletions

View File

@@ -96,6 +96,7 @@ public class AlchemyRoom extends MTARoom
private AlchemyItem best; private AlchemyItem best;
private Cupboard suggestion; private Cupboard suggestion;
private boolean hintSet;
@Inject @Inject
private AlchemyRoom(Client client, MTAConfig config, MTAPlugin plugin, ItemManager itemManager, InfoBoxManager infoBoxManager) private AlchemyRoom(Client client, MTAConfig config, MTAPlugin plugin, ItemManager itemManager, InfoBoxManager infoBoxManager)
@@ -221,6 +222,11 @@ public class AlchemyRoom extends MTARoom
if (!inside()) if (!inside())
{ {
reset(); reset();
if (hintSet)
{
client.clearHintArrow();
hintSet = false;
}
} }
} }
} }
@@ -381,6 +387,7 @@ public class AlchemyRoom extends MTARoom
{ {
client.setHintArrow(object.getWorldLocation()); client.setHintArrow(object.getWorldLocation());
found = true; found = true;
hintSet = true;
} }
BufferedImage image = itemManager.getImage(alchemyItem.getId()); BufferedImage image = itemManager.getImage(alchemyItem.getId());
@@ -395,6 +402,7 @@ public class AlchemyRoom extends MTARoom
if (!found && suggestion != null) if (!found && suggestion != null)
{ {
client.setHintArrow(suggestion.gameObject.getWorldLocation()); client.setHintArrow(suggestion.gameObject.getWorldLocation());
hintSet = true;
} }
} }

View File

@@ -50,6 +50,7 @@ public class EnchantmentRoom extends MTARoom
private final Client client; private final Client client;
private final List<WorldPoint> dragonstones = new ArrayList<>(); private final List<WorldPoint> dragonstones = new ArrayList<>();
private boolean hintSet;
@Inject @Inject
private EnchantmentRoom(MTAConfig config, Client client) private EnchantmentRoom(MTAConfig config, Client client)
@@ -64,6 +65,11 @@ public class EnchantmentRoom extends MTARoom
if (gameStateChanged.getGameState() == GameState.LOADING) if (gameStateChanged.getGameState() == GameState.LOADING)
{ {
dragonstones.clear(); dragonstones.clear();
if (hintSet)
{
client.clearHintArrow();
hintSet = false;
}
} }
} }
@@ -79,10 +85,12 @@ public class EnchantmentRoom extends MTARoom
if (nearest != null) if (nearest != null)
{ {
client.setHintArrow(nearest); client.setHintArrow(nearest);
hintSet = true;
} }
else else
{ {
client.clearHintArrow(); client.clearHintArrow();
hintSet = false;
} }
} }