Notifications
Clear all

[Closed] Toggle Show Buttons in Modifier Stack – problem

Hi

I got these two scripts, where the first one does “update in realtime” thanks to the cui.commandPanelOpen = false / true, while the second one doesnt.

How can it be solved then?

fn changeCPOrderToggle=
(	
local max_ini = getMaxIniFile()	
local order = getIniSetting max_ini "WindowState" "WindowOrder" == "8"
setIniSetting max_ini "WindowState" "WindowOrder" ( if order then "0" else "8")
format "Is docked on top?:%
" (not order)
cui.commandPanelOpen = false
cui.commandPanelOpen = true	)
changeCPOrderToggle()  --This is working fine

fn displayCPButtonsToggle=
(
local max_ini = getMaxIniFile()
local visible = getIniSetting max_ini "Modstack" "visible" == "1"
setIniSetting max_ini "Modstack" "visible" (if visible then "0" else "1")
format "Is visible?:%
" (not visible)
cui.commandPanelOpen = false
cui.commandPanelOpen = true
)
displayCPButtonsToggle() --This only after restart