Show GE and HA only when showing both prices
- Change the price displaying to dropdown menu - Show (GE:, (HA: only when showing both prices at once, otherwise do not add label at all Depends on: #2149 Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
package net.runelite.client.plugins.grounditems;
|
package net.runelite.client.plugins.grounditems;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
import net.runelite.client.config.ConfigGroup;
|
import net.runelite.client.config.ConfigGroup;
|
||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import net.runelite.client.plugins.grounditems.config.ItemHighlightMode;
|
import net.runelite.client.plugins.grounditems.config.ItemHighlightMode;
|
||||||
import net.runelite.client.plugins.grounditems.config.MenuHighlightMode;
|
import net.runelite.client.plugins.grounditems.config.MenuHighlightMode;
|
||||||
|
import net.runelite.client.plugins.grounditems.config.PriceDisplayMode;
|
||||||
|
|
||||||
@ConfigGroup(
|
@ConfigGroup(
|
||||||
keyName = "grounditems",
|
keyName = "grounditems",
|
||||||
@@ -44,7 +44,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "highlightedItems",
|
keyName = "highlightedItems",
|
||||||
name = "Highlighted Items",
|
name = "Highlighted Items",
|
||||||
description = "Configures specifically highlighted ground items. Format: (item), (item)",
|
description = "Configures specifically highlighted ground items. Format: (item), (item)",
|
||||||
position = 1
|
position = 0
|
||||||
)
|
)
|
||||||
default String getHighlightItems()
|
default String getHighlightItems()
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "hiddenItems",
|
keyName = "hiddenItems",
|
||||||
name = "Hidden Items",
|
name = "Hidden Items",
|
||||||
description = "Configures hidden ground items. Format: (item), (item)",
|
description = "Configures hidden ground items. Format: (item), (item)",
|
||||||
position = 2
|
position = 1
|
||||||
)
|
)
|
||||||
default String getHiddenItems()
|
default String getHiddenItems()
|
||||||
{
|
{
|
||||||
@@ -80,51 +80,40 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "showHighlightedOnly",
|
keyName = "showHighlightedOnly",
|
||||||
name = "Show Highlighted items only",
|
name = "Show Highlighted items only",
|
||||||
description = "Configures whether or not to draw items only on your highlighted list",
|
description = "Configures whether or not to draw items only on your highlighted list",
|
||||||
position = 3
|
position = 2
|
||||||
)
|
)
|
||||||
default boolean showHighlightedOnly()
|
default boolean showHighlightedOnly()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showGEPrice",
|
|
||||||
name = "Show Grand Exchange Prices",
|
|
||||||
description = "Configures whether or not to draw GE prices alongside ground items",
|
|
||||||
position = 4
|
|
||||||
)
|
|
||||||
default boolean showGEPrice()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
|
||||||
keyName = "showHAValue",
|
|
||||||
name = "Show High Alchemy Values",
|
|
||||||
description = "Configures whether or not to draw High Alchemy values alongside ground items",
|
|
||||||
position = 5
|
|
||||||
)
|
|
||||||
default boolean showHAValue()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showMenuItemQuantities",
|
keyName = "showMenuItemQuantities",
|
||||||
name = "Show Menu Item Quantities",
|
name = "Show Menu Item Quantities",
|
||||||
description = "Configures whether or not to show the item quantities in the menu",
|
description = "Configures whether or not to show the item quantities in the menu",
|
||||||
position = 6
|
position = 3
|
||||||
)
|
)
|
||||||
default boolean showMenuItemQuantities()
|
default boolean showMenuItemQuantities()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "priceDisplayMode",
|
||||||
|
name = "Price Display Mode",
|
||||||
|
description = "Configures what price types are shown alongside of ground item name",
|
||||||
|
position = 4
|
||||||
|
)
|
||||||
|
default PriceDisplayMode priceDisplayMode()
|
||||||
|
{
|
||||||
|
return PriceDisplayMode.BOTH;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "itemHighlightMode",
|
keyName = "itemHighlightMode",
|
||||||
name = "Item Highlight Mode",
|
name = "Item Highlight Mode",
|
||||||
description = "Configures how ground items will be highlighted",
|
description = "Configures how ground items will be highlighted",
|
||||||
position = 7
|
position = 5
|
||||||
)
|
)
|
||||||
default ItemHighlightMode itemHighlightMode()
|
default ItemHighlightMode itemHighlightMode()
|
||||||
{
|
{
|
||||||
@@ -135,7 +124,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "menuHighlightMode",
|
keyName = "menuHighlightMode",
|
||||||
name = "Menu Highlight Mode",
|
name = "Menu Highlight Mode",
|
||||||
description = "Configures what to highlight in right-click menu",
|
description = "Configures what to highlight in right-click menu",
|
||||||
position = 8
|
position = 6
|
||||||
)
|
)
|
||||||
default MenuHighlightMode menuHighlightMode()
|
default MenuHighlightMode menuHighlightMode()
|
||||||
{
|
{
|
||||||
@@ -146,7 +135,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "hideUnderGeValue",
|
keyName = "hideUnderGeValue",
|
||||||
name = "Hide < GE Value",
|
name = "Hide < GE Value",
|
||||||
description = "Configures hidden ground items under GE value",
|
description = "Configures hidden ground items under GE value",
|
||||||
position = 9
|
position = 7
|
||||||
)
|
)
|
||||||
default int getHideUnderGeValue()
|
default int getHideUnderGeValue()
|
||||||
{
|
{
|
||||||
@@ -157,7 +146,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "hideUnderHaValue",
|
keyName = "hideUnderHaValue",
|
||||||
name = "Hide < HA Value",
|
name = "Hide < HA Value",
|
||||||
description = "Configures hidden ground items under High Alch value",
|
description = "Configures hidden ground items under High Alch value",
|
||||||
position = 10
|
position = 8
|
||||||
)
|
)
|
||||||
default int getHideUnderHAValue()
|
default int getHideUnderHAValue()
|
||||||
{
|
{
|
||||||
@@ -168,7 +157,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "defaultColor",
|
keyName = "defaultColor",
|
||||||
name = "Default items color",
|
name = "Default items color",
|
||||||
description = "Configures the color for default, non-highlighted items",
|
description = "Configures the color for default, non-highlighted items",
|
||||||
position = 11
|
position = 9
|
||||||
)
|
)
|
||||||
default Color defaultColor()
|
default Color defaultColor()
|
||||||
{
|
{
|
||||||
@@ -179,7 +168,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "highlightedColor",
|
keyName = "highlightedColor",
|
||||||
name = "Highlighted items color",
|
name = "Highlighted items color",
|
||||||
description = "Configures the color for highlighted items",
|
description = "Configures the color for highlighted items",
|
||||||
position = 12
|
position = 10
|
||||||
)
|
)
|
||||||
default Color highlightedColor()
|
default Color highlightedColor()
|
||||||
{
|
{
|
||||||
@@ -190,7 +179,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "lowValueColor",
|
keyName = "lowValueColor",
|
||||||
name = "Low value items color",
|
name = "Low value items color",
|
||||||
description = "Configures the color for low value items",
|
description = "Configures the color for low value items",
|
||||||
position = 13
|
position = 11
|
||||||
)
|
)
|
||||||
default Color lowValueColor()
|
default Color lowValueColor()
|
||||||
{
|
{
|
||||||
@@ -201,7 +190,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "lowValuePrice",
|
keyName = "lowValuePrice",
|
||||||
name = "Low value price",
|
name = "Low value price",
|
||||||
description = "Configures the start price for low value items",
|
description = "Configures the start price for low value items",
|
||||||
position = 14
|
position = 12
|
||||||
)
|
)
|
||||||
default int lowValuePrice()
|
default int lowValuePrice()
|
||||||
{
|
{
|
||||||
@@ -212,7 +201,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "mediumValueColor",
|
keyName = "mediumValueColor",
|
||||||
name = "Medium value items color",
|
name = "Medium value items color",
|
||||||
description = "Configures the color for medium value items",
|
description = "Configures the color for medium value items",
|
||||||
position = 15
|
position = 13
|
||||||
)
|
)
|
||||||
default Color mediumValueColor()
|
default Color mediumValueColor()
|
||||||
{
|
{
|
||||||
@@ -223,7 +212,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "mediumValuePrice",
|
keyName = "mediumValuePrice",
|
||||||
name = "Medium value price",
|
name = "Medium value price",
|
||||||
description = "Configures the start price for medium value items",
|
description = "Configures the start price for medium value items",
|
||||||
position = 16
|
position = 14
|
||||||
)
|
)
|
||||||
default int mediumValuePrice()
|
default int mediumValuePrice()
|
||||||
{
|
{
|
||||||
@@ -234,7 +223,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "highValueColor",
|
keyName = "highValueColor",
|
||||||
name = "High value items color",
|
name = "High value items color",
|
||||||
description = "Configures the color for high value items",
|
description = "Configures the color for high value items",
|
||||||
position = 17
|
position = 15
|
||||||
)
|
)
|
||||||
default Color highValueColor()
|
default Color highValueColor()
|
||||||
{
|
{
|
||||||
@@ -245,7 +234,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "highValuePrice",
|
keyName = "highValuePrice",
|
||||||
name = "High value price",
|
name = "High value price",
|
||||||
description = "Configures the start price for high value items",
|
description = "Configures the start price for high value items",
|
||||||
position = 18
|
position = 16
|
||||||
)
|
)
|
||||||
default int highValuePrice()
|
default int highValuePrice()
|
||||||
{
|
{
|
||||||
@@ -256,7 +245,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "insaneValueColor",
|
keyName = "insaneValueColor",
|
||||||
name = "Insane value items color",
|
name = "Insane value items color",
|
||||||
description = "Configures the color for insane value items",
|
description = "Configures the color for insane value items",
|
||||||
position = 19
|
position = 17
|
||||||
)
|
)
|
||||||
default Color insaneValueColor()
|
default Color insaneValueColor()
|
||||||
{
|
{
|
||||||
@@ -267,7 +256,7 @@ public interface GroundItemsConfig extends Config
|
|||||||
keyName = "insaneValuePrice",
|
keyName = "insaneValuePrice",
|
||||||
name = "Insane value price",
|
name = "Insane value price",
|
||||||
description = "Configures the start price for insane value items",
|
description = "Configures the start price for insane value items",
|
||||||
position = 20
|
position = 18
|
||||||
)
|
)
|
||||||
default int insaneValuePrice()
|
default int insaneValuePrice()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import net.runelite.api.coords.LocalPoint;
|
|||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
import static net.runelite.client.plugins.grounditems.config.ItemHighlightMode.MENU;
|
import static net.runelite.client.plugins.grounditems.config.ItemHighlightMode.MENU;
|
||||||
|
import net.runelite.client.plugins.grounditems.config.PriceDisplayMode;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
@@ -163,18 +164,35 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.showGEPrice() && item.getGePrice() > 0)
|
if (config.priceDisplayMode() == PriceDisplayMode.BOTH)
|
||||||
{
|
{
|
||||||
itemStringBuilder.append(" (EX: ")
|
if (item.getGePrice() > 0)
|
||||||
.append(StackFormatter.quantityToStackSize(item.getGePrice()))
|
{
|
||||||
.append(" gp)");
|
itemStringBuilder.append(" (EX: ")
|
||||||
}
|
.append(StackFormatter.quantityToStackSize(item.getGePrice()))
|
||||||
|
.append(" gp)");
|
||||||
|
}
|
||||||
|
|
||||||
if (config.showHAValue() && item.getHaPrice() > 0)
|
if (item.getHaPrice() > 0)
|
||||||
|
{
|
||||||
|
itemStringBuilder.append(" (HA: ")
|
||||||
|
.append(StackFormatter.quantityToStackSize(item.getHaPrice()))
|
||||||
|
.append(" gp)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (config.priceDisplayMode() != PriceDisplayMode.OFF)
|
||||||
{
|
{
|
||||||
itemStringBuilder.append(" (HA: ")
|
final int price = config.priceDisplayMode() == PriceDisplayMode.GE
|
||||||
.append(StackFormatter.quantityToStackSize(item.getHaPrice()))
|
? item.getGePrice()
|
||||||
.append(" gp)");
|
: item.getHaPrice();
|
||||||
|
|
||||||
|
if (price > 0)
|
||||||
|
{
|
||||||
|
itemStringBuilder
|
||||||
|
.append(" (")
|
||||||
|
.append(StackFormatter.quantityToStackSize(price))
|
||||||
|
.append(" gp)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final String itemString = itemStringBuilder.toString();
|
final String itemString = itemStringBuilder.toString();
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, Tomas Slusny <slusnucky@gmail.com>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.grounditems.config;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum PriceDisplayMode
|
||||||
|
{
|
||||||
|
HA("High Alchemy"),
|
||||||
|
GE("Grand Exchange"),
|
||||||
|
BOTH("Both"),
|
||||||
|
OFF("Off");
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user