Posted January 4, 20187 yr 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
January 4, 20187 yr Author 1 hour ago, 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. 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
January 4, 20187 yr 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 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
January 4, 20187 yr Author 3 minutes ago, 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 But where am I supposed to get that variable? :L
January 4, 20187 yr Just now, weeeee said: But where am I supposed to get that variable? :L Quote possibly event.buttonList.get(number) or something like that 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
January 5, 20187 yr 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. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.