Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
AC.PlayerMenus Class Reference
Inheritance diagram for AC.PlayerMenus:

Classes

struct  InteractionMenuData

Public Member Functions

void OnInitPersistentEngine ()
void ShowEnabledOnStartMenus ()
void RebuildMenus (MenuManager menuManager=null)
 Rebuilds the game's Menus, either from the existing MenuManager asset, or from a new one.
void CreateEventSystem (bool force=false)
 Spawns an Event System, either using the prefab supplied in the Menu Manager, or generating one from scratch otherwise.
void OnInitialiseScene ()
void ClearParents ()
void DrawLoadingMenus ()
void DrawMenus ()
Menu GetMenuWithElement (MenuElement _element)
 Gets the Menu that a given MenuElement is a part of.
void DrawMenu (AC.Menu menu, int languageNumber=0)
 Draws an Adventure Creator-sourced Menu. This should be called from OnGUI()
void UpdateMenuPosition (AC.Menu menu, Vector2 invertedMouse, bool force=false)
 Updates a Menu's position.
void UpdateMenu (AC.Menu menu, int languageNumber=0, bool justPosition=false, bool updateElements=true)
 Updates a Menu's display and position.
bool IsEventSystemSelectingObject (GameObject _gameObject)
 Checks if the Unity UI EventSystem currently has a given GameObject selected.
bool IsEventSystemSelectingObject ()
 Checks if the Unity UI EventSystem currently has any GameObject selected.
bool DeselectEventSystemMenu (Menu _menu)
 De-selects the Unity UI EventSystem's selected gameobject if it is associated with a given Menu.
void RefreshDialogueOptions ()
void UpdateLoadingMenus ()
void CheckForInput ()
void UpdateAllMenus ()
void CheckCrossfade (AC.Menu _menu)
 Begins fading in the second Menu in a crossfade if the first Menu matches the supplied parameter.
virtual void SelectInputBox (MenuInput input)
 Selects a MenuInput element, allowing the player to enter text into it.
void OnTurnOffMenu (Menu menu)
 Called automatically whenever a Menu is turned off.
void DeselectInputBox (MenuElement menuElement)
 Deselects the active InputBox element if it is the one in the parameter.
void RemoveSpeechFromMenu (Speech speech)
 Unassigns a Speech line from any temporarily-duplicated Menus. This will signal such Menus that they can be removed.
void AssignSpeechToMenu (Speech speech)
 Duplicates any Menu set to display a single speech line.
Menu[] GetMenusAssignedToSpeech (Speech speech)
 Gets all Menus associated with a given Speech line.
void CrossFade (AC.Menu _menuTo)
 Crossfades to a Menu. Any other Menus will be turned off.
void CloseInteractionMenus ()
void EnableInteractionMenus (Hotspot hotspotFor)
 Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Hotspot.
void EnableInteractionMenus (InvInstance itemFor)
 Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to.
void EnableInteractionMenus (InvItem itemFor)
 Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to.
void RequestRepositionUpdate (Menu menu, Vector2 screenPosition)
 Repositions a menu a frame later, so that its scale values can be properly calculated after spawning. This normally only needs to be called internally.
void DisableHotspotMenus ()
string GetHotspotLabel ()
 Gets the complete Hotspot label to be displayed in a MenuLabel element with labelType = AC_LabelType.Hotspot.
bool CanCurrentlyRightClick ()
void UpdatePauseMenusRecord ()
bool ArePauseMenusOn (Menu excludingMenu=null)
 Checks if any Menus that pause the game are currently turned on.
void ForceOffSubtitles (SpeechMenuLimit speechMenuLimit=SpeechMenuLimit.All)
 Instantly turns off all Menus that have appearType = AppearType.WhenSpeechPlays.
Menu GetMenuWithCanvas (Canvas canvas)
 Gets the Menu associated with a given Unity UI Canvas</summar>

Parameters
canvasThe Canvas object linked to the Menu to be found
Returns
The Menu associated with a given Unity UI Canvas

void RegisterCustomMenu (Menu menu, bool deleteWhenTurnOff=false)
 Registers a script-created Menu instance, so that it's click-handling, updating and rendering are handled automatically.
void UnregisterCustomMenu (Menu menu, bool showError=true)
 Unregisters a script-created Menu instance, so that it is no longer updated automatically.
Menu[] GetRegisteredCustomMenus ()
 Gets all Menu instances currently registered as custom Menus that are automatically updated by PlayerMenus.
void DestroyCustomMenus ()
void RecalculateAll ()
void FindFirstSelectedElement (Menu menuToIgnore=null, bool ignoreIfAlreadySelectingMenu=false)
 Selects the first element GameObject in a Unity UI-based Menu.
void SelectUIElement (GameObject objectToSelect)
 Selects a Unity UI GameObject.
virtual int GetElementOverCursorID ()
 Gets the ID number of the CursorIcon, defined in CursorManager, to switch to based on what MenuElement the cursor is currently over.
bool IsMouseOverMenu ()
 Checks if the cursor is hovering over a Menu.
bool IsMouseOverInventory ()
 Checks if the cursor is hovering over an Inventory.
bool IsMouseOverInteractionMenu ()
 Checks if the cursor is hovering over a Menu with appearType = AppearType.OnInteraction.
bool IsInteractionMenuOn ()
 Checks if any Menu with appearType = AppearType.OnInteraction is on.
bool IsCyclingInteractionMenu ()
 Checks if the player is currently manipulating an Interaction Menu by cycling the Interaction elements inside it.
bool IsPausingInteractionMenuOn ()
 Checks if the last-opened Menu with appearType = AppearType.OnInteraction is both open and set to pause the game.
void UpdateUIInteractability ()
MainData SaveMainData (MainData mainData)
 Updates a MainData class with its own variables that need saving.
void LoadMainData (MainData mainData)
 Updates its own variables from a MainData class.
virtual void PreScreenshotBackup ()
virtual void PostScreenshotBackup ()
void DiableUIInNextFrame (Menu menu)

Static Public Member Functions

static List< MenuGetMenus (bool includeDuplicatesAndCustom=false)
 Gets a List of all defined Menus.
static Menu GetMenuWithName (string menuName)
 Gets a Menu with a specific name.
static MenuElement GetElementWithName (string menuName, string menuElementName)
 Gets a MenuElement with a specific name.
static bool IsSavingLocked (Action _actionToIgnore=null, bool showDebug=false)
 Checks if saving cannot be performed at this time.
static void ResetInventoryBoxes ()
static void CreateRecipe ()
static void ForceOffAllMenus (bool onlyPausing=false)
 Instantly turns off all Menus.
static void SimulateClick (string menuName, string menuElementName, int slot=1)
 Simulates the clicking of a MenuElement.
static void SimulateClick (string menuName, MenuElement _element, int _slot=1)
 Simulates the clicking of a MenuElement.

Protected Member Functions

void CycleMouseOverUIs ()
IEnumerator CycleMouseOverUIsCo (Menu[] _menus)
bool AreAnyMenusUI ()
void OnAddSubScene (SubScene subScene)
void OnEnterGameState (GameState gameState)
void OnExitGameState (GameState gameState)
void OnMouseOverMenu (AC.Menu menu, MenuElement element, int slot)
void UpdatePauseBackground (bool fadeIn)
bool MoveMenuToHotspot (Menu menu, Hotspot hotspot)
bool MoveUIMenuToHotspot (Menu menu, Hotspot hotspot)
void UpdateElements (AC.Menu menu, int languageNumber, bool justDisplay=false)
bool SlotIsInteractive (AC.Menu menu, int elementIndex, int slotIndex, GameState gameState)
bool CheckClicks (AC.Menu menu)
void UpdateAllMenusAgain ()
virtual void DeselectInputBox ()
void CheckClick (AC.Menu _menu, MenuElement _element, int _slot, MouseState _mouseState)
bool CheckContinuousClick (AC.Menu _menu, MenuElement _element, int _slot, MouseState _mouseState)
bool ShouldCloseInteractionMenu ()
void SetInteractionMenus (bool turnOn, Hotspot _hotspotFor, InvInstance _invInstanceFor)
IEnumerator SwapInteractionMenu (InteractionMenuData interactionMenuData)
void SetStyles (MenuElement element)
bool CanElementBeDroppedOnto (MenuElement element)
void OnDestroy ()
void ForceOffSubtitles (Menu menu, SpeechMenuLimit speechMenuLimit)
IEnumerator SelectUIElementCoroutine (GameObject objectToSelect)
string CreateMenuLockData ()
string CreateMenuVisibilityData ()
string CreateMenuElementVisibilityData ()
string CreateMenuJournalData ()
void AssignMenuLocks (string menuLockData)
void AssignMenuVisibility (string menuVisibilityData)
void AssignMenuElementVisibility (string menuElementVisibilityData)
bool AreInteractionMenusOn ()
void AssignMenuJournals (string menuJournalData)
void OnApplicationQuit ()

Protected Attributes

bool isMouseOverMenu = false
bool isMouseOverInteractionMenu = false
bool canKeyboardControl = false
bool interactionMenuIsOn = false
bool interactionMenuPauses = false
int selected_option
bool foundMouseOverMenu = false
bool foundMouseOverInteractionMenu = false
bool foundMouseOverInventory = false
bool foundCanKeyboardControl = false
bool isMouseOverInventory = false
float pauseAlpha = 0f
List< Menumenus = new List<Menu>()
List< MenudupSpeechMenus = new List<Menu>()
List< MenudupHotspotMenus = new List<Menu>()
List< MenucustomMenus = new List<Menu>()
Texture2D pauseTexture
int menuIdentifier = -1
int lastMenuIdentifier = -1
int elementIdentifier = -1
int lastElementIdentifier = -1
MenuInput selectedInputBox
string selectedInputBoxMenuName
MenuInventoryBox activeInventoryBox
MenuCrafting activeCrafting
Menu activeInventoryBoxMenu
InvInstance oldHoverInstance
Menu mouseOverMenu
MenuElement mouseOverElement
int mouseOverElementSlot
bool isOverRightClickElement
Menu crossFadeTo
Menu crossFadeFrom
UnityEngine.EventSystems.EventSystem eventSystem
bool areAnyPauseMenusOn
int elementOverCursorID = -1
GUIStyle normalStyle = new GUIStyle ()
GUIStyle highlightedStyle = new GUIStyle()
Rect lastSafeRect
float lastAspectRatio
bool isInCutscene

Properties

bool PreventSaving [get, set]
UnityEngine.EventSystems.EventSystem EventSystem [get]
float PauseTextureAlpha [get]
Menu MouseOverMenu [get]
MenuElement MouseOverMenuElement [get]
int MouseOverElementSlot [get]
bool IsInCutscene [get]

Detailed Description

This script handles the initialisation, position and display of all Menus defined in MenuManager. Menus are transferred from MenuManager to a local List within this script when the game begins. It must be placed on the PersistentEngine prefab.

Member Function Documentation

◆ ArePauseMenusOn()

bool AC.PlayerMenus.ArePauseMenusOn ( Menu excludingMenu = null)

Checks if any Menus that pause the game are currently turned on.

Parameters
excludingMenuIf assigned, this Menu will be excluded from the check
Returns
True if any Menus that pause the game are currently turned on

◆ AssignSpeechToMenu()

void AC.PlayerMenus.AssignSpeechToMenu ( Speech speech)

Duplicates any Menu set to display a single speech line.

Parameters
speechThe Speech line to assign to any duplicated Menu

◆ CheckCrossfade()

void AC.PlayerMenus.CheckCrossfade ( AC.Menu _menu)

Begins fading in the second Menu in a crossfade if the first Menu matches the supplied parameter.

Parameters
_menuThe Menu to check for. If this menu is crossfading out, then it will be turned off, and the second Menu will fade in

◆ CheckForInput()

void AC.PlayerMenus.CheckForInput ( )

Checks for inputs made to all Menus. This is called every frame by StateHandler.

◆ ClearParents()

void AC.PlayerMenus.ClearParents ( )

Clears the parents of any Unity UI-based Menu Canvases. This makes them able to survive a scene change.

◆ CloseInteractionMenus()

void AC.PlayerMenus.CloseInteractionMenus ( )

Closes all "Interaction" Menus.

◆ CreateEventSystem()

void AC.PlayerMenus.CreateEventSystem ( bool force = false)

Spawns an Event System, either using the prefab supplied in the Menu Manager, or generating one from scratch otherwise.

Parameters
forceIf True, the EventSystem will always be created. If False, it will only be generated if any Menus rely on Unity UI

◆ CreateRecipe()

void AC.PlayerMenus.CreateRecipe ( )
static

Takes the ingredients supplied to a MenuCrafting element and sets the appropriate outcome of another MenuCrafting element with craftingType = CraftingElementType.Output.

◆ CrossFade()

void AC.PlayerMenus.CrossFade ( AC.Menu _menuTo)

Crossfades to a Menu. Any other Menus will be turned off.

Parameters
_menuToThe Menu to crossfade to

◆ DeselectEventSystemMenu()

bool AC.PlayerMenus.DeselectEventSystemMenu ( Menu _menu)

De-selects the Unity UI EventSystem's selected gameobject if it is associated with a given Menu.

Parameters
_menuThe Menu to deselect
Returns
True if the Unity UI EventSystem's selected gameobject was in the given Menu

◆ DeselectInputBox()

void AC.PlayerMenus.DeselectInputBox ( MenuElement menuElement)

Deselects the active InputBox element if it is the one in the parameter.

Parameters
menuElementThe InputBox element that should be disabled

◆ DestroyCustomMenus()

void AC.PlayerMenus.DestroyCustomMenus ( )

Destroys and unregisters all custom Menus registered with PlayerMenus

◆ DiableUIInNextFrame()

void AC.PlayerMenus.DiableUIInNextFrame ( Menu menu)

Disables a given menu's UI canvas after a frame delay, provided that it is still off by then

◆ DisableHotspotMenus()

void AC.PlayerMenus.DisableHotspotMenus ( )

Turns off any Menus with appearType = AppearType.OnHotspot.

◆ DrawLoadingMenus()

void AC.PlayerMenus.DrawLoadingMenus ( )

Draws any OnGUI-based Menus set to appear while the game is loading.

◆ DrawMenu()

void AC.PlayerMenus.DrawMenu ( AC.Menu menu,
int languageNumber = 0 )

Draws an Adventure Creator-sourced Menu. This should be called from OnGUI()

Parameters
menuThe Menu to draw
languageNumberThe index number of the language to use (0 = default)

◆ DrawMenus()

void AC.PlayerMenus.DrawMenus ( )

Draws all OnGUI-based Menus.

◆ EnableInteractionMenus() [1/3]

void AC.PlayerMenus.EnableInteractionMenus ( Hotspot hotspotFor)

Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Hotspot.

Parameters
_hotspotForThe Hotspot to connect the Menus to.

◆ EnableInteractionMenus() [2/3]

void AC.PlayerMenus.EnableInteractionMenus ( InvInstance itemFor)

Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to.

Parameters
_itemForThe instance of the Inventory item to connect the Menus to.

◆ EnableInteractionMenus() [3/3]

void AC.PlayerMenus.EnableInteractionMenus ( InvItem itemFor)

Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to.

Parameters
_itemForThe Inventory item to connect the Menus to.

◆ FindFirstSelectedElement()

void AC.PlayerMenus.FindFirstSelectedElement ( Menu menuToIgnore = null,
bool ignoreIfAlreadySelectingMenu = false )

Selects the first element GameObject in a Unity UI-based Menu.

Parameters
menuToIgnoreIf set, this menu will be ignored when searching

◆ ForceOffAllMenus()

void AC.PlayerMenus.ForceOffAllMenus ( bool onlyPausing = false)
static

Instantly turns off all Menus.

Parameters
onlyPausingIf True, then only Menus with pauseWhenEnabled = True will be turned off

◆ ForceOffSubtitles()

void AC.PlayerMenus.ForceOffSubtitles ( SpeechMenuLimit speechMenuLimit = SpeechMenuLimit::All)

Instantly turns off all Menus that have appearType = AppearType.WhenSpeechPlays.

Parameters
speechMenuLimitThe type of speech to kill (All, BlockingOnly, BackgroundOnly)

◆ GetElementOverCursorID()

virtual int AC.PlayerMenus.GetElementOverCursorID ( )
virtual

Gets the ID number of the CursorIcon, defined in CursorManager, to switch to based on what MenuElement the cursor is currently over.

Returns
The ID number of the CursorIcon, defined in CursorManager, to switch to based on what MenuElement the cursor is currently over

◆ GetElementWithName()

MenuElement AC.PlayerMenus.GetElementWithName ( string menuName,
string menuElementName )
static

Gets a MenuElement with a specific name.

Parameters
menuNameThe name (title) of the Menu to find
menuElementNameThe name (title) of the MenuElement with the Menu to find
Returns
The MenuElement with the specific name

◆ GetHotspotLabel()

string AC.PlayerMenus.GetHotspotLabel ( )

Gets the complete Hotspot label to be displayed in a MenuLabel element with labelType = AC_LabelType.Hotspot.

Returns
The complete Hotspot label to be displayed in a MenuLabel element with labelType = AC_LabelType.Hotspot

◆ GetMenus()

List< Menu > AC.PlayerMenus.GetMenus ( bool includeDuplicatesAndCustom = false)
static

Gets a List of all defined Menus.

Parameters
includeDuplicatesAndCustomIf True, then duplicate and custom Menus will also be included in the returned List
Returns
A List of all defined Menus

◆ GetMenusAssignedToSpeech()

Menu[] AC.PlayerMenus.GetMenusAssignedToSpeech ( Speech speech)

Gets all Menus associated with a given Speech line.

Parameters
speechThe Speech line in question
Returns
An array of all Menus associated with the Speech line

◆ GetMenuWithElement()

Menu AC.PlayerMenus.GetMenuWithElement ( MenuElement _element)

Gets the Menu that a given MenuElement is a part of.

Parameters
_elementThe MenuElement to get the Menu for
Returns
The Menu that the MenuElement is a part of

◆ GetMenuWithName()

Menu AC.PlayerMenus.GetMenuWithName ( string menuName)
static

Gets a Menu with a specific name.

Parameters
menuNameThe name (title) of the Menu to find
Returns
The Menu with the specific name

◆ GetRegisteredCustomMenus()

Menu[] AC.PlayerMenus.GetRegisteredCustomMenus ( )

Gets all Menu instances currently registered as custom Menus that are automatically updated by PlayerMenus.

Returns
An array of all Menu instances currently registered as custom Menus that are automatically updated by PlayerMenus

◆ IsCyclingInteractionMenu()

bool AC.PlayerMenus.IsCyclingInteractionMenu ( )

Checks if the player is currently manipulating an Interaction Menu by cycling the Interaction elements inside it.

Returns
True if the player is currently manipulating an Interaction Menu by cycling the Interaction elements inside it.

◆ IsEventSystemSelectingObject() [1/2]

bool AC.PlayerMenus.IsEventSystemSelectingObject ( )

Checks if the Unity UI EventSystem currently has any GameObject selected.

Returns
True if the Unity UI EventSystem currently has any GameObject selected

◆ IsEventSystemSelectingObject() [2/2]

bool AC.PlayerMenus.IsEventSystemSelectingObject ( GameObject _gameObject)

Checks if the Unity UI EventSystem currently has a given GameObject selected.

Parameters
_gameObjectThe GameObject to check
Returns
True if the Unity UI EventSystem currently has a given GameObject selected

◆ IsInteractionMenuOn()

bool AC.PlayerMenus.IsInteractionMenuOn ( )

Checks if any Menu with appearType = AppearType.OnInteraction is on.

Returns
True if any Menu with appearType = AppearType.OnInteraction is on.

◆ IsMouseOverInteractionMenu()

bool AC.PlayerMenus.IsMouseOverInteractionMenu ( )

Checks if the cursor is hovering over a Menu with appearType = AppearType.OnInteraction.

Returns
True if the cursor is hovering over a Menu with appearType = AppearType.OnInteraction.

◆ IsMouseOverMenu()

bool AC.PlayerMenus.IsMouseOverMenu ( )

Checks if the cursor is hovering over a Menu.

Returns
True if the cursor is hovering over a Menu

◆ IsPausingInteractionMenuOn()

bool AC.PlayerMenus.IsPausingInteractionMenuOn ( )

Checks if the last-opened Menu with appearType = AppearType.OnInteraction is both open and set to pause the game.

Returns
True if the last-opened Menu with appearType = AppearType.OnInteraction is both open and set to pause the game.

◆ IsSavingLocked()

bool AC.PlayerMenus.IsSavingLocked ( Action _actionToIgnore = null,
bool showDebug = false )
static

Checks if saving cannot be performed at this time.

Parameters
_actionToIgnoreAny gameplay-blocking ActionList that contains this Action will be excluded from the check
showDebugIf True, then a warning message will be displayed in the Console if saving is not possible, with further information
Returns
True if saving cannot be performed at this time

◆ LoadMainData()

void AC.PlayerMenus.LoadMainData ( MainData mainData)

Updates its own variables from a MainData class.

Parameters
mainDataThe MainData class to load from

◆ OnTurnOffMenu()

void AC.PlayerMenus.OnTurnOffMenu ( Menu menu)

Called automatically whenever a Menu is turned off.

Parameters
menuThe Menu that was turned off

◆ PostScreenshotBackup()

virtual void AC.PlayerMenus.PostScreenshotBackup ( )
virtual

Restores the menu and cursor systems to their former states, after taking a screenshot.

◆ PreScreenshotBackup()

virtual void AC.PlayerMenus.PreScreenshotBackup ( )
virtual

Backs up the state of the menu and cursor systems, and disables them, before taking a screenshot.

◆ RebuildMenus()

void AC.PlayerMenus.RebuildMenus ( MenuManager menuManager = null)

Rebuilds the game's Menus, either from the existing MenuManager asset, or from a new one.

Parameters
menuManagerThe Menu Manager to use for Menu generation. If left empty, the default Menu Manager will be used.

◆ RecalculateAll()

void AC.PlayerMenus.RecalculateAll ( )

Recalculates the position, size and display of all Menus. This is an intensive process, and should not be called every fame.

◆ RefreshDialogueOptions()

void AC.PlayerMenus.RefreshDialogueOptions ( )

Refreshes any active MenuDialogList elements, after changing the state of dialogue options.

◆ RegisterCustomMenu()

void AC.PlayerMenus.RegisterCustomMenu ( Menu menu,
bool deleteWhenTurnOff = false )

Registers a script-created Menu instance, so that it's click-handling, updating and rendering are handled automatically.

Parameters
menuThe custom Menu to register
deleteWhenTurnOffWhen True, the associated UI canvas will be deleted (if present), and the menu will be unregistered, automatically when the Menu is turned off

◆ RemoveSpeechFromMenu()

void AC.PlayerMenus.RemoveSpeechFromMenu ( Speech speech)

Unassigns a Speech line from any temporarily-duplicated Menus. This will signal such Menus that they can be removed.

Parameters
speechThe Speech line to unassign

◆ RequestRepositionUpdate()

void AC.PlayerMenus.RequestRepositionUpdate ( Menu menu,
Vector2 screenPosition )

Repositions a menu a frame later, so that its scale values can be properly calculated after spawning. This normally only needs to be called internally.

Parameters
menuThe menu to reposition
screenPositionThe position to take.

◆ ResetInventoryBoxes()

void AC.PlayerMenus.ResetInventoryBoxes ( )
static

Calls RecalculateSize() on all MenuInventoryBox elements.

◆ SaveMainData()

MainData AC.PlayerMenus.SaveMainData ( MainData mainData)

Updates a MainData class with its own variables that need saving.

Parameters
mainDataThe original MainData class
Returns
The updated MainData class

◆ SelectInputBox()

virtual void AC.PlayerMenus.SelectInputBox ( MenuInput input)
virtual

Selects a MenuInput element, allowing the player to enter text into it.

Parameters
inputThe input box to select

◆ SelectUIElement()

void AC.PlayerMenus.SelectUIElement ( GameObject objectToSelect)

Selects a Unity UI GameObject.

Parameters
objectToSelectThe UI GameObject to select

◆ ShowEnabledOnStartMenus()

void AC.PlayerMenus.ShowEnabledOnStartMenus ( )

Enables any Menus set to be "enabled on start"

◆ SimulateClick() [1/2]

void AC.PlayerMenus.SimulateClick ( string menuName,
MenuElement _element,
int _slot = 1 )
static

Simulates the clicking of a MenuElement.

Parameters
menuNameThe name (title) of the Menu that contains the MenuElement
_elementThe MenuElement
slotThe index number of the slot, if the MenuElement has multiple slots

◆ SimulateClick() [2/2]

void AC.PlayerMenus.SimulateClick ( string menuName,
string menuElementName,
int slot = 1 )
static

Simulates the clicking of a MenuElement.

Parameters
menuNameThe name (title) of the Menu that contains the MenuElement
menuElementNameThe name (title) of the MenuElement
slotThe index number of the slot, if the MenuElement has multiple slots

◆ UnregisterCustomMenu()

void AC.PlayerMenus.UnregisterCustomMenu ( Menu menu,
bool showError = true )

Unregisters a script-created Menu instance, so that it is no longer updated automatically.

Parameters
menuThe custom Menu to unregister
showErrorIf True, then the Console will display a Warning message if the Menu is not registered

◆ UpdateAllMenus()

void AC.PlayerMenus.UpdateAllMenus ( )

Updates the state of all Menus. This is called every frame by StateHandler.

◆ UpdateLoadingMenus()

void AC.PlayerMenus.UpdateLoadingMenus ( )

Updates the state of all Menus set to appear while the game is loading.

◆ UpdateMenu()

void AC.PlayerMenus.UpdateMenu ( AC.Menu menu,
int languageNumber = 0,
bool justPosition = false,
bool updateElements = true )

Updates a Menu's display and position.

Parameters
menuThe Menu to update
languageNumberThe index number of the language to use (0 = default)
justPositionIf True, then only the Menu's position will be updated - not its content
updateElementsIf True, then the Menu's elements will be updated as well

KickStarter.playerInput.IsCursorLocked () &&

◆ UpdateMenuPosition()

void AC.PlayerMenus.UpdateMenuPosition ( AC.Menu menu,
Vector2 invertedMouse,
bool force = false )

Updates a Menu's position.

Parameters
menuThe Menu to reposition
invertedMouseThe y-inverted mouse position
forceIf True, the position will be updated regardless of whether or not the Menu is on.

◆ UpdatePauseMenusRecord()

void AC.PlayerMenus.UpdatePauseMenusRecord ( )

Recalculates whether or not any pause menus are on

◆ UpdateUIInteractability()

void AC.PlayerMenus.UpdateUIInteractability ( )

Updates the interactability of all Menus linked to Unity UI.

Property Documentation

◆ EventSystem

UnityEngine.EventSystems.EventSystem AC.PlayerMenus.EventSystem
get

The EventSystem used by AC Menus.

◆ PauseTextureAlpha

float AC.PlayerMenus.PauseTextureAlpha
get

The alpha value of the full-screen texture drawn when the game is paused. This is set even if no pause texture is assigned.

◆ PreventSaving

bool AC.PlayerMenus.PreventSaving
getset

If True, then saving will be manually disabled