Custom GUI tabs

Started by luckys25 on

Topic category: User side tutorials

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom GUI tabs

Hi. I want to share with you the way I made custom GUI tabs in my Worm Industries mod. There is no custom coding, just vanilla MCreator procedures. Originally I made it in MCreator 2020.5 but this tutorial was made in 2021.1.

ute

The principle is very simple. You have several GUIs and clicking the button switch between them.

 

1. Create the block/item you want to bound the GUI to.
 

2. Design your custom GUI.

afadf
I created a GUI where I want to use 3 tabs (Soup, Bell and Clock). I added pictures and buttons. This is your template GUI you will work with.

 

The "tab area" on the left side is just a custom picture.
po

adga
I set it as the main GUI for my block so when I right click the block, this GUI opens.
 

3. Create your "tab" GUIs.

For each tab create its own GUI. To keep the same layout just duplicate the main (template) GUI and modify it.

aaa
aav
sfh

I created three tab GUIs (Soup, Bell and Clock). Changed the text field in the top and added a picture in the midle. But you can add/remove whatever you want.

Also I changed the pictures in the tab area to black and white variants. Only the one that refers to actual open tab is coloured.

The easiest way to change a picture for another one is to double-click it and from the pop-up menu you choose different one.

ava
 

4. Make switching procedures.

For each tab button you have to make its own procedure. But it's very simple. Just choose from Player procedure blocks "Open screen for entity..." Then select the GUI you want to open.

Here I want to open Soup GUI after Soup Button clicking.

fhdhdh
 

5. Connect the procedures to the buttons.

Now connect the procedures you made with the right buttons in each GUI. Here I'll connect SoupButton procedure to each button "Soup" in my GUIs. Then I'll continue with connecting BellButton procedure to Bell button, etc.

abababa

Leave the button procedure empty if the button you press opens the tab you currently are in. For example I'm in the Bell tab and I click Bell button. Nothing happens because it is useless to open a GUI I'm in again.

ababababab

In the end I have got 8 mod elements:
plo
 

Now if you connected everything correctly you can see the result in the game. :)

kukt

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
   Thank you so much for…
Fri, 05/21/2021 - 10:45

 

 Thank you so much for this. This has made my traders/gui much more interesting.

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you, this was helpful!
Tue, 09/06/2022 - 00:04

Thank you, this was helpful!

Joined Dec 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Rikurob Thank you for…
Wed, 09/07/2022 - 17:40

@Rikurob Thank you for sharing it! I thought I hallucinated this tutorial when I couldn't find it again haha

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No problem, that tutorial…
Fri, 09/09/2022 - 02:19

No problem, that tutorial taught me so much about actually coding the GUIs when I was playing around with the files, its one of my personal favorites.