当前位置: 首页>>代码示例>>Java>>正文


Java WndOptions类代码示例

本文整理汇总了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() {};
	} );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:18,代码来源:InventoryScroll.java

示例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);
        }
    }
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:25,代码来源:ChaliceOfBlood.java

示例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 );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:27,代码来源:Potion.java

示例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();
				}
			}
		}
	);
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:17,代码来源:Chasm.java

示例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() {};
	} );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:19,代码来源:InventoryScroll.java

示例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);
                      }
                  }
              } );
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:16,代码来源:LoadSaveScene.java

示例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();
				}
			};
		}
	);
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:14,代码来源:Chasm.java

示例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);
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:32,代码来源:AlchemyPot.java

示例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);
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:34,代码来源:TimekeepersHourglass.java

示例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;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:16,代码来源:MissileWeapon.java

示例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 );
		
	}
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:31,代码来源:Potion.java

示例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);
		}
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:29,代码来源:ChaliceOfBlood.java

示例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);
							}
						}
					}
			);
		}
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:38,代码来源:MagesStaff.java

示例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 );
			}
		
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:32,代码来源:Potion.java

示例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 );
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:29,代码来源:Potion.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。