// DialogDemo.cs using Simuspaces.Simulation; public class DialogDemo : SimuScriptBase { public override void Start() { TryPerformAction(); Log("DialogDemo -- Start()"); } void TryPerformAction() { int success = PerformSomeAction(); if (success == 1) { ShowDialog( "Success", "Action completed successfully!", SSModalDialogIcon.Success ); } else { ShowDialog( "Error", "Failed to complete the action. Please try again.", SSModalDialogIcon.Error, SSModalDialogButtons.OKCancel, OnErrorDialogResult ); } } void OnErrorDialogResult(SSModalDialogResult result) { if (result == SSModalDialogResult.OK) Log("User OKd dialog"); else Log("User cancelled retry"); } int PerformSomeAction() { return 1; } }