Merge pull request #3796 from deathbeam/ground-item-changes
Ground item changes (as requested by people in Discord)
This commit is contained in:
@@ -186,11 +186,22 @@ public interface GroundItemsConfig extends Config
|
|||||||
return Color.decode("#AA00FF");
|
return Color.decode("#AA00FF");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "hiddenColor",
|
||||||
|
name = "Hidden items color",
|
||||||
|
description = "Configures the color for hidden items in right-click menu and when holding ALT",
|
||||||
|
position = 12
|
||||||
|
)
|
||||||
|
default Color hiddenColor()
|
||||||
|
{
|
||||||
|
return Color.GRAY;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
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 = 12
|
position = 13
|
||||||
)
|
)
|
||||||
default Color lowValueColor()
|
default Color lowValueColor()
|
||||||
{
|
{
|
||||||
@@ -201,7 +212,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 = 13
|
position = 14
|
||||||
)
|
)
|
||||||
default int lowValuePrice()
|
default int lowValuePrice()
|
||||||
{
|
{
|
||||||
@@ -212,7 +223,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 = 14
|
position = 15
|
||||||
)
|
)
|
||||||
default Color mediumValueColor()
|
default Color mediumValueColor()
|
||||||
{
|
{
|
||||||
@@ -223,7 +234,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 = 15
|
position = 16
|
||||||
)
|
)
|
||||||
default int mediumValuePrice()
|
default int mediumValuePrice()
|
||||||
{
|
{
|
||||||
@@ -234,7 +245,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 = 16
|
position = 17
|
||||||
)
|
)
|
||||||
default Color highValueColor()
|
default Color highValueColor()
|
||||||
{
|
{
|
||||||
@@ -245,7 +256,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 = 17
|
position = 18
|
||||||
)
|
)
|
||||||
default int highValuePrice()
|
default int highValuePrice()
|
||||||
{
|
{
|
||||||
@@ -256,7 +267,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 = 18
|
position = 19
|
||||||
)
|
)
|
||||||
default Color insaneValueColor()
|
default Color insaneValueColor()
|
||||||
{
|
{
|
||||||
@@ -267,7 +278,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 = 19
|
position = 20
|
||||||
)
|
)
|
||||||
default int insaneValuePrice()
|
default int insaneValuePrice()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -342,11 +342,31 @@ public class GroundItemsPlugin extends Plugin
|
|||||||
|
|
||||||
// Cache colors
|
// Cache colors
|
||||||
priceChecks.clear();
|
priceChecks.clear();
|
||||||
priceChecks.put(config.insaneValuePrice(), config.insaneValueColor());
|
|
||||||
priceChecks.put(config.highValuePrice(), config.highValueColor());
|
if (config.insaneValuePrice() > 0)
|
||||||
priceChecks.put(config.mediumValuePrice(), config.mediumValueColor());
|
{
|
||||||
priceChecks.put(config.lowValuePrice(), config.lowValueColor());
|
priceChecks.put(config.insaneValuePrice(), config.insaneValueColor());
|
||||||
priceChecks.put(config.getHighlightOverValue(), config.highlightedColor());
|
}
|
||||||
|
|
||||||
|
if (config.highValuePrice() > 0)
|
||||||
|
{
|
||||||
|
priceChecks.put(config.highValuePrice(), config.highValueColor());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.mediumValuePrice() > 0)
|
||||||
|
{
|
||||||
|
priceChecks.put(config.mediumValuePrice(), config.mediumValueColor());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.lowValuePrice() > 0)
|
||||||
|
{
|
||||||
|
priceChecks.put(config.lowValuePrice(), config.lowValueColor());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (config.getHighlightOverValue() > 0)
|
||||||
|
{
|
||||||
|
priceChecks.put(config.getHighlightOverValue(), config.highlightedColor());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -478,7 +498,7 @@ public class GroundItemsPlugin extends Plugin
|
|||||||
|
|
||||||
// Explicit highlight takes priority over implicit hide
|
// Explicit highlight takes priority over implicit hide
|
||||||
return isExplicitHidden || (!isExplicitHighlight && canBeHidden && underGe && underHa)
|
return isExplicitHidden || (!isExplicitHighlight && canBeHidden && underGe && underHa)
|
||||||
? Color.GRAY
|
? config.hiddenColor()
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user