News:

SMFNew Installed

+-+-

User+-

Welcome, Guest.
Please login or register.
 
 
 

Login with your social network

Forgot your password?

Site Stats+-

Members
Total Members: 728
Latest: Cho
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 10932
Total Topics: 795
Most Online Today: 157
Most Online Ever: 854
(September 18, 2024, 07:49:37 am)
Users Online
Members: 0
Guests: 229
Total: 229

Author Topic: UI Button Toggle Logic  (Read 1887 times)

0 Members and 71 Guests are viewing this topic.

UI Button Toggle Logic
« on: »
Hi all.

It's been a while since I was modding, but in the last few days I've started working on a small project. One mod I'm trying to do is to make a simple show/hide toggle for the in-game side tabs.

I can make the tabs show and hide with a standard button, but I can't figure out the logic on how to do it with a toggle button. I guess it's not so hard, but I can't wrap my head around it... I've tried looking at some logic, but the once I've found contains more than what I'm looking to do, so I get confused.

Once I know how to use the toggle button, I need to figure out how to prevent the tabs from showing again after the side panels have been opened. I'm guessing this can be done with the Game State Controller some how.

Any help or pointers to example mods are appreciated.

Share on Bluesky Share on Facebook


Re: UI Button Toggle Logic
« Reply #1 on: »
Quote
Any help or pointers to example mods are appreciated.

Maybe you can see this Mod: Smart Panel Tabs Toggle

Quote
I'm guessing this can be done with the Game State Controller some how.

If you are looking Mod for Game State Controller, you can see this Mod: Steam Controller Custom UI

I hope this can help. :D

Re: UI Button Toggle Logic
« Reply #2 on: »
Thanks for your reply.

I've looked at the Smart Panel Tabs Toggle mod, but that's the one that confuse me. The logic has much more going on than the toggle, so I'm having a hard time understanding what is what.

Re: UI Button Toggle Logic
« Reply #3 on: »
Maybe you can see this Mod:
- Auto Consume
- Map keybinds (Toggle & hold)
- UI Display Toggle

I don't know if this is simpler than the previous one or not. :)
« Last Edit: July 24, 2018, 01:37:14 pm by Sch123 »

Re: UI Button Toggle Logic
« Reply #4 on: »
Hi @Wolven !  Firstly, i hope youre using GUTS to work with your UI elements! I personally find it horrific to try and work with UI .LAYOUT files via a text editor.

Next, just to check i'm getting it sraight - you say you can make stuff open and close with "standard buttons" but can't make a "toggle button" work. But isn't "toggle" how the standard buttons are operating (click it once, it opens something. click it again, it closes that something)?  So my question is, what is it you want to make into a toggle - some UI element other than the standard buttons, or a keystroke?


Re: UI Button Toggle Logic
« Reply #5 on: »
The best example is "hide menu buttons in combat" mod by zParticle


Then if you want the tabs to be kept hidden even after you exited the game...

What you'll need:

1. Savable STAT (Data Editors/Stats)
2. Logic Group (If there's an existing, no need to add new)
3. Stat Operator x2
4. Stat Evaluator x1
5. Timer x1 (Loops forever)

LOGIC in logic group:

- Insert your button and 2 stat operators

- Set your button to (Stat) operate for active value and inactive value (I use 0 for OFF and 1 for ON)

- Insert your Timer, Stat Evaluator, and the object you want hidden/shown

- Set a timer that (Stat) evaluates your custom stat's value for true or false

- If Stat Evaluator is true/false then hide/show the object.

Note: Make sure that no other LOGIC is trying to hide/show your object
Note2: If you intend to hide/show the whole menu with menu controller, be sure to mind other LOGIC also. Specially during combat and pause menu.

Re: UI Button Toggle Logic
« Reply #6 on: »
Ah. A reply from the UI master. Thank you very much. I'll see if I can get it working with these instructions.

Re: UI Button Toggle Logic
« Reply #7 on: »
@doudley !!! So nice to hear from you :D

Yep getting a reply from doudley is like opening a boss chest ;) !


Re: UI Button Toggle Logic
« Reply #8 on: »
@doudley !!! So nice to hear from you :D

Yep getting a reply from doudley is like opening a boss chest ;) !
:D

Thanks @Phanjam !

 

Recent Topics+-