• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java WndClass类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.watabou.pixeldungeon.windows.WndClass的典型用法代码示例。如果您正苦于以下问题:Java WndClass类的具体用法?Java WndClass怎么用?Java WndClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

WndClass类属于com.watabou.pixeldungeon.windows包,在下文中一共展示了WndClass类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateClass

点赞 2

import com.watabou.pixeldungeon.windows.WndClass; //导入依赖的package包/类
private void updateClass( HeroClass cl ) {
	
	if (curClass == cl) {
		add( new WndClass( cl ) );
		return;
	}
	
	if (curClass != null) {
		shields.get( curClass ).highlight( false );
	}
	shields.get( curClass = cl ).highlight( true );
	
	if (cl != HeroClass.HUNTRESS || huntressUnlocked) {
	
		unlock.visible = false;
		
		GamesInProgress.Info info = GamesInProgress.check( curClass );
		if (info != null) {
			
			btnLoad.visible = true;
			btnLoad.secondary( Utils.format( TXT_DPTH_LVL, info.depth, info.level ), info.challenges );
			
			btnNewGame.visible = true;
			btnNewGame.secondary( TXT_ERASE, false );
			
			float w = (Camera.main.width - GAP) / 2 - buttonX;
			
			btnLoad.setRect(
				buttonX, buttonY, w, BUTTON_HEIGHT );
			btnNewGame.setRect(
				btnLoad.right() + GAP, buttonY, w, BUTTON_HEIGHT );
			
		} else {
			btnLoad.visible = false;
			
			btnNewGame.visible = true;
			btnNewGame.secondary( null, false );
			btnNewGame.setRect( buttonX, buttonY, Camera.main.width - buttonX * 2, BUTTON_HEIGHT );
		}
		
	} else {
		
		unlock.visible = true;
		btnLoad.visible = false;
		btnNewGame.visible = false;
		
	}
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:49,
代码来源:StartScene.java

示例2: updateShield

点赞 2

import com.watabou.pixeldungeon.windows.WndClass; //导入依赖的package包/类
private void updateShield(ClassShield shield) {
    if (curShield == shield) {
        add(new WndClass(shield.cl));
        return;
    }

    if (curShield != null) {
        curShield.highlight(false);
    }

    curShield = shield;
    curShield.highlight(true);


    if (!BuildConfig.DEBUG) {
        if (curShield.cl == HeroClass.HUNTRESS && !huntressUnlocked) {
            updateUnlockLabel(Game.getVar(R.string.StartScene_Unlock));
            return;
        }

        if (curShield.cl == HeroClass.ELF && !elfUnlocked) {
            updateUnlockLabel(Game.getVar(R.string.StartScene_UnlockElf));
            return;
        }

        if (curShield.cl == HeroClass.GNOLL && !gnollUnlocked) {
            updateUnlockLabel(Game.getVar(R.string.StartScene_UnlockGnoll));
            return;
        }

    }

    unlock.setVisible(false);

    GamesInProgress.Info info = GamesInProgress.check(curShield.cl);
    if (info != null) {

        btnLoad.setVisible(true);
        btnLoad.secondary(Utils.format(Game
                        .getVar(R.string.StartScene_Depth), info.depth,
                info.level));

        btnNewGame.setVisible(true);
        btnNewGame.secondary(Game
                .getVar(R.string.StartScene_Erase));

        float w = (Camera.main.width - GAP) / 2 - buttonX;

        btnLoad.setRect(buttonX, buttonY, w, BUTTON_HEIGHT);
        btnNewGame.setRect(btnLoad.right() + GAP, buttonY, w,
                BUTTON_HEIGHT);

    } else {
        btnLoad.setVisible(false);

        btnNewGame.setVisible(true);
        btnNewGame.secondary(null);
        btnNewGame.setRect(buttonX, buttonY, Camera.main.width
                - buttonX * 2, BUTTON_HEIGHT);
    }

}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:63,
代码来源:StartScene.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)