v3.6.1 Documentation
Fungus.MenuDialog Class Reference

Presents multiple choice buttons to the players. More...

Inheritance diagram for Fungus.MenuDialog:

Public Member Functions

virtual void SetActive (bool state)
 Sets the active state of the Menu Dialog gameobject. More...
 
virtual void Clear ()
 Clear all displayed options in the Menu Dialog. More...
 
virtual void HideSayDialog ()
 Hides any currently displayed Say Dialog. More...
 
virtual bool AddOption (string text, bool interactable, Block targetBlock)
 Adds the option to the list of displayed options. More...
 
virtual bool AddOption (string text, bool interactable, LuaEnvironment luaEnv, Closure callBack)
 Adds the option to the list of displayed options, calls a Lua function when selected. More...
 
virtual void ShowTimer (float duration, Block targetBlock)
 Show a timer during which the player can select an option. More...
 
virtual IEnumerator ShowTimer (float duration, LuaEnvironment luaEnv, Closure callBack)
 Show a timer during which the player can select an option. More...
 
virtual bool IsActive ()
 Returns true if the Menu Dialog is currently displayed. More...
 

Static Public Member Functions

static MenuDialog GetMenuDialog ()
 Returns a menu dialog by searching for one in the scene or creating one if none exists. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void CheckEventSystem ()
 
virtual void OnEnable ()
 
virtual IEnumerator WaitForTimeout (float timeoutDuration, Block targetBlock)
 
IEnumerator CallBlock (Block block)
 
IEnumerator CallLuaClosure (LuaEnvironment luaEnv, Closure callback)
 

Protected Attributes

bool autoSelectFirstButton = false
 
Button [] cachedButtons
 
Slider cachedSlider
 

Properties

static MenuDialog ActiveMenuDialog [get, set]
 Currently active Menu Dialog used to display Menu options More...
 
virtual Button [] CachedButtons [get]
 A cached list of button objects in the menu dialog. More...
 
virtual Slider CachedSlider [get]
 A cached slider object used for the timer in the menu dialog. More...
 
virtual int DisplayedOptionsCount [get]
 Returns the number of currently displayed options. More...
 

Detailed Description

Presents multiple choice buttons to the players.

Definition at line 16 of file MenuDialog.cs.

Member Function Documentation

◆ AddOption() [1/2]

virtual bool Fungus.MenuDialog.AddOption ( string  text,
bool  interactable,
Block  targetBlock 
)
virtual

Adds the option to the list of displayed options.

Calls a Block when selected. Will cause the Menu dialog to become visible if it is not already visible.

Returns
true, if the option was added successfully.
Parameters
textThe option text to display on the button.
interactableIf false, the option is displayed but is not selectable.
targetBlockBlock to execute when the option is selected.

Definition at line 219 of file MenuDialog.cs.

◆ AddOption() [2/2]

virtual bool Fungus.MenuDialog.AddOption ( string  text,
bool  interactable,
LuaEnvironment  luaEnv,
Closure  callBack 
)
virtual

Adds the option to the list of displayed options, calls a Lua function when selected.

Will cause the Menu dialog to become visible if it is not already visible.

Returns
true, if the option was added successfully.

Definition at line 272 of file MenuDialog.cs.

◆ Awake()

virtual void Fungus.MenuDialog.Awake ( )
protectedvirtual

Definition at line 25 of file MenuDialog.cs.

◆ CallBlock()

IEnumerator Fungus.MenuDialog.CallBlock ( Block  block)
protected

Definition at line 96 of file MenuDialog.cs.

◆ CallLuaClosure()

IEnumerator Fungus.MenuDialog.CallLuaClosure ( LuaEnvironment  luaEnv,
Closure  callback 
)
protected

Definition at line 102 of file MenuDialog.cs.

◆ CheckEventSystem()

virtual void Fungus.MenuDialog.CheckEventSystem ( )
protectedvirtual

Definition at line 44 of file MenuDialog.cs.

◆ Clear()

virtual void Fungus.MenuDialog.Clear ( )
virtual

Clear all displayed options in the Menu Dialog.

Definition at line 172 of file MenuDialog.cs.

◆ GetMenuDialog()

static MenuDialog Fungus.MenuDialog.GetMenuDialog ( )
static

Returns a menu dialog by searching for one in the scene or creating one if none exists.

Definition at line 121 of file MenuDialog.cs.

◆ HideSayDialog()

virtual void Fungus.MenuDialog.HideSayDialog ( )
virtual

Hides any currently displayed Say Dialog.

Definition at line 202 of file MenuDialog.cs.

◆ IsActive()

virtual bool Fungus.MenuDialog.IsActive ( )
virtual

Returns true if the Menu Dialog is currently displayed.

Definition at line 373 of file MenuDialog.cs.

◆ OnEnable()

virtual void Fungus.MenuDialog.OnEnable ( )
protectedvirtual

Definition at line 59 of file MenuDialog.cs.

◆ SetActive()

virtual void Fungus.MenuDialog.SetActive ( bool  state)
virtual

Sets the active state of the Menu Dialog gameobject.

Definition at line 164 of file MenuDialog.cs.

◆ ShowTimer() [1/2]

virtual void Fungus.MenuDialog.ShowTimer ( float  duration,
Block  targetBlock 
)
virtual

Show a timer during which the player can select an option.

Calls a Block when the timer expires.

Parameters
durationThe duration during which the player can select an option.
targetBlockBlock to execute if the player does not select an option in time.

Definition at line 319 of file MenuDialog.cs.

◆ ShowTimer() [2/2]

virtual IEnumerator Fungus.MenuDialog.ShowTimer ( float  duration,
LuaEnvironment  luaEnv,
Closure  callBack 
)
virtual

Show a timer during which the player can select an option.

Calls a Lua function when the timer expires.

Definition at line 333 of file MenuDialog.cs.

◆ WaitForTimeout()

virtual IEnumerator Fungus.MenuDialog.WaitForTimeout ( float  timeoutDuration,
Block  targetBlock 
)
protectedvirtual

Definition at line 66 of file MenuDialog.cs.

Member Data Documentation

◆ autoSelectFirstButton

bool Fungus.MenuDialog.autoSelectFirstButton = false
protected

Definition at line 19 of file MenuDialog.cs.

◆ cachedButtons

Button [] Fungus.MenuDialog.cachedButtons
protected

Definition at line 21 of file MenuDialog.cs.

◆ cachedSlider

Slider Fungus.MenuDialog.cachedSlider
protected

Definition at line 23 of file MenuDialog.cs.

Property Documentation

◆ ActiveMenuDialog

MenuDialog Fungus.MenuDialog.ActiveMenuDialog
staticgetset

Currently active Menu Dialog used to display Menu options

Definition at line 116 of file MenuDialog.cs.

◆ CachedButtons

virtual Button [] Fungus.MenuDialog.CachedButtons
get

A cached list of button objects in the menu dialog.

The cached buttons.

Definition at line 153 of file MenuDialog.cs.

◆ CachedSlider

virtual Slider Fungus.MenuDialog.CachedSlider
get

A cached slider object used for the timer in the menu dialog.

The cached slider.

Definition at line 159 of file MenuDialog.cs.

◆ DisplayedOptionsCount

virtual int Fungus.MenuDialog.DisplayedOptionsCount
get

Returns the number of currently displayed options.

Definition at line 382 of file MenuDialog.cs.


The documentation for this class was generated from the following file: