Various
This commit is contained in:
supermxn
2019-05-08 03:20:10 -06:00
committed by GitHub
10 changed files with 147 additions and 41 deletions

View File

@@ -77,6 +77,7 @@ public class ProjectileID
public static final int DEMONIC_GORILLA_BOULDER = 856; public static final int DEMONIC_GORILLA_BOULDER = 856;
public static final int XARPUS_ACID = 1555; public static final int XARPUS_ACID = 1555;
public static final int CERB_FIRE = 1247;
/** /**
* missing: marble gargoyle, superior dark beast * missing: marble gargoyle, superior dark beast
@@ -97,5 +98,5 @@ public class ProjectileID
public static final int HYDRA_POISON = 1644; public static final int HYDRA_POISON = 1644;
public static final int HYDRA_LIGHTNING = 1664; public static final int HYDRA_LIGHTNING = 1664;
public static final int HYDRA_LIGHTNING_2 = 1665; public static final int HYDRA_LIGHTNING_2 = 1665;
public static final int DRAKE_BREATH = 1637; public static final int DRAKE_BREATH = 1637;
} }

View File

@@ -107,11 +107,15 @@ public enum AoeProjectileInfo
*/ */
ADDY_DRAG_POISON(ProjectileID.ADDY_DRAG_POISON, 1), ADDY_DRAG_POISON(ProjectileID.ADDY_DRAG_POISON, 1),
/** /**
* the Breath of the Drake * the Breath of the Drake
*/ */
DRAKE_BREATH(ProjectileID.DRAKE_BREATH, 1),
DRAKE_BREATH(ProjectileID.DRAKE_BREATH, 1);
/**
* Cerbs fire
*/
CERB_FIRE(ProjectileID.CERB_FIRE, 2);
private static final Map<Integer, AoeProjectileInfo> map = new HashMap<>(); private static final Map<Integer, AoeProjectileInfo> map = new HashMap<>();

View File

@@ -253,14 +253,25 @@ public interface AoeWarningConfig extends Config
return true; return true;
} }
@ConfigItem( @ConfigItem(
keyName = "drake", keyName = "drake",
name = "Drakes Breath", name = "Drakes Breath",
description = "Configures if Drakes Breath tile markers are displayed" description = "Configures if Drakes Breath tile markers are displayed"
) )
default boolean isDrakeEnabled() { default boolean isDrakeEnabled()
return true; {
} return true;
}
@ConfigItem(
keyName = "cerbFire",
name = "Cerberus Fire",
description = "Configures if Cerberus fire tile markers are displayed"
)
default boolean isCerbFireEnabled()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = "delay", keyName = "delay",

View File

@@ -300,8 +300,10 @@ public class AoeWarningPlugin extends Plugin
return config.isXarpusEnabled(); return config.isXarpusEnabled();
case ADDY_DRAG_POISON: case ADDY_DRAG_POISON:
return config.addyDrags(); return config.addyDrags();
case DRAKE_BREATH: case DRAKE_BREATH:
return config.isDrakeEnabled(); return config.isDrakeEnabled();
case CERB_FIRE:
return config.isCerbFireEnabled();
} }
return false; return false;

View File

@@ -70,6 +70,8 @@ import net.runelite.http.api.hiscore.HiscoreSkill;
import net.runelite.http.api.hiscore.SingleHiscoreSkillResult; import net.runelite.http.api.hiscore.SingleHiscoreSkillResult;
import net.runelite.http.api.hiscore.Skill; import net.runelite.http.api.hiscore.Skill;
import net.runelite.http.api.item.ItemPrice; import net.runelite.http.api.item.ItemPrice;
import net.runelite.http.api.osbuddy.OSBGrandExchangeClient;
import net.runelite.http.api.osbuddy.OSBGrandExchangeResult;
import org.apache.commons.text.WordUtils; import org.apache.commons.text.WordUtils;
@PluginDescriptor( @PluginDescriptor(
@@ -98,6 +100,7 @@ public class ChatCommandsPlugin extends Plugin
private final HiscoreClient hiscoreClient = new HiscoreClient(); private final HiscoreClient hiscoreClient = new HiscoreClient();
private final ChatClient chatClient = new ChatClient(); private final ChatClient chatClient = new ChatClient();
private final OSBGrandExchangeClient CLIENT = new OSBGrandExchangeClient();
private boolean logKills; private boolean logKills;
private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player
@@ -597,19 +600,31 @@ public class ChatCommandsPlugin extends Plugin
if (!results.isEmpty()) if (!results.isEmpty())
{ {
ItemPrice item = retrieveFromList(results, search); ItemPrice item = retrieveFromList(results, search);
OSBGrandExchangeResult osbresult = new OSBGrandExchangeResult();
try
{
osbresult = CLIENT.lookupItem(item.getId());
}
catch (IOException e)
{
e.printStackTrace();
}
int itemId = item.getId(); int itemId = item.getId();
int itemPrice = item.getPrice(); int itemPrice = item.getPrice();
final ChatMessageBuilder builder = new ChatMessageBuilder() final ChatMessageBuilder builder = new ChatMessageBuilder();
.append(ChatColorType.NORMAL) builder.append(ChatColorType.NORMAL);
.append("Price of ") builder.append(ChatColorType.HIGHLIGHT);
.append(ChatColorType.HIGHLIGHT) builder.append(item.getName());
.append(item.getName()) builder.append(ChatColorType.NORMAL);
.append(ChatColorType.NORMAL) builder.append(": GE ");
.append(": GE average ") builder.append(ChatColorType.HIGHLIGHT);
.append(ChatColorType.HIGHLIGHT) builder.append(StackFormatter.formatNumber(itemPrice));
.append(StackFormatter.formatNumber(itemPrice)); builder.append(ChatColorType.NORMAL);
builder.append(": OSB ");
builder.append(ChatColorType.HIGHLIGHT);
builder.append(StackFormatter.formatNumber(osbresult.getOverall_average()));
ItemComposition itemComposition = itemManager.getItemComposition(itemId); ItemComposition itemComposition = itemManager.getItemComposition(itemId);
if (itemComposition != null) if (itemComposition != null)

View File

@@ -26,6 +26,7 @@ package net.runelite.client.plugins.examine;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import java.io.IOException;
import java.time.Instant; import java.time.Instant;
import java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.Deque; import java.util.Deque;
@@ -54,6 +55,8 @@ import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.util.StackFormatter; import net.runelite.client.util.StackFormatter;
import net.runelite.http.api.examine.ExamineClient; import net.runelite.http.api.examine.ExamineClient;
import net.runelite.http.api.osbuddy.OSBGrandExchangeClient;
import net.runelite.http.api.osbuddy.OSBGrandExchangeResult;
/** /**
* Submits examine info to the api * Submits examine info to the api
@@ -72,6 +75,7 @@ public class ExaminePlugin extends Plugin
private static final Pattern X_PATTERN = Pattern.compile("^\\d+ x "); private static final Pattern X_PATTERN = Pattern.compile("^\\d+ x ");
private final Deque<PendingExamine> pending = new ArrayDeque<>(); private final Deque<PendingExamine> pending = new ArrayDeque<>();
private final OSBGrandExchangeClient CLIENT = new OSBGrandExchangeClient();
private final Cache<CacheKey, Boolean> cache = CacheBuilder.newBuilder() private final Cache<CacheKey, Boolean> cache = CacheBuilder.newBuilder()
.maximumSize(128L) .maximumSize(128L)
.build(); .build();
@@ -342,11 +346,24 @@ public class ExaminePlugin extends Plugin
if (gePrice > 0) if (gePrice > 0)
{ {
OSBGrandExchangeResult osbresult = new OSBGrandExchangeResult();
try
{
osbresult = CLIENT.lookupItem(itemComposition.getId());
}
catch (IOException e)
{
e.printStackTrace();
}
message message
.append(ChatColorType.NORMAL) .append(ChatColorType.NORMAL)
.append(" GE average ") .append(" GE ")
.append(ChatColorType.HIGHLIGHT) .append(ChatColorType.HIGHLIGHT)
.append(StackFormatter.formatNumber(gePrice * quantity)); .append(StackFormatter.formatNumber(gePrice * quantity))
.append(ChatColorType.NORMAL)
.append(" OSB ")
.append(ChatColorType.HIGHLIGHT)
.append(StackFormatter.formatNumber(osbresult.getOverall_average() * quantity));
if (quantity > 1) if (quantity > 1)
{ {

View File

@@ -59,6 +59,16 @@ public interface LootTrackerConfig extends Config
return true; return true;
} }
@ConfigItem(
keyName = "chestLootChat",
name = "Show chest loot value in chat",
description = "Show the value of items from CoX/ToB/Barrows chests in chat"
)
default boolean chestLootChat()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = "syncPanel", keyName = "syncPanel",
name = "Synchronize panel contents", name = "Synchronize panel contents",
@@ -70,4 +80,4 @@ public interface LootTrackerConfig extends Config
{ {
return true; return true;
} }
} }

View File

@@ -51,6 +51,7 @@ import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.runelite.api.ChatMessageType; import net.runelite.api.ChatMessageType;
import net.runelite.api.Client; import net.runelite.api.Client;
import net.runelite.api.Item;
import net.runelite.api.InventoryID; import net.runelite.api.InventoryID;
import net.runelite.api.ItemComposition; import net.runelite.api.ItemComposition;
import net.runelite.api.ItemContainer; import net.runelite.api.ItemContainer;
@@ -66,6 +67,10 @@ import net.runelite.api.widgets.WidgetID;
import net.runelite.client.account.AccountSession; import net.runelite.client.account.AccountSession;
import net.runelite.client.account.SessionManager; import net.runelite.client.account.SessionManager;
import net.runelite.client.callback.ClientThread; import net.runelite.client.callback.ClientThread;
import net.runelite.client.chat.ChatColorType;
import net.runelite.client.chat.ChatMessageBuilder;
import net.runelite.client.chat.ChatMessageManager;
import net.runelite.client.chat.QueuedMessage;
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.NpcLootReceived; import net.runelite.client.events.NpcLootReceived;
@@ -80,6 +85,7 @@ import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.ClientToolbar; import net.runelite.client.ui.ClientToolbar;
import net.runelite.client.ui.NavigationButton; import net.runelite.client.ui.NavigationButton;
import net.runelite.client.util.ImageUtil; import net.runelite.client.util.ImageUtil;
import net.runelite.client.util.StackFormatter;
import net.runelite.client.util.Text; import net.runelite.client.util.Text;
import net.runelite.http.api.loottracker.GameItem; import net.runelite.http.api.loottracker.GameItem;
import net.runelite.http.api.loottracker.LootRecord; import net.runelite.http.api.loottracker.LootRecord;
@@ -115,6 +121,9 @@ public class LootTrackerPlugin extends Plugin
@Inject @Inject
private ItemManager itemManager; private ItemManager itemManager;
@Inject
private ChatMessageManager chatMessageManager;
@Inject @Inject
private SpriteManager spriteManager; private SpriteManager spriteManager;
@@ -352,6 +361,29 @@ public class LootTrackerPlugin extends Plugin
return; return;
} }
if (!(event.getGroupId() == WidgetID.CLUE_SCROLL_REWARD_GROUP_ID) && config.chestLootChat())
{
Item[] items = container.getItems();
long chestPrice = 0;
for (Item item : items)
{
long itemStack = (long) itemManager.getItemPrice(item.getId()) * (long) item.getQuantity();
chestPrice += itemStack;
}
final ChatMessageBuilder message = new ChatMessageBuilder()
.append(ChatColorType.HIGHLIGHT)
.append("Your loot is worth around ")
.append(StackFormatter.formatNumber(chestPrice))
.append(" coins.")
.append(ChatColorType.NORMAL);
chatMessageManager.queue(QueuedMessage.builder()
.type(ChatMessageType.ITEM_EXAMINE)
.runeLiteFormattedMessage(message.build())
.build());
}
// Convert container items to array of ItemStack // Convert container items to array of ItemStack
final Collection<ItemStack> items = Arrays.stream(container.getItems()) final Collection<ItemStack> items = Arrays.stream(container.getItems())
.filter(item -> item.getId() > 0) .filter(item -> item.getId() > 0)

View File

@@ -55,11 +55,22 @@ public interface XpGlobesConfig extends Config
return false; return false;
} }
@ConfigItem(
keyName = "Time to level",
name = "Display TTL",
description = "Displays time left to level",
position = 2
)
default boolean enableTimeToLevel()
{
return true;
}
@ConfigItem( @ConfigItem(
keyName = "enableCustomArcColor", keyName = "enableCustomArcColor",
name = "Enable custom arc color", name = "Enable custom arc color",
description = "Enables the custom coloring of the globe's arc instead of using the skill's default color.", description = "Enables the custom coloring of the globe's arc instead of using the skill's default color.",
position = 2 position = 3
) )
default boolean enableCustomArcColor() default boolean enableCustomArcColor()
{ {
@@ -71,7 +82,7 @@ public interface XpGlobesConfig extends Config
keyName = "Progress arc color", keyName = "Progress arc color",
name = "Progress arc color", name = "Progress arc color",
description = "Change the color of the progress arc in the xp orb", description = "Change the color of the progress arc in the xp orb",
position = 3 position = 4
) )
default Color progressArcColor() default Color progressArcColor()
{ {
@@ -83,7 +94,7 @@ public interface XpGlobesConfig extends Config
keyName = "Progress orb outline color", keyName = "Progress orb outline color",
name = "Progress orb outline color", name = "Progress orb outline color",
description = "Change the color of the progress orb outline", description = "Change the color of the progress orb outline",
position = 4 position = 5
) )
default Color progressOrbOutLineColor() default Color progressOrbOutLineColor()
{ {
@@ -95,7 +106,7 @@ public interface XpGlobesConfig extends Config
keyName = "Progress orb background color", keyName = "Progress orb background color",
name = "Progress orb background color", name = "Progress orb background color",
description = "Change the color of the progress orb background", description = "Change the color of the progress orb background",
position = 5 position = 6
) )
default Color progressOrbBackgroundColor() default Color progressOrbBackgroundColor()
{ {
@@ -106,7 +117,7 @@ public interface XpGlobesConfig extends Config
keyName = "Progress arc width", keyName = "Progress arc width",
name = "Progress arc width", name = "Progress arc width",
description = "Change the stroke width of the progress arc", description = "Change the stroke width of the progress arc",
position = 6 position = 7
) )
default int progressArcStrokeWidth() default int progressArcStrokeWidth()
{ {
@@ -117,7 +128,7 @@ public interface XpGlobesConfig extends Config
keyName = "Orb size", keyName = "Orb size",
name = "Size of orbs", name = "Size of orbs",
description = "Change the size of the xp orbs", description = "Change the size of the xp orbs",
position = 7 position = 8
) )
default int xpOrbSize() default int xpOrbSize()
{ {
@@ -128,7 +139,7 @@ public interface XpGlobesConfig extends Config
keyName = "Orb duration", keyName = "Orb duration",
name = "Duration of orbs", name = "Duration of orbs",
description = "Change the duration the xp orbs are visible", description = "Change the duration the xp orbs are visible",
position = 8 position = 9
) )
default int xpOrbDuration() default int xpOrbDuration()
{ {

View File

@@ -293,12 +293,15 @@ public class XpGlobesOverlay extends Overlay
.build()); .build());
} }
String timeLeft = xpTrackerService.getTimeTillGoal(mouseOverSkill.getSkill()); if (config.enableTimeToLevel())
xpTooltip.getChildren().add(LineComponent.builder() {
.left("Time left:") String timeLeft = xpTrackerService.getTimeTillGoal(mouseOverSkill.getSkill());
.leftColor(Color.ORANGE) xpTooltip.getChildren().add(LineComponent.builder()
.right(timeLeft) .left("Time left:")
.build()); .leftColor(Color.ORANGE)
.right(timeLeft)
.build());
}
} }
xpTooltip.render(graphics); xpTooltip.render(graphics);