@DarkHelmet
That script is working as intended on my system. Perhaps the difference is that I misunderstood your intent.
The
OverrideDefaultSetting
function was only originally meant to be used before the list of default settings is processed -- which is shortly after the DOM is ready, and long before the session's permission level is known. That is what the
overrideSettings(false);
call on line 59 accomplishes. When we call
OverrideDefaultSetting
from the "Login Success" event handler, it is no longer able to affect the live
settings
object. When it is called this late, it only manages to change metadata about each setting (which is read by the UI Settings panel to know which settings to hide, what the default values are, etc).
If you wanted to leave admin users completely alone and only apply any of those settings changes to non-admin users, then that can't be accomplished simply via the
OverrideDefaultSetting
function. You can't just change the settings either (e.g.
settings.ui3_is_maximized = "1"
) because for the most part UI3 does not react to sudden changes in the settings object. You'd have to call
maximizedModeController.EnableMaximizedMode()
instead.
For some of the settings, you can actually set them (e.g.
settings.ui3_topbar_alerts_confirmed_shortcut_show = "1";
) and then call their
onChange
function (
OnChange_ui3_topbar_alerts_confirmed_shortcut_show()
) to make UI3 react to the change. But not all of the settings have an
onChange
function. You'd have to research how each setting is declared and used and identify the appropriate functions to call.
As another example,
ui3_streamingQuality
is another setting that doesnt have an
onChange
function. You'd need to instead call
genericQualityHelper.QualityChoiceChanged("1080p VBR^")
.