Interface ICustomMenuRegistrar
- Namespace
- SkyrimForge.Menus
- Assembly
- SkyrimForge.dll
Registers a menu of the plugin's own, which the game then constructs, shows, and drives as it does its own.
public interface ICustomMenuRegistrar
Remarks
menus.Register("SkyrimForge Menu", message => message switch
{
UI_MESSAGE_TYPE.kShow => UI_MESSAGE_RESULTS.kHandled,
_ => UI_MESSAGE_RESULTS.kPassOn
});
gameTarget.UIMessageQueue.AddMessage("SkyrimForge Menu", UI_MESSAGE_TYPE.kShow);
An exception from a handler is written to the log of the plugin that registered it. Call members on the game's thread.
Methods
Register(string, Func<UI_MESSAGE_TYPE, UI_MESSAGE_RESULTS>, string?, UI_MENU_FLAGS, sbyte, INPUT_CONTEXT_ID)
Registers a menu under name.
void Register(string name, Func<UI_MESSAGE_TYPE, UI_MESSAGE_RESULTS> handler, string? movieFile = null, UI_MENU_FLAGS flags = UI_MENU_FLAGS.kNone, sbyte depth = 3, UserEvents.INPUT_CONTEXT_IDS.INPUT_CONTEXT_ID context = INPUT_CONTEXT_ID.kMenuMode)
Parameters
namestringThe name that opens and closes the menu.
handlerFunc<UI_MESSAGE_TYPE, UI_MESSAGE_RESULTS>The handler for each message the game sends the menu. It may call the game. Only kIgnore changes what the game does, leaving a show unopened or a hide unclosed. The game does not resend an ignored message.
movieFilestringThe name of a Flash movie under Data/Interface without its extension, so that MyMenu loads Interface/MyMenu.swf. Null, or a name that loads no movie, gives a menu that draws nothing but still applies its input context.
flagsUI_MENU_FLAGSThe effects the menu has on the game while it is open, such as pausing the game or capturing the cursor.
depthsbyteThe menu's rank against the others. A higher rank is nearer the front. The game's HUD is 2, its console 12, and its cursor 13.
contextUserEvents.INPUT_CONTEXT_IDS.INPUT_CONTEXT_IDWhich control mapping is in force while the menu is open.
Exceptions
- ArgumentNullException
nameorhandlerisnull.- ArgumentException
nameis empty, or the game already registers a menu under it.- InvalidOperationException
The game has no interface yet, or 32 custom menus are already registered.