DrD Posted September 29, 2015 Posted September 29, 2015 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. Quote
DrD Posted September 30, 2015 Author Posted September 30, 2015 Updated the question because I could solve my first problem. :-) Quote
DARKHAWX Posted September 30, 2015 Posted September 30, 2015 Could you not just save the buttons as variables? or use the button id's? Quote No signature for you!
Ernio Posted September 30, 2015 Posted September 30, 2015 Buttons have IDs. this.buttonList.add(new GuiButton(id, x, y, width, height, "NameOrLangLink")); You can: if (guiButton.id == 1) { do } Quote 1.7.10 is no longer supported by forge, you are on your own.
DrD Posted September 30, 2015 Author Posted September 30, 2015 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! Quote
Recommended Posts
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.