showMilestoneDialog

utils.dlgs.showMilestoneDialog(ParentFigure, userPrefs, mode, options)

SHOWMILESTONEDIALOG - Show a gamification milestone / current-stats dialog with a celebration.

Syntax:
showMilestoneDialog(ParentFigure, userPrefs, mode)
showMilestoneDialog(ParentFigure, userPrefs, mode, options)

video and user performance statistics.

Input Arguments:
  • ParentFigure - handle to the parent window (AppContainer, uifigure, or []); used to center the dialog. Pass [] to use the cached handle from a prior call. In MIB pass obj.mibModel.getProgressBarParent() so the dialog follows the active dataset window when it is undocked. To supply the MIB installation path use options.mibPath.

  • userPrefs - struct - mibModel.preferences.Users (provides tier data and stats)

  • mode - [char] display mode:

    • 'milestoneReached' - congratulations dialog for reaching a new tier (default)

    • 'currentStats' - show current score and progress

  • options (optional) - struct with fields:

    • .mibPath - [char] path to MIB installation directory (default: '')

    • .WindowStyle - [char] 'modal' (default for 'milestoneReached') or 'normal'

    • .ParentFigure - [handle] uifigure / AppContainer handle for centering

Output Arguments:
  • newStatsPath - [char] folder chosen by the user for the per-workstation statistics files, or '' if it was not changed. The caller is expected to hand it to models.MibModel.relocateUserStats(), which carries this machine’s points over and sums in the statistics of the other workstations

  • updatedTiers - struct with the Tiers data the dialog was shown with; unchanged by the dialog itself

(none when called without output arguments - dialog blocks until dismissed)

Example 1 - Show a milestone congratulations dialog

utils.dlgs.showMilestoneDialog(obj.view.gui, ...
    obj.mibModel.preferences.Users, 'milestoneReached');

Example 2 - Show current score and progress

utils.dlgs.showMilestoneDialog(obj.view.gui, ...
    obj.mibModel.preferences.Users, 'currentStats');