Posted April 29, 201312 yr for my mod, I need a gui that can be written in (kind of like the sign) but I'm not sure how to do it. I've looked at the sign but that didn't help me at all. if anyone can point me to a tutorial or help me set it up, that would be great. Thanks in advance.
April 30, 201312 yr Author I can set up all but one thing in the GUI. I don't know how to make what the player is typing show up in the GUI. kind if like the search box in NEI.
April 30, 201312 yr Author I tried what you said I should do, but it returns a NullPointerError when I open the GUI. it says the error is on line 76 of this file. https://github.com/code-lyoko-modding/CodeLyokoMod/blob/master/matt/lyoko/client/GuiTowerConsole.java I'm not sure why it gives that or how to fix it.
May 1, 201312 yr Author now I have a new problem. the text box is hidden behind the GUI screen. I put it on the screen on line 83 of the previously linked file. when I put it in drawGuiContainerForegroundLayer the text box isn't correctly displayed. EDIT: also, how would I change a variable in the TileEntity through the GUI? I have some basic packet handling stuff set up in the corresponding files, but it doesn't even change the client side value.
May 1, 201312 yr when button is pressed: - Send button press packet to the Server - Server get's the packet, checks the type and figures it's a packet relating to your GUI - You check the button ID, and then if button ID == SetValueButtonID - Get TE based on the xyz you sent with the packet and the player's world. - Check TE to be of correct type and not null - instanceof - and then te.SetValue(ValueYouSentViaPacketHere) If you guys dont get it.. then well ya.. try harder...
May 1, 201312 yr Author It's a text field not a button. And I have absolutely no clue how to do steps 1-3
May 1, 201312 yr Well you enter text, press enter and the program know's you are done typing text? There's some action preformed so it knows you are done typing and that this is the final text you wanted inn the field? Haven't used dynamic text fields but there should be some method of knowing when you are done editing them I assume? Else you could have a button to press once you are done typing. Then make that method tell the packet handler to send a packet. I guess this one is still up to date: http://www.minecraftforge.net/wiki/Packet_Handling There you can see how they send int's and such via packets, so using that you should be able to send a packet containing the ints x,y,z and the string from the text box as well as any other data you want. If you guys dont get it.. then well ya.. try harder...
May 1, 201312 yr Author Okay, I've got everything working except that the text box appears behind the GUI. for now I have the text box partially visible from the side. anyone know how to make it appear on the top?
May 2, 201312 yr Nice! Well done mate! As for you're last question I have no idea but since none else has answered you I'm just gonna try a thought I have: Since I can't see a variable for depth on the field when you call for them/it to be drawn I'd guess there's some other way to decide what's drawn on top. So I'd assume that the order inn which the draw calls are placed would be important? Maybe first called, first drawn and thereby it's drawn behind everything further below? If you guys dont get it.. then well ya.. try harder...
May 2, 201312 yr Author maybe, but if I call it in the method that draws stuff in the foreground, then the visual is shifted down and to the right.
May 2, 201312 yr I meant what happens if you move the line for drawing the text field to below the line drawing the background? If you guys dont get it.. then well ya.. try harder...
May 2, 201312 yr y just no read your code: this.textBoxCode.drawTextBox(); super.drawScreen(par1, par2, par3); with that u are saying to the textbox render before the rest it should be super.drawScreen(par1, par2, par3); this.textBoxCode.drawTextBox();
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.