本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions类的典型用法代码示例。如果您正苦于以下问题:Java WndOptions类的具体用法?Java WndOptions怎么用?Java WndOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WndOptions类属于com.shatteredpixel.shatteredpixeldungeon.windows包,在下文中一共展示了WndOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: confirmCancelation
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
private void confirmCancelation() {
GameScene.show( new WndOptions( name(), TXT_WARNING, TXT_YES, TXT_NO ) {
@Override
protected void onSelect( int index ) {
switch (index) {
case 0:
curUser.spendAndNext( TIME_TO_READ );
identifiedByUse = false;
break;
case 1:
GameScene.selectItem( itemSelector, mode, inventoryTitle );
break;
}
}
public void onBackPressed() {};
} );
}
示例2: execute
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void execute(Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_PRICK)){
int damage = 3*(level*level);
if (damage > hero.HP*0.75) {
GameScene.show(
new WndOptions(TXT_CHALICE, TXT_PRICK, TXT_YES, TXT_NO) {
@Override
protected void onSelect(int index) {
if (index == 0)
prick(Dungeon.hero);
};
}
);
} else {
prick(hero);
}
}
}
示例3: doThrow
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void doThrow( final Hero hero ) {
if (isKnown() && (
this instanceof PotionOfExperience ||
this instanceof PotionOfHealing ||
this instanceof PotionOfMindVision ||
this instanceof PotionOfStrength ||
this instanceof PotionOfInvisibility ||
this instanceof PotionOfMight)) {
GameScene.show(
new WndOptions( TXT_BENEFICIAL, TXT_R_U_SURE_THROW, TXT_YES, TXT_NO ) {
@Override
protected void onSelect(int index) {
if (index == 0) {
Potion.super.doThrow( hero );
}
};
}
);
} else {
super.doThrow( hero );
}
}
示例4: heroJump
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
public static void heroJump( final Hero hero ) {
GameScene.show(
new WndOptions( Messages.get(Chasm.class, "chasm"),
Messages.get(Chasm.class, "jump"),
Messages.get(Chasm.class, "yes"),
Messages.get(Chasm.class, "no") ) {
@Override
protected void onSelect( int index ) {
if (index == 0) {
jumpConfirmed = true;
hero.resume();
}
}
}
);
}
示例5: confirmCancelation
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
private void confirmCancelation() {
GameScene.show( new WndOptions( Messages.titleCase(name()), Messages.get(this, "warning"),
Messages.get(this, "yes"), Messages.get(this, "no") ) {
@Override
protected void onSelect( int index ) {
switch (index) {
case 0:
curUser.spendAndNext( TIME_TO_READ );
identifiedByUse = false;
break;
case 1:
GameScene.selectItem( itemSelector, mode, inventoryTitle );
break;
}
}
public void onBackPressed() {};
} );
}
示例6: onClick
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
protected void onClick() {
if (isSave) {
exportGames(classInfo, saveSlot);
} else {
loadSaveScene.add( new WndOptions( TXT_REALLY + " " +saveSlot + " " + secondary.text() + "?", TXT_WARNING, TXT_YES + " " + saveSlot, TXT_NO ) {
@Override
protected void onSelect( int index ) {
if (index == 0) {
importGames(classInfo, saveSlot);
}
}
} );
}
}
示例7: heroJump
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
public static void heroJump( final Hero hero ) {
GameScene.show(
new WndOptions( TXT_CHASM, TXT_JUMP, TXT_YES, TXT_NO ) {
@Override
protected void onSelect( int index ) {
if (index == 0) {
jumpConfirmed = true;
hero.resume();
}
};
}
);
}
示例8: operate
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
public static void operate( Hero hero, int pos ) {
AlchemyPot.hero = hero;
AlchemyPot.pos = pos;
Iterator<Item> items = hero.belongings.iterator();
foundFruit = false;
Heap heap = Dungeon.level.heaps.get( pos );
if (heap == null)
while (items.hasNext() && !foundFruit){
curItem = items.next();
if (curItem instanceof Blandfruit && ((Blandfruit) curItem).potionAttrib == null){
GameScene.show(
new WndOptions(TXT_POT, TXT_OPTIONS, TXT_FRUIT, TXT_POTION) {
@Override
protected void onSelect(int index) {
if (index == 0) {
curItem.cast( AlchemyPot.hero, AlchemyPot.pos );
} else
GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED);
}
}
);
foundFruit = true;
}
}
if (!foundFruit)
GameScene.selectItem(itemSelector, WndBag.Mode.SEED, TXT_SELECT_SEED);
}
示例9: execute
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void execute( Hero hero, String action ) {
if (action.equals(AC_ACTIVATE)){
if (!isEquipped( hero )) GLog.i("You need to equip your hourglass to do that.");
else if (activeBuff != null) GLog.i("Your hourglass is already in use.");
else if (charge <= 1) GLog.i("Your hourglass hasn't recharged enough to be usable yet.");
else if (cursed) GLog.i("You cannot use a cursed hourglass.");
else GameScene.show(
new WndOptions(TXT_HGLASS, TXT_DESC, TXT_STASIS, TXT_FREEZE) {
@Override
protected void onSelect(int index) {
if (index == 0) {
GLog.i("The world seems to shift around you in an instant.");
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_TELEPORT);
activeBuff = new timeStasis();
activeBuff.attachTo(Dungeon.hero);
} else if (index == 1) {
GLog.i("everything around you suddenly freezes.");
GameScene.flash(0xFFFFFF);
Sample.INSTANCE.play(Assets.SND_TELEPORT);
activeBuff = new timeFreeze();
activeBuff.attachTo(Dungeon.hero);
}
};
}
);
} else
super.execute(hero, action);
}
示例10: doEquip
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public boolean doEquip( final Hero hero ) {
GameScene.show(
new WndOptions( TXT_MISSILES, TXT_R_U_SURE, TXT_YES, TXT_NO ) {
@Override
protected void onSelect(int index) {
if (index == 0) {
MissileWeapon.super.doEquip( hero );
}
};
}
);
return false;
}
示例11: execute
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void execute( final Hero hero, String action ) {
if (action.equals( AC_DRINK )) {
if (isKnown() && (
this instanceof PotionOfLiquidFlame ||
this instanceof PotionOfToxicGas ||
this instanceof PotionOfParalyticGas)) {
GameScene.show(
new WndOptions( TXT_HARMFUL, TXT_R_U_SURE_DRINK, TXT_YES, TXT_NO ) {
@Override
protected void onSelect(int index) {
if (index == 0) {
drink( hero );
}
};
}
);
} else {
drink( hero );
}
} else {
super.execute( hero, action );
}
}
示例12: execute
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void execute(Hero hero, String action ) {
super.execute(hero, action);
if (action.equals(AC_PRICK)){
int damage = 3*(level()*level());
if (damage > hero.HP*0.75) {
GameScene.show(
new WndOptions(Messages.get(this, "name"),
Messages.get(this, "prick_warn"),
Messages.get(this, "yes"),
Messages.get(this, "no")) {
@Override
protected void onSelect(int index) {
if (index == 0)
prick(Dungeon.hero);
}
}
);
} else {
prick(hero);
}
}
}
示例13: onSelect
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void onSelect( final Item item ) {
if (item != null) {
if (!item.isIdentified()) {
GLog.w(Messages.get(MagesStaff.class, "id_first"));
return;
} else if (item.cursed){
GLog.w(Messages.get(MagesStaff.class, "cursed"));
return;
}
if (wand == null){
applyWand((Wand)item);
} else {
final int newLevel =
item.level() >= level() ?
level() > 0 ?
item.level() + 1
: item.level()
: level();
GameScene.show(
new WndOptions("",
Messages.get(MagesStaff.class, "warning", newLevel),
Messages.get(MagesStaff.class, "yes"),
Messages.get(MagesStaff.class, "no")) {
@Override
protected void onSelect(int index) {
if (index == 0) {
applyWand((Wand)item);
}
}
}
);
}
}
}
示例14: execute
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void execute( final Hero hero, String action ) {
super.execute( hero, action );
if (action.equals( AC_DRINK )) {
if (isKnown() && (
this instanceof PotionOfLiquidFlame ||
this instanceof PotionOfToxicGas ||
this instanceof PotionOfParalyticGas)) {
GameScene.show(
new WndOptions( Messages.get(Potion.class, "harmful"),
Messages.get(Potion.class, "sure_drink"),
Messages.get(Potion.class, "yes"), Messages.get(Potion.class, "no") ) {
@Override
protected void onSelect(int index) {
if (index == 0) {
drink( hero );
}
};
}
);
} else {
drink( hero );
}
}
}
示例15: doThrow
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions; //导入依赖的package包/类
@Override
public void doThrow( final Hero hero ) {
if (isKnown() && (
this instanceof PotionOfExperience ||
this instanceof PotionOfHealing ||
this instanceof PotionOfMindVision ||
this instanceof PotionOfStrength ||
this instanceof PotionOfInvisibility ||
this instanceof PotionOfMight)) {
GameScene.show(
new WndOptions( Messages.get(Potion.class, "beneficial"),
Messages.get(Potion.class, "sure_throw"),
Messages.get(Potion.class, "yes"), Messages.get(Potion.class, "no") ) {
@Override
protected void onSelect(int index) {
if (index == 0) {
Potion.super.doThrow( hero );
}
};
}
);
} else {
super.doThrow( hero );
}
}