Lsbox moving Thread last updated on 2004-04-11 20:11:54

Posted by member 125450 on 2004-04-09 10:15:33

How do I get Litestep to reload a config file.
I'm setting up toggles for LSboxes and having remaining boxes move and strech to fill the viod. I can move and strech by using !lsBoxmove and !LSBoxResize, but cannot add the box back in and have the other boxes adjust accordingly. The X pos on the boxes are vars:
TaskWide $ResolutionX-670+trayx+mailx+ampx+vwmx$
TaskposX $420-ampx-mailx$
ampx is based on the value of ampOn true/false

Example:
I setup my script to textreplace a var

*Script bang !ampOn
If ampOn = true
*Script exec !textreplace @$ConfigDir$configure.rc@ @^(ampOn *)true@ @\1false@
*Script exec !LSBoxDestroy amp
Endif
If ampOn = false
*Script exec !textreplace @$ConfigDir$configure.rc@ @^(ampOn *)false@ @\1true@
!LsBoxCreate $ConfigDir$amp.box
Endif
*Script ~bang

Now with ampOn false my other boxes move to new positions

Then when !ampOn executes it still sees ampOn True and gives me an error from the box destroy saying can't find amp
If I use !recycle everthing works, but I don't want to recycle the theme

I've tried !refreshsettings, !reload, tried unloading LSbox and reloading and a dozen other half-backed Ideas

I've been browsing script files for the answer, just not clicking

Posted by member 12025 on 2004-04-10 23:45:04 link

Use mzscript to do the work while LS is running. Make it's variable file the same one (or ones) as you use for evars, and just be sure to never have any evars ($$) in the script file and no mzscript variables in any other files (%{}). This way, you have the same variable name for the evar and mzscript variable, so the mzscript ones get saved like you need them on !recycle.
It's not perfect, like any decent solution :), but it works very well, and can start saving you headaches right off the bat.
!reload and !refresh kinda work, but some modules don't like them, and you still have to reload the modules in question each time you make some changes.

Posted by member 7 on 2004-04-11 01:33:29 link

!execute [!changesettings][!reload][!reloadmodule affectedmodule.dll]

Posted by member 125450 on 2004-04-11 20:11:54 link

Hey thanks will give those ideas a shot