Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: FunctionCallHandler

[25:7] extends: FunctionCallDelegate

Wraps an AussomFunctionCallHandler (subclass of FXGL's abstract FunctionCallHandler) so Aussom code can resolve function-call lines from a DialogueGraph (e.g. "give_item sword 1"). Two surfaces:

  • onHandle(Cb) — fallback for unmatched calls. The callback receives (functionName, argsList) and may return any value; the return is the value substituted into the dialogue scene.
  • addFunctionCallDelegate(obj) — adds a Java object whose methods are scanned and dispatched by name; if a call matches one of those method signatures, the fallback is skipped.

Methods

  • FunctionCallHandler ()

    Creates a new FunctionCallHandler. Use onHandle to wire the fallback before passing this to CutsceneService.startDialogueSceneFull.

  • adopt (object Ajo)

    Wraps an existing FunctionCallHandler AussomJavaObject.

    • @p Ajo is an AussomJavaObject around a FunctionCallHandler.
    • @r A new wrapper.
  • onHandle (callback Cb)

    Registers the fallback handler called when no delegate method matches the dialogue function-call line.

    • @p Cb is a callback (functionName, argsList) -> any.
    • @r this object
  • addFunctionCallDelegate (object DelegateObj)

    Adds a Java delegate whose methods will be scanned and dispatched by name when a dialogue function-call line matches.

    • @p DelegateObj is an AussomJavaObject around a FunctionCallDelegate.
    • @r this object
  • removeFunctionCallDelegate (object DelegateObj)

    Removes a previously-added delegate.

    • @p DelegateObj is an AussomJavaObject around a FunctionCallDelegate.
    • @r this object
  • exists (string FunctionName, int ParamCount)

    Returns whether a function with the given name and parameter count is registered through a delegate.

    • @p FunctionName is the name of the function.
    • @p ParamCount is the number of parameters.
    • @r A bool.
  • getRfc ()

    Returns the underlying ReflectionFunctionCaller as a raw AJO (the engine's dispatch table). Wrap with the ReflectionFunctionCaller wrapper if you need typed access.