Fix highlighting wrong default world

The default world plugin was running after the list was populated, by not highlighting any default world, only the current world after login, we unsure that it highlights the correct first world.
This commit is contained in:
psikoi
2018-08-16 02:02:40 +01:00
parent 6506409f02
commit 98f843627c
2 changed files with 3 additions and 1 deletions

View File

@@ -44,6 +44,7 @@ import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.swing.SwingUtilities;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.ChatMessageType;
import net.runelite.api.ChatPlayer;
@@ -124,6 +125,7 @@ public class WorldHopperPlugin extends Plugin
private NavigationButton navButton;
private WorldSwitcherPanel panel;
@Getter
private int lastWorld;
private int favoriteWorld1, favoriteWorld2;

View File

@@ -177,7 +177,7 @@ class WorldSwitcherPanel extends PluginPanel
for (int i = 0; i < worlds.size(); i++)
{
World world = worlds.get(i);
rows.add(buildRow(world, i % 2 == 0, world.getId() == plugin.getCurrentWorld(), plugin.isFavorite(world)));
rows.add(buildRow(world, i % 2 == 0, world.getId() == plugin.getCurrentWorld() && plugin.getLastWorld() != 0, plugin.isFavorite(world)));
}
updateList();