本文整理汇总了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;
}
}
示例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);
}
}
示例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();
}
}
}
示例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);
}
}
}
示例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();
}
}
示例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());
}
}
示例7: onDisplaygui
import net.minecraftforge.client.event.GuiScreenEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onDisplaygui(GuiScreenEvent.DrawScreenEvent e) {
}
示例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);
}
}
}
}