|
unrealtor Beginner
Joined: 23 May 2020 Posts: 18
|
Posted: Mon Apr 08, 2024 4:53 pm
Set Button State with Code |
I can't seem to find a way to basically set selected index to X on a multi-state button. I am wanting to create an alias to quickly set a few different buttons to specific state selections (ex: "ButtonA" to state 2 and "ButtonB" to state 1). Is this possible?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4689 Location: Pensacola, FL, USA
|
Posted: Tue Apr 09, 2024 12:49 pm |
If you set the ID field of the button you can do:
#STATE ID 2 |
|
_________________ Discord: Shalimarwildcat |
|
|
|
unrealtor Beginner
Joined: 23 May 2020 Posts: 18
|
Posted: Tue Apr 09, 2024 2:27 pm |
I set the button id as "dd_id", its variable as "dd_val", and there are 3 button states. I manually set the dropdown to button state 1. When I run "#state dd_id 3;#show @dd_val", the text in the dropdown doesn't change and @dd_val still displays as 1.
Update:
As I was typing this, I tried just setting the variable of the button and that worked... "#var dd_val 3".
Thanks for the help. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4689 Location: Pensacola, FL, USA
|
Posted: Tue Apr 09, 2024 8:02 pm |
The button variable has nothing to do with the state, by default anyway.
So this is expected behavior.
Usually that is a display value, for gauges and what have you.
If you are wanting to reference the current state of a given setting, you would use:
#SHOW %state(ID) |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Dybala Newbie
Joined: 05 Jul 2024 Posts: 1
|
Posted: Fri Jul 05, 2024 12:19 pm Re: Set Button State with Code |
unrealtor wrote: |
I can't seem to find a way to basically set selected index to X on a multi-state button. I am wanting to create an alias to quickly set a few different buttons to specific state selections (ex: "ButtonA" to state 2 and "ButtonB" to state 1). Is this possible? |
To set the selected index on a multi-state button, you can create an alias to quickly change specific buttons to desired states. For example, you can set 'ButtonA' to state 2 and 'ButtonB' to state 1. It should be achievable with the right scripting. |
|
|
|
|
|