// Path: scripting/gui/MainScreen.java
// public class MainScreen extends ScriptScreen {
// 	
// 	public static final int REFRESH_TICKS = 200; //Check every 10 seconds
// 	
// 	private Container container;
// 	private Label title;
// 	private Button close, client, server;
// 	
// 	public MainScreen() {
// 		super(null);
// 	}
// 	
// 	public void setServerScripts(boolean flag) {
// 		server.setEnabled(flag);
// 	}
// 
// 	@Override
// 	protected void revalidateGui() {
// 		title.setPosition(width/2, height/4 - 20);
// 		client.setPosition(width/2 - 50, height/4 + 18);
// 		server.setPosition(width/2 - 50, height/4 + 43);
// 		close.setPosition(width/2 - 75, height/4 + 90);
// 		container.revalidate(0, 0, width, height);
// 	}
// 
// 	@Override
// 	protected void createGui() {
// 		container = new Container();
// 		title = new Label(ScriptingMod.NAME, new Tooltip("v" + ScriptingMod.VERSION));
// 		client = new ButtonVanilla(100, 20, "Client", this);
// 		client.setEnabled(ScriptingMod.proxy.getClientCore().hasScripts());
// 		server = new ButtonVanilla(100, 20, "Server", this);
// 		server.setEnabled(false);
// 		close = new ButtonVanilla(150, 20, "Close", new CloseHandler());
// 		
// 		container.addWidgets(title, close, client, server);
// 		containers.add(container);
// 		selectedContainer = container;
// 		
// 		ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getPacket(PacketType.HAS_SCRIPTS));
// 	}
// 	
// 	public void buttonClicked(Button button) { 
// 		if (button == client)
// 			mc.displayGuiScreen(new ClientMenu(this));
// 		if (button == server)
// 			ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getRequestPacket(PacketType.STATE));
// 	}
// 	
// 	@Override
// 	public void reopenedGui() {
// 		ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getPacket(PacketType.HAS_SCRIPTS));
// 	}
// 
// }


import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import scripting.gui.MainScreen;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
package scripting.forge;




public class KeyListener {
	
	private final KeyBinding scriptGUI;
	
	public KeyListener() {
		scriptGUI = new KeyBinding("key.script.gui", Keyboard.KEY_F7, "key.categories.misc");
		ClientRegistry.registerKeyBinding(scriptGUI);
	}
	
	@SubscribeEvent
	public void onKeyInput(KeyInputEvent event) {
		if (Minecraft.getMinecraft().currentScreen == null && scriptGUI.isPressed())
// Path: scripting/gui/MainScreen.java
// public class MainScreen extends ScriptScreen {
// 	
// 	public static final int REFRESH_TICKS = 200; //Check every 10 seconds
// 	
// 	private Container container;
// 	private Label title;
// 	private Button close, client, server;
// 	
// 	public MainScreen() {
// 		super(null);
// 	}
// 	
// 	public void setServerScripts(boolean flag) {
// 		server.setEnabled(flag);
// 	}
// 
// 	@Override
// 	protected void revalidateGui() {
// 		title.setPosition(width/2, height/4 - 20);
// 		client.setPosition(width/2 - 50, height/4 + 18);
// 		server.setPosition(width/2 - 50, height/4 + 43);
// 		close.setPosition(width/2 - 75, height/4 + 90);
// 		container.revalidate(0, 0, width, height);
// 	}
// 
// 	@Override
// 	protected void createGui() {
// 		container = new Container();
// 		title = new Label(ScriptingMod.NAME, new Tooltip("v" + ScriptingMod.VERSION));
// 		client = new ButtonVanilla(100, 20, "Client", this);
// 		client.setEnabled(ScriptingMod.proxy.getClientCore().hasScripts());
// 		server = new ButtonVanilla(100, 20, "Server", this);
// 		server.setEnabled(false);
// 		close = new ButtonVanilla(150, 20, "Close", new CloseHandler());
// 		
// 		container.addWidgets(title, close, client, server);
// 		containers.add(container);
// 		selectedContainer = container;
// 		
// 		ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getPacket(PacketType.HAS_SCRIPTS));
// 	}
// 	
// 	public void buttonClicked(Button button) { 
// 		if (button == client)
// 			mc.displayGuiScreen(new ClientMenu(this));
// 		if (button == server)
// 			ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getRequestPacket(PacketType.STATE));
// 	}
// 	
// 	@Override
// 	public void reopenedGui() {
// 		ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getPacket(PacketType.HAS_SCRIPTS));
// 	}
// 
// }


// Path: scripting/forge/KeyListener.java
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import scripting.gui.MainScreen;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;

package scripting.forge;




public class KeyListener {
	
	private final KeyBinding scriptGUI;
	
	public KeyListener() {
		scriptGUI = new KeyBinding("key.script.gui", Keyboard.KEY_F7, "key.categories.misc");
		ClientRegistry.registerKeyBinding(scriptGUI);
	}
	
	@SubscribeEvent
	public void onKeyInput(KeyInputEvent event) {
		if (Minecraft.getMinecraft().currentScreen == null && scriptGUI.isPressed())
			Minecraft.getMinecraft().displayGuiScreen(new MainScreen());