v2.0.2: overhauled action indicator functionality
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.8 KiB |
+13
-2
@@ -32,6 +32,8 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIcon;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.DangerIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
@@ -241,8 +243,17 @@ public class Berserk extends Buff implements ActionIndicator.Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
//TODO, should look into these in general honestly
|
return new HeroIcon(HeroIcon.BERSERK);
|
||||||
return new BuffIcon(BuffIndicator.FURY, true);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image secondIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
return 0x660000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+26
-14
@@ -42,6 +42,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndCombo;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndCombo;
|
||||||
@@ -71,7 +72,7 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
|||||||
public void tintIcon(Image icon) {
|
public void tintIcon(Image icon) {
|
||||||
ComboMove move = getHighestMove();
|
ComboMove move = getHighestMove();
|
||||||
if (move != null){
|
if (move != null){
|
||||||
icon.hardlight(move.tintColor & 0x00FFFFFF);
|
icon.hardlight(move.tintColor);
|
||||||
} else {
|
} else {
|
||||||
icon.resetColor();
|
icon.resetColor();
|
||||||
}
|
}
|
||||||
@@ -175,15 +176,26 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
Image icon;
|
return new HeroIcon(HeroIcon.COMBO);
|
||||||
if (((Hero)target).belongings.weapon() != null){
|
}
|
||||||
icon = new ItemSprite(((Hero)target).belongings.weapon().image, null);
|
|
||||||
} else {
|
|
||||||
icon = new ItemSprite(new Item(){ {image = ItemSpriteSheet.WEAPON_HOLDER; }});
|
|
||||||
}
|
|
||||||
|
|
||||||
icon.tint(getHighestMove().tintColor);
|
@Override
|
||||||
return icon;
|
public Image secondIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
ComboMove best = getHighestMove();
|
||||||
|
if (best == null) {
|
||||||
|
return 0xDFDFDF;
|
||||||
|
} else {
|
||||||
|
//take the tint color and darken slightly to match buff icon
|
||||||
|
int r = (int) ((best.tintColor & 0xFF) * 0.875f);
|
||||||
|
int g = (int) (((best.tintColor >> 8) & 0xFF) * 0.875f);
|
||||||
|
int b = (int) ((best.tintColor & 0xFF) * 0.875f);
|
||||||
|
return (r << 16) + (g << 8) + b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -192,11 +204,11 @@ public class Combo extends Buff implements ActionIndicator.Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum ComboMove {
|
public enum ComboMove {
|
||||||
CLOBBER(2, 0xFF00FF00),
|
CLOBBER(2, 0x00FF00),
|
||||||
SLAM (4, 0xFFCCFF00),
|
SLAM (4, 0xCCFF00),
|
||||||
PARRY (6, 0xFFFFFF00),
|
PARRY (6, 0xFFFF00),
|
||||||
CRUSH (8, 0xFFFFCC00),
|
CRUSH (8, 0xFFCC00),
|
||||||
FURY (10, 0xFFFF0000);
|
FURY (10, 0xFF0000);
|
||||||
|
|
||||||
public int comboReq, tintColor;
|
public int comboReq, tintColor;
|
||||||
|
|
||||||
|
|||||||
+14
-3
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIcon;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
@@ -206,9 +207,19 @@ public class Momentum extends Buff implements ActionIndicator.Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
Image im = new BuffIcon(BuffIndicator.HASTE, true);
|
Image actionIco = new HeroIcon(HeroIcon.MOMENTUM);
|
||||||
im.hardlight(0x99992E);
|
actionIco.hardlight(1, 1, 0);
|
||||||
return im;
|
return actionIco;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image secondIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
return 0x444444;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+17
-1
@@ -42,12 +42,14 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.features.Door;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndMonkAbilities;
|
import com.shatteredpixel.shatteredpixeldungeon.windows.WndMonkAbilities;
|
||||||
|
import com.watabou.noosa.BitmapText;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
@@ -242,7 +244,21 @@ public class MonkEnergy extends Buff implements ActionIndicator.Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
return new HeroIcon(HeroSubClass.MONK);
|
return new HeroIcon(HeroIcon.MONK_ABILITIES);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image secondIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
if (abilitiesEmpowered(Dungeon.hero)){
|
||||||
|
return 0xA0FF40;
|
||||||
|
} else {
|
||||||
|
return 0xA08840;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+12
-1
@@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
@@ -252,10 +253,20 @@ public class Preparation extends Buff implements ActionIndicator.Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
Image actionIco = Effects.get(Effects.Type.WOUND);
|
Image actionIco = new HeroIcon(HeroIcon.PREPARATION);
|
||||||
tintIcon(actionIco);
|
tintIcon(actionIco);
|
||||||
return actionIco;
|
return actionIco;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image secondIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
return 0x444444;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAction() {
|
public void doAction() {
|
||||||
|
|||||||
+13
-2
@@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
@@ -114,9 +115,19 @@ public class SnipersMark extends FlavourBuff implements ActionIndicator.Action {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
return new ItemSprite(ItemSpriteSheet.SPIRIT_BOW, null);
|
return new HeroIcon(HeroIcon.SNIPERS_MARK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image secondIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
return 0x444444;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAction() {
|
public void doAction() {
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ abstract public class KindOfWeapon extends EquipableItem {
|
|||||||
activate( hero );
|
activate( hero );
|
||||||
Talent.onItemEquipped(hero, this);
|
Talent.onItemEquipped(hero, this);
|
||||||
Badges.validateDuelistUnlock();
|
Badges.validateDuelistUnlock();
|
||||||
ActionIndicator.updateIcon();
|
ActionIndicator.refresh();
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
|
|
||||||
cursedKnown = true;
|
cursedKnown = true;
|
||||||
@@ -152,7 +152,7 @@ abstract public class KindOfWeapon extends EquipableItem {
|
|||||||
activate( hero );
|
activate( hero );
|
||||||
Talent.onItemEquipped(hero, this);
|
Talent.onItemEquipped(hero, this);
|
||||||
Badges.validateDuelistUnlock();
|
Badges.validateDuelistUnlock();
|
||||||
ActionIndicator.updateIcon();
|
ActionIndicator.refresh();
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
|
|
||||||
cursedKnown = true;
|
cursedKnown = true;
|
||||||
|
|||||||
+27
-8
@@ -29,25 +29,23 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Barrier;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LockedFloor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.LostInventory;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MonkEnergy;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MonkEnergy;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Transmuting;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.CellSelector;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.ActionIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.AttackIndicator;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
@@ -153,7 +151,7 @@ public class MeleeWeapon extends Weapon {
|
|||||||
@Override
|
@Override
|
||||||
public boolean doEquip(Hero hero) {
|
public boolean doEquip(Hero hero) {
|
||||||
if (super.doEquip(hero)){
|
if (super.doEquip(hero)){
|
||||||
ActionIndicator.updateIcon();
|
ActionIndicator.refresh();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -162,7 +160,7 @@ public class MeleeWeapon extends Weapon {
|
|||||||
@Override
|
@Override
|
||||||
public boolean equipSecondary(Hero hero) {
|
public boolean equipSecondary(Hero hero) {
|
||||||
if (super.equipSecondary(hero)){
|
if (super.equipSecondary(hero)){
|
||||||
ActionIndicator.updateIcon();
|
ActionIndicator.refresh();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -171,7 +169,7 @@ public class MeleeWeapon extends Weapon {
|
|||||||
@Override
|
@Override
|
||||||
public boolean doUnequip(Hero hero, boolean collect, boolean single) {
|
public boolean doUnequip(Hero hero, boolean collect, boolean single) {
|
||||||
if (super.doUnequip(hero, collect, single)){
|
if (super.doUnequip(hero, collect, single)){
|
||||||
ActionIndicator.updateIcon();
|
ActionIndicator.refresh();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -551,11 +549,32 @@ public class MeleeWeapon extends Weapon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Image actionIcon() {
|
public Image actionIcon() {
|
||||||
|
Image ico;
|
||||||
if (Dungeon.hero.belongings.weapon == null){
|
if (Dungeon.hero.belongings.weapon == null){
|
||||||
return new ItemSprite(ItemSpriteSheet.WEAPON_HOLDER);
|
ico = new ItemSprite(ItemSpriteSheet.WEAPON_HOLDER);
|
||||||
} else {
|
} else {
|
||||||
return new ItemSprite(Dungeon.hero.belongings.weapon);
|
ico = new ItemSprite(Dungeon.hero.belongings.weapon);
|
||||||
}
|
}
|
||||||
|
ico.width += 4; //shift slightly to the left to separate from smaller icon
|
||||||
|
return ico;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Image secondIcon() {
|
||||||
|
Image ico;
|
||||||
|
if (Dungeon.hero.belongings.secondWep == null){
|
||||||
|
ico = new ItemSprite(ItemSpriteSheet.WEAPON_HOLDER);
|
||||||
|
} else {
|
||||||
|
ico = new ItemSprite(Dungeon.hero.belongings.secondWep);
|
||||||
|
}
|
||||||
|
ico.scale.set(PixelScene.align(0.51f));
|
||||||
|
ico.brightness(0.6f);
|
||||||
|
return ico;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int actionColor() {
|
||||||
|
return 0x5500BB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+29
-7
@@ -25,19 +25,19 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
import com.shatteredpixel.shatteredpixeldungeon.SPDAction;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndKeyBindings;
|
|
||||||
import com.watabou.input.GameAction;
|
import com.watabou.input.GameAction;
|
||||||
import com.watabou.noosa.Image;
|
import com.watabou.noosa.Image;
|
||||||
|
|
||||||
public class ActionIndicator extends Tag {
|
public class ActionIndicator extends Tag {
|
||||||
|
|
||||||
Image icon;
|
Image icon;
|
||||||
|
Image secondIcon;
|
||||||
|
|
||||||
public static Action action;
|
public static Action action;
|
||||||
public static ActionIndicator instance;
|
public static ActionIndicator instance;
|
||||||
|
|
||||||
public ActionIndicator() {
|
public ActionIndicator() {
|
||||||
super( 0xFFFF4C );
|
super( 0 );
|
||||||
|
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
@@ -65,8 +65,10 @@ public class ActionIndicator extends Tag {
|
|||||||
else icon.x = x + width - (SIZE + icon.width()) / 2f - 1;
|
else icon.x = x + width - (SIZE + icon.width()) / 2f - 1;
|
||||||
icon.y = y + (height - icon.height()) / 2f;
|
icon.y = y + (height - icon.height()) / 2f;
|
||||||
PixelScene.align(icon);
|
PixelScene.align(icon);
|
||||||
if (!members.contains(icon))
|
if (secondIcon != null){
|
||||||
add(icon);
|
secondIcon.x = icon.center().x + 8 - secondIcon.width();
|
||||||
|
secondIcon.y = icon.y + icon.height() - secondIcon.height();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,13 +80,15 @@ public class ActionIndicator extends Tag {
|
|||||||
|
|
||||||
if (!Dungeon.hero.ready){
|
if (!Dungeon.hero.ready){
|
||||||
if (icon != null) icon.alpha(0.5f);
|
if (icon != null) icon.alpha(0.5f);
|
||||||
|
if (secondIcon != null) secondIcon.alpha(0.5f);
|
||||||
} else {
|
} else {
|
||||||
if (icon != null) icon.alpha(1f);
|
if (icon != null) icon.alpha(1f);
|
||||||
|
if (secondIcon != null) secondIcon.alpha(1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!visible && action != null){
|
if (!visible && action != null){
|
||||||
visible = true;
|
visible = true;
|
||||||
updateIcon();
|
refresh();
|
||||||
flash();
|
flash();
|
||||||
} else {
|
} else {
|
||||||
visible = action != null;
|
visible = action != null;
|
||||||
@@ -115,7 +119,7 @@ public class ActionIndicator extends Tag {
|
|||||||
|
|
||||||
public static void setAction(Action action){
|
public static void setAction(Action action){
|
||||||
ActionIndicator.action = action;
|
ActionIndicator.action = action;
|
||||||
updateIcon();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void clearAction(Action action){
|
public static void clearAction(Action action){
|
||||||
@@ -124,16 +128,29 @@ public class ActionIndicator extends Tag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateIcon(){
|
public static void refresh(){
|
||||||
if (instance != null){
|
if (instance != null){
|
||||||
synchronized (instance) {
|
synchronized (instance) {
|
||||||
if (instance.icon != null) {
|
if (instance.icon != null) {
|
||||||
instance.icon.killAndErase();
|
instance.icon.killAndErase();
|
||||||
instance.icon = null;
|
instance.icon = null;
|
||||||
}
|
}
|
||||||
|
if (instance.secondIcon != null){
|
||||||
|
instance.secondIcon.killAndErase();
|
||||||
|
instance.secondIcon = null;
|
||||||
|
}
|
||||||
if (action != null) {
|
if (action != null) {
|
||||||
instance.icon = action.actionIcon();
|
instance.icon = action.actionIcon();
|
||||||
|
instance.add(instance.icon);
|
||||||
|
|
||||||
|
Image secondIco = action.secondIcon();
|
||||||
|
if (secondIco != null){
|
||||||
|
instance.secondIcon = secondIco;
|
||||||
|
instance.add(instance.secondIcon);
|
||||||
|
}
|
||||||
|
|
||||||
instance.needsLayout = true;
|
instance.needsLayout = true;
|
||||||
|
instance.setColor(action.actionColor());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,6 +162,11 @@ public class ActionIndicator extends Tag {
|
|||||||
|
|
||||||
public Image actionIcon();
|
public Image actionIcon();
|
||||||
|
|
||||||
|
//TODO more variable than an icon maybe
|
||||||
|
public Image secondIcon();
|
||||||
|
|
||||||
|
public int actionColor();
|
||||||
|
|
||||||
public void doAction();
|
public void doAction();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.watabou.noosa.Image;
|
|||||||
|
|
||||||
public class DangerIndicator extends Tag {
|
public class DangerIndicator extends Tag {
|
||||||
|
|
||||||
public static final int COLOR = 0xFF4C4C;
|
public static final int COLOR = 0xC03838;
|
||||||
|
|
||||||
private BitmapText number;
|
private BitmapText number;
|
||||||
private Image icon;
|
private Image icon;
|
||||||
@@ -46,7 +46,7 @@ public class DangerIndicator extends Tag {
|
|||||||
public static int HEIGHT = 16;
|
public static int HEIGHT = 16;
|
||||||
|
|
||||||
public DangerIndicator() {
|
public DangerIndicator() {
|
||||||
super( 0xFF4C4C );
|
super( COLOR );
|
||||||
|
|
||||||
setSize( SIZE, HEIGHT );
|
setSize( SIZE, HEIGHT );
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,14 @@ public class HeroIcon extends Image {
|
|||||||
public static final int FEINT = 30;
|
public static final int FEINT = 30;
|
||||||
public static final int RATMOGRIFY = 31;
|
public static final int RATMOGRIFY = 31;
|
||||||
|
|
||||||
|
//action indicator visuals
|
||||||
|
public static final int BERSERK = 32;
|
||||||
|
public static final int COMBO = 33;
|
||||||
|
public static final int PREPARATION = 34;
|
||||||
|
public static final int MOMENTUM = 35;
|
||||||
|
public static final int SNIPERS_MARK = 36;
|
||||||
|
public static final int MONK_ABILITIES = 37;
|
||||||
|
|
||||||
public HeroIcon(HeroSubClass subCls){
|
public HeroIcon(HeroSubClass subCls){
|
||||||
super( Assets.Interfaces.HERO_ICONS );
|
super( Assets.Interfaces.HERO_ICONS );
|
||||||
if (film == null){
|
if (film == null){
|
||||||
@@ -82,4 +90,13 @@ public class HeroIcon extends Image {
|
|||||||
frame(film.get(abil.icon()));
|
frame(film.get(abil.icon()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO make this consistent with subclass and ability icons
|
||||||
|
public HeroIcon(int icon){
|
||||||
|
super( Assets.Interfaces.HERO_ICONS );
|
||||||
|
if (film == null){
|
||||||
|
film = new TextureFilm(texture, SIZE, SIZE);
|
||||||
|
}
|
||||||
|
frame(film.get(icon));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class LootIndicator extends Tag {
|
|||||||
private int lastQuantity = 0;
|
private int lastQuantity = 0;
|
||||||
|
|
||||||
public LootIndicator() {
|
public LootIndicator() {
|
||||||
super( 0x1F75CC );
|
super( 0x185898 );
|
||||||
|
|
||||||
setSize( SIZE, SIZE );
|
setSize( SIZE, SIZE );
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class ResumeIndicator extends Tag {
|
|||||||
private Image icon;
|
private Image icon;
|
||||||
|
|
||||||
public ResumeIndicator() {
|
public ResumeIndicator() {
|
||||||
super(0xCDD5C0);
|
super(0xA3A695);
|
||||||
|
|
||||||
setSize( SIZE, SIZE );
|
setSize( SIZE, SIZE );
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,13 @@ public class Tag extends Button {
|
|||||||
bg.flipHorizontal(value);
|
bg.flipHorizontal(value);
|
||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setColor( int color ){
|
||||||
|
this.r = (color >> 16) / 255f;
|
||||||
|
this.g = ((color >> 8) & 0xFF) / 255f;
|
||||||
|
this.b = (color & 0xFF) / 255f;
|
||||||
|
bg.hardlight( r, g, b );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ public class WndCombo extends Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Combo.ComboMove move : Combo.ComboMove.values()) {
|
for (Combo.ComboMove move : Combo.ComboMove.values()) {
|
||||||
Image ic = new Image(icon);
|
|
||||||
|
|
||||||
RedButton moveBtn = new RedButton(move.desc(combo.getComboCount()), 6){
|
RedButton moveBtn = new RedButton(move.desc(combo.getComboCount()), 6){
|
||||||
@Override
|
@Override
|
||||||
@@ -72,8 +71,6 @@ public class WndCombo extends Window {
|
|||||||
combo.useMove(move);
|
combo.useMove(move);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ic.tint(move.tintColor);
|
|
||||||
moveBtn.icon(ic);
|
|
||||||
moveBtn.leftJustify = true;
|
moveBtn.leftJustify = true;
|
||||||
moveBtn.multiline = true;
|
moveBtn.multiline = true;
|
||||||
moveBtn.setSize(width, moveBtn.reqHeight());
|
moveBtn.setSize(width, moveBtn.reqHeight());
|
||||||
|
|||||||
Reference in New Issue
Block a user