Merge pull request #5293 from Unmoon/show-runenergy-toggle
Show run energy remaining in overlay if orb shows run time remaining
This commit is contained in:
@@ -43,13 +43,15 @@ class RunEnergyOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
private final RunEnergyPlugin plugin;
|
private final RunEnergyPlugin plugin;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
|
private final RunEnergyConfig config;
|
||||||
private final TooltipManager tooltipManager;
|
private final TooltipManager tooltipManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private RunEnergyOverlay(final RunEnergyPlugin plugin, final Client client, final TooltipManager tooltipManager)
|
private RunEnergyOverlay(final RunEnergyPlugin plugin, final Client client, final RunEnergyConfig config, final TooltipManager tooltipManager)
|
||||||
{
|
{
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.client = client;
|
this.client = client;
|
||||||
|
this.config = config;
|
||||||
this.tooltipManager = tooltipManager;
|
this.tooltipManager = tooltipManager;
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
@@ -77,8 +79,16 @@ class RunEnergyOverlay extends Overlay
|
|||||||
if (bounds.contains(mousePosition.getX(), mousePosition.getY()))
|
if (bounds.contains(mousePosition.getX(), mousePosition.getY()))
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Weight: ").append(client.getWeight()).append(" kg</br>")
|
sb.append("Weight: ").append(client.getWeight()).append(" kg</br>");
|
||||||
.append("Run Time Remaining: ").append(plugin.getEstimatedRunTimeRemaining(false));
|
|
||||||
|
if (config.replaceOrbText())
|
||||||
|
{
|
||||||
|
sb.append("Run Energy: ").append(client.getEnergy()).append("%");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.append("Run Time Remaining: ").append(plugin.getEstimatedRunTimeRemaining(false));
|
||||||
|
}
|
||||||
|
|
||||||
int secondsUntil100 = plugin.getEstimatedRecoverTimeRemaining();
|
int secondsUntil100 = plugin.getEstimatedRecoverTimeRemaining();
|
||||||
if (secondsUntil100 > 0)
|
if (secondsUntil100 > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user