Difference between revisions of "OnMenuOpenCloseEvent - ScriptObject"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Mator
imported>Google0013
m (As of Fallout 4 1.9.4, QuickContainerMenu is not a valid menu register. From Papyrus.log ```[08/07/2017 - 11:30:24AM] error: "QuickContainerMenu" is not a valid menu name.```)
Line 66: Line 66:
**PromptMenu
**PromptMenu
**QuantityMenu
**QuantityMenu
**QuickContainerMenu
**ScopeMenu
**ScopeMenu
**SitWaitMenu
**SitWaitMenu

Revision as of 13:54, 7 August 2017

Member of: ScriptObject

Event called when menus are opened or closed - if this active magic effect/alias/form is registered for it.

This event will only be sent to the specific script that registered for it. Other scripts attached to the same form/alias/active magic effect will not receive the event unless they also register.

Syntax

Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening)

Parameters

  • asMenuName: Name of the menu opening / closing. E.g. "LockpickingMenu", "ContainerMenu", etc.
  • abOpening: True if the menu is opening, false if the menu is closing

Example

Function SomeFunction()
  RegisterForMenuOpenCloseEvent("LockpickingMenu") ; Before we can use OnMenuOpenCloseEvent we must register.
EndFunction

Event OnMenuOpenCloseEvent(string asMenuName, bool abOpening)
    if (asMenuName== "LockpickingMenu")
        if (abOpening)
	    Debug.Trace("Lockpicking menu is open!")
        endif
    endif
endEvent

Notes

  • Aliases and quests will automatically unregister for this event when the quest stops. Active magic effects will automatically unregister when they are removed.
  • Valid menu names:
    • BarterMenu
    • BookMenu
    • BSOverlayMenu
    • CompanionMenu
    • Console
    • ConsoleNativeUIMenu
    • ContainerMenu
    • CookingMenu
    • CreditsMenu
    • CursorMenu
    • DebugTextMenu
    • DialogueMenu
    • ExamineMenu
    • FaderMenu
    • FavoritesMenu
    • GenericMenu
    • GiftMenu
    • HUDMenu
    • InventoryMenu
    • LevelUpMenu
    • LoadingMenu
    • LockpickingMenu
    • LooksMenu
    • MagicMenu
    • MainMenu
    • MessageBoxMenu
    • MultiActivateMenu
    • PauseMenu
    • PipboyMenu
    • PromptMenu
    • QuantityMenu
    • ScopeMenu
    • SitWaitMenu
    • SleepWaitMenu
    • SPECIALMenu
    • StatsMenu
    • SWFLoaderMenu
    • TerminalHolotapeMenu
    • TerminalMenu
    • VATSMenu
    • VignetteMenu
    • WorkshopMenu
    • Workshop_CaravanMenu

See Also