Interface IScaleformFunctionRegistrar
- Namespace
- SkyrimForge.Menus
- Assembly
- SkyrimForge.dll
Adds functions that this plugin implements to Scaleform movies, for their ActionScript to call.
public interface IScaleformFunctionRegistrar
Remarks
// _root.getPlayerGold() in the movie's ActionScript calls the delegate below.
scaleform.Register(movie, root, "getPlayerGold", call => call.RetVal?.SetNumber(player.GetGoldAmount()));
A delegate may call the game directly. An exception from a delegate is written to the log of the plugin that registered it. A registration lasts until the process exits.
Properties
OnMovieCreated
Raised as the game finishes each movie.
IGameEvent<ScaleformMovieCreatedEventArgs> OnMovieCreated { get; }
Property Value
Remarks
The game builds a menu's movie each time the menu opens, so a function is registered again on each one. A handler may call the game, and may call Register(IGFxMovie, GFxValue, string, Action<Params>) for the movie it was given.
Exceptions
- InvalidOperationException
The running SKSE has no Scaleform interface.
Methods
Register(IGFxMovie, GFxValue, string, Action<Params>)
Puts a function named name on target.
void Register(IGFxMovie movie, GFxValue target, string name, Action<GFxFunctionHandler.Params> handler)
Parameters
movieIGFxMovieThe movie that creates the function, which is
UiMovieon the menu being extended.targetGFxValueThe ActionScript object that takes the function as a member, usually the movie's
_root.namestringThe name ActionScript uses for it.
handlerAction<GFxFunctionHandler.Params>The delegate that runs for each call.
Args.Get()returns the arguments the movie passed, and writing intoRetValsends a value back. LeavingRetValalone returns undefined.
Exceptions
- ArgumentNullException
nameorhandlerisnull.- ArgumentException
nameis empty.- InvalidOperationException
Setting the member on
targetreturned false.