Clue.dialog constructor

Clue.dialog({
  1. required String id,
  2. InteractableRenderSettings? renderSettings,
  3. Action<InteractableTooltip> onHover = _defaultOnHover,
  4. Padlock? padlock,
  5. String? keyId,
  6. EscapeGameDialog? noKeyDialog,
  7. EscapeGameDialog? clueDialog,
  8. bool removeAfterFound = false,
  9. InteractableTooltip? removedTooltip,
})

Creates a new Clue instance by providing some dialogs.

Implementation

Clue.dialog({
  required String id,
  InteractableRenderSettings? renderSettings,
  Action<InteractableTooltip> onHover = _defaultOnHover,
  Padlock? padlock,
  String? keyId,
  EscapeGameDialog? noKeyDialog,
  EscapeGameDialog? clueDialog,
  bool removeAfterFound = false,
  InteractableTooltip? removedTooltip,
}) : this(
        id: id,
        renderSettings: renderSettings,
        onHover: onHover,
        padlock: padlock,
        keyId: keyId,
        onCantUnlock: (escapeGame) {
          if (noKeyDialog != null) {
            escapeGame.showDialog(noKeyDialog);
          }
          return const ActionResult.failed();
        },
        onFound: (escapeGame) {
          if (clueDialog != null) {
            escapeGame.showDialog(clueDialog);
          }
          return const ActionResult.success();
        },
        removeAfterFound: removeAfterFound,
        removedTooltip: removedTooltip,
      );