Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -53,9 +53,14 @@ public interface Callbacks
|
|||||||
void postDeferred(Object event);
|
void postDeferred(Object event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called each client cycle.
|
* Called each tick
|
||||||
*/
|
*/
|
||||||
void clientMainLoop();
|
void tick();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called each frame
|
||||||
|
*/
|
||||||
|
void frame();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called after receiving update NPCs packet from server.
|
* Called after receiving update NPCs packet from server.
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ public class Hooks implements Callbacks
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clientMainLoop()
|
public void tick()
|
||||||
{
|
{
|
||||||
if (shouldProcessGameTick)
|
if (shouldProcessGameTick)
|
||||||
{
|
{
|
||||||
@@ -194,8 +194,6 @@ public class Hooks implements Callbacks
|
|||||||
client.setTickCount(tick + 1);
|
client.setTickCount(tick + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
eventBus.post(BEFORE_RENDER);
|
|
||||||
|
|
||||||
clientThread.invoke();
|
clientThread.invoke();
|
||||||
|
|
||||||
long now = System.nanoTime();
|
long now = System.nanoTime();
|
||||||
@@ -225,6 +223,12 @@ public class Hooks implements Callbacks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void frame()
|
||||||
|
{
|
||||||
|
eventBus.post(BEFORE_RENDER);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When the world map opens it loads about ~100mb of data into memory, which
|
* When the world map opens it loads about ~100mb of data into memory, which
|
||||||
* represents about half of the total memory allocated by the client.
|
* represents about half of the total memory allocated by the client.
|
||||||
|
|||||||
@@ -61,18 +61,18 @@ public class BarrowsBrotherSlainOverlay extends OverlayPanel
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
// Do not display overlay if potential is null/hidden
|
final Widget barrowsBrothers = client.getWidget(WidgetInfo.BARROWS_BROTHERS);
|
||||||
final Widget potential = client.getWidget(WidgetInfo.BARROWS_POTENTIAL);
|
if (barrowsBrothers == null)
|
||||||
if (potential == null || potential.isHidden())
|
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide original overlay
|
// Hide original brother and potential overlays
|
||||||
final Widget barrowsBrothers = client.getWidget(WidgetInfo.BARROWS_BROTHERS);
|
barrowsBrothers.setHidden(true);
|
||||||
if (barrowsBrothers != null)
|
|
||||||
|
final Widget potential = client.getWidget(WidgetInfo.BARROWS_POTENTIAL);
|
||||||
|
if (potential != null)
|
||||||
{
|
{
|
||||||
barrowsBrothers.setHidden(true);
|
|
||||||
potential.setHidden(true);
|
potential.setHidden(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -364,6 +364,7 @@ public class CameraPlugin extends Plugin implements KeyListener, MouseListener
|
|||||||
public void onClientTick(ClientTick event)
|
public void onClientTick(ClientTick event)
|
||||||
{
|
{
|
||||||
menuHasEntries = hasMenuEntries(client.getMenuEntries());
|
menuHasEntries = hasMenuEntries(client.getMenuEntries());
|
||||||
|
sliderTooltip = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -416,7 +417,6 @@ public class CameraPlugin extends Plugin implements KeyListener, MouseListener
|
|||||||
if (sliderTooltip != null)
|
if (sliderTooltip != null)
|
||||||
{
|
{
|
||||||
tooltipManager.add(sliderTooltip);
|
tooltipManager.add(sliderTooltip);
|
||||||
sliderTooltip = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1437,12 +1437,18 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
public void onGameStateChanged(GameStateChanged gameStateChanged)
|
||||||
{
|
{
|
||||||
if (computeMode == ComputeMode.NONE || gameStateChanged.getGameState() != GameState.LOGGED_IN)
|
switch (gameStateChanged.getGameState())
|
||||||
{
|
{
|
||||||
return;
|
case LOGGED_IN:
|
||||||
|
if (computeMode != ComputeMode.NONE)
|
||||||
|
{
|
||||||
|
invokeOnMainThread(this::uploadScene);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case LOGIN_SCREEN:
|
||||||
|
// Avoid drawing the last frame's buffer during LOADING after LOGIN_SCREEN
|
||||||
|
targetBufferOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
invokeOnMainThread(this::uploadScene);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void uploadScene()
|
private void uploadScene()
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ import net.runelite.api.VarPlayer;
|
|||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.events.AreaSoundEffectPlayed;
|
import net.runelite.api.events.AreaSoundEffectPlayed;
|
||||||
import net.runelite.api.events.BeforeRender;
|
import net.runelite.api.events.BeforeRender;
|
||||||
|
import net.runelite.api.events.ClientTick;
|
||||||
import net.runelite.api.events.GameStateChanged;
|
import net.runelite.api.events.GameStateChanged;
|
||||||
import net.runelite.api.events.PostStructComposition;
|
import net.runelite.api.events.PostStructComposition;
|
||||||
import net.runelite.api.events.ScriptPreFired;
|
import net.runelite.api.events.ScriptPreFired;
|
||||||
@@ -918,10 +919,15 @@ public class MusicPlugin extends Plugin
|
|||||||
if (sliderTooltip != null)
|
if (sliderTooltip != null)
|
||||||
{
|
{
|
||||||
tooltipManager.add(sliderTooltip);
|
tooltipManager.add(sliderTooltip);
|
||||||
sliderTooltip = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onClientTick(ClientTick event)
|
||||||
|
{
|
||||||
|
sliderTooltip = null;
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onAreaSoundEffectPlayed(AreaSoundEffectPlayed areaSoundEffectPlayed)
|
public void onAreaSoundEffectPlayed(AreaSoundEffectPlayed areaSoundEffectPlayed)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user