Table of Contents

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

name string

The name that opens and closes the menu.

handler Func<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.

movieFile string

The 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.

flags UI_MENU_FLAGS

The effects the menu has on the game while it is open, such as pausing the game or capturing the cursor.

depth sbyte

The 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.

context UserEvents.INPUT_CONTEXT_IDS.INPUT_CONTEXT_ID

Which control mapping is in force while the menu is open.

Exceptions

ArgumentNullException

name or handler is null.

ArgumentException

name is empty, or the game already registers a menu under it.

InvalidOperationException

The game has no interface yet, or 32 custom menus are already registered.