Add configurable bottom line contents for XP tracker
Add option to switch between xp/hour and actions/hour for bottom line of XP tracker. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -125,14 +125,30 @@ class XpInfoBoxOverlay extends Overlay
|
|||||||
.right(StackFormatter.quantityToRSDecimalStack(rightNum, true))
|
.right(StackFormatter.quantityToRSDecimalStack(rightNum, true))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final LineComponent xpHour = LineComponent.builder()
|
final String bottemLeftStr;
|
||||||
.left("XP/Hour:")
|
final int bottomRightNum;
|
||||||
.right(StackFormatter.quantityToRSDecimalStack(snapshot.getXpPerHour(), true))
|
|
||||||
|
switch (config.onScreenDisplayModeBottom())
|
||||||
|
{
|
||||||
|
case ACTIONS_HOUR:
|
||||||
|
bottemLeftStr = snapshot.getActionType().getLabel() + "/Hour";
|
||||||
|
bottomRightNum = snapshot.getActionsPerHour();
|
||||||
|
break;
|
||||||
|
case XP_HOUR:
|
||||||
|
default:
|
||||||
|
bottemLeftStr = "XP/Hour";
|
||||||
|
bottomRightNum = snapshot.getXpPerHour();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
final LineComponent xpLineBottom = LineComponent.builder()
|
||||||
|
.left(bottemLeftStr + ":")
|
||||||
|
.right(StackFormatter.quantityToRSDecimalStack(bottomRightNum, true))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final SplitComponent xpSplit = SplitComponent.builder()
|
final SplitComponent xpSplit = SplitComponent.builder()
|
||||||
.first(xpLine)
|
.first(xpLine)
|
||||||
.second(xpHour)
|
.second(xpLineBottom)
|
||||||
.orientation(ComponentOrientation.VERTICAL)
|
.orientation(ComponentOrientation.VERTICAL)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,13 @@ public interface XpTrackerConfig extends Config
|
|||||||
ACTIONS_LEFT
|
ACTIONS_LEFT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
enum OnScreenDisplayModeBottom
|
||||||
|
{
|
||||||
|
XP_HOUR,
|
||||||
|
ACTIONS_HOUR,
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 0,
|
position = 0,
|
||||||
keyName = "hideMaxed",
|
keyName = "hideMaxed",
|
||||||
@@ -88,11 +95,22 @@ public interface XpTrackerConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 4,
|
position = 4,
|
||||||
keyName = "onScreenDisplayMode",
|
keyName = "onScreenDisplayMode",
|
||||||
name = "On-screen tracker display mode",
|
name = "On-screen tracker display mode (top)",
|
||||||
description = "Configures the information displayed in the first line of on-screen XP overlays"
|
description = "Configures the information displayed in the first line of on-screen XP overlays"
|
||||||
)
|
)
|
||||||
default OnScreenDisplayMode onScreenDisplayMode()
|
default OnScreenDisplayMode onScreenDisplayMode()
|
||||||
{
|
{
|
||||||
return OnScreenDisplayMode.XP_GAINED;
|
return OnScreenDisplayMode.XP_GAINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 4,
|
||||||
|
keyName = "onScreenDisplayMode",
|
||||||
|
name = "On-screen tracker display mode (bottom)",
|
||||||
|
description = "Configures the information displayed in the second line of on-screen XP overlays"
|
||||||
|
)
|
||||||
|
default OnScreenDisplayModeBottom onScreenDisplayModeBottom()
|
||||||
|
{
|
||||||
|
return OnScreenDisplayModeBottom.XP_HOUR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user