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:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user