Merge pull request #3113 from SRLJustin/rl-upstream10-01
upstream: merge
This commit is contained in:
@@ -27,7 +27,7 @@ object ProjectVersions {
|
|||||||
const val launcherVersion = "2.2.0"
|
const val launcherVersion = "2.2.0"
|
||||||
const val rlVersion = "1.8.9"
|
const val rlVersion = "1.8.9"
|
||||||
|
|
||||||
const val openosrsVersion = "4.18.0"
|
const val openosrsVersion = "4.18.1"
|
||||||
|
|
||||||
const val rsversion = 202
|
const val rsversion = 202
|
||||||
const val cacheversion = 165
|
const val cacheversion = 165
|
||||||
|
|||||||
@@ -1682,6 +1682,13 @@ public interface Client extends GameEngine
|
|||||||
*/
|
*/
|
||||||
void setFriendsChatMembersHidden(boolean state);
|
void setFriendsChatMembersHidden(boolean state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether or not clan members are hidden.
|
||||||
|
*
|
||||||
|
* @param state the new clan chat member hidden state
|
||||||
|
*/
|
||||||
|
void setClanChatMembersHidden(boolean state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not ignored players are hidden.
|
* Sets whether or not ignored players are hidden.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -332,11 +332,23 @@ public interface RuneLiteConfig extends Config
|
|||||||
return FontType.REGULAR;
|
return FontType.REGULAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "infoboxFontType",
|
||||||
|
name = "Infobox Font",
|
||||||
|
description = "Configures what font type is used for infoboxes.",
|
||||||
|
position = 33,
|
||||||
|
section = overlaySettings
|
||||||
|
)
|
||||||
|
default FontType infoboxFontType()
|
||||||
|
{
|
||||||
|
return FontType.REGULAR;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "menuEntryShift",
|
keyName = "menuEntryShift",
|
||||||
name = "Require Shift for overlay menu",
|
name = "Require Shift for overlay menu",
|
||||||
description = "Overlay right-click menu will require shift to be added",
|
description = "Overlay right-click menu will require shift to be added",
|
||||||
position = 33,
|
position = 34,
|
||||||
section = overlaySettings
|
section = overlaySettings
|
||||||
)
|
)
|
||||||
default boolean menuEntryShift()
|
default boolean menuEntryShift()
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 4,
|
position = 4,
|
||||||
keyName = "hideClanMates",
|
keyName = "hideClanMates", // is actually friends chat
|
||||||
name = "Hide Friends Chat members",
|
name = "Hide Friends Chat members",
|
||||||
description = "Configures whether or not friends chat members are hidden"
|
description = "Configures whether or not friends chat members are hidden"
|
||||||
)
|
)
|
||||||
@@ -80,6 +80,17 @@ public interface EntityHiderConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 5,
|
position = 5,
|
||||||
|
keyName = "hideClanChatMembers",
|
||||||
|
name = "Hide Clan Chat members",
|
||||||
|
description = "Configures whether or not clan chat members are hidden"
|
||||||
|
)
|
||||||
|
default boolean hideClanChatMembers()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 6,
|
||||||
keyName = "hideIgnores",
|
keyName = "hideIgnores",
|
||||||
name = "Hide Ignores",
|
name = "Hide Ignores",
|
||||||
description = "Configures whether or not ignored players are hidden"
|
description = "Configures whether or not ignored players are hidden"
|
||||||
@@ -90,7 +101,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 6,
|
position = 7,
|
||||||
keyName = "hideLocalPlayer",
|
keyName = "hideLocalPlayer",
|
||||||
name = "Hide Local Player",
|
name = "Hide Local Player",
|
||||||
description = "Configures whether or not the local player is hidden"
|
description = "Configures whether or not the local player is hidden"
|
||||||
@@ -101,7 +112,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 7,
|
position = 8,
|
||||||
keyName = "hideLocalPlayer2D",
|
keyName = "hideLocalPlayer2D",
|
||||||
name = "Hide Local Player 2D",
|
name = "Hide Local Player 2D",
|
||||||
description = "Configures whether or not the local player's 2D elements are hidden"
|
description = "Configures whether or not the local player's 2D elements are hidden"
|
||||||
@@ -112,7 +123,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 8,
|
position = 9,
|
||||||
keyName = "hideNPCs",
|
keyName = "hideNPCs",
|
||||||
name = "Hide NPCs",
|
name = "Hide NPCs",
|
||||||
description = "Configures whether or not NPCs are hidden"
|
description = "Configures whether or not NPCs are hidden"
|
||||||
@@ -123,7 +134,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 9,
|
position = 10,
|
||||||
keyName = "hideNPCs2D",
|
keyName = "hideNPCs2D",
|
||||||
name = "Hide NPCs 2D",
|
name = "Hide NPCs 2D",
|
||||||
description = "Configures whether or not NPCs 2D elements are hidden"
|
description = "Configures whether or not NPCs 2D elements are hidden"
|
||||||
@@ -134,7 +145,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 10,
|
position = 11,
|
||||||
keyName = "hidePets",
|
keyName = "hidePets",
|
||||||
name = "Hide Pets",
|
name = "Hide Pets",
|
||||||
description = "Configures whether or not other player pets are hidden"
|
description = "Configures whether or not other player pets are hidden"
|
||||||
@@ -145,7 +156,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 11,
|
position = 12,
|
||||||
keyName = "hideAttackers",
|
keyName = "hideAttackers",
|
||||||
name = "Hide Attackers",
|
name = "Hide Attackers",
|
||||||
description = "Configures whether or not NPCs/players attacking you are hidden"
|
description = "Configures whether or not NPCs/players attacking you are hidden"
|
||||||
@@ -156,7 +167,7 @@ public interface EntityHiderConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 12,
|
position = 13,
|
||||||
keyName = "hideProjectiles",
|
keyName = "hideProjectiles",
|
||||||
name = "Hide Projectiles",
|
name = "Hide Projectiles",
|
||||||
description = "Configures whether or not projectiles are hidden"
|
description = "Configures whether or not projectiles are hidden"
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
|
|
||||||
client.setFriendsHidden(config.hideFriends());
|
client.setFriendsHidden(config.hideFriends());
|
||||||
client.setFriendsChatMembersHidden(config.hideFriendsChatMembers());
|
client.setFriendsChatMembersHidden(config.hideFriendsChatMembers());
|
||||||
|
client.setClanChatMembersHidden(config.hideClanChatMembers());
|
||||||
client.setIgnoresHidden(config.hideIgnores());
|
client.setIgnoresHidden(config.hideIgnores());
|
||||||
|
|
||||||
client.setLocalPlayerHidden(config.hideLocalPlayer());
|
client.setLocalPlayerHidden(config.hideLocalPlayer());
|
||||||
@@ -103,6 +104,7 @@ public class EntityHiderPlugin extends Plugin
|
|||||||
|
|
||||||
client.setFriendsHidden(false);
|
client.setFriendsHidden(false);
|
||||||
client.setFriendsChatMembersHidden(false);
|
client.setFriendsChatMembersHidden(false);
|
||||||
|
client.setClanChatMembersHidden(false);
|
||||||
client.setIgnoresHidden(false);
|
client.setIgnoresHidden(false);
|
||||||
|
|
||||||
client.setLocalPlayerHidden(false);
|
client.setLocalPlayerHidden(false);
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import java.awt.Color;
|
|||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import net.runelite.api.EquipmentInventorySlot;
|
|
||||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -37,21 +36,18 @@ class ItemChargeInfobox extends Counter
|
|||||||
{
|
{
|
||||||
private final ItemChargePlugin plugin;
|
private final ItemChargePlugin plugin;
|
||||||
private final int item;
|
private final int item;
|
||||||
private final EquipmentInventorySlot slot;
|
|
||||||
|
|
||||||
ItemChargeInfobox(
|
ItemChargeInfobox(
|
||||||
ItemChargePlugin plugin,
|
ItemChargePlugin plugin,
|
||||||
BufferedImage image,
|
BufferedImage image,
|
||||||
String name,
|
String name,
|
||||||
int charges,
|
int charges,
|
||||||
int item,
|
int item)
|
||||||
EquipmentInventorySlot slot)
|
|
||||||
{
|
{
|
||||||
super(image, plugin, charges);
|
super(image, plugin, charges);
|
||||||
setTooltip(name);
|
setTooltip(name);
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.item = item;
|
this.item = item;
|
||||||
this.slot = slot;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ public class ItemChargePlugin extends Plugin
|
|||||||
|
|
||||||
final String name = itemManager.getItemComposition(id).getName();
|
final String name = itemManager.getItemComposition(id).getName();
|
||||||
final BufferedImage image = itemManager.getImage(id);
|
final BufferedImage image = itemManager.getImage(id);
|
||||||
infobox = new ItemChargeInfobox(this, image, name, charges, id, slot);
|
infobox = new ItemChargeInfobox(this, image, name, charges, id);
|
||||||
infoBoxManager.addInfoBox(infobox);
|
infoBoxManager.addInfoBox(infobox);
|
||||||
infoboxes.put(slot, infobox);
|
infoboxes.put(slot, infobox);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,12 +40,13 @@ import static net.runelite.api.ItemID.*;
|
|||||||
import net.runelite.api.Skill;
|
import net.runelite.api.Skill;
|
||||||
import net.runelite.api.Varbits;
|
import net.runelite.api.Varbits;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.client.events.ConfigChanged;
|
import net.runelite.api.events.BeforeRender;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
|
import net.runelite.client.events.ConfigChanged;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
@@ -138,6 +139,7 @@ public class RunEnergyPlugin extends Plugin
|
|||||||
|
|
||||||
private boolean localPlayerRunningToDestination;
|
private boolean localPlayerRunningToDestination;
|
||||||
private WorldPoint prevLocalPlayerLocation;
|
private WorldPoint prevLocalPlayerLocation;
|
||||||
|
private String runTimeRemaining;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
RunEnergyConfig getConfig(ConfigManager configManager)
|
RunEnergyConfig getConfig(ConfigManager configManager)
|
||||||
@@ -170,9 +172,15 @@ public class RunEnergyPlugin extends Plugin
|
|||||||
|
|
||||||
prevLocalPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
prevLocalPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
||||||
|
|
||||||
if (energyConfig.replaceOrbText())
|
runTimeRemaining = energyConfig.replaceOrbText() ? getEstimatedRunTimeRemaining(true) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void onBeforeRender(BeforeRender beforeRender)
|
||||||
|
{
|
||||||
|
if (runTimeRemaining != null)
|
||||||
{
|
{
|
||||||
setRunOrbText(getEstimatedRunTimeRemaining(true));
|
setRunOrbText(runTimeRemaining);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,14 +226,13 @@ public class RunEnergyPlugin extends Plugin
|
|||||||
// Return the text
|
// Return the text
|
||||||
if (inSeconds)
|
if (inSeconds)
|
||||||
{
|
{
|
||||||
return Integer.toString((int) Math.floor(secondsLeft)) + "s";
|
return (int) Math.floor(secondsLeft) + "s";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
final int minutes = (int) Math.floor(secondsLeft / 60.0);
|
final int minutes = (int) Math.floor(secondsLeft / 60.0);
|
||||||
final int seconds = (int) Math.floor(secondsLeft - (minutes * 60.0));
|
final int seconds = (int) Math.floor(secondsLeft - (minutes * 60.0));
|
||||||
|
return minutes + ":" + StringUtils.leftPad(Integer.toString(seconds), 2, "0");
|
||||||
return Integer.toString(minutes) + ":" + StringUtils.leftPad(Integer.toString(seconds), 2, "0");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package net.runelite.client.ui.overlay.components;
|
|||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Font;
|
||||||
import java.awt.FontMetrics;
|
import java.awt.FontMetrics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
@@ -53,6 +54,7 @@ public class InfoBoxComponent implements LayoutableRenderableEntity
|
|||||||
private Dimension preferredSize = new Dimension(DEFAULT_SIZE, DEFAULT_SIZE);
|
private Dimension preferredSize = new Dimension(DEFAULT_SIZE, DEFAULT_SIZE);
|
||||||
private String text;
|
private String text;
|
||||||
private Color color = Color.WHITE;
|
private Color color = Color.WHITE;
|
||||||
|
private Font font;
|
||||||
private boolean outline;
|
private boolean outline;
|
||||||
private Color backgroundColor = ComponentConstants.STANDARD_BACKGROUND_COLOR;
|
private Color backgroundColor = ComponentConstants.STANDARD_BACKGROUND_COLOR;
|
||||||
private BufferedImage image;
|
private BufferedImage image;
|
||||||
@@ -67,7 +69,7 @@ public class InfoBoxComponent implements LayoutableRenderableEntity
|
|||||||
return new Dimension();
|
return new Dimension();
|
||||||
}
|
}
|
||||||
|
|
||||||
graphics.setFont(getSize() < DEFAULT_SIZE ? FontManager.getRunescapeSmallFont() : FontManager.getRunescapeFont());
|
graphics.setFont(getSize() < DEFAULT_SIZE ? FontManager.getRunescapeSmallFont() : font);
|
||||||
|
|
||||||
final int baseX = preferredLocation.x;
|
final int baseX = preferredLocation.x;
|
||||||
final int baseY = preferredLocation.y;
|
final int baseY = preferredLocation.y;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ package net.runelite.client.ui.overlay.infobox;
|
|||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Font;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
@@ -122,6 +123,10 @@ public class InfoBoxOverlay extends OverlayPanel
|
|||||||
panelComponent.setPreferredSize(new Dimension(DEFAULT_WRAP_COUNT * (config.infoBoxSize() + GAP), DEFAULT_WRAP_COUNT * (config.infoBoxSize() + GAP)));
|
panelComponent.setPreferredSize(new Dimension(DEFAULT_WRAP_COUNT * (config.infoBoxSize() + GAP), DEFAULT_WRAP_COUNT * (config.infoBoxSize() + GAP)));
|
||||||
panelComponent.setOrientation(orientation);
|
panelComponent.setOrientation(orientation);
|
||||||
|
|
||||||
|
final Font font = config.infoboxFontType().getFont();
|
||||||
|
final boolean infoBoxTextOutline = config.infoBoxTextOutline();
|
||||||
|
final Color overlayBackgroundColor = config.overlayBackgroundColor();
|
||||||
|
final Dimension preferredSize = new Dimension(config.infoBoxSize(), config.infoBoxSize());
|
||||||
for (InfoBox box : infoBoxes)
|
for (InfoBox box : infoBoxes)
|
||||||
{
|
{
|
||||||
if (!box.render())
|
if (!box.render())
|
||||||
@@ -134,15 +139,16 @@ public class InfoBoxOverlay extends OverlayPanel
|
|||||||
|
|
||||||
final InfoBoxComponent infoBoxComponent = new InfoBoxComponent();
|
final InfoBoxComponent infoBoxComponent = new InfoBoxComponent();
|
||||||
infoBoxComponent.setText(text);
|
infoBoxComponent.setText(text);
|
||||||
|
infoBoxComponent.setFont(font);
|
||||||
if (color != null)
|
if (color != null)
|
||||||
{
|
{
|
||||||
infoBoxComponent.setColor(color);
|
infoBoxComponent.setColor(color);
|
||||||
}
|
}
|
||||||
infoBoxComponent.setOutline(config.infoBoxTextOutline());
|
infoBoxComponent.setOutline(infoBoxTextOutline);
|
||||||
infoBoxComponent.setImage(box.getScaledImage());
|
infoBoxComponent.setImage(box.getScaledImage());
|
||||||
infoBoxComponent.setTooltip(box.getTooltip());
|
infoBoxComponent.setTooltip(box.getTooltip());
|
||||||
infoBoxComponent.setPreferredSize(new Dimension(config.infoBoxSize(), config.infoBoxSize()));
|
infoBoxComponent.setPreferredSize(preferredSize);
|
||||||
infoBoxComponent.setBackgroundColor(config.overlayBackgroundColor());
|
infoBoxComponent.setBackgroundColor(overlayBackgroundColor);
|
||||||
infoBoxComponent.setInfoBox(box);
|
infoBoxComponent.setInfoBox(box);
|
||||||
panelComponent.getChildren().add(infoBoxComponent);
|
panelComponent.getChildren().add(infoBoxComponent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
|||||||
@Inject
|
@Inject
|
||||||
public static boolean hideClanMates;
|
public static boolean hideClanMates;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public static boolean hideClanChatMembers;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public static boolean hideIgnores;
|
public static boolean hideIgnores;
|
||||||
|
|
||||||
@@ -122,6 +125,13 @@ public abstract class EntityHiderBridgeMixin implements RSClient
|
|||||||
hideClanMates = state;
|
hideClanMates = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
@Override
|
||||||
|
public void setClanChatMembersHidden(boolean state)
|
||||||
|
{
|
||||||
|
hideClanChatMembers = state;
|
||||||
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public void setIgnoresHidden(boolean state)
|
public void setIgnoresHidden(boolean state)
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ public abstract class EntityHiderMixin implements RSScene
|
|||||||
@Shadow("hideClanMates")
|
@Shadow("hideClanMates")
|
||||||
private static boolean hideClanMates;
|
private static boolean hideClanMates;
|
||||||
|
|
||||||
|
@Shadow("hideClanChatMembers")
|
||||||
|
private static boolean hideClanChatMembers;
|
||||||
|
|
||||||
@Shadow("hideLocalPlayer")
|
@Shadow("hideLocalPlayer")
|
||||||
private static boolean hideLocalPlayer;
|
private static boolean hideLocalPlayer;
|
||||||
|
|
||||||
@@ -168,6 +171,11 @@ public abstract class EntityHiderMixin implements RSScene
|
|||||||
return !hideClanMates;
|
return !hideClanMates;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player.isClanMember())
|
||||||
|
{
|
||||||
|
return !hideClanChatMembers;
|
||||||
|
}
|
||||||
|
|
||||||
if (client.getFriendManager().isIgnored(player.getRsName()))
|
if (client.getFriendManager().isIgnored(player.getRsName()))
|
||||||
{
|
{
|
||||||
return !hideIgnores;
|
return !hideIgnores;
|
||||||
|
|||||||
Reference in New Issue
Block a user