obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

frontend-tools: Add ability to enable/disable scripts

Open cg2121 opened this issue 3 years ago • 14 comments

Description

This adds the ability to enable or disable scripts by clicking the visibility icon in the scripts list.

Screenshot from 2022-07-27 21-53-12

Motivation and Context

If a user doesn't want to use a script, but use it later, they can now just disable it without unloading and loading it.

How Has This Been Tested?

Tested by enabling/disabling scripts.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

cg2121 avatar Mar 08 '22 08:03 cg2121

Can it log the enabled state of scripts for support?

exeldro avatar Mar 08 '22 08:03 exeldro

@exeldro I feel the log would get too spammy when users enable/disable scripts. Plus sources are not logged when they are toggled, so this would be the same behavior as them.

cg2121 avatar Mar 08 '22 09:03 cg2121

As long as the state on startup is logged, that should be fine.

WizardCM avatar Mar 08 '22 09:03 WizardCM

I'd like feedback from @Warchamp7 but my gut reaction to using the 👁 icon for enabling/disabling a script seems wrong. Like, it makes sense as an "active" checkbox but the eye usually implies "visibility" somehow, not just being on or off.

dodgepong avatar Mar 08 '22 18:03 dodgepong

The eye symbol is consistent with our Filters dialog, including audio filters.

WizardCM avatar Mar 09 '22 01:03 WizardCM

The eye makes sense for visual filters, though I've never really liked it for audio filters. I think it only ends up working in the audio filters dialog because of the parallel use in the video filters dialog.

dodgepong avatar Mar 09 '22 03:03 dodgepong

Heads up, there are merge conflicts.

WizardCM avatar Apr 13 '22 06:04 WizardCM

Audio filters should have an ear or speaker icon instead of an eye. Scripts should have a play (active) / pause (inactive) icon.

mufunyo avatar Apr 13 '22 22:04 mufunyo

Agreeing with @dodgepong I'd like to see this as a checkbox instead of the eye toggle.

In the future I'd like to add a proper UI toggle button to replace checkboxes in many places (The left/right style dot one)

Warchamp7 avatar Apr 14 '22 12:04 Warchamp7

Updated to latest master.

I agree with @Warchamp7, that we should have the slider toggle. But for now, I think the eye icon is fine because it is used elsewhere in the program.

cg2121 avatar Apr 17 '22 07:04 cg2121

UX-wise it does feel weird that the properties section displays "No properties available" when a script is disabled but selected. Outside of that, this seems to do what it says on the tin.

WizardCM avatar Jun 17 '22 09:06 WizardCM

UX-wise it does feel weird that the properties section displays "No properties available" when a script is disabled but selected. Outside of that, this seems to do what it says on the tin.

Could this be changed to show a new string indicating "Script is disabled" instead?

Otherwise fine with this. We use the eye icon for toggling audio filters too.

Warchamp7 avatar Jun 25 '22 20:06 Warchamp7

Updated to have the label show that the script is disabled. Screenshot from 2022-07-27 21-53-12

cg2121 avatar Jul 28 '22 02:07 cg2121

Updated to have the label show that the script is disabled. Screenshot from 2022-07-27 21-53-12

As a user, I puzzle why the description of a script is now set to "Script is disabled".

I would have expected, a description of the script...

Reading this PR, I understand how we ended up here, and that it's the execution of the script that probably populates it's description, but as a User I'd very much like to know what a script does, without having to enable it.

ryantheleach avatar Sep 13 '22 17:09 ryantheleach

Added seeking testers, but conflicts will need to be resolved. Once CI is re-run, we can drop this PR for people in the scripting channels to test.

Fenrirthviti avatar Nov 11 '22 20:11 Fenrirthviti

The merge conflicts are now fixed.

As a user, I puzzle why the description of a script is now set to "Script is disabled".

It is not possible to get the description of the scripts, as they are unloaded when disabled.

cg2121 avatar Nov 12 '22 14:11 cg2121

Coming back around to this, how hard would it be to still load the description and possibly even properties (disabled) of scripts but not run their other functions? I imagine it would require some deeper changes, but should be possible, no?

Warchamp7 avatar Mar 05 '23 20:03 Warchamp7

Updated to use a single checkbox in the corner instead of the visibility icons. This will also look nicer when we use the new OBS widgets in #8447.

Enabled: Screenshot from 2023-10-10 15-22-12

Disabled: Screenshot from 2023-10-10 15-22-20

cg2121 avatar Oct 10 '23 20:10 cg2121

I don't think it makes sense to have this toggle in the corner. It's visually disconnected from everything else in the window. Can we put the checkbox back on the list items and just an actual checkbox instead of the eye icon?

It looks like in the latest screenshot we are able to load the description when the script is disabled. Are we able to load the properties?

If we CAN, I'd like to still show all the property controls but have them disabled.

If we CAN'T, I'd like to amend the info text to say Script properties cannot be viewed or modified when a script is disabled.

Warchamp7 avatar Oct 11 '23 16:10 Warchamp7