// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). // It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) using UnityEngine.UI; using MoonSharp.Interpreter; using System.Collections; namespace Fungus { /// /// Presents multiple choice buttons to the players. /// public interface IMenuDialog { /// /// A cached list of button objects in the menu dialog. /// /// The cached buttons. Button[] CachedButtons { get; } /// /// A cached slider object used for the timer in the menu dialog. /// /// The cached slider. Slider CachedSlider { get; } /// /// Sets the active state of the Menu Dialog gameobject. /// void SetActive(bool state); /// /// Clear all displayed options in the Menu Dialog. /// void Clear(); /// /// Hides any currently displayed Say Dialog. /// void HideSayDialog(); /// /// 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. /// /// true, if the option was added successfully. /// The option text to display on the button. /// If false, the option is displayed but is not selectable. /// Block to execute when the option is selected. bool AddOption(string text, bool interactable, Block targetBlock); /// /// 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. /// /// true, if the option was added successfully. bool AddOption(string text, bool interactable, ILuaEnvironment luaEnv, Closure callBack); /// /// Show a timer during which the player can select an option. Calls a Block when the timer expires. /// /// The duration during which the player can select an option. /// Block to execute if the player does not select an option in time. void ShowTimer(float duration, Block targetBlock); /// /// Show a timer during which the player can select an option. Calls a Lua function when the timer expires. /// IEnumerator ShowTimer(float duration, ILuaEnvironment luaEnv, Closure callBack); /// /// Returns true if the Menu Dialog is currently displayed. /// bool IsActive(); /// /// Returns the number of currently displayed options. /// int DisplayedOptionsCount { get; } } }