Skip to Main Content
Table of Contents

BTD_Mod_Helper​.Api​.Components​.ModHelperWindow


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Components

ModHelperWindow Class

A ModHelperComponent for a custom Window that can be opened in game and behaves similarly to a desktop Window

public class ModHelperWindow : BTD_Mod_Helper.Api.Components.ModHelperPanel

Inheritance UnityEngine.MonoBehaviourModHelperComponentModHelperPanel  ModHelperWindow

Fields

ModHelperWindow.blockHotkeysWhileFocused Field

Whether in game hotkeys should not happen while this window is being actively interacted with

public bool blockHotkeysWhileFocused;

Field Value

System.Boolean

ModHelperWindow.blockRightClickOnContent Field

Whether the options menu can be opened from right clicking on window content

public bool blockRightClickOnContent;

Field Value

System.Boolean

ModHelperWindow.closeButton Field

The button in the topRightGroup that can Close() the window

public ModHelperButton closeButton;

Field Value

ModHelperButton

ModHelperWindow.content Field

The content panel of the Window where most UI should be added to

public ModHelperPanel content;

Field Value

ModHelperPanel

ModHelperWindow.contentCanvas Field

The CanvasGroup of the content

public CanvasGroup contentCanvas;

Field Value

UnityEngine.CanvasGroup

ModHelperWindow.dockButton Field

The button on the dock for the window, or null if this window doesn't use one

public ModHelperDockButton dockButton;

Field Value

ModHelperDockButton

ModHelperWindow.EdgeThreshold Field

How close the mouse needs to be for resizing

public const int EdgeThreshold = 10;

Field Value

System.Int32

ModHelperWindow.icon Field

The icon of this window, if it has one

public ModHelperImage icon;

Field Value

ModHelperImage

ModHelperWindow.locked Field

Whether this window is locked

public bool locked;

Field Value

System.Boolean

ModHelperWindow.main Field

The main inset panel of the Window

public ModHelperPanel main;

Field Value

ModHelperPanel

ModHelperWindow.Margin Field

The default visual margin between elements

public const int Margin = 25;

Field Value

System.Int32

ModHelperWindow.minButton Field

The button in the topRightGroup that will Minimize the window

public ModHelperButton minButton;

Field Value

ModHelperButton

ModHelperWindow.minHeight Field

The minimum height of this window when resizing

public float minHeight;

Field Value

System.Single

ModHelperWindow.minWidth Field

The minimum width of this window when resizing

public float minWidth;

Field Value

System.Single

ModHelperWindow.noResizing Field

Whether resizing is blocked for this window

public bool noResizing;

Field Value

System.Boolean

ModHelperWindow.rightClickMenu Field

The options menu for the window

public ModHelperPopupMenu rightClickMenu;

Field Value

ModHelperPopupMenu

ModHelperWindow.rootCanvas Field

The CanvasGroup at the root of this Window

public CanvasGroup rootCanvas;

Field Value

UnityEngine.CanvasGroup

ModHelperWindow.settingsButton Field

The button in the topRightGroup that toggles the rightClickMenu

public ModHelperButton settingsButton;

Field Value

ModHelperButton

ModHelperWindow.title Field

The title of this window, if it has one

public ModHelperText title;

Field Value

ModHelperText

ModHelperWindow.topBar Field

The top row of the window

public ModHelperPanel topBar;

Field Value

ModHelperPanel

ModHelperWindow.topBarHeight Field

The height of the topBar of the window

public int topBarHeight;

Field Value

System.Int32

ModHelperWindow.topCenterGroup Field

The center group of the top bar, which is by default empty

public ModHelperPanel topCenterGroup;

Field Value

ModHelperPanel

ModHelperWindow.topLeftGroup Field

The left side group of the top bar, which by default features the Icon and window name

public ModHelperPanel topLeftGroup;

Field Value

ModHelperPanel

ModHelperWindow.topRightGroup Field

The right side group of the top bar, which by default features the Close / Options / Minimize buttons

public ModHelperPanel topRightGroup;

Field Value

ModHelperPanel

Properties

ModHelperWindow.ColorOption Property

The color option within the options menu

public BTD_Mod_Helper.Api.Components.ModHelperPopupOption ColorOption { get; }

Property Value

ModHelperPopupOption

ModHelperWindow.IsFocused Property

Whether the window is currently focused, it's on top of all other windows and the user is interacting with it instead of the game

public bool IsFocused { get; set; }

Property Value

System.Boolean

ModHelperWindow.IsMinimized Property

Whether this window is minimized or not

public bool IsMinimized { get; }

Property Value

System.Boolean

ModHelperWindow.LockOption Property

The lock / unlock option within the options menu

public BTD_Mod_Helper.Api.Components.ModHelperPopupOption LockOption { get; }

Property Value

ModHelperPopupOption

ModHelperWindow.ModWindow Property

The ModWindow definition used for this window, if any

public BTD_Mod_Helper.Api.UI.ModWindow ModWindow { get; set; }

Property Value

ModWindow

ModHelperWindow.WindowColor Property

The current WindowColor theme of this window

public BTD_Mod_Helper.Api.UI.ModWindowColor WindowColor { get; set; }

Property Value

ModWindowColor

Methods

ModHelperWindow.ApplyWindowColor(GameObject, PanelType) Method

Applies the current window color to a game object and keeps track of it as part of this window

public void ApplyWindowColor(GameObject gobject, BTD_Mod_Helper.Api.UI.ModWindowColor.PanelType type);

Parameters

gobject UnityEngine.GameObject

Game object that has an Image component

type PanelType

panel type

ModHelperWindow.Close() Method

Closes this Window

public void Close();

ModHelperWindow.Create(Info, int, string, string, float, string) Method

Creates a ModHelperWindow gameobject and adds it to the appropriate parent object for Windows.
Also creates a corresponding ModHelperDockButton within the ModHelperDock

public static BTD_Mod_Helper.Api.Components.ModHelperWindow Create(BTD_Mod_Helper.Api.Components.Info info, int topBarHeight=50, string icon=null, string title=null, float iconScale=1f, string dockTitle=null);

Parameters

info Info

the position / size / name info

topBarHeight System.Int32

the height of the top bar

icon System.String

the icon to display, or null for none

title System.String

the title to display, or null for none

iconScale System.Single

visual scale for the icon

dockTitle System.String

title for the dock button

Returns

ModHelperWindow
the created ModHelperWindow

ModHelperWindow.Create(ModWindow) Method

Creates a ModHelperWindow gameobject from a ModWindow definition

public static BTD_Mod_Helper.Api.Components.ModHelperWindow Create(BTD_Mod_Helper.Api.UI.ModWindow modWindow);

Parameters

modWindow ModWindow

ModWindow definition

Returns

ModHelperWindow
the created ModHelperWindow

ModHelperWindow.OpenRightClickMenu() Method

Open the Options Menu for this window at the current mouse position. Will handle changing the menu's position
if it would be off screen

public void OpenRightClickMenu();

ModHelperWindow.ToggleLocked() Method

Toggles whether this window is Locked, and cant be moved / resized / left clicked normally

public void ToggleLocked();

ModHelperWindow.ToggleMinimized() Method

Toggles whether this window is minimized to the dock

public void ToggleMinimized();

ModHelperWindow.UpdateWindowColor(string) Method

Updates the WindowColor theme for this window

public void UpdateWindowColor(string newColor);

Parameters

newColor System.String

new WindowColor theme

To learn how to download BTD Mod Helper and install mods, click here