Difference between revisions of "OnMenuOpenCloseEvent - ScriptObject"
Jump to navigation
Jump to search
imported>Headbomb |
imported>Mator |
||
Line 20: | Line 20: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Function SomeFunction() | Function SomeFunction() | ||
RegisterForMenuOpenCloseEvent() ; Before we can use OnMenuOpenCloseEvent we must register. | RegisterForMenuOpenCloseEvent("LockpickingMenu") ; Before we can use OnMenuOpenCloseEvent we must register. | ||
EndFunction | EndFunction | ||
Revision as of 23:35, 5 May 2016
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
- QuickContainerMenu
- ScopeMenu
- SitWaitMenu
- SleepWaitMenu
- SPECIALMenu
- StatsMenu
- SWFLoaderMenu
- TerminalHolotapeMenu
- TerminalMenu
- VATSMenu
- VignetteMenu
- WorkshopMenu
- Workshop_CaravanMenu