mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-20 19:49:47 +07:00
Added class only string to item label
This commit is contained in:
parent
43e6eae12a
commit
376c574dd8
@ -146,4 +146,17 @@ public enum CharacterClass {
|
||||
default: throw new GdxRuntimeException("Invalid class id: " + classId);
|
||||
}
|
||||
}
|
||||
|
||||
public static CharacterClass get(String charClass) {
|
||||
if (charClass == null || charClass.length() < 3) throw new GdxRuntimeException("Invalid class id: " + charClass);
|
||||
switch (charClass.charAt(0)) {
|
||||
case 'a': return charClass.charAt(1) == 'm' ? CharacterClass.AMAZON : CharacterClass.ASSASSIN;
|
||||
case 'b': return CharacterClass.BARBARIAN;
|
||||
case 'd': return CharacterClass.DRUID;
|
||||
case 'n': return CharacterClass.NECROMANCER;
|
||||
case 'p': return CharacterClass.PALADIN;
|
||||
case 's': return CharacterClass.SORCERESS;
|
||||
default: throw new GdxRuntimeException("Invalid class id: " + charClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.IntMap;
|
||||
import com.badlogic.gdx.utils.IntSet;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
import com.riiablo.CharacterClass;
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.codec.DC6;
|
||||
import com.riiablo.codec.Index;
|
||||
@ -890,6 +891,9 @@ public class Item extends Actor implements Disposable {
|
||||
}
|
||||
if (!Item.this.base.nodurability && (stat = stats.get(Stat.durability)) != null)
|
||||
add(new Label(Riiablo.string.lookup("ItemStats1d") + " " + stat.value + " " + Riiablo.string.lookup("ItemStats1j") + " " + stats.get(Stat.maxdurability).value, font, Riiablo.colors.white)).center().space(SPACING).row();
|
||||
if (Item.this.type.is("clas")) {
|
||||
add(new Label(Riiablo.string.lookup(CharacterClass.get(Item.this.type.Class).entry().StrClassOnly), font, Riiablo.colors.white)).center().space(SPACING).row();
|
||||
}
|
||||
if ((stat = stats.get(Stat.dexterity)) != null && stat.value > 0)
|
||||
add(new Label(Riiablo.string.lookup("ItemStats1f") + " " + stat.value, font, Riiablo.colors.white)).center().space(SPACING).row();
|
||||
if ((stat = stats.get(Stat.strength)) != null && stat.value > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user