Skip to Main Content
Table of Contents

BTD_Mod_Helper​.Api​.UI​.ModWindow


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.UI

ModWindow Class

Defines a kind of Window that can be opened in game from the custom Mod Helper start menu with specific name and content

public abstract class ModWindow : BTD_Mod_Helper.Api.UI.ModStartMenuEntry

Inheritance System.ObjectModContentNamedModContentModStartMenuEntry  ModWindow

Derived
ModWindow<T>

Properties

ModWindow.ActiveWindows Property

All window instances that have been opened for this type of ModWindow and are currently not minimized

public System.Collections.Generic.IReadOnlyList<BTD_Mod_Helper.Api.Components.ModHelperWindow> ActiveWindows { get; }

Property Value

System.Collections.Generic.IReadOnlyList<ModHelperWindow>

ModWindow.AllowMultiple Property

Whether to allow more than one of this window to be opened at once

public virtual bool AllowMultiple { get; }

Property Value

System.Boolean

ModWindow.AllowResizing Property

Whether the user should be able to resize the window

public virtual bool AllowResizing { get; }

Property Value

System.Boolean

ModWindow.BlockHotkeysWhileFocused Property

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

public virtual bool BlockHotkeysWhileFocused { get; }

Property Value

System.Boolean

ModWindow.DefaultHeight Property

Default height of the window

public virtual int DefaultHeight { get; }

Property Value

System.Int32

ModWindow.DefaultWidth Property

Default width of the window

public virtual int DefaultWidth { get; }

Property Value

System.Int32

ModWindow.DefaultWindowColor Property

Override to change the default window color to something other than the user's defined default

public virtual BTD_Mod_Helper.Api.UI.ModWindowColor DefaultWindowColor { get; }

Property Value

ModWindowColor

ModWindow.DockButtonWidth Property

Width of the button in the dock for this Window

public virtual int DockButtonWidth { get; }

Property Value

System.Int32

ModWindow.DockName Property

What name this should display within the Dock. It's a small space by default, so the shorter the better. null for no text

public virtual string DockName { get; }

Property Value

System.String

ModWindow.HideOverlappingTopBarItems Property

Whether to hide top bar elements when the window is sized too small so they would overlap

public virtual bool HideOverlappingTopBarItems { get; }

Property Value

System.Boolean

ModWindow.MinimumHeight Property

Minimum height of the window when resizing

public virtual int MinimumHeight { get; }

Property Value

System.Int32

ModWindow.MinimumWidth Property

Minimum width of the window when resizing

public virtual int MinimumWidth { get; }

Property Value

System.Int32

ModWindow.OpenedWindows Property

All window instances that have been opened for this type of ModWindow. They may be minimized

public System.Collections.Generic.IReadOnlyList<BTD_Mod_Helper.Api.Components.ModHelperWindow> OpenedWindows { get; }

Property Value

System.Collections.Generic.IReadOnlyList<ModHelperWindow>

ModWindow.RightClickOnContent Property

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

public virtual bool RightClickOnContent { get; }

Property Value

System.Boolean

ModWindow.RotateDockIcon Property

Whether to rotate the dock icon so that it's facing upwards in the 16x9 aspect ratio dock setup

public virtual bool RotateDockIcon { get; }

Property Value

System.Boolean

ModWindow.ShowIconInDock Property

Whether the dock entry should show the icon

public virtual bool ShowIconInDock { get; }

Property Value

System.Boolean

ModWindow.ShowIconOnWindow Property

Whether the window should show its icon in the upper left

public virtual bool ShowIconOnWindow { get; }

Property Value

System.Boolean

ModWindow.ShowTitleOnWindow Property

Whether the window should show its title in the upper left

public virtual bool ShowTitleOnWindow { get; }

Property Value

System.Boolean

ModWindow.TopBarHeight Property

Height of the top bar of the window which has the Close, Settings, and Minimize buttons by default

public virtual int TopBarHeight { get; }

Property Value

System.Int32

ModWindow.WindowInfo Property

The Mod Helper Info used to initially define the ModHelperWindow

public virtual BTD_Mod_Helper.Api.Components.Info WindowInfo { get; }

Property Value

Info

Methods

ModWindow.IsHidden() Method

Whether this start menu entry should not appear in the menu at this time

public override bool IsHidden();

Returns

System.Boolean
whether it's hidden or not

ModWindow.LoadWindow(ModHelperWindow, JObject) Method

Called when this window is loaded in a new match because it was saved

public virtual void LoadWindow(BTD_Mod_Helper.Api.Components.ModHelperWindow window, JObject saveData);

Parameters

window ModHelperWindow

the ModHelperWindow instance

saveData Newtonsoft.Json.Linq.JObject

the save data for the window

ModWindow.ModifyOptionsMenu(ModHelperWindow, ModHelperPopupMenu) Method

Modifies the content of the options / Right Click menu for the window. This happens after ModifyWindow(ModHelperWindow)

public virtual void ModifyOptionsMenu(BTD_Mod_Helper.Api.Components.ModHelperWindow window, BTD_Mod_Helper.Api.Components.ModHelperPopupMenu menu);

Parameters

window ModHelperWindow

the ModHelperWindow instance

menu ModHelperPopupMenu

the right click menu

ModWindow.ModifyWindow(ModHelperWindow) Method

Modifies the initial content of the window.
Adding UI to content and topLeftGroup is most common

public abstract void ModifyWindow(BTD_Mod_Helper.Api.Components.ModHelperWindow window);

Parameters

window ModHelperWindow

the ModHelperWindow instance being created

ModWindow.OnClose(ModHelperWindow) Method

Called when the window is closed

public virtual void OnClose(BTD_Mod_Helper.Api.Components.ModHelperWindow window);

Parameters

window ModHelperWindow

the ModHelperWindow instance

ModWindow.OnMinimized(ModHelperWindow) Method

Called when the window is minimized to the dock

public virtual void OnMinimized(BTD_Mod_Helper.Api.Components.ModHelperWindow window);

Parameters

window ModHelperWindow

the ModHelperWindow instance

ModWindow.OnMove(ModHelperWindow, Vector2, Vector2) Method

Called each frame while a window is being moved around by a user

public virtual void OnMove(BTD_Mod_Helper.Api.Components.ModHelperWindow window, Vector2 oldPos, Vector2 newPos);

Parameters

window ModHelperWindow

the ModHelperWindow instance

oldPos UnityEngine.Vector2

the old position of the window

newPos UnityEngine.Vector2

the new position of the window

ModWindow.OnResize(ModHelperWindow, Vector2, Vector2) Method

Called each frame while a window is being resized by the user

public virtual void OnResize(BTD_Mod_Helper.Api.Components.ModHelperWindow window, Vector2 oldSize, Vector2 newSize);

Parameters

window ModHelperWindow

the ModHelperWindow instance

oldSize UnityEngine.Vector2

the old height and width of the window

newSize UnityEngine.Vector2

the new height and width of the window

ModWindow.OnUnMinimized(ModHelperWindow) Method

Called when the window is unminimized from the deck

public virtual void OnUnMinimized(BTD_Mod_Helper.Api.Components.ModHelperWindow window);

Parameters

window ModHelperWindow

the ModHelperWindow instance

ModWindow.OnUpdate() Method

Called once each frame as long as any window of this type is open

public virtual void OnUpdate();

ModWindow.OnUpdate(ModHelperWindow) Method

Called each frame for each window that is Open / Unminimized

public virtual void OnUpdate(BTD_Mod_Helper.Api.Components.ModHelperWindow window);

Parameters

window ModHelperWindow

the ModHelperWindow instance

ModWindow.Open() Method

Opens a new ModHelperWindow for this window in game

public BTD_Mod_Helper.Api.Components.ModHelperWindow Open();

Returns

ModHelperWindow
the ModModHelperWindow

ModWindow.SaveWindow(ModHelperWindow, JObject) Method

Called when this window is saved for reuse

public virtual bool SaveWindow(BTD_Mod_Helper.Api.Components.ModHelperWindow window, ref JObject saveData);

Parameters

window ModHelperWindow

the ModHelperWindow instance

saveData Newtonsoft.Json.Linq.JObject

necessary save data

Returns

System.Boolean
whether the window should be saved or not

ModWindow.StartMenuEntryClicked() Method

What to do when the start menu entry is clicked. Not called if this has child entries

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