Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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...

Posted

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...

Posted

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?

Posted

Nice! Well done mate! :D

 

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...

Posted

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...

Posted

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.

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.