weeeee Posted January 4, 2018 Posted January 4, 2018 Hi, I wanted to remove a button and a string from an exisiting gui. "event.buttonList.remove(2);" worked perfectly fine to remove the button but is there a similar code to remove a string? And also, is there a way to change the state of a button? For instance when I click on "Create World" it's usually set to "Survivial" and I would like it to be set to "Creative" without having to click on it Quote
weeeee Posted January 4, 2018 Author Posted January 4, 2018 On 1/4/2018 at 9:44 PM, diesieben07 said: No. Text drawing is usually hardcoded in the GUIs drawScreen method. There is no uniform way. You need to check what the button does when clicked on and then perform a similar action when the GUI is opened. Expand Oh okay. And is there a way to "hide" buttons instead of removing them with "event.buttonList.remove(2);"? That one seems to crash my game :L Quote
hiotewdew Posted January 4, 2018 Posted January 4, 2018 If you can get the GuiButton variable possibly event.buttonList.get(number) or something like that You can set the visible variable to true/false Quote All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
weeeee Posted January 4, 2018 Author Posted January 4, 2018 On 1/4/2018 at 11:32 PM, hiotewdew said: If you can get the GuiButton variable possibly event.buttonList.get(number) or something like that You can set the visible variable to true/false Expand But where am I supposed to get that variable? :L Quote
hiotewdew Posted January 4, 2018 Posted January 4, 2018 On 1/4/2018 at 11:36 PM, weeeee said: But where am I supposed to get that variable? :L Expand Quote possibly event.buttonList.get(number) or something like that Expand Quote All Projects found here: Website Main Programmer for: Better Animals Plus, Better Animal Models Created independently: QuickHomes, ClaimIt, ClaimIt API, CloneLand, DerpCats, QuickTeleports, QuickSpawns, MCMusicPlayer, MCDevDate, [SBM] Fluid Gun, OpenScreens Work on/Contribute to: Bewitchment Commissioned for: [SBM] Breadstone, [SBM] Infinite Falling, [SBM] Dead Man's Satchel, [SBM] Handheld Piston
jabelar Posted January 5, 2018 Posted January 5, 2018 If you want a lot of control to change a gui, you can replace the GUI with one of your own that basically copies the original code but with the modifications you want. Then handle the gui open event and if the gui is the one you want to replace, replace it. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.