Merge remote-tracking branch 'runelite/master' into 0409-merge

This commit is contained in:
Owain van Brakel
2019-09-04 12:26:30 +02:00
6 changed files with 52 additions and 16 deletions

View File

@@ -323,14 +323,14 @@ public class RuneLite
// to main settings
pluginManager.loadDefaultPluginConfiguration();
// Initialize UI
RuneLiteSplashScreen.stage(.75, "Initialize UI");
clientUI.init(this);
// Start client session
RuneLiteSplashScreen.stage(.80, "Starting core interface");
RuneLiteSplashScreen.stage(.75, "Starting core interface");
clientSessionManager.start();
// Initialize UI
RuneLiteSplashScreen.stage(.80, "Initialize UI");
clientUI.init(this);
if (!isOutdated)
{
// Initialize chat colors

View File

@@ -158,7 +158,7 @@ public class PluginManager
}
catch (PluginInstantiationException e)
{
log.warn("Error during starting/stopping plugin {}. {}", plugin.getClass().getSimpleName(), e);
log.warn("Error during starting/stopping plugin {}", plugin.getClass().getSimpleName(), e);
}
}));
}
@@ -228,7 +228,7 @@ public class PluginManager
}
catch (PluginInstantiationException ex)
{
log.warn("Unable to start plugin {}. {}", plugin.getClass().getSimpleName(), ex);
log.warn("Unable to start plugin {}", plugin.getClass().getSimpleName(), ex);
plugins.remove(plugin);
}

View File

@@ -275,6 +275,15 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
bufferId = uvBufferId = uniformBufferId = -1;
unorderedModels = smallModels = largeModels = 0;
canvas = client.getCanvas();
if (!canvas.isDisplayable())
{
return false;
}
canvas.setIgnoreRepaint(true);
vertexBuffer = new GpuIntBuffer();
uvBuffer = new GpuFloatBuffer();
@@ -282,8 +291,10 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
modelBufferSmall = new GpuIntBuffer();
modelBuffer = new GpuIntBuffer();
canvas = client.getCanvas();
canvas.setIgnoreRepaint(true);
if (log.isDebugEnabled())
{
System.setProperty("jogl.debug", "true");
}
GLProfile.initSingleton();
@@ -361,7 +372,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
shutDown();
}
return true;
});
}

View File

@@ -378,7 +378,7 @@ public class SlayerPlugin extends Plugin
return configManager.getConfig(SlayerConfig.class);
}
private void onGameStateChanged(GameStateChanged event)
void onGameStateChanged(GameStateChanged event)
{
switch (event.getGameState())
{
@@ -396,7 +396,7 @@ public class SlayerPlugin extends Plugin
if (loginTick && this.amount != -1
&& !this.taskName.isEmpty())
{
setTask(this.taskName, this.amount, this.initialAmount, true, this.taskLocation, this.lastCertainAmount);
setTask(this.taskName, this.amount, this.initialAmount, true, this.taskLocation, this.lastCertainAmount, false);
}
}
}
@@ -822,7 +822,7 @@ public class SlayerPlugin extends Plugin
private void onConfigChanged(ConfigChanged event)
{
if (!event.getGroup().equals("slayer"))
if (!event.getGroup().equals("slayer") || !event.getKey().equals("infobox"))
{
return;
}
@@ -1029,6 +1029,11 @@ public class SlayerPlugin extends Plugin
}
private void setTask(String name, int amt, int initAmt, boolean isNewAssignment, String location, int lastCertainAmt)
{
setTask(name, amt, initAmt, isNewAssignment, location, lastCertainAmt, true);
}
private void setTask(String name, int amt, int initAmt, boolean isNewAssignment, String location, int lastCertainAmt, boolean addCounter)
{
currentTask = new TaskData(isNewAssignment ? 0 : currentTask.getElapsedTime(),
isNewAssignment ? 0 : currentTask.getElapsedKills(),
@@ -1042,8 +1047,12 @@ public class SlayerPlugin extends Plugin
save();
removeCounter();
addCounter();
infoTimer = Instant.now();
if (addCounter)
{
infoTimer = Instant.now();
addCounter();
}
Task task = Task.getTask(name);
targetNames.clear();

View File

@@ -44,7 +44,7 @@ public interface TimersConfig extends Config
@ConfigItem(
keyName = "showAntipoison",
name = "Antipoison/Venom timers",
description = "Configures whether timers for poison and venom protection are displayed"
description = "Configures whether timers for Antipoison, Antidote and Antivenom are displayed"
)
default boolean showAntiPoison()
{

View File

@@ -33,6 +33,7 @@ import javax.inject.Inject;
import net.runelite.api.ChatMessageType;
import static net.runelite.api.ChatMessageType.GAMEMESSAGE;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.Skill;
@@ -40,6 +41,7 @@ import net.runelite.api.Varbits;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ExperienceChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.VarbitChanged;
import net.runelite.api.widgets.Widget;
@@ -572,4 +574,18 @@ public class SlayerPluginTest
assertEquals(34, slayerPlugin.getCurrentTask().getAmount());
}
@Test
public void infoboxNotAddedOnLogin()
{
GameStateChanged loggingIn = new GameStateChanged();
loggingIn.setGameState(GameState.LOGGING_IN);
slayerPlugin.onGameStateChanged(loggingIn);
GameStateChanged loggedIn = new GameStateChanged();
loggedIn.setGameState(GameState.LOGGED_IN);
slayerPlugin.onGameStateChanged(loggedIn);
verify(infoBoxManager, never()).addInfoBox(any());
}
}