Widget Switcher - Disable Button

Hi,

So, I am making a main menu using a widget switcher. When I click a button, I change the index of the widget switcher to 1, 2, 3, etc depending on what button I click, right? So, I want to be able to disable the button while the widget switcher index is at 0, 1, 2, 3, etc but I am not quite sure how to implement this. I want it to be like the Fortnite main menu and other battle royale titles.

I have tried many ways already such as checking if the widget switcher index is a certain number, disable a certain button else check if it is another index and disable another button instead but it doesn’t seem to work.

Does anybody have any idea what the best way would be to implement this?

Thank You!

This is pretty ham-fisted but has the benefit of being simple and robust:

or you could whip up a small macro:


For something a tad more complex, I’d wrap each button in a separate widget, create a [ Button | Int ] Map and make the button widgets dispatch themselves to look up their mapped indexes in the parent.

I decided to go with your first method and it worked! Thank you for your help. Also, one of the widgets in my widget switcher is set active by default which is obviously the widget with an index of 0 but I was wondering if there is any way to have the button for that widget disabled by default?

I was wondering if there is any way to
have the button for that widget
disabled by default?

Sure, modify the Construct event a bit to check what’s the default index and then disable the corresponding button:

Sorry, this has sort of confused me a little. Do I have to change everything that I have already done and replace it with the new nodes you have shown me in this print screen?

Oh, I understand now. Thank you

Edit: This worked, thank you very much for your help!

No, just add it to what you see in the first pic, the one you used. it’s just one node after setting the array :slight_smile:

By the way @everynone, I have two buttons in the same place, so I’m trying to make one visible at a time

The widget switcher contains two maps, a ‘historic’ one and a ‘current’ one. Each map has one button inviting you to see the other map (ie, Historic map has button saying “see current” and vice versa). I didn’t want both buttons to be visible because it would look more professional have one button only at a time.

THANK YOU

Oh! If you’re seeing this @everynone, I deleted my question bc I realized I had to promote the array to a variable :slight_smile: cheers