Adventure Creator  1.72.0
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2019
AC.PlayerMenus Class Reference
Inheritance diagram for AC.PlayerMenus:

Classes

struct  InteractionMenuData
 

Public Member Functions

void OnInitPersistentEngine ()
 
void RebuildMenus (MenuManager menuManager=null)
 Rebuilds the game's Menus, either from the existing MenuManager asset, or from a new one. More...
 
void ClearParents ()
 
void DrawLoadingMenus ()
 
void DrawMenus ()
 
Menu GetMenuWithElement (MenuElement _element)
 Gets the Menu that a given MenuElement is a part of More...
 
void DrawMenu (AC.Menu menu, int languageNumber=0)
 Draws an Adventure Creator-sourced Menu. This should be called from OnGUI() More...
 
void UpdateMenuPosition (AC.Menu menu, Vector2 invertedMouse, bool force=false)
 Updates a Menu's position. More...
 
void UpdateMenu (AC.Menu menu, int languageNumber=0, bool justPosition=false, bool updateElements=true)
 Updates a Menu's display and position More...
 
bool IsEventSystemSelectingObject (GameObject _gameObject)
 Checks if the Unity UI EventSystem currently has a given GameObject selected. More...
 
bool IsEventSystemSelectingObject ()
 Checks if the Unity UI EventSystem currently has any GameObject selected. More...
 
bool DeselectEventSystemMenu (Menu _menu)
 De-selects the Unity UI EventSystem's selected gameobject if it is associated with a given Menu. More...
 
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. More...
 
virtual void SelectInputBox (MenuInput input)
 Selects a MenuInput element, allowing the player to enter text into it. More...
 
void OnTurnOffMenu (Menu menu)
 Called automatically whenever a Menu is turned off More...
 
void DeselectInputBox (MenuElement menuElement)
 Deselects the active InputBox element if it is the one in the parameter More...
 
void RemoveSpeechFromMenu (Speech speech)
 Unassigns a Speech line from any temporarily-duplicated Menus. This will signal such Menus that they can be removed. More...
 
void AssignSpeechToMenu (Speech speech)
 Duplicates any Menu set to display a single speech line. More...
 
Menu[] GetMenusAssignedToSpeech (Speech speech)
 Gets all Menus associated with a given Speech line More...
 
void CrossFade (AC.Menu _menuTo)
 Crossfades to a Menu. Any other Menus will be turned off. More...
 
void CloseInteractionMenus ()
 Closes all "Interaction" Menus. More...
 
void EnableInteractionMenus (Hotspot hotspotFor)
 Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Hotspot. More...
 
void EnableInteractionMenus (InvInstance itemFor)
 Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to. More...
 
void EnableInteractionMenus (InvItem itemFor)
 Shows any Menus with appearType = AppearType.OnInteraction, and connected to a given Inventory item to. More...
 
void DisableHotspotMenus ()
 
string GetHotspotLabel ()
 Gets the complete Hotspot label to be displayed in a MenuLabel element with labelType = AC_LabelType.Hotspot. More...
 
void UpdatePauseMenusRecord ()
 
bool ArePauseMenusOn (Menu excludingMenu=null)
 Checks if any Menus that pause the game are currently turned on. More...
 
void ForceOffSubtitles (SpeechMenuLimit speechMenuLimit=SpeechMenuLimit.All)
 Instantly turns off all Menus that have appearType = AppearType.WhenSpeechPlays. More...
 
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. More...
 
void UnregisterCustomMenu (Menu menu, bool showError=true)
 Unregisters a script-created Menu instance, so that it is no longer updated automatically. More...
 
Menu[] GetRegisteredCustomMenus ()
 Gets all Menu instances currently registered as custom Menus that are automatically updated by PlayerMenus More...
 
void DestroyCustomMenus ()
 Destroys and unregisters all custom Menus registered with PlayerMenus More...
 
void RecalculateAll ()
 
void FindFirstSelectedElement (Menu menuToIgnore=null)
 Selects the first element GameObject in a Unity UI-based Menu. More...
 
void SelectUIElement (GameObject objectToSelect)
 Selects a Unity UI GameObject More...
 
int GetElementOverCursorID ()
 Gets the ID number of the CursorIcon, defined in CursorManager, to switch to based on what MenuElement the cursor is currently over More...
 
void SetManualSaveLock (bool state)
 Sets the state of the manual save lock. More...
 
bool IsMouseOverMenu ()
 Checks if the cursor is hovering over a Menu. More...
 
bool IsMouseOverInventory ()
 Checks if the cursor is hovering over an Inventory More...
 
bool IsMouseOverInteractionMenu ()
 Checks if the cursor is hovering over a Menu with appearType = AppearType.OnInteraction. More...
 
bool IsInteractionMenuOn ()
 Checks if any Menu with appearType = AppearType.OnInteraction is on. More...
 
bool IsCyclingInteractionMenu ()
 Checks if the player is currently manipulating an Interaction Menu by cycling the Interaction elements inside it. More...
 
bool IsPausingInteractionMenuOn ()
 Checks if the last-opened Menu with appearType = AppearType.OnInteraction is both open and set to pause the game. More...
 
void MakeUIInteractive ()
 
void MakeUINonInteractive ()
 
MainData SaveMainData (MainData mainData)
 Updates a MainData class with its own variables that need saving. More...
 
void LoadMainData (MainData mainData)
 Updates its own variables from a MainData class. More...
 
virtual void PreScreenshotBackup ()
 
virtual void PostScreenshotBackup ()
 

Static Public Member Functions

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

Protected Member Functions

IEnumerator CycleMouseOverUIs ()
 
void CreateEventSystem ()
 
bool AreAnyMenusUI ()
 
void OnInitialiseScene ()
 
void OnAddSubScene (SubScene subScene)
 
void OnEnterGameState (GameState gameState)
 
void OnExitGameState (GameState gameState)
 
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)
 
void CheckClicks (AC.Menu menu)
 
void UpdateAllMenusAgain ()
 
virtual void DeselectInputBox ()
 
void CheckClick (AC.Menu _menu, MenuElement _element, int _slot, MouseState _mouseState)
 
void 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
 
bool lockSave = 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< MenucustomMenus = new List<Menu>()
 
Texture2D pauseTexture
 
string menuIdentifier = string.Empty
 
string lastMenuIdentifier = string.Empty
 
string elementIdentifier = string.Empty
 
string lastElementIdentifier = string.Empty
 
MenuInput selectedInputBox
 
string selectedInputBoxMenuName
 
MenuInventoryBox activeInventoryBox
 
MenuCrafting activeCrafting
 
Menu activeInventoryBoxMenu
 
InvInstance oldHoverInstance
 
Menu mouseOverMenu
 
MenuElement mouseOverElement
 
int mouseOverElementSlot
 
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
 
string hotspotLabelOverride
 

Properties

UnityEngine.EventSystems.EventSystem EventSystem [get]
 
float PauseTextureAlpha [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.

◆ CreateRecipe()

static 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

◆ 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)

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

Parameters
menuToIgnoreIf set, this menu will be ignored when searching

◆ ForceOffAllMenus()

static 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()

int AC.PlayerMenus.GetElementOverCursorID ( )

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()

static 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()

static 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()

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

◆ IsMouseOverInventory()

bool AC.PlayerMenus.IsMouseOverInventory ( )

Checks if the cursor is hovering over an Inventory

◆ 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()

static 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

◆ MakeUIInteractive()

void AC.PlayerMenus.MakeUIInteractive ( )

Makes all Menus linked to Unity UI interactive.

◆ MakeUINonInteractive()

void AC.PlayerMenus.MakeUINonInteractive ( )

Makes all Menus linked to Unity UI non-interactive.

◆ 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

◆ ResetInventoryBoxes()

static 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

◆ SetManualSaveLock()

void AC.PlayerMenus.SetManualSaveLock ( bool  state)

Sets the state of the manual save lock.

Parameters
stateIf True, then saving will be manually disabled

◆ SimulateClick() [1/2]

static 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]

static 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

◆ 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

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.