added global access gui

Still have work too do with it to even use it but it opens threw greater
security till i can think of a way to manage the gui opening another
way.
This commit is contained in:
Robert Seifert 2013-04-25 02:02:25 -04:00
parent 893a94d142
commit 2ba22f5417
7 changed files with 132 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 978 B

View file

@ -0,0 +1,13 @@
package dark.library;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
public class ClientProxy extends CommonProxy
{
@Override
public void preInit()
{
}
}

View file

@ -0,0 +1,17 @@
package dark.library;
public class CommonProxy
{
public void preInit()
{
}
public void init()
{
}
public void postInit()
{
}
}

View file

@ -5,6 +5,8 @@ import java.awt.Color;
import net.minecraft.world.World;
import universalelectricity.core.vector.Vector3;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.common.SidedProxy;
import dark.library.effects.FXBeam;
public class DarkMain
@ -23,4 +25,12 @@ public class DarkMain
{
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, color.getRed(), color.getGreen(), color.getBlue(), age));
}
@SidedProxy(clientSide = "dark.library.ClientProxy", serverSide = "dark.library..CommonProxy")
public static CommonProxy proxy;
public void init()
{
proxy.preInit();
}
}

View file

@ -1,17 +1,106 @@
package dark.library.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.StringTranslate;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.gui.GuiScreen;
import universalelectricity.prefab.GuiBase;
import dark.library.DarkMain;
public class GuiGlobalList extends GuiScreen
public class GuiGlobalList extends GuiBase
{
EntityPlayer player;
private GuiTextField stringInput;
int xSize;
int ySize;
public GuiGlobalList(EntityPlayer player) {
super();
this.player = player;
this.xSize = 256;
this.ySize = 226;
}
@Override
protected void keyTyped(char keycode, int par2)
protected void keyTyped(char character, int keycode)
{
if (keycode == Keyboard.KEY_ESCAPE)
{
this.mc.thePlayer.closeScreen();
}
this.stringInput.textboxKeyTyped(character, keycode);
}
@Override
public void initGui()
{
super.initGui();
StringTranslate var1 = StringTranslate.getInstance();
int width = (this.width - this.xSize) / 2;
int height = (this.height - this.ySize) / 2;
this.stringInput = new GuiTextField(this.fontRenderer, width + 12, height + 165, 135, 11);
this.stringInput.setMaxStringLength(30);
this.buttonList.add(new GuiButtonArrow(1, width + 151, height + 21, false));
this.buttonList.add(new GuiButtonArrow(2, width + 151, height + 152, true));
Keyboard.enableRepeatEvents(true);
}
@Override
public void onGuiClosed()
{
super.onGuiClosed();
Keyboard.enableRepeatEvents(false);
}
@Override
public void updateScreen()
{
super.updateScreen();
this.stringInput.setFocused(true);
}
@Override
public void handleMouseInput()
{
super.handleMouseInput();
}
@Override
protected void actionPerformed(GuiButton button)
{
super.actionPerformed(button);
}
@Override
protected void mouseClicked(int x, int y, int type)
{
super.mouseClicked(x, y, type);
this.stringInput.mouseClicked(x, y, type);
}
@Override
protected void drawForegroundLayer(int x, int y, float var1)
{
String title = "Global Access Interface";
this.fontRenderer.drawString("\u00a77" + title, this.xSize / 2 - title.length() * 3, 4, 4210752);
}
@Override
protected void drawBackgroundLayer(int x, int y, float var1)
{
this.mc.renderEngine.bindTexture(DarkMain.GUI_DIRECTORY + "gui_access_base.png");
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int containerWidth = (this.width - this.xSize) / 2;
int containerHeight = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize);
}
}