Skip to Main Content

BTD_Mod_Helper​.Api​.Components​.ModHelperPopupMenu


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Components

ModHelperPopupMenu Class

ModHelperComponent for a PopUp menu similar to desktop right click menus

public class ModHelperPopupMenu : BTD_Mod_Helper.Api.Components.ModHelperPanel

Inheritance UnityEngine.MonoBehaviourModHelperComponentModHelperPanel  ModHelperPopupMenu

Fields

ModHelperPopupMenu.autoHide Field

Whether the menu should automatically hide when a click happens elsewhere

public bool autoHide;

Field Value

System.Boolean

ModHelperPopupMenu.parentComponent Field

The parent object that this is for, used for determining if clicks elsewhere will auto hide the menu or not

public ModHelperComponent parentComponent;

Field Value

ModHelperComponent

Properties

ModHelperPopupMenu.IsShowing Property

Whether this menu is open or not

public bool IsShowing { get; }

Property Value

System.Boolean

ModHelperPopupMenu.Options Property

The current ModHelperPopupOptions in the menu

public System.Collections.Generic.IEnumerable<BTD_Mod_Helper.Api.Components.ModHelperPopupOption> Options { get; }

Property Value

System.Collections.Generic.IEnumerable<ModHelperPopupOption>

Methods

ModHelperPopupMenu.AddOption(Info, string, string, UnityAction, ModHelperPopupMenu, Func) Method

Add an option to the menu

public BTD_Mod_Helper.Api.Components.ModHelperPopupMenu AddOption(BTD_Mod_Helper.Api.Components.Info info, string text=null, string icon=null, UnityAction action=null, BTD_Mod_Helper.Api.Components.ModHelperPopupMenu subMenu=null, Func<bool> isSelected=null);

Parameters

info Info

The info to use for its size, if no Height is set, 75 will be used

text System.String

Option label, if null then uses the Name from the info

icon System.String

Option icon, null for no icon, empty string for still creating the icon but it being empty

action UnityEngine.Events.UnityAction

Action to perform when this option is clicked

subMenu ModHelperPopupMenu

Sub menu that this option opens

isSelected Il2CppSystem.Func

Function to determine if this option should display as selected or not

Returns

ModHelperPopupMenu
this

ModHelperPopupMenu.AddOption(ModHelperPopupOption) Method

Add an option to the menu

public BTD_Mod_Helper.Api.Components.ModHelperPopupMenu AddOption(BTD_Mod_Helper.Api.Components.ModHelperPopupOption option);

Parameters

option ModHelperPopupOption

Option to add

Returns

ModHelperPopupMenu
this

ModHelperPopupMenu.AddSeparator(int) Method

Adds a horizontal separation line to the menu

public BTD_Mod_Helper.Api.Components.ModHelperPopupMenu AddSeparator(int height=2);

Parameters

height System.Int32

Returns

ModHelperPopupMenu
this

ModHelperPopupMenu.Create(Info, bool) Method

Constructs a new PopUp Menu, and makes it inactive to start

public static BTD_Mod_Helper.Api.Components.ModHelperPopupMenu Create(BTD_Mod_Helper.Api.Components.Info info, bool fitSize=true);

Parameters

info Info

the initial info for the menu

fitSize System.Boolean

whether to use a UnityEngine.UI.ContentSizeFitter

Returns

ModHelperPopupMenu
the created menu

ModHelperPopupMenu.Hide(bool) Method

Hide the menu

public void Hide(bool propagate=false);

Parameters

propagate System.Boolean

ModHelperPopupMenu.Show() Method

Show the menu

public void Show();
To learn how to download BTD Mod Helper and install mods, click here