当前位置: 首页>>代码示例>>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;未经允许,请勿转载。