v0.9.3: overhauled hero info window again
This commit is contained in:
parent
0d7dc3bee5
commit
d4bbaaf688
|
@ -338,32 +338,44 @@ actors.hero.abilities.armorability.no_target=There's nothing to target there!
|
|||
actors.hero.abilities.armorability.prompt=Choose a location to target
|
||||
|
||||
actors.hero.abilities.warrior.heroicleap.name=heroic leap
|
||||
actors.hero.abilities.warrior.heroicleap.desc=The Warrior performs a heroic leap towards a targeted location, slamming down to stun all neighbouring enemies. Consumes 35 charge.
|
||||
actors.hero.abilities.warrior.heroicleap.prompt=Choose direction to leap
|
||||
actors.hero.abilities.warrior.heroicleap.short_desc=The Warrior performs a heroic leap towards a targeted location, slamming down to stun all neighbouring enemies. Consumes 35 charge.
|
||||
actors.hero.abilities.warrior.heroicleap.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.warrior.shockwave.name=shockwave
|
||||
actors.hero.abilities.warrior.shockwave.desc=The Warrior slams the ground and releases a shockwave in a conical AOE. Enemies caught in the shockwave are damaged and crippled. Consumes 35 energy.
|
||||
actors.hero.abilities.warrior.shockwave.short_desc=The Warrior slams the ground and releases a shockwave in a conical AOE. Enemies caught in the shockwave are damaged and crippled. Consumes 35 energy.
|
||||
actors.hero.abilities.warrior.shockwave.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.warrior.warrior3.name=???
|
||||
actors.hero.abilities.warrior.warrior3.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.warrior.warrior3.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.mage.elementalblast.name=elemental blast
|
||||
actors.hero.abilities.mage.elementalblast.desc=TODO
|
||||
actors.hero.abilities.mage.elementalblast.short_desc=TODO
|
||||
actors.hero.abilities.mage.elementalblast.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.mage.mage2.name=???
|
||||
actors.hero.abilities.mage.mage2.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.mage.mage2.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.mage.mage3.name=???
|
||||
actors.hero.abilities.mage.mage3.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.mage.mage3.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.rogue.smokebomb.name=smoke bomb
|
||||
actors.hero.abilities.rogue.smokebomb.fov=You can only jump to an empty location in your field of view
|
||||
actors.hero.abilities.rogue.smokebomb.desc=The Rogue blinks to any nearby location which he can see, leaving a plume of smoke where he stood. This ability makes the rogue temporarily invisible, and blinds any enemies adjacent to his old location. Consumes 35 charge.
|
||||
actors.hero.abilities.rogue.smokebomb.prompt=Choose a location to jump to
|
||||
actors.hero.abilities.rogue.smokebomb.short_desc=The Rogue blinks to any nearby location which he can see, leaving a plume of smoke where he stood. This ability makes the rogue temporarily invisible, and blinds any enemies adjacent to his old location. Consumes 35 charge.
|
||||
actors.hero.abilities.rogue.smokebomb.desc=TODO
|
||||
actors.hero.abilities.rogue.rogue2.name=???
|
||||
actors.hero.abilities.rogue.rogue2.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.rogue.rogue2.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.rogue.rogue2.desc=TODO
|
||||
actors.hero.abilities.rogue.rogue3.name=???
|
||||
actors.hero.abilities.rogue.rogue3.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.rogue.rogue3.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.rogue.rogue3.desc=TODO
|
||||
actors.hero.abilities.huntress.spectralblades.name=spectral blades
|
||||
actors.hero.abilities.huntress.spectralblades.desc=The Huntress throws a spectral blade at a target, inflicting damage depending on her currently equipped melee weapon. Consumes 35 charge.
|
||||
actors.hero.abilities.huntress.spectralblades.short_desc=The Huntress throws a spectral blade at a target, inflicting damage depending on her currently equipped melee weapon. Consumes 35 charge.
|
||||
actors.hero.abilities.huntress.spectralblades.desc=TODO
|
||||
actors.hero.abilities.huntress.huntress2.name=???
|
||||
actors.hero.abilities.huntress.huntress2.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.huntress.huntress2.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.huntress.huntress2.desc=TODO
|
||||
actors.hero.abilities.huntress.huntress3.name=???
|
||||
actors.hero.abilities.huntress.huntress3.desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.huntress.huntress3.short_desc=I haven't decided on this ability yet.
|
||||
actors.hero.abilities.huntress.huntress3.desc=TODO
|
||||
|
||||
actors.hero.hero.name=you
|
||||
actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below!
|
||||
|
@ -384,44 +396,44 @@ actors.hero.hero.pain_resist=The pain helps you resist the urge to sleep.
|
|||
actors.hero.hero.revive=The ankh explodes with life-giving energy!
|
||||
|
||||
actors.hero.heroclass.warrior=warrior
|
||||
actors.hero.heroclass.warrior_desc_innate=The Warrior starts with a _unique broken seal,_ which he can affix to armor. He will slowly generate shielding over his health while he is wearing armor with the seal affixed.\n\nThe Warrior's seal can be moved between different armor sets, transferring a single upgrade with it.\n\nThe Warrior automatically identifies:\n- Scrolls of Identify\n- Potions of Healing\n- Scrolls of Rage
|
||||
actors.hero.heroclass.warrior_desc_loadout=The Warrior starts with a _worn shortsword,_ which offers more direct damage than other starter weapons.\n\nThe Warrior starts with _three throwing stones,_ which offer limited ranged damage.\n\nThe Warrior starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Warrior starts with a _velvet pouch,_ which can store small items like seeds and runestones.
|
||||
actors.hero.heroclass.warrior_desc_subclasses=A subclass can be chosen after defeating the second boss. The Warrior has two subclasses:
|
||||
actors.hero.heroclass.warrior_desc=The Warrior starts with a _unique broken seal_ that generates shielding over his health. The seal can be moved between armors, and can _transfer a single upgrade_ with it.\n\nThe Warrior also starts with a _worn shortsword_, _three throwing stones_, cloth armor, a wasterskin, and a velvet pouch.\n\nThe Warrior automatically identifies:\n_-_ Scrolls of Identify\n_-_ Potions of Healing\n_-_ Scrolls of Rage
|
||||
|
||||
actors.hero.heroclass.mage=mage
|
||||
actors.hero.heroclass.mage_desc=The Mage starts with a _unique staff_, which recharges significantly faster than a wand and has 1 more charge. The staff _can be imbued with any wand_ the mage finds in the dungeon.\n\nThe Mage also starts with a _wand of magic missile_ imbued in his staff, cloth armor, a wasterskin, and a velvet pouch.\n\nThe Mage automatically identifies:\n_-_ Scrolls of Identify\n_-_ Potions of Liquid Flame\n_-_ Scrolls of Upgrade
|
||||
actors.hero.heroclass.mage_unlock=The Mage is an expert with wands, and carries a _unique magical staff._\n\nTo unlock him _use a scroll of upgrade to make an item stronger._
|
||||
actors.hero.heroclass.mage_desc_innate=The Mage starts with a _unique staff_ of magic missile. The staff recharges significantly faster than a wand, and has 1 more maximum charge.\n\nThe Mage's staff can be imbued with any wand he finds in the dungeon. Imbuing changes the staff's effect and can be used to transfer some upgrades.\n\nThe Mage automatically identifies:\n- Scrolls of Identify\n- Potions of Liquid Flame\n- Scrolls of Upgrade
|
||||
actors.hero.heroclass.mage_desc_loadout=The Mage starts with his staff as his melee weapon. The staff deals less melee damage than other starter weapons.\n\nThe Mage can use the magic in his staff to attack at range.\n\nThe Mage starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Mage starts with a _velvet pouch,_ which can store small items like seeds and runestones.
|
||||
actors.hero.heroclass.mage_desc_subclasses=A subclass can be chosen after defeating the second boss. The Mage has two subclasses:
|
||||
|
||||
actors.hero.heroclass.rogue=rogue
|
||||
actors.hero.heroclass.rogue_desc=The Rogue starts with a unique _Cloak of Shadows_, which he can use to become invisible at will.\n\nThe Rogue can _detect secrets and traps_ from a greater distance.\n\nThe Rogue also starts with _a dagger_, _three throwing knives_, cloth armor, a wasterskin, and a velvet pouch.\n\nThe Rogue automatically identifies:\n_-_Scrolls of Identify\n_-_ Potions of Invisibility\n_-_ Scrolls of Magic Mapping
|
||||
actors.hero.heroclass.rogue_unlock=The Rogue can control the flow of battle and strike from invisibility using his _unique cloak of shadows._\n\nTo unlock him _perform 10 surprise attacks in one run._
|
||||
actors.hero.heroclass.rogue_desc_innate=The Rogue starts with a unique artifact: the _Cloak of Shadows,_ which he can use to become invisible at will. Like all artifacts, the cloak becomes more powerful as it is used.\n\nThe Rogue can detect secrets and traps from a greater distance.\n\nThe Rogue automatically identifies:\n- Scrolls of Identify\n- Potions of Invisibility\n- Scrolls of Magic Mapping
|
||||
actors.hero.heroclass.rogue_desc_loadout=The Rogue starts with a _dagger,_ which deals more damage when surprising enemies.\n\nThe Rogue starts with _three throwing knives,_ which offer some ranged damage and deal more damage to surprised enemies.\n\nThe Rogue starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Rogue starts with a _velvet pouch,_ which can store small items like seeds and runestones.
|
||||
actors.hero.heroclass.rogue_desc_subclasses=A subclass can be chosen after defeating the second boss. The Rogue has two subclasses:
|
||||
|
||||
actors.hero.heroclass.huntress=huntress
|
||||
actors.hero.heroclass.huntress_desc=The Huntress starts with a _unique spirit bow,_ which can fire an infinite number of conjured arrows.\n\nThe Huntress can travel through tall grass _without trampling it_.\n\nThe Huntress also starts with _studded gloves_, cloth armor, a wasterskin, and a velvet pouch.\n\nThe Huntress automatically identifies:\n_-_ Scrolls of Identify\n_-_ Potions of Mind Vision\n_-_ Scrolls of Lullaby
|
||||
actors.hero.heroclass.huntress_unlock=The Huntress is a master of thrown weapons, and has a _unique magical bow_ with infinite arrows.\n\nTo unlock her _hit 15 different enemies with thrown weapons in one run._
|
||||
actors.hero.heroclass.huntress_desc_innate=The Huntress starts with a _unique spirit bow,_ which can fire an infinite number of conjured arrows. The bow steadily grows stronger as the huntress levels up, and can be augmented and enchanted.\n\nThe Huntress can travel through tall grass without trampling it.\n\nThe Huntress automatically identifies:\n- Scrolls of Identify\n- Potions of Mind Vision\n- Scrolls of Lullaby
|
||||
actors.hero.heroclass.huntress_desc_loadout=The Huntress starts with a pair of _studded gloves,_ which attack much faster than other starter weapons.\n\nThe Huntress starts with her bow as a ranged option.\n\nThe Huntress starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Huntress starts with a _velvet pouch,_ which can store small items like seeds and runestones.
|
||||
actors.hero.heroclass.huntress_desc_subclasses=A subclass can be chosen after defeating the second boss. The Huntress has two subclasses:
|
||||
|
||||
actors.hero.herosubclass.gladiator=gladiator
|
||||
actors.hero.herosubclass.gladiator_desc=A successful attack with a melee weapon allows the _Gladiator_ to start a combo. Building combo allows him to use unique combo moves.
|
||||
actors.hero.herosubclass.gladiator_short_desc=The _Gladiator_ builds combo when he makes successful attacks. He can spend combo to use unique combo moves.
|
||||
actors.hero.herosubclass.gladiator_desc=TODO
|
||||
actors.hero.herosubclass.berserker=berserker
|
||||
actors.hero.herosubclass.berserker_desc=The _Berserker_ builds rage as he takes damage, which increases his damage. When at full rage, he can refuse to die for a short time, at the cost of exhaustion.
|
||||
actors.hero.herosubclass.berserker_short_desc=The _Berserker_ builds rage as he takes damage. Rage increases his damage, and full rage lets him refuse to die for a short time.
|
||||
actors.hero.herosubclass.berserker_desc=TODO
|
||||
actors.hero.herosubclass.warlock=warlock
|
||||
actors.hero.herosubclass.warlock_desc=When using wands on an enemy, the _Warlock_ has a chance to mark their soul. Marked enemies will heal him whenever he attacks them with physical damage.
|
||||
actors.hero.herosubclass.warlock_short_desc=The _Warlock_ has a chance to mark a characters soul when using wands on them. Marked enemies will heal him whenever he attacks them with physical damage.
|
||||
actors.hero.herosubclass.warlock_desc=TODO
|
||||
actors.hero.herosubclass.battlemage=battlemage
|
||||
actors.hero.herosubclass.battlemage_desc=When fighting with his staff, the _Battlemage_ conjures bonus effects depending on the wand his staff is imbued with. His staff will also gain charge through combat.
|
||||
actors.hero.herosubclass.battlemage_short_desc=The _Battlemage_ conjures bonus effects when fighting in melee with his staff. These effects depend on the wand his staff is imbued with.
|
||||
actors.hero.herosubclass.battlemage_desc=TODO
|
||||
actors.hero.herosubclass.assassin=assassin
|
||||
actors.hero.herosubclass.assassin_desc=While invisible the _Assassin_ prepares a deadly strike on his next attack. The longer spent invisible, the more powerful the attack will be.
|
||||
actors.hero.herosubclass.assassin_short_desc=The _Assassin_ can prepare a deadly strike while he is invisible. The longer spent invisible, the more powerful the attack will be.
|
||||
actors.hero.herosubclass.assassin_desc=TODO
|
||||
actors.hero.herosubclass.freerunner=freerunner
|
||||
actors.hero.herosubclass.freerunner_desc=The _Freerunner_ builds momentum as he runs. Momentum can be used to start freerunning, which grants him 2x movespeed and bonus evasion for a short while.
|
||||
actors.hero.herosubclass.freerunner_short_desc=The _Freerunner_ builds momentum as he runs. Momentum can be used to start freerunning, which grants him bonus speed and evasion for a short while.
|
||||
actors.hero.herosubclass.freerunner_desc=TODO
|
||||
actors.hero.herosubclass.sniper=sniper
|
||||
actors.hero.herosubclass.sniper_desc=The _Sniper_ is a master of ranged combat. Her ranged attacks pierce armor, and after striking with a thrown weapon she can follow up with a special attack from her bow.
|
||||
actors.hero.herosubclass.sniper_short_desc=The _Sniper_ is a master of ranged combat. Her ranged attacks pierce armor, and after striking with a thrown weapon she can follow up with a special attack from her bow.
|
||||
actors.hero.herosubclass.sniper_desc=TODO
|
||||
actors.hero.herosubclass.warden=warden
|
||||
actors.hero.herosubclass.warden_desc=The _Warden_ has a strong connection to nature which allows her to see through tall grass and command furrowed grass to sprout around plants she grows. Plants she tramples will also give bonus effects.
|
||||
actors.hero.herosubclass.warden_short_desc=The _Warden_ has a strong connection to nature which allows her to see through tall grass and gives her bonus effects when she plants seeds and tramples plants.
|
||||
actors.hero.herosubclass.warden_desc=TODO
|
||||
|
||||
##talents
|
||||
|
||||
|
|
|
@ -58,11 +58,12 @@ windows.wndhero$statstab.health=Health
|
|||
windows.wndhero$statstab.gold=Gold Collected
|
||||
windows.wndhero$statstab.depth=Maximum Depth
|
||||
|
||||
windows.wndheroinfo.innate_title=innate powers
|
||||
windows.wndheroinfo.loadout_title=loadout
|
||||
windows.wndheroinfo.talents_title=talents
|
||||
windows.wndheroinfo.talents_desc=Talents are unlocked as the hero levels up.
|
||||
windows.wndheroinfo.subclasses_title=subclasses
|
||||
windows.wndheroinfo.talents=talents
|
||||
windows.wndheroinfo.talents_msg=Talents are unlocked as the hero levels up. Tier 2 talents start at level 6, more talents appear after defeating the second boss.
|
||||
windows.wndheroinfo.subclasses=subclasses
|
||||
windows.wndheroinfo.subclasses_msg=A subclass can be chosen after defeating the second boss.
|
||||
windows.wndheroinfo.abilities=armor abilities
|
||||
windows.wndheroinfo.abilities_msg=An armor ability can be chosen after defeating the fourth boss.
|
||||
|
||||
windows.wndimp.message=Oh yes! You are my hero!\nRegarding your reward, I don't have cash with me right now, but I have something better for you. This is my family heirloom ring: my granddad took it off a dead paladin's finger.
|
||||
windows.wndimp.reward=Take the ring
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.H
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.huntress.SpectralBlades;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.Mage2;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.Mage3;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.MoltenEarth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.mage.ElementalBlast;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.Rogue2;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.Rogue3;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.SmokeBomb;
|
||||
|
@ -200,6 +200,10 @@ public enum HeroClass {
|
|||
return Messages.get(HeroClass.class, name());
|
||||
}
|
||||
|
||||
public String desc(){
|
||||
return Messages.get(HeroClass.class, name()+"_desc");
|
||||
}
|
||||
|
||||
public HeroSubClass[] subClasses() {
|
||||
return subClasses;
|
||||
}
|
||||
|
@ -209,7 +213,7 @@ public enum HeroClass {
|
|||
case WARRIOR: default:
|
||||
return new ArmorAbility[]{new HeroicLeap(), new Shockwave(), new Warrior3()};
|
||||
case MAGE:
|
||||
return new ArmorAbility[]{new MoltenEarth(), new Mage2(), new Mage3()};
|
||||
return new ArmorAbility[]{new ElementalBlast(), new Mage2(), new Mage3()};
|
||||
case ROGUE:
|
||||
return new ArmorAbility[]{new SmokeBomb(), new Rogue2(), new Rogue3()};
|
||||
case HUNTRESS:
|
||||
|
|
|
@ -45,7 +45,11 @@ public enum HeroSubClass {
|
|||
public String title() {
|
||||
return Messages.get(this, name());
|
||||
}
|
||||
|
||||
|
||||
public String shortDesc() {
|
||||
return Messages.get(this, name()+"_short_desc");
|
||||
}
|
||||
|
||||
public String desc() {
|
||||
return Messages.get(this, name()+"_desc");
|
||||
}
|
||||
|
|
|
@ -70,6 +70,10 @@ public abstract class ArmorAbility implements Bundlable {
|
|||
return Messages.get(this, "name");
|
||||
}
|
||||
|
||||
public String shortDesc(){
|
||||
return Messages.get(this, "short_desc");
|
||||
}
|
||||
|
||||
public String desc(){
|
||||
return Messages.get(this, "desc");
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ public class TalentsPane extends ScrollPane {
|
|||
|
||||
private int tier;
|
||||
|
||||
RenderedTextBlock title;
|
||||
public RenderedTextBlock title;
|
||||
ArrayList<TalentButton> buttons;
|
||||
|
||||
ArrayList<Image> stars = new ArrayList<>();
|
||||
|
|
|
@ -35,12 +35,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.WndInfoArmorAbility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.WndInfoSubclass;
|
||||
import com.watabou.noosa.Image;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
public class WndChooseAbility extends Window {
|
||||
|
||||
private static final int WIDTH = 130;
|
||||
|
@ -69,7 +65,7 @@ public class WndChooseAbility extends Window {
|
|||
float pos = body.bottom() + 3*GAP;
|
||||
for (ArmorAbility ability : hero.heroClass.armorAbilities()) {
|
||||
|
||||
RedButton abilityButton = new RedButton("_" + Messages.titleCase(ability.name()) + ":_ " + ability.desc(), 6){
|
||||
RedButton abilityButton = new RedButton("_" + Messages.titleCase(ability.name()) + ":_ " + ability.shortDesc(), 6){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
GameScene.show(new WndOptions(new Image(hero.heroClass.spritesheet(), 0, 90, 12, 15),
|
||||
|
|
|
@ -34,8 +34,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.WndInfoSubclass;
|
||||
import com.watabou.noosa.RenderedText;
|
||||
|
||||
public class WndChooseSubclass extends Window {
|
||||
|
||||
|
@ -60,7 +58,7 @@ public class WndChooseSubclass extends Window {
|
|||
float pos = message.bottom() + 3*GAP;
|
||||
|
||||
for (HeroSubClass subCls : hero.heroClass.subClasses()){
|
||||
RedButton btnCls = new RedButton( subCls.desc(), 6 ) {
|
||||
RedButton btnCls = new RedButton( subCls.shortDesc(), 6 ) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
GameScene.show(new WndOptions(subCls.icon(),
|
||||
|
|
|
@ -1,167 +0,0 @@
|
|||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2021 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.watabou.noosa.Group;
|
||||
|
||||
public class WndClass extends WndTabbed {
|
||||
|
||||
private static final int WIDTH = 110;
|
||||
|
||||
private static final int TAB_WIDTH = 50;
|
||||
|
||||
private HeroClass cl;
|
||||
|
||||
private PerksTab tabPerks;
|
||||
private MasteryTab tabMastery;
|
||||
|
||||
public WndClass( HeroClass cl ) {
|
||||
|
||||
super();
|
||||
|
||||
this.cl = cl;
|
||||
|
||||
tabPerks = new PerksTab();
|
||||
add( tabPerks );
|
||||
|
||||
Tab tab = new RankingTab( cl.title().toUpperCase(), tabPerks );
|
||||
tab.setSize( TAB_WIDTH, tabHeight() );
|
||||
add( tab );
|
||||
|
||||
if (Badges.isUnlocked( cl.masteryBadge() )) {
|
||||
tabMastery = new MasteryTab();
|
||||
add( tabMastery );
|
||||
|
||||
tab = new RankingTab( Messages.get(this, "mastery"), tabMastery );
|
||||
add( tab );
|
||||
|
||||
resize(
|
||||
(int)Math.max( tabPerks.width, tabMastery.width ),
|
||||
(int)Math.max( tabPerks.height, tabMastery.height ) );
|
||||
} else {
|
||||
resize( (int)tabPerks.width, (int)tabPerks.height );
|
||||
}
|
||||
|
||||
layoutTabs();
|
||||
|
||||
select( 0 );
|
||||
}
|
||||
|
||||
private class RankingTab extends LabeledTab {
|
||||
|
||||
private Group page;
|
||||
|
||||
public RankingTab( String label, Group page ) {
|
||||
super( label );
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void select( boolean value ) {
|
||||
super.select( value );
|
||||
if (page != null) {
|
||||
page.visible = page.active = selected;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class PerksTab extends Group {
|
||||
|
||||
private static final int MARGIN = 4;
|
||||
private static final int GAP = 4;
|
||||
|
||||
public float height;
|
||||
public float width;
|
||||
|
||||
public PerksTab() {
|
||||
super();
|
||||
|
||||
float dotWidth = 0;
|
||||
|
||||
String[] items = cl.perks();
|
||||
float pos = MARGIN;
|
||||
|
||||
for (int i=0; i < items.length; i++) {
|
||||
|
||||
if (i > 0) {
|
||||
pos += GAP;
|
||||
}
|
||||
|
||||
RenderedTextBlock item = PixelScene.renderTextBlock( "-" + items[i], 6 );
|
||||
item.maxWidth((int)(WIDTH - MARGIN * 2 - dotWidth));
|
||||
item.setPos(0, pos);
|
||||
add( item );
|
||||
|
||||
pos += item.height();
|
||||
float w = item.width();
|
||||
if (w > width) {
|
||||
width = w;
|
||||
}
|
||||
}
|
||||
|
||||
width += MARGIN + dotWidth;
|
||||
height = pos + MARGIN;
|
||||
}
|
||||
}
|
||||
|
||||
private class MasteryTab extends Group {
|
||||
|
||||
private static final int MARGIN = 4;
|
||||
|
||||
public float height;
|
||||
public float width;
|
||||
|
||||
public MasteryTab() {
|
||||
super();
|
||||
|
||||
String message = null;
|
||||
switch (cl) {
|
||||
case WARRIOR:
|
||||
message = HeroSubClass.GLADIATOR.desc() + "\n\n" + HeroSubClass.BERSERKER.desc();
|
||||
break;
|
||||
case MAGE:
|
||||
message = HeroSubClass.BATTLEMAGE.desc() + "\n\n" + HeroSubClass.WARLOCK.desc();
|
||||
break;
|
||||
case ROGUE:
|
||||
message = HeroSubClass.FREERUNNER.desc() + "\n\n" + HeroSubClass.ASSASSIN.desc();
|
||||
break;
|
||||
case HUNTRESS:
|
||||
message = HeroSubClass.SNIPER.desc() + "\n\n" + HeroSubClass.WARDEN.desc();
|
||||
break;
|
||||
}
|
||||
|
||||
RenderedTextBlock text = PixelScene.renderTextBlock( 6 );
|
||||
text.text( message, WIDTH - MARGIN * 2 );
|
||||
text.setPos( MARGIN, MARGIN );
|
||||
add( text );
|
||||
|
||||
height = text.bottom() + MARGIN;
|
||||
width = text.right() + MARGIN;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,198 +21,338 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.IconButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TalentsPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.watabou.noosa.Game;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.ui.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public class WndHeroInfo extends WndTabbed {
|
||||
|
||||
private RenderedTextBlock title;
|
||||
private RenderedTextBlock info;
|
||||
private HeroInfoTab heroInfo;
|
||||
private TalentInfoTab talentInfo;
|
||||
private SubclassInfoTab subclassInfo;
|
||||
private ArmorAbilityInfoTab abilityInfo;
|
||||
|
||||
private TalentsPane talents;
|
||||
private RedButton firstSub;
|
||||
private RedButton secondSub;
|
||||
|
||||
private int WIDTH = 120;
|
||||
private int HEIGHT = 125;
|
||||
private int MARGIN = 2;
|
||||
private int INFO_WIDTH = WIDTH - MARGIN*2;
|
||||
|
||||
private static boolean secondSubclass = false;
|
||||
private static int WIDTH = 120;
|
||||
private static int HEIGHT = 125;
|
||||
private static int MARGIN = 2;
|
||||
|
||||
public WndHeroInfo( HeroClass cl ){
|
||||
|
||||
title = PixelScene.renderTextBlock(9);
|
||||
title.hardlight(TITLE_COLOR);
|
||||
add(title);
|
||||
|
||||
info = PixelScene.renderTextBlock(6);
|
||||
add(info);
|
||||
|
||||
ArrayList<LinkedHashMap<Talent, Integer>> talentList = new ArrayList<>();
|
||||
Talent.initClassTalents(cl, talentList);
|
||||
Talent.initSubclassTalents(cl.subClasses()[secondSubclass ? 1 : 0], talentList);
|
||||
talents = new TalentsPane(false, talentList);
|
||||
add(talents);
|
||||
|
||||
boolean subsAvailable = Badges.isUnlocked(Badges.Badge.LEVEL_REACHED_2) && Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_2);
|
||||
|
||||
firstSub = new RedButton(Messages.titleCase(cl.subClasses()[0].title()), 7){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
if (secondSubclass){
|
||||
secondSubclass = false;
|
||||
hide();
|
||||
WndHeroInfo newWindow = new WndHeroInfo(cl);
|
||||
newWindow.talents.scrollTo(0, talents.content().camera.scroll.y);
|
||||
newWindow.select(2);
|
||||
ShatteredPixelDungeon.scene().addToFront(newWindow);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!secondSubclass) firstSub.textColor(Window.TITLE_COLOR);
|
||||
firstSub.setSize(40, firstSub.reqHeight()+2);
|
||||
if (subsAvailable) add(firstSub);
|
||||
|
||||
secondSub = new RedButton(Messages.titleCase(cl.subClasses()[1].title()), 7){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
if (!secondSubclass){
|
||||
secondSubclass = true;
|
||||
hide();
|
||||
WndHeroInfo newWindow = new WndHeroInfo(cl);
|
||||
newWindow.talents.scrollTo(0, talents.content().camera.scroll.y);
|
||||
newWindow.select(2);
|
||||
ShatteredPixelDungeon.scene().addToFront(newWindow);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (secondSubclass) secondSub.textColor(Window.TITLE_COLOR);
|
||||
secondSub.setSize(40, secondSub.reqHeight()+2);
|
||||
if (subsAvailable) add(secondSub);
|
||||
|
||||
Tab tab;
|
||||
Image[] tabIcons;
|
||||
Image tabIcon;
|
||||
switch (cl){
|
||||
case WARRIOR: default:
|
||||
tabIcons = new Image[]{
|
||||
new ItemSprite(ItemSpriteSheet.SEAL, null),
|
||||
new ItemSprite(ItemSpriteSheet.WORN_SHORTSWORD, null)
|
||||
};
|
||||
tabIcon = new ItemSprite(ItemSpriteSheet.SEAL, null);
|
||||
break;
|
||||
case MAGE:
|
||||
tabIcons = new Image[]{
|
||||
new ItemSprite(ItemSpriteSheet.MAGES_STAFF, null),
|
||||
new ItemSprite(ItemSpriteSheet.MAGES_STAFF, null)
|
||||
};
|
||||
tabIcon = new ItemSprite(ItemSpriteSheet.MAGES_STAFF, null);
|
||||
break;
|
||||
case ROGUE:
|
||||
tabIcons = new Image[]{
|
||||
new ItemSprite(ItemSpriteSheet.ARTIFACT_CLOAK, null),
|
||||
new ItemSprite(ItemSpriteSheet.DAGGER, null)
|
||||
};
|
||||
tabIcon = new ItemSprite(ItemSpriteSheet.ARTIFACT_CLOAK, null);
|
||||
break;
|
||||
case HUNTRESS:
|
||||
tabIcons = new Image[]{
|
||||
new ItemSprite(ItemSpriteSheet.SPIRIT_BOW, null),
|
||||
new ItemSprite(ItemSpriteSheet.GLOVES, null)
|
||||
};
|
||||
tabIcon = new ItemSprite(ItemSpriteSheet.SPIRIT_BOW, null);
|
||||
break;
|
||||
}
|
||||
|
||||
tab = new IconTab( tabIcons[0] ){
|
||||
@Override
|
||||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
if (value){
|
||||
title.text(Messages.titleCase(Messages.get(WndHeroInfo.class, "innate_title")));
|
||||
info.text(Messages.get(cl, cl.name() + "_desc_innate"), INFO_WIDTH);
|
||||
}
|
||||
}
|
||||
};
|
||||
add(tab);
|
||||
heroInfo = new HeroInfoTab(cl);
|
||||
add(heroInfo);
|
||||
heroInfo.setSize(WIDTH, HEIGHT);
|
||||
|
||||
tab = new IconTab( tabIcons[1] ){
|
||||
add( new IconTab( tabIcon ){
|
||||
@Override
|
||||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
if (value){
|
||||
title.text(Messages.titleCase(Messages.get(WndHeroInfo.class, "loadout_title")));
|
||||
info.text(Messages.get(cl, cl.name() + "_desc_loadout"), INFO_WIDTH);
|
||||
}
|
||||
heroInfo.visible = heroInfo.active = value;
|
||||
}
|
||||
};
|
||||
add(tab);
|
||||
});
|
||||
|
||||
tab = new IconTab( Icons.get(Icons.TALENT) ){
|
||||
@Override
|
||||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
if (value){
|
||||
title.text(Messages.titleCase(Messages.get(WndHeroInfo.class, "talents_title")));
|
||||
info.text(Messages.get(WndHeroInfo.class, "talents_desc"), INFO_WIDTH);
|
||||
}
|
||||
talents.visible = talents.active = value;
|
||||
firstSub.visible = firstSub.active = value;
|
||||
secondSub.visible = secondSub.active = value;
|
||||
}
|
||||
};
|
||||
add(tab);
|
||||
talentInfo = new TalentInfoTab(cl);
|
||||
add(talentInfo);
|
||||
talentInfo.setSize(WIDTH, HEIGHT);
|
||||
|
||||
tab = new IconTab(new ItemSprite(ItemSpriteSheet.MASTERY, null)){
|
||||
add( new IconTab( Icons.get(Icons.TALENT) ){
|
||||
@Override
|
||||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
if (value){
|
||||
title.text(Messages.titleCase(Messages.get(WndHeroInfo.class, "subclasses_title")));
|
||||
String msg = Messages.get(cl, cl.name() + "_desc_subclasses");
|
||||
for (HeroSubClass sub : cl.subClasses()){
|
||||
msg += "\n\n" + sub.desc();
|
||||
}
|
||||
info.text(msg, INFO_WIDTH);
|
||||
}
|
||||
talentInfo.visible = talentInfo.active = value;
|
||||
}
|
||||
};
|
||||
add(tab);
|
||||
});
|
||||
|
||||
if (Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_2)) {
|
||||
subclassInfo = new SubclassInfoTab(cl);
|
||||
add(subclassInfo);
|
||||
subclassInfo.setSize(WIDTH, HEIGHT);
|
||||
|
||||
add(new IconTab(new ItemSprite(ItemSpriteSheet.MASK, null)) {
|
||||
@Override
|
||||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
subclassInfo.visible = subclassInfo.active = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (Badges.isUnlocked(Badges.Badge.BOSS_SLAIN_4)) {
|
||||
abilityInfo = new ArmorAbilityInfoTab(cl);
|
||||
add(abilityInfo);
|
||||
abilityInfo.setSize(WIDTH, HEIGHT);
|
||||
|
||||
add(new IconTab(new ItemSprite(ItemSpriteSheet.CROWN, null)) {
|
||||
@Override
|
||||
protected void select(boolean value) {
|
||||
super.select(value);
|
||||
abilityInfo.visible = abilityInfo.active = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
resize(WIDTH, HEIGHT);
|
||||
|
||||
layoutTabs();
|
||||
talentInfo.layout();
|
||||
|
||||
select(0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void select(Tab tab) {
|
||||
super.select(tab);
|
||||
private static class HeroInfoTab extends Component {
|
||||
|
||||
title.setPos((WIDTH-title.width())/2, MARGIN);
|
||||
info.setPos(MARGIN, title.bottom()+2*MARGIN);
|
||||
private RenderedTextBlock title;
|
||||
private RenderedTextBlock[] info;
|
||||
private Image[] icons;
|
||||
|
||||
firstSub.setPos((title.left() - firstSub.width())/2, 0);
|
||||
secondSub.setPos(title.right() + (WIDTH - title.right() - secondSub.width())/2, 0);
|
||||
public HeroInfoTab(HeroClass cls){
|
||||
super();
|
||||
title = PixelScene.renderTextBlock(Messages.titleCase(cls.title()), 9);
|
||||
title.hardlight(TITLE_COLOR);
|
||||
add(title);
|
||||
|
||||
talents.setRect(0, info.bottom()+MARGIN, WIDTH, HEIGHT - (info.bottom()+MARGIN));
|
||||
String[] desc_entries = cls.desc().split("\n\n");
|
||||
|
||||
resize(WIDTH, Math.max(HEIGHT, (int)info.bottom()));
|
||||
info = new RenderedTextBlock[desc_entries.length];
|
||||
|
||||
layoutTabs();
|
||||
for (int i = 0; i < desc_entries.length; i++){
|
||||
info[i] = PixelScene.renderTextBlock(desc_entries[i], 6);
|
||||
add(info[i]);
|
||||
}
|
||||
|
||||
switch (cls){
|
||||
case WARRIOR: default:
|
||||
icons = new Image[]{ new ItemSprite(ItemSpriteSheet.SEAL),
|
||||
new ItemSprite(ItemSpriteSheet.WORN_SHORTSWORD),
|
||||
new ItemSprite(ItemSpriteSheet.SCROLL_ISAZ)};
|
||||
break;
|
||||
case MAGE:
|
||||
icons = new Image[]{ new ItemSprite(ItemSpriteSheet.MAGES_STAFF),
|
||||
new ItemSprite(ItemSpriteSheet.WAND_MAGIC_MISSILE),
|
||||
new ItemSprite(ItemSpriteSheet.SCROLL_ISAZ)};
|
||||
break;
|
||||
case ROGUE:
|
||||
icons = new Image[]{ new ItemSprite(ItemSpriteSheet.ARTIFACT_CLOAK),
|
||||
Icons.get(Icons.DEPTH),
|
||||
new ItemSprite(ItemSpriteSheet.DAGGER),
|
||||
new ItemSprite(ItemSpriteSheet.SCROLL_ISAZ)};
|
||||
break;
|
||||
case HUNTRESS:
|
||||
icons = new Image[]{ new ItemSprite(ItemSpriteSheet.SPIRIT_BOW),
|
||||
new Image(Assets.Environment.TILES_SEWERS, 112, 96, 16, 16),
|
||||
new ItemSprite(ItemSpriteSheet.GLOVES),
|
||||
new ItemSprite(ItemSpriteSheet.SCROLL_ISAZ)};
|
||||
break;
|
||||
}
|
||||
for (Image im : icons) {
|
||||
add(im);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
|
||||
title.setPos((width-title.width())/2, MARGIN);
|
||||
|
||||
float pos = title.bottom()+4*MARGIN;
|
||||
|
||||
for (int i = 0; i < info.length; i++){
|
||||
info[i].maxWidth((int)width - 20);
|
||||
info[i].setPos(20, pos);
|
||||
|
||||
icons[i].x = (20-icons[i].width())/2;
|
||||
icons[i].y = info[i].top() + (info[i].height() - icons[i].height())/2;
|
||||
|
||||
pos = info[i].bottom() + 4*MARGIN;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static class TalentInfoTab extends Component {
|
||||
|
||||
private RenderedTextBlock title;
|
||||
private RenderedTextBlock message;
|
||||
private TalentsPane talentPane;
|
||||
|
||||
public TalentInfoTab( HeroClass cls ){
|
||||
super();
|
||||
title = PixelScene.renderTextBlock(Messages.titleCase(Messages.get(WndHeroInfo.class, "talents")), 9);
|
||||
title.hardlight(TITLE_COLOR);
|
||||
add(title);
|
||||
|
||||
message = PixelScene.renderTextBlock(Messages.get(WndHeroInfo.class, "talents_msg"), 6);
|
||||
add(message);
|
||||
|
||||
ArrayList<LinkedHashMap<Talent, Integer>> talents = new ArrayList<>();
|
||||
Talent.initClassTalents(cls, talents);
|
||||
talents.get(2).clear(); //we show T3 talents with subclasses
|
||||
|
||||
talentPane = new TalentsPane(false, talents);
|
||||
add(talentPane);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
|
||||
title.setPos((width-title.width())/2, MARGIN);
|
||||
message.maxWidth((int)width);
|
||||
message.setPos(0, title.bottom()+4*MARGIN);
|
||||
|
||||
talentPane.setRect(0, message.bottom() + MARGIN, width, height-message.bottom());
|
||||
}
|
||||
}
|
||||
|
||||
private static class SubclassInfoTab extends Component {
|
||||
|
||||
private RenderedTextBlock title;
|
||||
private RenderedTextBlock message;
|
||||
private RenderedTextBlock[] subClsDescs;
|
||||
private IconButton[] subClsInfos;
|
||||
|
||||
public SubclassInfoTab( HeroClass cls ){
|
||||
super();
|
||||
title = PixelScene.renderTextBlock(Messages.titleCase(Messages.get(WndHeroInfo.class, "subclasses")), 9);
|
||||
title.hardlight(TITLE_COLOR);
|
||||
add(title);
|
||||
|
||||
message = PixelScene.renderTextBlock(Messages.get(WndHeroInfo.class, "subclasses_msg"), 6);
|
||||
add(message);
|
||||
|
||||
HeroSubClass[] subClasses = cls.subClasses();
|
||||
|
||||
subClsDescs = new RenderedTextBlock[subClasses.length];
|
||||
subClsInfos = new IconButton[subClasses.length];
|
||||
|
||||
for (int i = 0; i < subClasses.length; i++){
|
||||
subClsDescs[i] = PixelScene.renderTextBlock(subClasses[i].shortDesc(), 6);
|
||||
int finalI = i;
|
||||
subClsInfos[i] = new IconButton( Icons.get(Icons.INFO) ){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
Game.scene().addToFront(new WndInfoSubclass(cls, subClasses[finalI]));
|
||||
}
|
||||
};
|
||||
add(subClsDescs[i]);
|
||||
add(subClsInfos[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
|
||||
title.setPos((width-title.width())/2, MARGIN);
|
||||
message.maxWidth((int)width);
|
||||
message.setPos(0, title.bottom()+4*MARGIN);
|
||||
|
||||
float pos = message.bottom()+4*MARGIN;
|
||||
|
||||
for (int i = 0; i < subClsDescs.length; i++){
|
||||
subClsDescs[i].maxWidth((int)width - 20);
|
||||
subClsDescs[i].setPos(0, pos);
|
||||
|
||||
subClsInfos[i].setRect(width-20, subClsDescs[i].top() + (subClsDescs[i].height()-20)/2, 20, 20);
|
||||
|
||||
pos = subClsDescs[i].bottom() + 4*MARGIN;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static class ArmorAbilityInfoTab extends Component {
|
||||
|
||||
private RenderedTextBlock title;
|
||||
private RenderedTextBlock message;
|
||||
private RenderedTextBlock[] abilityDescs;
|
||||
private IconButton[] abilityInfos;
|
||||
|
||||
public ArmorAbilityInfoTab(HeroClass cls){
|
||||
super();
|
||||
title = PixelScene.renderTextBlock(Messages.titleCase(Messages.get(WndHeroInfo.class, "abilities")), 9);
|
||||
title.hardlight(TITLE_COLOR);
|
||||
add(title);
|
||||
|
||||
message = PixelScene.renderTextBlock(Messages.get(WndHeroInfo.class, "abilities_msg"), 6);
|
||||
add(message);
|
||||
|
||||
ArmorAbility[] abilities = cls.armorAbilities();
|
||||
|
||||
abilityDescs = new RenderedTextBlock[abilities.length];
|
||||
abilityInfos = new IconButton[abilities.length];
|
||||
|
||||
for (int i = 0; i < abilities.length; i++){
|
||||
abilityDescs[i] = PixelScene.renderTextBlock(abilities[i].shortDesc(), 6);
|
||||
int finalI = i;
|
||||
abilityInfos[i] = new IconButton( Icons.get(Icons.INFO) ){
|
||||
@Override
|
||||
protected void onClick() {
|
||||
Game.scene().addToFront(new WndInfoArmorAbility(cls, abilities[finalI]));
|
||||
}
|
||||
};
|
||||
add(abilityDescs[i]);
|
||||
add(abilityInfos[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void layout() {
|
||||
super.layout();
|
||||
|
||||
title.setPos((width-title.width())/2, MARGIN);
|
||||
message.maxWidth((int)width);
|
||||
message.setPos(0, title.bottom()+4*MARGIN);
|
||||
|
||||
float pos = message.bottom()+4*MARGIN;
|
||||
|
||||
for (int i = 0; i < abilityDescs.length; i++){
|
||||
abilityDescs[i].maxWidth((int)width - 20);
|
||||
abilityDescs[i].setPos(0, pos);
|
||||
|
||||
abilityInfos[i].setRect(width-20, abilityDescs[i].top() + (abilityDescs[i].height()-20)/2, 20, 20);
|
||||
|
||||
pos = abilityDescs[i].bottom() + 4*MARGIN;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHeroInfo;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndTitledMessage;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TalentsPane;
|
||||
import com.watabou.noosa.Image;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -14,14 +13,13 @@ import java.util.LinkedHashMap;
|
|||
public class WndInfoArmorAbility extends WndTitledMessage {
|
||||
|
||||
public WndInfoArmorAbility(HeroClass cls, ArmorAbility ability){
|
||||
//TODO longer descriptions?
|
||||
super( new Image(cls.spritesheet(), 0, 90, 12, 15), Messages.titleCase(ability.name()), ability.desc());
|
||||
|
||||
ArrayList<LinkedHashMap<Talent, Integer>> talentList = new ArrayList<>();
|
||||
Talent.initArmorTalents(ability, talentList);
|
||||
|
||||
TalentsPane.TalentTierPane talentPane = new TalentsPane.TalentTierPane(talentList.get(3), 4, false);
|
||||
talentPane.title.text( Messages.titleCase(Messages.get(WndHeroInfo.class, "talents_title")));
|
||||
talentPane.title.text( Messages.titleCase(Messages.get(WndHeroInfo.class, "talents")));
|
||||
talentPane.setRect(0, height + 5, width, talentPane.height());
|
||||
add(talentPane);
|
||||
resize(width, (int) talentPane.bottom());
|
|
@ -1,9 +1,10 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.ui;
|
||||
package com.shatteredpixel.shatteredpixeldungeon.windows;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.TalentsPane;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHeroInfo;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndTitledMessage;
|
||||
|
||||
|
@ -13,7 +14,6 @@ import java.util.LinkedHashMap;
|
|||
public class WndInfoSubclass extends WndTitledMessage {
|
||||
|
||||
public WndInfoSubclass(HeroClass cls, HeroSubClass subCls){
|
||||
//TODO longer subclass description?
|
||||
super( subCls.icon(), Messages.titleCase(subCls.title()), subCls.desc());
|
||||
|
||||
ArrayList<LinkedHashMap<Talent, Integer>> talentList = new ArrayList<>();
|
||||
|
@ -21,7 +21,7 @@ public class WndInfoSubclass extends WndTitledMessage {
|
|||
Talent.initSubclassTalents(subCls, talentList);
|
||||
|
||||
TalentsPane.TalentTierPane talentPane = new TalentsPane.TalentTierPane(talentList.get(2), 3, false);
|
||||
talentPane.title.text( Messages.titleCase(Messages.get(WndHeroInfo.class, "talents_title")));
|
||||
talentPane.title.text( Messages.titleCase(Messages.get(WndHeroInfo.class, "talents")));
|
||||
talentPane.setRect(0, height + 5, width, talentPane.height());
|
||||
add(talentPane);
|
||||
resize(width, (int) talentPane.bottom());
|
|
@ -267,7 +267,7 @@ public class WndStartGame extends Window {
|
|||
if (cl == null) return;
|
||||
String msg = Messages.get(cl, cl.name() + "_desc_subclasses");
|
||||
for (HeroSubClass sub : cl.subClasses()){
|
||||
msg += "\n\n" + sub.desc();
|
||||
msg += "\n\n" + sub.shortDesc();
|
||||
}
|
||||
ShatteredPixelDungeon.scene().addToFront(new WndMessage(msg));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user