Jump to content

Recommended Posts

Posted

Hi!

 

what i'm trying to do is replace the generic GuiChat with my own "VisualizationGuiChat" which extends GuiScreen. my class is an exact copy of GuiChat but with my own modifications.

 

now for making the game use my Gui i've put this into my main mod file (Note i'm on minecraft version 1.6.4)

 

@ForgeSubscribe
public void onOpenGuiScreen(GuiOpenEvent event)
{		
if(!(event.gui instanceof VisualizationGuiChat) && event.gui instanceof GuiChat)
{		
	String s = "";

	try 
	{
		s = readPrivateClassString("defaultInputFieldText", event.gui);
	} 
	catch (Exception e) 
	{
		System.out.println("Failed to get defaultInputFieldText");		
	}			
	//mc.displayGuiScreen(null);//clear the current screen
	mc.thePlayer.closeScreen();
	mc.displayGuiScreen(new VisualizationGuiChat(s));
}	
}

 

my GUI initializes and stuff (tested through breakpointing) however my keyTyped event never fires, it is instead fired in GuiChat, which then tells me that GuiChat was never closed as per my instruction here:

 mc.thePlayer.closeScreen(); 

before opening my one.

 

this is probably a messy way to go about it, though i'm unsure if forge's key events override the ones in Minecraft.java.. if so i could just slave the chat key to my own GUI and just be done with it but yeah.. what's stopping GuiChat from closing?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.