Posted July 31, 201312 yr Hi! I wanna make a Gui next to the inventory, but i cant find the event for it. Do you know what/where is this Event/boolean? (I think this is an event or boolean) I need a line like that: if( -|INVENTORY OPENED|- ); { tam-tararam-ta-tam-ta-tam } ;D Nevermind, please help me if you can!
July 31, 201312 yr You may use RenderGameOverlayEvent or a TickHandler. Then check if world is loaded, player exists, and has open the inventory you want to build a Gui against.
July 31, 201312 yr @GotoLink, i was using tickhandler to draw stuff before the RenderGameOverlayEvent was made. (jeez that sounds hipster) and afaik you cant interract with it. so i think its worth to note that you will only be able to look at this GUI and not interract with it how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 31, 201312 yr Author Can you make me an example? Or link me a tutorial, or any useable things of it?
July 31, 201312 yr do you need to interract with it ? like click on buttons and stuff, cuz it wont work if you need to how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 31, 201312 yr I think opening another gui (with buttons and even slots) is feasible, though you can't rely on player.opengui(...) to do that, because Minecraft would allow only one to be open at a time. You'll have to catch mouse event on your own, i suppose. Another solution would be to make an "extending Gui", a gui that look like the one you replace, with more buttons and stuff. You'll have to pass the vanilla gui content into your own then. I remember mods that probably did this in 1.4.7.
July 31, 201312 yr @GotoLink, probably with a coremod :\ how to debug 101:http://www.minecraftforge.net/wiki/Debug_101 -hydroflame, author of the forge revolution-
July 31, 201312 yr Author I think opening another gui (with buttons and even slots) is feasible, though you can't rely on player.opengui(...) to do that, because Minecraft would allow only one to be open at a time. You'll have to catch mouse event on your own, i suppose. Another solution would be to make an "extending Gui", a gui that look like the one you replace, with more buttons and stuff. You'll have to pass the vanilla gui content into your own then. I remember mods that probably did this in 1.4.7. You think it is possible? How hard do you think?
July 31, 201312 yr As for the first idea (opening a GUI while another GUI is still open) this is probably making-your-own-gui-system-from-start-to-finish (like a game within a game) kinda hard. Intensive use of a tickhandler, making your own mouse listener, catching packets if you want to pass items between the two GUIs, then saving data somehow when your own GUI closes... The second idea would require keeping a copy of the original GUI, closing it, opening a combined GUI with the copy as an argument, so it can build it again and add more. Making this copy (the only hard step, as everything else can be handled by vanilla Minecraft) may require reflection, bytecode manipulation...this is on advanced-object-handling level, i think.
August 1, 201312 yr Author I see. I will try the first way. Thanks for help! I will write when it works, or it isnt.
August 1, 201312 yr Author I have got a new idea about it! It will be sooo better! I will made a gui, like It will be GuiInGame, i will made pressable pictures to the right bottom corner. If i press, the Gui is appear. Like World of Warcraft and a binded button to Show/Hide the mouse. I think its a really good idea. ;D
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.