I want to change the messageBox behaviour in my script

Hello,

I have a script that looks like this:

macroScript AutoBackToggle
	category:"Haider"
	buttonText:"AB-Toggle"
	toolTip:"AutoBackup Toggle"
(
	on isChecked do (autoBackup.enabled)
 
	on execute do 
	if autoBackup.enabled == true then 
	(
		autoBackup.enabled = false 
		/*print (autoBackup.enabled)*/
		messageBox "Autobackup disabled." title:"Autobackup State" beep:false
	)
	else 
	(
		autoBackup.enabled = true
		/*print (autoBackup.enabled)*/
		messageBox "Autobackup enabled." title:"Autobackup State" beep:false
	)
)

The messageBox command will lock the user, forcing one to press OK before continuing.
How do I change the popup to be a regular information popup that doesn't "lock" the viewport?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

Replace it with regular rollout.

barigazy's picture

...

macroScript AutoBackToggle
	category:"Haider"
	buttonText:"AB-Toggle"
	toolTip:"AutoBackup Toggle"
(
	global msgRollPopup
	fn msgRollPopup = 
	(
		try(destroyDialog ::msgRoll)catch()
		rollout bgaRoll "Autobackup State"
		(
			local msg = if autoBackup.enabled then " Autobackup enabled." else " Autobackup disabled."
			label lbl msg pos:[5,5] style_sunkenedge:on width:140 height:16 
		)
		createDialog bgaRoll 150 26 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
	)	
	on isChecked do (autoBackup.enabled)
 
	on execute do 
		if autoBackup.enabled == true then 
		(
			autoBackup.enabled = off 
			msgRollPopup()
		)
		else 
		(
			autoBackup.enabled = on
			msgRollPopup()
		)
)

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.