//Отменяем и открываем свое
if(ConfigLoader.configFile.getBoolean("ingamemenu", Configuration.CATEGORY_GENERAL, ConfigLoader.ingamemenu, "off / on ingamemeny") == true)
{
if (event.gui instanceof GuiIngameMenu){
event.gui = new EProject.gamedata.gui.menu.GuiIngameMenu();
}
}
//guiIngamemenu тупо копируем с сорсов майна и изменяем под себя.
//ну или мое:
import EProject.gamedata.gui.shop.GuiCharacter;
import EProject.gamedata.gui.shop.GuiFAQ;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiOptions;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.achievement.GuiStats;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
@SideOnly(Side.CLIENT)
public class GuiIngameMenu extends GuiScreen
{
private int field_146445_a;
private int field_146444_f;
private static final String __OBFID = "CL_00000703";
public static EntityPlayer plas;
/**
* Adds the buttons (and other controls) to the screen in question.
*/
public void initGui()
{
this.field_146445_a = 0;
this.buttonList.clear();
byte b0 = -16;
boolean flag = true;
this.buttonList.add(new GuiButton(1, this.width / 2 - 40, this.height / 4 - 0 + b0, 98, 20, I18n.format("Save test simulation", new Object[0])));
if (!this.mc.isIntegratedServerRunning())
{
((GuiButton)this.buttonList.get(0)).displayString = I18n.format("Select character", new Object[0]);
}
this.buttonList.add(new GuiButton(0, this.width / 2 - 40, this.height / 4 - 40 + b0, 98, 20, I18n.format("Options", new Object[0])));
//this.buttonList.add(new GuiButton(0, this.width / 2 - 200, this.height / 4 + 96 + b0, 98, 20, I18n.format("menu.options", new Object[0])));
GuiButton guibutton;
this.buttonList.add(guibutton = new GuiButton(7, this.width / 2 - 1100, this.height / 4 + 72 + b0, 200, 20, I18n.format("menu.shareToLan", new Object[0])));
this.buttonList.add(new GuiButton(5, this.width / 2 - 140, this.height / 4 - 40 + b0, 98, 20, I18n.format("Marketplace", new Object[0])));
this.buttonList.add(new GuiButton(6, this.width / 2 + 60, this.height / 4 - 40 + b0, 98, 20, I18n.format("Character static", new Object[0])));
guibutton.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic();
}
protected void actionPerformed(GuiButton p_146284_1_)
{
switch (p_146284_1_.id)
{
case 0:
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
break;
case 1:
p_146284_1_.enabled = false;
this.mc.theWorld.sendQuittingDisconnectingPacket();
this.mc.loadWorld((WorldClient)null);
this.mc.displayGuiScreen(new GuiMenu());
case 2:
case 3:
default:
break;
case 4:
this.mc.displayGuiScreen((GuiScreen)null);
this.mc.setIngameFocus();
break;
case 5:
if (this.mc.thePlayer != null)
// this.mc.displayGuiScreen(new GuiShop(plas));
//StarWarsMod.mc.thePlayer.openGui(StarWarsMod.instance, Resources.GUI_SHOP, (World)null, 0, 0, 0);
break;
case 6:
if (this.mc.thePlayer != null)
this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter()));
break;
case 7:
// this.mc.displayGuiScreen(new GuiShareToLan(this));
this.mc.displayGuiScreen(new GuiCharacter());
break;
case 12:
this.mc.displayGuiScreen(new GuiFAQ());
break;
}
}
/**
* Called from the main game loop to update the screen.
*/
public void updateScreen()
{
super.updateScreen();
++this.field_146444_f;
}
/**
* Draws the screen and all the components in it.
*/
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
{
this.drawDefaultBackground();
// this.drawCenteredString(this.fontRendererObj, I18n.format("menu.game", new Object[0]), this.width / 2, 40, 16777215);
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
}
}