v2.5.0: added a cancel confirmation window to scrolls of enchantment
This commit is contained in:
@@ -1149,8 +1149,10 @@ items.scrolls.exotic.scrollofenchantment.name=scroll of enchantment
|
|||||||
items.scrolls.exotic.scrollofenchantment.inv_title=Enchant an item
|
items.scrolls.exotic.scrollofenchantment.inv_title=Enchant an item
|
||||||
items.scrolls.exotic.scrollofenchantment.weapon=Select an enchantment to apply to your weapon.
|
items.scrolls.exotic.scrollofenchantment.weapon=Select an enchantment to apply to your weapon.
|
||||||
items.scrolls.exotic.scrollofenchantment.armor=Select a glyph to apply to your armor.
|
items.scrolls.exotic.scrollofenchantment.armor=Select a glyph to apply to your armor.
|
||||||
items.scrolls.exotic.scrollofenchantment.cancel_warn=Cancelling will still consume the scroll.
|
|
||||||
items.scrolls.exotic.scrollofenchantment.cancel=cancel
|
items.scrolls.exotic.scrollofenchantment.cancel=cancel
|
||||||
|
items.scrolls.exotic.scrollofenchantment.cancel_warn=Cancelling with still consume your scroll of enchantment, are you sure?
|
||||||
|
items.scrolls.exotic.scrollofenchantment.cancel_warn_yes=Yes, I'm sure
|
||||||
|
items.scrolls.exotic.scrollofenchantment.cancel_warn_no=No, I changed my mind
|
||||||
items.scrolls.exotic.scrollofenchantment.desc=This scroll will infuse a weapon or armor with powerful magical energy. The reader even has some degree of control over which magic is imbued.
|
items.scrolls.exotic.scrollofenchantment.desc=This scroll will infuse a weapon or armor with powerful magical energy. The reader even has some degree of control over which magic is imbued.
|
||||||
|
|
||||||
items.scrolls.exotic.scrollofforesight.name=scroll of foresight
|
items.scrolls.exotic.scrollofforesight.name=scroll of foresight
|
||||||
|
|||||||
+39
-12
@@ -162,9 +162,7 @@ public class ScrollOfEnchantment extends ExoticScroll {
|
|||||||
Weapon.Enchantment ench2, Weapon.Enchantment ench3){
|
Weapon.Enchantment ench2, Weapon.Enchantment ench3){
|
||||||
super(new ItemSprite(new ScrollOfEnchantment()),
|
super(new ItemSprite(new ScrollOfEnchantment()),
|
||||||
Messages.titleCase(new ScrollOfEnchantment().name()),
|
Messages.titleCase(new ScrollOfEnchantment().name()),
|
||||||
Messages.get(ScrollOfEnchantment.class, "weapon") +
|
Messages.get(ScrollOfEnchantment.class, "weapon"),
|
||||||
"\n\n" +
|
|
||||||
Messages.get(ScrollOfEnchantment.class, "cancel_warn"),
|
|
||||||
ench1.name(),
|
ench1.name(),
|
||||||
ench2.name(),
|
ench2.name(),
|
||||||
ench3.name(),
|
ench3.name(),
|
||||||
@@ -185,10 +183,9 @@ public class ScrollOfEnchantment extends ExoticScroll {
|
|||||||
|
|
||||||
Sample.INSTANCE.play( Assets.Sounds.READ );
|
Sample.INSTANCE.play( Assets.Sounds.READ );
|
||||||
Enchanting.show(curUser, wep);
|
Enchanting.show(curUser, wep);
|
||||||
|
} else {
|
||||||
|
GameScene.show(new WndConfirmCancel());
|
||||||
}
|
}
|
||||||
|
|
||||||
wep = null;
|
|
||||||
enchantments = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -225,9 +222,7 @@ public class ScrollOfEnchantment extends ExoticScroll {
|
|||||||
Armor.Glyph glyph2, Armor.Glyph glyph3) {
|
Armor.Glyph glyph2, Armor.Glyph glyph3) {
|
||||||
super(new ItemSprite(new ScrollOfEnchantment()),
|
super(new ItemSprite(new ScrollOfEnchantment()),
|
||||||
Messages.titleCase(new ScrollOfEnchantment().name()),
|
Messages.titleCase(new ScrollOfEnchantment().name()),
|
||||||
Messages.get(ScrollOfEnchantment.class, "armor") +
|
Messages.get(ScrollOfEnchantment.class, "armor"),
|
||||||
"\n\n" +
|
|
||||||
Messages.get(ScrollOfEnchantment.class, "cancel_warn"),
|
|
||||||
glyph1.name(),
|
glyph1.name(),
|
||||||
glyph2.name(),
|
glyph2.name(),
|
||||||
glyph3.name(),
|
glyph3.name(),
|
||||||
@@ -248,10 +243,9 @@ public class ScrollOfEnchantment extends ExoticScroll {
|
|||||||
|
|
||||||
Sample.INSTANCE.play(Assets.Sounds.READ);
|
Sample.INSTANCE.play(Assets.Sounds.READ);
|
||||||
Enchanting.show(curUser, arm);
|
Enchanting.show(curUser, arm);
|
||||||
|
} else {
|
||||||
|
GameScene.show(new WndConfirmCancel());
|
||||||
}
|
}
|
||||||
|
|
||||||
arm = null;
|
|
||||||
glyphs = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -273,4 +267,37 @@ public class ScrollOfEnchantment extends ExoticScroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class WndConfirmCancel extends WndOptions{
|
||||||
|
|
||||||
|
public WndConfirmCancel(){
|
||||||
|
super(new ItemSprite(new ScrollOfEnchantment()),
|
||||||
|
Messages.titleCase(new ScrollOfEnchantment().name()),
|
||||||
|
Messages.get(ScrollOfEnchantment.class, "cancel_warn"),
|
||||||
|
Messages.get(ScrollOfEnchantment.class, "cancel_warn_yes"),
|
||||||
|
Messages.get(ScrollOfEnchantment.class, "cancel_warn_no"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSelect(int index) {
|
||||||
|
super.onSelect(index);
|
||||||
|
if (index == 1){
|
||||||
|
if (WndEnchantSelect.wep != null) {
|
||||||
|
GameScene.show(new WndEnchantSelect());
|
||||||
|
} else {
|
||||||
|
GameScene.show(new WndGlyphSelect());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
WndEnchantSelect.wep = null;
|
||||||
|
WndEnchantSelect.enchantments = null;
|
||||||
|
WndGlyphSelect.arm = null;
|
||||||
|
WndGlyphSelect.glyphs = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
//do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user