Hi guys.
I try to store in mem block currently active subtool name.
But when i try to read variable from mem block its empty.
What am i doing wrong.
The main goal of this script is to toggle visibility of one subtool without any switching to this subtool or any mouse or ui button manipulations.
Here is a scripts(one to store subtool name and one to toggle its visibility later):
KEY_TOOLVISSTORE.TXT
[IButton,???,"store tool visibility state",
[IShowActions,0]
[IConfig,2019]
[IFreeze,
[If,[MemGetSize,VOID_StoreRestoreVisUD_MemBlock], // if UD exist do nothing
// store tool visibility state
[VarSet,activeSubT,[IGetTitle, Tool:Current Tool]] //set variable name for current subtool name
[MVarSet,VOID_StoreRestoreVisUD_MemBlock,0,activeSubT]
[Note,activeSubT,,2]
[Note,"exsist",,0.2]
,
[MVarDef,VOID_StoreRestoreVisUD_MemBlock,1,0] // esle create UD first run
// store tool visibility state
[MVarSet,VOID_StoreRestoreVisUD_MemBlock,0,[IGetTitle, Tool:Current Tool]]
[Note,activeSubT,,2]
[Note,"stored",,0.2]
]
]
]
KEY_TOOLVISRESTORE.TXT
[RoutineDef, ShowSubT,
[VarSet,activeSubT,[IGetTitle, Tool:Current Tool]] //set variable name for current subtool name
[IModSet,[StrMerge,"Tool:SubTool:",#activeSubT],17] //show current tool
]
[RoutineDef, HideSubT,
[VarSet,activeSubT,[IGetTitle, Tool:Current Tool]] //set variable name for current subtool name
[IModSet,[StrMerge,"Tool:SubTool:",#activeSubT],1] //hide current tool
]
[IButton,???,"restore tool visibility state",
[IFreeze,
[If,[MemGetSize,VOID_StoreRestoreVisUD_MemBlock], // if UD exist do nothing
// restore tool visibility state
[VarSet,activeSubT,[MVarGet,VOID_StoreRestoreVisUD_MemBlock,0]]
[Note,activeSubT,,2]
[VarSet,CheckState,[IModget,[StrMerge,"Tool:SubTool:",#activeSubT]]]
[If, [Var,#CheckState] >=16,//if the subtool is visible
[RoutineCall,HideSubT] //call the routine that will hide subtool
, //if the subtool is hidden
[RoutineCall,ShowSubT] //call routine that will show subtool
]
[Note,"restored",,0.2]
,
[Note,"no name",,0.2] // if UD do not exist in dyn mem
]
]
]