To unify the access to the icons that are anyway residing near
IconTextField, move the declarations to IconTextField.Icon class.
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
The effects of the Tele Block spell expire on three possible conditions:
1. When a player leaves the wilderness on a non-PVP/DMM world
2. When a player enters a PVP/DMM world safe zone
3. When a player logs out
Leaving the wilderness can be detected via Varbits changes, entering
safe zones in PVP/DMM worlds can be detected via WidgetHiddenChanged
events, and logging out is already detected via GameStateChanged events.
With that said, addressing the first two cases is not a trvial effort as
there are certain race conditions that must be handled. The
WidgetHiddenChanged event triggers upon login to PVP worlds regardless
of where you log in, and the PVP widgets all initially load in a state
which would be reflective of being in a safe zone, and are later set to
the proper state before the first display frame is rendered. Similarly,
during world hops, GameStateChanged and VarbitChanged events trigger in
a pattern which causes the client to think that a player is always
outside the wilderness upon reaching a `LOGGED_IN` game state; that is,
the following events occur on world hopping:
1. Game state changes to `HOPPING`
2. Varbits are all reset to default values. In the case of the
wilderness varbit, it is set to 0--the value representing being
outside the wilderness.
3. Game state changes to `LOGGED_IN`
4. Varbits are set based on player information. Only at this point is
the IN_WILDERNESS varbit set to its proper value.
To handle these race conditions, the event subscribers for game state
change and widget hidden events only set a flag which is checked once
per game tick to handle PVP safe zone (and wilderness varbit) checks.
Fixesrunelite/runelite#2384
- Remove last item ID checks completely and simply update the widget
text with OSB actively traded price whenever the widget do not contains
any
- Properly reset grandExchangeText and grandExchangeItem widgets on
plugin shutdown
Fixes#5098Closes#5158
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>