22 package com.realtime.crossfire.jxclient.gui.label;
29 import java.awt.Color;
31 import org.jetbrains.annotations.NotNull;
32 import org.jetbrains.annotations.Nullable;
70 public void statChanged(
final int statNo,
final int value) {
102 public void simpleWeaponSpeedChanged(
final boolean simpleWeaponSpeed) {
107 public void titleChanged(@NotNull
final String title) {
114 @SuppressWarnings(
"IfMayBeConditional")
115 public void rangeChanged(@NotNull
final String range) {
121 if (range.startsWith(
"Range: spell ")) {
122 text = range.substring(13);
123 }
else if (range.startsWith(
"Range: ") || range.startsWith(
"Skill: ")) {
124 text = range.substring(7);
132 public void activeSkillChanged(@NotNull
final String activeSkill) {
137 public void experienceChanged(
final long exp) {
144 public void experienceNextLevelChanged(
final long expNextLevel) {
146 setText(String.valueOf(expNextLevel));
165 super(tooltipManager, elementListener, name, null, font, color, backgroundColor, alignment,
"");
168 this.stats.addCrossfireStatsListener(statsListener);
Listener for GUIElement related events.
A AbstractLabel that renders the text as a plain string.
void setText(@NotNull final String text)
The label text.
final TooltipManager tooltipManager
The TooltipManager to update.
static final int CS_STAT_TITLE
The Title stat.
static final int CS_STAT_RANGE
The Range stat - this is what is currently readied by the player to fire.
void removeCrossfireStatsListener(@NotNull final StatsListener statsListener)
Removes a StatsListener to be notified about stat changes.
final GUIElementListener elementListener
The GUIElementListener to notify.
final int stat
The stat to display.
final Color backgroundColor
If set, the opaque background color.
final String name
The name of this element.
static final int CS_STAT_WEIGHT_LIM
The Weight Limit stat.
double getWeaponSpeed()
Returns the weapon speed stat.
final Stats stats
The Stats instance to use.
static final int C_STAT_EXP_NEXT_LEVEL
The global experience needed to reach next level stat.
void setTooltipText(@Nullable final String tooltipText)
Sets the tooltip text to show when the mouse is inside this element.the text to show ornull to disab...
A GUILabel that displays a value of the last received "stats" command.
Interface for listeners interested in changes of Stats instances.
double getFloatStat(final int statNo)
Returns the numerical value of the given statistic.
static final int CS_STAT_EXP64
The Global Experience (64bit encoding) stat.
static final int CS_STAT_EXP
The Global Experience (32bit encoding) stat.
static final int C_STAT_WEIGHT
The character's weight.
String text
The label text.
GUILabelStats(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final Font font, @NotNull final Color color, @Nullable final Color backgroundColor, final int stat, @NotNull final Alignment alignment, @NotNull final Stats stats)
Creates a new instance.
final StatsListener statsListener
The StatsListener registered to be notified about stat changes.
This is the representation of all the statistics of a player, like its speed or its experience...
static final int CS_STAT_WEAP_SP
The Weapon Speed stat.
static final long serialVersionUID
The serial version UID.
static final int CS_STAT_SPEED
The Speed stat.
void dispose()
Releases all allocated resources.