Merge pull request #2214 from xKylee/upstreammerge
project: upstream merge
This commit is contained in:
@@ -51,7 +51,7 @@ public interface AgilityConfig extends Config
|
||||
description = "This will remove the distance cap on rendering overlays for agility.",
|
||||
warning = "<html><center>Enabling this setting on a low end machine may severely affect your fps." +
|
||||
"<br>Click yes to enable this setting, knowing it might affect performance.</center></html>",
|
||||
position = 1,
|
||||
position = 0,
|
||||
titleSection = "mainConfig"
|
||||
)
|
||||
default boolean removeDistanceCap()
|
||||
@@ -59,6 +59,17 @@ public interface AgilityConfig extends Config
|
||||
return false;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "showCourseClickboxes",
|
||||
name = "Show course Clickboxes",
|
||||
description = "Show agility course obstacle clickboxes",
|
||||
position = 1
|
||||
)
|
||||
default boolean showCourseClickboxes()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "showLapCount",
|
||||
name = "Show Lap Count",
|
||||
|
||||
@@ -71,7 +71,8 @@ class AgilityOverlay extends Overlay
|
||||
plugin.getObstacles().forEach((object, obstacle) ->
|
||||
{
|
||||
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !plugin.isHighlightShortcuts() ||
|
||||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !plugin.isShowTrapOverlay())
|
||||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !plugin.isShowTrapOverlay() ||
|
||||
Obstacles.COURSE_OBSTACLE_IDS.contains(object.getId()) && !plugin.isShowCourseClickboxes())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -141,6 +141,8 @@ public class AgilityPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean removeDistanceCap;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showCourseClickboxes;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private boolean showLapCount;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int lapTimeout;
|
||||
@@ -260,6 +262,7 @@ public class AgilityPlugin extends Plugin
|
||||
private void updateConfig()
|
||||
{
|
||||
this.removeDistanceCap = config.removeDistanceCap();
|
||||
this.showCourseClickboxes = config.showCourseClickboxes();
|
||||
this.showLapCount = config.showLapCount();
|
||||
this.lapTimeout = config.lapTimeout();
|
||||
this.lapsToLevel = config.lapsToLevel();
|
||||
|
||||
@@ -89,7 +89,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
|
||||
.put(new WorldPoint(2209, 3161, 0), "North-east of Tyras Camp (BJS).")
|
||||
.put(new WorldPoint(2181, 3206, 0), "South of Elf Camp.")
|
||||
.put(new WorldPoint(3081, 3209, 0), "Small Island (CLP).")
|
||||
.put(new WorldPoint(3374, 3250, 0), "Duel Arena combat area.")
|
||||
.put(new WorldPoint(3399, 3246, 0), "Behind the Duel Arena.")
|
||||
.put(new WorldPoint(2699, 3251, 0), "Little island (AIR).")
|
||||
.put(new WorldPoint(3546, 3251, 0), "North-east of Burgh de Rott.")
|
||||
.put(new WorldPoint(3544, 3256, 0), "North-east of Burgh de Rott.")
|
||||
|
||||
@@ -539,26 +539,46 @@ public class HiscorePanel extends PluginPanel
|
||||
}
|
||||
case BOUNTY_HUNTER_ROGUE:
|
||||
{
|
||||
String rank = (result.getBountyHunterRogue().getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(result.getBountyHunterRogue().getRank());
|
||||
Skill bountyHunterRogue = result.getBountyHunterRogue();
|
||||
String rank = (bountyHunterRogue.getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(bountyHunterRogue.getRank());
|
||||
content += "<p><span style = 'color:white'>Rank:</span> " + rank + "</p>";
|
||||
if (bountyHunterRogue.getLevel() > -1)
|
||||
{
|
||||
content += "<p><span style = 'color:white'>Score:</span> " + QuantityFormatter.formatNumber(bountyHunterRogue.getLevel()) + "</p>";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BOUNTY_HUNTER_HUNTER:
|
||||
{
|
||||
String rank = (result.getBountyHunterHunter().getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(result.getBountyHunterHunter().getRank());
|
||||
Skill bountyHunterHunter = result.getBountyHunterHunter();
|
||||
String rank = (bountyHunterHunter.getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(bountyHunterHunter.getRank());
|
||||
content += "<p><span style = 'color:white'>Rank:</span> " + rank + "</p>";
|
||||
if (bountyHunterHunter.getLevel() > -1)
|
||||
{
|
||||
content += "<p><span style = 'color:white'>Score:</span> " + QuantityFormatter.formatNumber(bountyHunterHunter.getLevel()) + "</p>";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LAST_MAN_STANDING:
|
||||
{
|
||||
String rank = (result.getLastManStanding().getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(result.getLastManStanding().getRank());
|
||||
Skill lastManStanding = result.getLastManStanding();
|
||||
String rank = (lastManStanding.getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(lastManStanding.getRank());
|
||||
content += "<p><span style = 'color:white'>Rank:</span> " + rank + "</p>";
|
||||
if (lastManStanding.getLevel() > -1)
|
||||
{
|
||||
content += "<p><span style = 'color:white'>Score:</span> " + QuantityFormatter.formatNumber(lastManStanding.getLevel()) + "</p>";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LEAGUE_POINTS:
|
||||
{
|
||||
String rank = (result.getLeaguePoints().getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(result.getLeaguePoints().getRank());
|
||||
Skill leaguePoints = result.getLeaguePoints();
|
||||
String rank = (leaguePoints.getRank() == -1) ? "Unranked" : QuantityFormatter.formatNumber(leaguePoints.getRank());
|
||||
content += "<p><span style = 'color:white'>Rank:</span> " + rank + "</p>";
|
||||
if (leaguePoints.getLevel() > -1)
|
||||
{
|
||||
content += "<p><span style = 'color:white'>Points:</span> " + QuantityFormatter.formatNumber(leaguePoints.getLevel()) + "</p>";
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OVERALL:
|
||||
|
||||
@@ -28,12 +28,15 @@ package net.runelite.client.plugins.skillcalculator;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.FocusAdapter;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Box;
|
||||
import javax.swing.JCheckBox;
|
||||
@@ -111,6 +114,12 @@ class SkillCalculator extends JPanel
|
||||
|
||||
uiInput.getUiFieldTargetLevel().addActionListener(e -> onFieldTargetLevelUpdated());
|
||||
uiInput.getUiFieldTargetXP().addActionListener(e -> onFieldTargetXPUpdated());
|
||||
|
||||
// Register focus listeners to calculate xp when exiting a text field
|
||||
uiInput.getUiFieldCurrentLevel().addFocusListener(buildFocusAdapter(e -> onFieldCurrentLevelUpdated()));
|
||||
uiInput.getUiFieldCurrentXP().addFocusListener(buildFocusAdapter(e -> onFieldCurrentXPUpdated()));
|
||||
uiInput.getUiFieldTargetLevel().addFocusListener(buildFocusAdapter(e -> onFieldTargetLevelUpdated()));
|
||||
uiInput.getUiFieldTargetXP().addFocusListener(buildFocusAdapter(e -> onFieldTargetXPUpdated()));
|
||||
}
|
||||
|
||||
void openCalculator(CalculatorType calculatorType)
|
||||
@@ -437,4 +446,15 @@ class SkillCalculator extends JPanel
|
||||
return slot.getAction().getName().toLowerCase().contains(text.toLowerCase());
|
||||
}
|
||||
|
||||
private FocusAdapter buildFocusAdapter(Consumer<FocusEvent> focusLostConsumer)
|
||||
{
|
||||
return new FocusAdapter()
|
||||
{
|
||||
@Override
|
||||
public void focusLost(FocusEvent e)
|
||||
{
|
||||
focusLostConsumer.accept(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user