xpdrops: fix recoloring xpdrops when prayer is flicked on the previous tick

Previously the widget hidden event would not run until the next client
tick, due to it being on a timer, and the game tick event being deferred
until the next frame. Now that we are hooking to the script being
executed it fires prior to the game tick event being fired.
This commit is contained in:
Adam
2020-07-11 11:46:22 -04:00
parent cb4b7d42ea
commit e086a1155b

View File

@@ -68,7 +68,6 @@ public class XpDropPlugin extends Plugin
private boolean correctPrayer;
private Skill lastSkill = null;
private Map<Skill, Integer> previousSkillExpTable = new EnumMap<>(Skill.class);
private PrayerType currentTickPrayer;
@Provides
XpDropConfig provideConfig(ConfigManager configManager)
@@ -103,7 +102,7 @@ public class XpDropPlugin extends Plugin
xpdrop.setChildren(Arrays.copyOf(children, 1));
}
PrayerType prayer = currentTickPrayer;
PrayerType prayer = getActivePrayerType();
if (prayer == null)
{
resetTextColor(text);
@@ -176,7 +175,6 @@ public class XpDropPlugin extends Plugin
@Subscribe
public void onGameTick(GameTick tick)
{
currentTickPrayer = getActivePrayerType();
correctPrayer = false;
final int fakeTickDelay = config.fakeXpDropDelay();