23 package com.realtime.crossfire.jxclient.gui.label;
31 import java.awt.Color;
33 import org.jetbrains.annotations.NotNull;
34 import org.jetbrains.annotations.Nullable;
112 public void resetBefore() {
117 public void resetAfter() {
122 public void statChanged(
final int statNo,
final int value) {
130 public void simpleWeaponSpeedChanged(
final boolean simpleWeaponSpeed) {
135 public void titleChanged(@NotNull
final String title) {
140 public void godNameChanged(@NotNull
final String godName) {
145 public void rangeChanged(@NotNull
final String range) {
150 public void activeSkillChanged(@NotNull
final String activeSkill) {
155 public void experienceChanged(
final long exp) {
160 public void experienceNextLevelChanged(
final long expNextLevel) {
186 public GUILabelStats2(@NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final String
name, @NotNull
final Font font, @NotNull
final Color colorNormal, @NotNull
final Color
colorUpgradable, @NotNull
final Color
colorDepleted, @NotNull
final Color
colorBoosted, @NotNull
final Color
colorBoostedUpgradable, @Nullable
final Color
backgroundColor,
final int statCurrent,
final int statBase,
final int statRace,
final int statApplied, @NotNull
final Alignment alignment, @NotNull
final Stats stats, @NotNull
final GuiFactory guiFactory) {
187 super(
tooltipManager,
elementListener,
name,
null, font, colorNormal, colorNormal,
backgroundColor, alignment,
"",
guiFactory);
209 if (baseValue == 0 && raceValue == 0) {
211 color = super.getTextColor();
212 setText(String.valueOf(currValue));
217 final int currValueWithoutGear = currValue-appliedValue;
218 final Color newColor;
219 if (currValueWithoutGear < baseValue) {
221 }
else if (currValueWithoutGear == baseValue) {
222 newColor = baseValue < raceValue ?
colorUpgradable : super.getTextColor();
226 if (
color != newColor) {
230 setText(String.valueOf(currValue));
241 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
248 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
253 if (baseValue == 0 && raceValue == 0) {
257 final StringBuilder sb =
new StringBuilder();
258 sb.append(
"<html>Current: ").append(currValue);
260 final int currValueWithoutGear = currValue-appliedValue;
261 if (currValueWithoutGear < baseValue) {
262 sb.append(
"<br>Depleted by ").append(baseValue-currValueWithoutGear).append(
" from ").append(baseValue).append(
".");
263 }
else if (currValueWithoutGear > baseValue) {
264 sb.append(
"<br>Increased by ").append(currValueWithoutGear-baseValue).append(
" from ").append(baseValue).append(
".");
266 if (appliedValue > 0) {
267 sb.append(
"<br>Boosted by ").append(appliedValue).append(
" by gear or skills.");
268 }
else if (appliedValue < 0) {
269 sb.append(
"<br>Reduced by ").append(-appliedValue).append(
" by gear or skills.");
271 if (baseValue < raceValue) {
272 sb.append(
"<br>Upgradable to ").append(raceValue).append(
" by drinking stat potions.");