Jump to content

[Solved] Accessing GUI elements more reliably


DrD

Recommended Posts

Hi,

 

I have some noob questions.

 

Problem #1 solved itself somehow!?

 

To identify the buttons in the GUI I can do something like this:

 

if(button.displayString.contains("Difficulty")) {
   button.enabled = false;
}

 

But this fails when the user has changed his language. How can I identify the buttons more reliably? Forge version is 1517 so I'm still in 1.7.10.

Link to comment
Share on other sites

Thank you for your answers. I don't try to access my own button (that would be easier), I want to access the regular Minecraft GUI. The ID of the buttons are not unique so I cannot use "button.id".

 

Nevermind, I just did it wrong! It works now, thank you!

Link to comment
Share on other sites

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.