xp drops: add option to override standard client xp drop colors

Co-authored-by: Zeusay <kentgamesdesign@Gmail.com>
This commit is contained in:
Adam
2021-06-13 17:03:55 -04:00
committed by Adam
parent 0580e32cc6
commit 159c239908
2 changed files with 26 additions and 9 deletions

View File

@@ -44,11 +44,19 @@ public interface XpDropConfig extends Config
return false;
}
@ConfigItem(
keyName = "standardColor",
name = "Standard Color",
description = "XP drop color when no prayer is active",
position = 1
)
Color standardColor();
@ConfigItem(
keyName = "meleePrayerColor",
name = "Melee Prayer Color",
description = "XP drop color when a melee prayer is active",
position = 1
position = 2
)
default Color getMeleePrayerColor()
{
@@ -59,7 +67,7 @@ public interface XpDropConfig extends Config
keyName = "rangePrayerColor",
name = "Range Prayer Color",
description = "XP drop color when a range prayer is active",
position = 2
position = 3
)
default Color getRangePrayerColor()
{
@@ -70,7 +78,7 @@ public interface XpDropConfig extends Config
keyName = "magePrayerColor",
name = "Mage Prayer Color",
description = "XP drop color when a mage prayer is active",
position = 3
position = 4
)
default Color getMagePrayerColor()
{
@@ -81,12 +89,11 @@ public interface XpDropConfig extends Config
keyName = "fakeXpDropDelay",
name = "Fake Xp Drop delay",
description = "Configures how many ticks should pass between fake XP drops, 0 to disable",
position = 4
position = 5
)
@Units(Units.TICKS)
default int fakeXpDropDelay()
{
return 0;
}
}

View File

@@ -25,6 +25,7 @@
package net.runelite.client.plugins.experiencedrop;
import com.google.inject.Provides;
import java.awt.Color;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.Map;
@@ -151,10 +152,19 @@ public class XpDropPlugin extends Plugin
private void resetTextColor(Widget widget)
{
EnumComposition colorEnum = client.getEnum(EnumID.XPDROP_COLORS);
int defaultColorId = client.getVar(Varbits.EXPERIENCE_DROP_COLOR);
int color = colorEnum.getIntValue(defaultColorId);
widget.setTextColor(color);
Color standardColor = config.standardColor();
if (standardColor != null)
{
int color = standardColor.getRGB();
widget.setTextColor(color);
}
else
{
EnumComposition colorEnum = client.getEnum(EnumID.XPDROP_COLORS);
int defaultColorId = client.getVar(Varbits.EXPERIENCE_DROP_COLOR);
int color = colorEnum.getIntValue(defaultColorId);
widget.setTextColor(color);
}
}
private void hideSkillIcons(Widget xpdrop)