Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -1454,38 +1454,42 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
/**
|
||||
* Check is a model is visible and should be drawn.
|
||||
*/
|
||||
private boolean isVisible(Model model, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int _x, int _y, int _z, long hash)
|
||||
private boolean isVisible(Model model, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z)
|
||||
{
|
||||
final int XYZMag = model.getXYZMag();
|
||||
model.calculateBoundsCylinder();
|
||||
|
||||
final int xzMag = model.getXYZMag();
|
||||
final int bottomY = model.getBottomY();
|
||||
final int zoom = client.get3dZoom();
|
||||
final int modelHeight = model.getModelHeight();
|
||||
|
||||
int Rasterizer3D_clipMidX2 = client.getRasterizer3D_clipMidX2();
|
||||
int Rasterizer3D_clipNegativeMidX = client.getRasterizer3D_clipNegativeMidX();
|
||||
int Rasterizer3D_clipNegativeMidY = client.getRasterizer3D_clipNegativeMidY();
|
||||
int Rasterizer3D_clipMidY2 = client.getRasterizer3D_clipMidY2();
|
||||
int Rasterizer3D_clipMidX2 = client.getRasterizer3D_clipMidX2(); // width / 2
|
||||
int Rasterizer3D_clipNegativeMidX = client.getRasterizer3D_clipNegativeMidX(); // -width / 2
|
||||
int Rasterizer3D_clipNegativeMidY = client.getRasterizer3D_clipNegativeMidY(); // -height / 2
|
||||
int Rasterizer3D_clipMidY2 = client.getRasterizer3D_clipMidY2(); // height / 2
|
||||
|
||||
int var11 = yawCos * _z - yawSin * _x >> 16;
|
||||
int var12 = pitchSin * _y + pitchCos * var11 >> 16;
|
||||
int var13 = pitchCos * XYZMag >> 16;
|
||||
int var14 = var12 + var13;
|
||||
if (var14 > 50)
|
||||
int var11 = yawCos * z - yawSin * x >> 16;
|
||||
int var12 = pitchSin * y + pitchCos * var11 >> 16;
|
||||
int var13 = pitchCos * xzMag >> 16;
|
||||
int depth = var12 + var13;
|
||||
if (depth > 50)
|
||||
{
|
||||
int var15 = _z * yawSin + yawCos * _x >> 16;
|
||||
int var16 = (var15 - XYZMag) * zoom;
|
||||
if (var16 / var14 < Rasterizer3D_clipMidX2)
|
||||
int rx = z * yawSin + yawCos * x >> 16;
|
||||
int var16 = (rx - xzMag) * zoom;
|
||||
if (var16 / depth < Rasterizer3D_clipMidX2)
|
||||
{
|
||||
int var17 = (var15 + XYZMag) * zoom;
|
||||
if (var17 / var14 > Rasterizer3D_clipNegativeMidX)
|
||||
int var17 = (rx + xzMag) * zoom;
|
||||
if (var17 / depth > Rasterizer3D_clipNegativeMidX)
|
||||
{
|
||||
int var18 = pitchCos * _y - var11 * pitchSin >> 16;
|
||||
int var19 = pitchSin * XYZMag >> 16;
|
||||
int var20 = (var18 + var19) * zoom;
|
||||
if (var20 / var14 > Rasterizer3D_clipNegativeMidY)
|
||||
int ry = pitchCos * y - var11 * pitchSin >> 16;
|
||||
int yheight = pitchSin * xzMag >> 16;
|
||||
int ybottom = (pitchCos * bottomY >> 16) + yheight; // use bottom height instead of y pos for height
|
||||
int var20 = (ry + ybottom) * zoom;
|
||||
if (var20 / depth > Rasterizer3D_clipNegativeMidY)
|
||||
{
|
||||
int var21 = (pitchCos * modelHeight >> 16) + var19;
|
||||
int var22 = (var18 - var21) * zoom;
|
||||
return var22 / var14 < Rasterizer3D_clipMidY2;
|
||||
int ytop = (pitchCos * modelHeight >> 16) + yheight;
|
||||
int var22 = (ry - ytop) * zoom;
|
||||
return var22 / depth < Rasterizer3D_clipMidY2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1521,9 +1525,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
renderable.setModelHeight(model.getModelHeight());
|
||||
}
|
||||
|
||||
model.calculateBoundsCylinder();
|
||||
|
||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||
if (!isVisible(model, pitchSin, pitchCos, yawSin, yawCos, x, y, z))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1551,9 +1553,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
{
|
||||
Model model = (Model) renderable;
|
||||
|
||||
model.calculateBoundsCylinder();
|
||||
|
||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||
if (!isVisible(model, pitchSin, pitchCos, yawSin, yawCos, x, y, z))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1589,9 +1589,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
||||
renderable.setModelHeight(model.getModelHeight());
|
||||
}
|
||||
|
||||
model.calculateBoundsCylinder();
|
||||
|
||||
if (!isVisible(model, orientation, pitchSin, pitchCos, yawSin, yawCos, x, y, z, hash))
|
||||
if (!isVisible(model, pitchSin, pitchCos, yawSin, yawCos, x, y, z))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.hiscore;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -47,6 +46,7 @@ import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
import net.runelite.api.events.MenuOptionClicked;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
@@ -70,8 +70,6 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
public class HiscorePlugin extends Plugin
|
||||
{
|
||||
private static final String LOOKUP = "Lookup";
|
||||
private static final String KICK_OPTION = "Kick";
|
||||
private static final ImmutableList<String> AFTER_OPTIONS = ImmutableList.of("Message", "Add ignore", "Remove friend", "Delete", KICK_OPTION);
|
||||
private static final Pattern BOUNTY_PATTERN = Pattern.compile("<col=ff0000>You've been assigned a target: (.*)</col>");
|
||||
|
||||
@Inject
|
||||
@@ -153,32 +151,30 @@ public class HiscorePlugin extends Plugin
|
||||
@Subscribe
|
||||
public void onMenuEntryAdded(MenuEntryAdded event)
|
||||
{
|
||||
if (!config.menuOption())
|
||||
if ((event.getType() != MenuAction.CC_OP.getId() && event.getType() != MenuAction.CC_OP_LOW_PRIORITY.getId()) || !config.menuOption())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final int componentId = event.getParam1();
|
||||
int groupId = WidgetInfo.TO_GROUP(componentId);
|
||||
String option = event.getOption();
|
||||
final String option = event.getOption();
|
||||
final int componentId = event.getActionParam1();
|
||||
final int groupId = WidgetInfo.TO_GROUP(componentId);
|
||||
|
||||
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.FRIENDS_CHAT.getGroupId() ||
|
||||
groupId == WidgetInfo.CHATBOX.getGroupId() && !KICK_OPTION.equals(option) || //prevent from adding for Kick option (interferes with the raiding party one)
|
||||
groupId == WidgetInfo.RAIDING_PARTY.getGroupId() || groupId == WidgetInfo.PRIVATE_CHAT_MESSAGE.getGroupId() ||
|
||||
groupId == WidgetInfo.IGNORE_LIST.getGroupId() || componentId == WidgetInfo.CLAN_MEMBER_LIST.getId() ||
|
||||
componentId == WidgetInfo.CLAN_GUEST_MEMBER_LIST.getId())
|
||||
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() && option.equals("Delete")
|
||||
|| groupId == WidgetInfo.FRIENDS_CHAT.getGroupId() && (option.equals("Add ignore") || option.equals("Remove friend"))
|
||||
|| groupId == WidgetInfo.CHATBOX.getGroupId() && (option.equals("Add ignore") || option.equals("Message"))
|
||||
|| groupId == WidgetInfo.IGNORE_LIST.getGroupId() && option.equals("Delete")
|
||||
|| (componentId == WidgetInfo.CLAN_MEMBER_LIST.getId() || componentId == WidgetInfo.CLAN_GUEST_MEMBER_LIST.getId()) && (option.equals("Add ignore") || option.equals("Remove friend"))
|
||||
|| groupId == WidgetInfo.PRIVATE_CHAT_MESSAGE.getGroupId() && (option.equals("Add ignore") || option.equals("Message"))
|
||||
|| groupId == WidgetID.GROUP_IRON_GROUP_ID && (option.equals("Add friend") || option.equals("Remove friend") || option.equals("Remove ignore"))
|
||||
)
|
||||
{
|
||||
if (!AFTER_OPTIONS.contains(option) || (option.equals("Delete") && groupId != WidgetInfo.IGNORE_LIST.getGroupId()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
final MenuEntry lookup = new MenuEntry();
|
||||
lookup.setOption(LOOKUP);
|
||||
lookup.setTarget(event.getTarget());
|
||||
lookup.setType(MenuAction.RUNELITE.getId());
|
||||
lookup.setParam0(event.getActionParam0());
|
||||
lookup.setParam1(event.getParam1());
|
||||
lookup.setParam1(event.getActionParam1());
|
||||
lookup.setIdentifier(event.getIdentifier());
|
||||
|
||||
insertMenuEntry(lookup, client.getMenuEntries());
|
||||
|
||||
@@ -40,6 +40,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Varbits;
|
||||
import net.runelite.api.WidgetNode;
|
||||
import net.runelite.api.coords.WorldPoint;
|
||||
import net.runelite.api.vars.Autoweed;
|
||||
import net.runelite.api.widgets.WidgetModalMode;
|
||||
@@ -101,11 +102,12 @@ public class FarmingTracker
|
||||
boolean changed = false;
|
||||
|
||||
//Varbits don't get sent when a modal widget is open so just return
|
||||
if (client.getComponentTable().getNodes()
|
||||
.stream()
|
||||
.anyMatch(widgetNode -> widgetNode.getModalMode() != WidgetModalMode.NON_MODAL))
|
||||
for (WidgetNode widgetNode : client.getComponentTable())
|
||||
{
|
||||
return false;
|
||||
if (widgetNode.getModalMode() != WidgetModalMode.NON_MODAL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -157,6 +157,18 @@ public class WikiPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if (client.getVar(Varbits.WIKI_ENTITY_LOOKUP) == 1) // disabled
|
||||
{
|
||||
// when the wiki entity lookup option is disabled the banner parent layer,
|
||||
// which is used for var transmit events, is not positioned. This is copied
|
||||
// from [proc,wiki_icon_update]
|
||||
wikiBannerParent.setOriginalX(client.isResized() ? 0 : 8);
|
||||
wikiBannerParent.setOriginalY(135);
|
||||
wikiBannerParent.setXPositionMode(WidgetPositionMode.ABSOLUTE_RIGHT);
|
||||
wikiBannerParent.setYPositionMode(WidgetPositionMode.ABSOLUTE_TOP);
|
||||
wikiBannerParent.revalidate();
|
||||
}
|
||||
|
||||
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
|
||||
if (vanilla != null)
|
||||
{
|
||||
|
||||
@@ -33,14 +33,13 @@ import javax.inject.Singleton;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Constants;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.TileItem;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.ItemContainer;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Node;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Scene;
|
||||
import net.runelite.api.Tile;
|
||||
import net.runelite.api.TileItem;
|
||||
import net.runelite.api.events.DecorativeObjectSpawned;
|
||||
import net.runelite.api.events.GameObjectSpawned;
|
||||
import net.runelite.api.events.GroundObjectSpawned;
|
||||
@@ -112,14 +111,9 @@ public class GameEventManager
|
||||
|
||||
eventBus.register(subscriber);
|
||||
|
||||
for (final InventoryID inventory : InventoryID.values())
|
||||
for (final ItemContainer itemContainer : client.getItemContainers())
|
||||
{
|
||||
final ItemContainer itemContainer = client.getItemContainer(inventory);
|
||||
|
||||
if (itemContainer != null)
|
||||
{
|
||||
eventBus.post(new ItemContainerChanged(inventory.getId(), itemContainer));
|
||||
}
|
||||
eventBus.post(new ItemContainerChanged(itemContainer.getId(), itemContainer));
|
||||
}
|
||||
|
||||
for (NPC npc : client.getCachedNPCs())
|
||||
|
||||
Reference in New Issue
Block a user