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