當前位置: 首頁>>代碼示例>>Java>>正文


Java GuiScreenEvent.DrawScreenEvent方法代碼示例

本文整理匯總了Java中net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java GuiScreenEvent.DrawScreenEvent方法的具體用法?Java GuiScreenEvent.DrawScreenEvent怎麽用?Java GuiScreenEvent.DrawScreenEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.client.event.GuiScreenEvent的用法示例。


在下文中一共展示了GuiScreenEvent.DrawScreenEvent方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: drawGui

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void drawGui(GuiScreenEvent.DrawScreenEvent event) {
    if (!(event.gui instanceof ScreenChatOptions))
        return;

    if (buttonToggleArmor != null)
        buttonToggleArmor.drawButton(event.gui.mc, event.mouseX, event.mouseY);

    if (!mouseClicked) {
        if (Mouse.isButtonDown(0)) {
            mouseClicked = true;

            if (buttonToggleArmor.mousePressed(event.gui.mc, event.mouseX, event.mouseY)) {
                showArmor = !showArmor;
                updateText();
                buttonToggleArmor.func_146113_a(event.gui.mc.getSoundHandler());
            }
        }
    } else {
        if (!Mouse.isButtonDown(0))
            mouseClicked = false;
    }
}
 
開發者ID:dmillerw,項目名稱:CosmeticArmor,代碼行數:24,代碼來源:GuiHandler.java

示例2: onDrawGui

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SuppressWarnings("unused")
@SubscribeEvent
public void onDrawGui(GuiScreenEvent.DrawScreenEvent event) {
    if (event.gui.getClass() == GuiMainMenu.class) {
        TextRenderHelper.drawString(Lang.get("itemGroup.Zombie Total Conversion"), 2, 2, TextAlignment.Left);
        TextRenderHelper.drawString("Developed by:", 2, 22, TextAlignment.Left);
        TextRenderHelper.drawString("Gavin Gassmann: @TheGassmama", 2, 32, TextAlignment.Left);
    }
    else if(event.gui.getClass() == GuiGameOver.class) {
        if(Keyboard.isKeyDown(Keyboard.KEY_G) && Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
            Minecraft.getMinecraft().thePlayer.respawnPlayer();
            Minecraft.getMinecraft().displayGuiScreen(null);
        }
        TextRenderHelper.drawString(Lang.get("ui.debug.ongameover"), 2, 2, TextAlignment.Left);
    }
}
 
開發者ID:gigimoi,項目名稱:Zombie-Total-Conversion-Craft,代碼行數:17,代碼來源:MainGuiOverrideManager.java

示例3: onDrawGuiScreen

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onDrawGuiScreen(GuiScreenEvent.DrawScreenEvent event) {
	handleTick();
	if (event.getGui() instanceof GuiMainMenu) {
		if (HotplugHandler.init())
			return;
		if (active) {
			selector.handleInput();
			selector.draw();
		}
	}
}
 
開發者ID:thilokru,項目名稱:Controller-Support,代碼行數:13,代碼來源:ModEventHandler.java

示例4: onDrawScreen

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onDrawScreen(GuiScreenEvent.DrawScreenEvent e) {
    if (ConfigHandler.showButtons && e.getGui() != null && e.getGui() instanceof GuiContainer) {
        int mouseY = JEIButtons.proxy.getMouseY();
        int mouseX = JEIButtons.proxy.getMouseX();

        if (JEIButtons.isAnyButtonHovered) {
           List<String> tip = Localization.getTooltip(JEIButtons.hoveredButton);
            if (tip != null) {
                GuiUtils.drawHoveringText(tip, mouseX, mouseY < 17 ? 17 : mouseY, ClientProxy.mc.displayWidth, ClientProxy.mc.displayHeight, -1, ClientProxy.mc.fontRenderer);
                RenderHelper.disableStandardItemLighting();
            }
        }


        if (ConfigHandler.enableSubsets)
            ModSubsetButtonHandler.drawSubsetList(mouseX, mouseY);
    }


    if (e.getGui() instanceof GuiConfig) {
        GuiConfigEntries eL = ((GuiConfig) e.getGui()).entryList;
        GuiConfig cfg = (GuiConfig) e.getGui();
        if (cfg.titleLine2 != null && cfg.titleLine2.equals(ConfigHandler.CATEGORY_POSITION)) {
            int y = getInt(1, eL);
            int x = getInt(0, eL);
            GuiUtils.drawGradientRect(10, x, y, x + 75, y + 75, 0x77888888, 0x77888888);
            ClientProxy.mc.fontRenderer.drawString("[Buttons]", x + 14, y + 10, 0xFFFFFF);
        }
    }
}
 
開發者ID:univrsal,項目名稱:JustEnoughButtons,代碼行數:32,代碼來源:EventHandlers.java

示例5: onRenderGUIScreen

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onRenderGUIScreen(GuiScreenEvent.DrawScreenEvent event) {
    if (event.getGui() instanceof GUIMetalSelect && !event.isCancelable()) {
        drawMetalOverlay();
    }
}
 
開發者ID:legobmw99,項目名稱:Allomancy,代碼行數:8,代碼來源:ClientEventHandler.java

示例6: onDrawScreen

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onDrawScreen(GuiScreenEvent.DrawScreenEvent event) {
	if(event.getGui() instanceof GuiDisconnected) {
		event.getGui().drawCenteredString(mc.fontRendererObj, "Reconnect in: " + time + " seconds", event.getGui().width / 2, 30, Color.WHITE.getRGB());
	}
}
 
開發者ID:TealNerd,項目名稱:AutoJoin,代碼行數:7,代碼來源:AutoJoin.java

示例7: onDisplaygui

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onDisplaygui(GuiScreenEvent.DrawScreenEvent e) {
}
 
開發者ID:ItsAMysterious,項目名稱:Real-Life-Mod-1.8,代碼行數:4,代碼來源:ClientHandler.java

示例8: handleDrawScreenEvent

import net.minecraftforge.client.event.GuiScreenEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void handleDrawScreenEvent(GuiScreenEvent.DrawScreenEvent event) {
    if(!ConfigurationHandler.instance().isFullscreenWindowedEnabled())
        return;


    boolean newState = isCorrectKeyBinding();
    if(_initialFullscreen && _cooldown >= Reference.DRAW_SCREEN_EVENT_COOLDOWN) {
        _cooldown = 0;
        _initialFullscreen = false;
        FullscreenWindowed.proxy.toggleFullScreen(_initialGoFullScreen, _initialDesiredMonitor);
    }
    else if(_cooldown >= Reference.DRAW_SCREEN_EVENT_COOLDOWN && (_lastState != newState) && newState)
    {
        _cooldown = 0;
        _lastState = newState;
        FullscreenWindowed.proxy.toggleFullScreen(!ClientProxy.fullscreen, ConfigurationHandler.instance().getFullscreenMonitor());
    }

    _lastState = newState;

    if(_cooldown < Reference.DRAW_SCREEN_EVENT_COOLDOWN)
        _cooldown++;

    if(client.getVersion().startsWith("forge-11")){
        //Do it the old way in 1.8 since event.getGui does not exist.
        if(client.currentScreen instanceof GuiVideoSettings && client.fullscreen != ClientProxy.fullscreen) {
            FullscreenWindowed.proxy.toggleFullScreen(client.fullscreen);
        }
    }else{
        try {
            if (event.getGui() instanceof GuiVideoSettings && client.fullscreen != ClientProxy.fullscreen) {
                FullscreenWindowed.proxy.toggleFullScreen(client.fullscreen);
            }
        // In certain scenarios of 1.8, client mods further change the version and the previous check fails.
        // In those scenarios, we'll get this error and we will fallback to the old method.
        } catch (NoSuchMethodError error) {
            //Do it the old way in 1.8 since event.getGui does not exist.
            if(client.currentScreen instanceof GuiVideoSettings && client.fullscreen != ClientProxy.fullscreen) {
                FullscreenWindowed.proxy.toggleFullScreen(client.fullscreen);
            }
        }
    }
}
 
開發者ID:hancin,項目名稱:Fullscreen-Windowed-Minecraft,代碼行數:45,代碼來源:DrawScreenEventHandler.java


注:本文中的net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。