hiscore panel: pass result to detailsHtml and remove reduncant null check
This commit is contained in:
@@ -474,7 +474,7 @@ public class HiscorePanel extends PluginPanel
|
|||||||
label.setText(Integer.toString(level));
|
label.setText(Integer.toString(level));
|
||||||
}
|
}
|
||||||
|
|
||||||
label.setToolTipText(detailsHtml(skill));
|
label.setToolTipText(detailsHtml(result, skill));
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -521,15 +521,13 @@ public class HiscorePanel extends PluginPanel
|
|||||||
/*
|
/*
|
||||||
Builds a html string to display on tooltip (when hovering a skill).
|
Builds a html string to display on tooltip (when hovering a skill).
|
||||||
*/
|
*/
|
||||||
private String detailsHtml(HiscoreSkill skill)
|
private String detailsHtml(HiscoreResult result, HiscoreSkill skill)
|
||||||
{
|
{
|
||||||
String openingTags = "<html><body style = 'padding: 5px;color:#989898'>";
|
String openingTags = "<html><body style = 'padding: 5px;color:#989898'>";
|
||||||
String closingTags = "</html><body>";
|
String closingTags = "</html><body>";
|
||||||
|
|
||||||
String content = "";
|
String content = "";
|
||||||
|
|
||||||
if (result != null)
|
|
||||||
{
|
|
||||||
if (skill == null)
|
if (skill == null)
|
||||||
{
|
{
|
||||||
double combatLevel = Experience.getCombatLevelPrecise(
|
double combatLevel = Experience.getCombatLevelPrecise(
|
||||||
@@ -632,7 +630,6 @@ public class HiscorePanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a html progress bar to the hover information
|
* Adds a html progress bar to the hover information
|
||||||
|
|||||||
Reference in New Issue
Block a user