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


Java GuiScreenEvent類代碼示例

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


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

示例1: onDraw

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void onDraw(GuiScreenEvent.DrawScreenEvent.Post event) {
	if (event.gui instanceof GuiMainMenu
			|| event.gui instanceof GuiIngameMenu) {
		GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
		GL11.glDisable(GL11.GL_LIGHTING);
		if (MoteCraft.mote == null) {
			this.mc.renderEngine.bindTexture(new ResourceLocation(
					MoteCraft.MODID, String.format("wiimote_search%02d.png",
							this.animstate / 3)));
		} else {
			this.mc.renderEngine.bindTexture(new ResourceLocation(
					MoteCraft.MODID, "wiimote_found.png"));
		}
		/*
		 * this.drawTexturedModalRect( 0, 0, 0, 0, 230, 1000);
		 */
		Utils.drawTexturedQuadFit(10, 10, 32, 32, zLevel + 1);
	}
}
 
開發者ID:freundTech,項目名稱:motecraft,代碼行數:21,代碼來源:GuiWiimoteStatus.java

示例2: intercept

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
    if (args == null || args.length > 1 || args.length == 0) {
        return methodProxy.invokeSuper(obj, args);
    }

    if (method.getName().contains("guiRender") || method.getName().contains("mouseClick")) {
        Object arg0 = args[0];
        if (arg0 instanceof GuiScreenEvent) {
            GuiScreenEvent drawEvent = (GuiScreenEvent) arg0;

            if (drawEvent.getGui() instanceof GuiMainMenu) {
                // Don't invoke.
                return methodProxy.getSignature().getReturnType().getOpcode(VOID);
            }
        }
    }
    return methodProxy.invokeSuper(obj, args);
}
 
開發者ID:darkevilmac,項目名稱:CreeperKiller,代碼行數:20,代碼來源:HammerKiller.java

示例3: onInitGuiPost

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
    if(!hasShownFirstGui)
    {
        hasShownFirstGui = true;

        //Add the layer renderers
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityLlama.class);
        if(renderer instanceof RenderLlama)
        {
            RenderLlama renderLlama = (RenderLlama)renderer;
            renderLlama.addLayer(new LayerFancyLlama(renderLlama));
        }
    }
}
 
開發者ID:iChun,項目名稱:BetterThanLlamas,代碼行數:17,代碼來源:BetterThanLlamas.java

示例4: onGuiKeyboardEvent

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent(priority = EventPriority.LOW)
public void onGuiKeyboardEvent(GuiScreenEvent.KeyboardInputEvent.Post event) {
	if (Keyboard.getEventKeyState()) {
		int eventKey = Keyboard.getEventKey();
		if (KeyBindings.TOGGLE.isActiveAndMatches(eventKey)) {
			Config.toggleEnabled();
			event.setCanceled(true);
		} else if (KeyBindings.ZOOM_IN.isActiveAndMatches(eventKey)) {
			Config.increaseZoom();
			event.setCanceled(true);
		} else if (KeyBindings.ZOOM_OUT.isActiveAndMatches(eventKey)) {
			Config.decreaseZoom();
			event.setCanceled(true);
		}
	}
}
 
開發者ID:mezz,項目名稱:ItemZoom,代碼行數:17,代碼來源:EventHandler.java

示例5: guiPostInit

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
	if (Minecraft.getMinecraft().player != null) {
		if ((event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiContainerCreative || event.getGui() instanceof GuiWearables)
				&& !Minecraft.getMinecraft().player.getCapability(TF2weapons.INVENTORY_CAP, null).isEmpty()) {
			// GuiContainer gui = (GuiContainer) event.getGui();
			event.getButtonList().add(new GuiButton(97535627, event.getGui().width / 2 - 10, event.getGui().height / 2 + 95, 20, 20, "W"));
		}

		if (event.getGui() instanceof GuiMerchant)
			if (((GuiMerchant) event.getGui()).getMerchant().getDisplayName().getUnformattedText().equals(I18n.format("entity.hale.name"))) {
				event.getButtonList().add(new GuiButton(7578, event.getGui().width / 2 - 100, event.getGui().height / 2 - 110, 100, 20, "Change Team"));
				event.getButtonList().add(new GuiButton(7579, event.getGui().width / 2, event.getGui().height / 2 - 110, 100, 20, "Recover Lost Items"));
			}
		Minecraft.getMinecraft().player.getCapability(TF2weapons.WEAPONS_CAP, null).state &= 8;
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:18,代碼來源:TF2EventsClient.java

示例6: guiPostAction

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void guiPostAction(GuiScreenEvent.ActionPerformedEvent.Post event) {

	if (event.getGui() instanceof GuiInventory || event.getGui() instanceof GuiContainerCreative)
		if (event.getButton().id == 97535627) {
			// Minecraft.getMinecraft().displayGuiScreen(null);
			TF2weapons.network.sendToServer(new TF2Message.ShowGuiMessage(0));
		}

	if (event.getGui() instanceof GuiWearables)
		if (event.getButton().id == 97535627) {
			event.getGui().mc.displayGuiScreen(new GuiInventory(event.getGui().mc.player));
		}
	// PacketHandler.INSTANCE.sendToServer(new
	// PacketOpenNormalInventory(event.getGui().mc.player));
	if (event.getGui() instanceof GuiMerchant && event.getButton().id == 7578) {
		ClientProxy.displayScreenJoinTeam();
	}
	else if (event.getGui() instanceof GuiMerchant && event.getButton().id == 7579) {
		TF2weapons.network.sendToServer(new TF2Message.ActionMessage(18));
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:23,代碼來源:TF2EventsClient.java

示例7: onInitGuiPost

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onInitGuiPost(GuiScreenEvent.InitGuiEvent.Post event)
{
    if(!hasShownFirstGui)
    {
        hasShownFirstGui = true;

        //Add the layer renderers
        Render renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityRabbit.class);
        if(renderer instanceof RenderRabbit)
        {
            RenderRabbit renderRabbit = (RenderRabbit)renderer;
            renderRabbit.addLayer(new LayerFancyBunny(renderRabbit));
        }
    }
}
 
開發者ID:iChun,項目名稱:Better-Than-Bunnies,代碼行數:17,代碼來源:BetterThanBunnies.java

示例8: mouseClicked

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
{
	if (p_73864_3_ == 0) {
		for (int l = 0; l < this.buttonList.size(); l++)
		{
			GuiButton guibutton = (GuiButton)this.buttonList.get(l);
			if (guibutton.mousePressed(this.mc, p_73864_1_, p_73864_2_))
			{
				GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
				if (MinecraftForge.EVENT_BUS.post(event)) {
					break;
				}
				this.selectedButton = event.button;
				event.button.func_146113_a(this.mc.getSoundHandler());
				actionPerformed(event.button);
				if (equals(this.mc.currentScreen)) {
					MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.buttonList));
				}
			}
		}
	}
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:23,代碼來源:GuiScreen.java

示例9: onInitGuiScreen

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void onInitGuiScreen(GuiScreenEvent.InitGuiEvent.Post event) {
	if (active) {
		LabelButtonInfo.inject(event.getGui());
		if (event.getGui() instanceof GuiIngameMenu) {
			event.getButtonList().add(new GuiButton(200, (event.getGui().width / 2) - 100, event.getGui().height - 20, I18n.format("gui.controller")));
		}
		if (event.getGui() instanceof GuiMainMenu) {
			this.selector = new GuiButtonSelector(event.getGui().width / 2, event.getGui().height / 2 + 30, 40, event.getButtonList().toArray(new GuiButton[0]));
			event.getButtonList().clear();
		}
		if (event.getButtonList().size() != 0)
			ActionButtonChange.moveMouse(new Wrapper(event.getButtonList().get(0)), event.getGui().width, event.getGui().height);
	}
}
 
開發者ID:thilokru,項目名稱:Controller-Support,代碼行數:16,代碼來源:ModEventHandler.java

示例10: preKeyboardInput

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void preKeyboardInput(GuiScreenEvent.KeyboardInputEvent.Pre event) {
    if (event.getGui() instanceof GuiContainer && playerHasBook()) {
        GuiContainer gui = (GuiContainer) event.getGui();
        Slot slot = gui.getSlotUnderMouse();
        if (slot != null && slot.getHasStack()) {
            if (Keyboard.getEventKey() == ProxyClient.recipeKey.getKeyCode() && RecipeManager.hasRecipes(slot.getStack())) {
                GuideBookGui.onOpenCmd = "recipe";
                GuideBookGui.onOpenArg = slot.getStack();
                Minecraft.getMinecraft().player.openGui(GuideBookMod.instance, 0, Minecraft.getMinecraft().world, 0, 0, 0);
            }
            else if(Keyboard.getEventKey() == ProxyClient.usageKey.getKeyCode() && RecipeManager.hasUsages(slot.getStack())) {
                GuideBookGui.onOpenCmd = "usage";
                GuideBookGui.onOpenArg = slot.getStack();
                Minecraft.getMinecraft().player.openGui(GuideBookMod.instance, 0, Minecraft.getMinecraft().world, 0, 0, 0);
            }
        }
    }
}
 
開發者ID:Creysys,項目名稱:GuideBook,代碼行數:20,代碼來源:ClientPlayerHandler.java

示例11: onGuiScreenonInitGui

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void onGuiScreenonInitGui(GuiScreenEvent.InitGuiEvent event) {
	if (event.gui instanceof GuiIngameMenu) {
		GuiIngameMenu menue = (GuiIngameMenu) event.gui;
		event.buttonList.add(new GuiButton(20, menue.width / 2 - 100, menue.height / 4 + 128, 200, 20, "Teambattle Settings"));
	}
}
 
開發者ID:HyCraftHD,項目名稱:TeambattleMod,代碼行數:8,代碼來源:ClientEventHandler.java

示例12: onDrawBackground

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void onDrawBackground(GuiScreenEvent.BackgroundDrawnEvent event)
{
    if (renderRecipes && event.getGui() instanceof GuiContainer)
    {
        GuiContainer gui = (GuiContainer) event.getGui();
        RecipeStorage recipes = InputEventHandler.instance().getRecipes();
        int count = recipes.getRecipeCount();

        for (int recipeId = 0; recipeId < count; recipeId++)
        {
            this.renderStoredRecipeStack(recipeId, count, recipes.getRecipe(recipeId).getResult(),
                    gui, gui.mc, recipeId == recipes.getSelection());
        }
    }
}
 
開發者ID:maruohon,項目名稱:itemscroller,代碼行數:17,代碼來源:RenderEventHandler.java

示例13: onDrawBackgroundEventPost

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SubscribeEvent
public void onDrawBackgroundEventPost(GuiScreenEvent.BackgroundDrawnEvent e)  {
    if (currentTask == ITask.TaskType.INVENTORY_SLOT) {
        GuiScreen currentGui = e.getGui();
        if (currentGui instanceof GuiContainer) {

            Container openContainer = ClientProxy.mc.player.openContainer;
            if (openContainer != null) {

                if (guiInventoryTask == null)
                    guiInventoryTask = new GuiInventoryTask(current_target, current_dimension, openContainer, (GuiContainer) currentGui);
                guiInventoryTask.drawScreen(e.getMouseX(), e.getMouseY(), 1.0F);
            }
        }
    } else {
        guiInventoryTask = null;
    }
}
 
開發者ID:univrsal,項目名稱:IIDY,代碼行數:19,代碼來源:ClientEventHandler.java

示例14: mouseClickedSuper

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
/**
 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
 */
protected void mouseClickedSuper(int mouseX, int mouseY, int mouseButton) throws IOException
{
    if (mouseButton == 0)
    {
        for (int i = 0; i < this.buttonList.size(); ++i)
        {
            GuiButton guibutton = (GuiButton)this.buttonList.get(i);

            if (guibutton.mousePressed(this.mc, mouseX, mouseY))
            {
                GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.buttonList);
                if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event))
                    break;
                guibutton = event.getButton();
                ReflectionHelper.setPrivateValue(GuiScreen.class, this, guibutton, "selectedButton", "field_146290_a");
                guibutton.playPressSound(this.mc.getSoundHandler());
                this.actionPerformed(guibutton);
                if (this.equals(this.mc.currentScreen))
                    MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.GuiScreenEvent.ActionPerformedEvent.Post(this, event.getButton(), this.buttonList));
            }
        }
    }
}
 
開發者ID:zerofall,項目名稱:EZStorage2,代碼行數:27,代碼來源:GuiExtractPort.java

示例15: mouseClicked

import net.minecraftforge.client.event.GuiScreenEvent; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
protected void mouseClicked(int par1, int par2, int par3) {
	if (par3 == 0) {
		for (int l = 0; l < this.OFMbuttonList.size(); l++) {
			GuiButton guibutton = (GuiButton)this.OFMbuttonList.get(l);
			if (guibutton.mousePressed(this.mc, par1, par2)) {
				GuiScreenEvent.ActionPerformedEvent.Pre event = new GuiScreenEvent.ActionPerformedEvent.Pre(this, guibutton, this.OFMbuttonList);
				if (MinecraftForge.EVENT_BUS.post(event))
					break;
				event.button.func_146113_a(this.mc.getSoundHandler());
				actionPerformed(event.button.id);
				if (equals(this.mc.currentScreen))
					MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.ActionPerformedEvent.Post(this, event.button, this.OFMbuttonList));
			}
		} 
	}
	super.mouseClicked(par1, par2, par3);
}
 
開發者ID:PC-Logix,項目名稱:OpenFM,代碼行數:19,代碼來源:GuiRadioBase.java


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