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


Java Element.isVisible方法代码示例

本文整理汇总了Java中de.lessvoid.nifty.elements.Element.isVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Element.isVisible方法的具体用法?Java Element.isVisible怎么用?Java Element.isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.lessvoid.nifty.elements.Element的用法示例。


在下文中一共展示了Element.isVisible方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onWindowButton

import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
@NiftyEventSubscriber(pattern="bt.*")
public void onWindowButton(String id, ButtonClickedEvent e) {
    String windowId = "wd" + id.substring(2);
    for (WindowController wc : windowControllers) {
        Window window = wc.getWindow();
        if (window.getId().equals(windowId)) {
            Element windowElement = window.getElement();
            if (windowElement.isVisible()) {
            	break;
            }
            // move the selected window to the top layer
            windowElement.markForMove(windowElement.getParent());
            windowElement.reactivate();
            windowElement.startEffect(EffectEventId.onCustom);

            windowElement.show();
            for (Element elm : windowElement.getElements()) {
            	// have to do this after markForMove(), otherwise radio button selections
            	// are not displayed properly
            	elm.show();
            }
            break;
        }
    }
}
 
开发者ID:dwhuang,项目名称:SMILE,代码行数:26,代码来源:GuiController.java

示例2: updateIcons

import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
void updateIcons() {
    if (playerCharacter == null) {
        return;
    }
    CSpellCast cCast = playerCharacter.getControl(CSpellCast.class);
    CCharacterBuff cBuff = playerCharacter.getControl(CCharacterBuff.class);
    boolean hasSilence = cBuff.hasBuff(BuffTypeIds.SILENCE);

    for (Map.Entry<String, Element> entry : icons.entrySet()) {
        float cooldown = cCast.getCooldown(Spell
                .getSpell(entry.getKey()).getId());
        Element overlay = entry.getValue()
                .findElementById(entry.getKey() + "-overlay");
        if (cooldown <= 0 && !hasSilence) {
            if (overlay.isVisible()) {
                overlay.hide();
            }
        } else {
            if (!overlay.isVisible()) {
                overlay.show();
            }

            Element cooldownText = overlay
                    .findElementById(entry.getKey() + "-spell-counter");
            
            TextRenderer txt = cooldownText.getRenderer(TextRenderer.class);

            if (cooldown > 3) {
                txt.setText(String.format("%d", (int) cooldown));
            } else if (cooldown > 0) {
                txt.setText(String.format("%.1f", cooldown));
            } else {
                txt.setText("");
            }
        }
    }
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:38,代码来源:SpellBar.java

示例3: setLatestStatsList

import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
void setLatestStatsList(List<PlayerRoundStats> latestStatsList,
        boolean teamStats) {
    this.latestStatsList = latestStatsList;
    Element statisticsLayer = screen.findElementById("layer_statistics");

    if (statisticsLayer.isVisible()) {
        update(teamStats);
    }
}
 
开发者ID:TripleSnail,项目名称:Arkhados,代码行数:10,代码来源:VisualStatistics.java

示例4: showChat

import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Displays the chat panel
 *
 */
public void showChat(){
	Element chatPanel = nifty.getScreen("hud").findElementByName("chatPanel");
	Element chatText = nifty.getScreen("hud").findElementByName("chatText");
	if(!chatPanel.isVisible()){
		chatPanel.startEffect(EffectEventId.onCustom);
		chatPanel.setVisible(true);
	}
	chatText.setFocus();
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:13,代码来源:HudScreenController.java

示例5: consumeItem

import de.lessvoid.nifty.elements.Element; //导入方法依赖的package包/类
/**Triggered when an Item is right clicked to activate
 * Processes the item according to its type, and updates
 * the model accordingly
 */
@NiftyEventSubscriber(pattern="ItemVal.*")
public void consumeItem(String id, NiftyMouseSecondaryReleaseEvent event){
	Item item = findItemById(id.substring(7),screenManager.getInventoryManager().getPlayer().getContainerInventory());

	//container items
	if (item instanceof AbstractContainerItem) {
		Element containerPanel = nifty.getScreen("hud").findElementByName("ContainerPanel");
		if (!containerPanel.isVisible()){
			containerPanel.setVisible(true);
			openContainer = item;
			screenManager.getInventoryManager().loadContainer(((AbstractContainerItem)item).getContainerInventory());
		}else{
			closeContainer();
		}
		hideInnerPopups(screenManager.getInventoryManager().getPlayer().getContainerInventory());
		Element containerText = nifty.getScreen("hud").findElementByName("ContainerText");
		String name = null;
		for (ItemDisplayTuple p : item) {
			if (p.stat == Stat.NAME){
				name = p.string;
			}
		}
		if (name == null){
			containerText.getRenderer(TextRenderer.class).setText("Container");
		}else{
			containerText.getRenderer(TextRenderer.class).setText(name);
		}
		return;
	}

	//Rightclickable items
	if (item instanceof RightClickable) {
		RightClickable toClick = (RightClickable) item;
		toClick.rightClick();

		if (!(toClick instanceof AbstractGizmo)) screenManager.getInventoryManager().removeItem(item);

		for(GUIObserver g : observers){
			g.onRightClicked(item);
		}
		return;
	}

	//Consumable items
	if (item instanceof AbstractConsumable){
		AbstractConsumable toConsume = (AbstractConsumable)item;
		toConsume.rightClick();
		screenManager.getInventoryManager().removeItem(item);
	}
}
 
开发者ID:GSam,项目名称:Game-Project,代码行数:55,代码来源:HudScreenController.java


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