Table of Contents
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.Object ModContent NamedModContent ModStartMenuEntry ModWindow
Derived
↳ ModWindow<T>
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; }
System.Collections.Generic.IReadOnlyList<ModHelperWindow>
Whether to allow more than one of this window to be opened at once
public virtual bool AllowMultiple { get; }
Whether the user should be able to resize the window
public virtual bool AllowResizing { get; }
Whether in game hotkeys should not happen while this window is being actively interacted with
public virtual bool BlockHotkeysWhileFocused { get; }
Default height of the window
public virtual int DefaultHeight { get; }
Default width of the window
public virtual int DefaultWidth { get; }
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; }
Width of the button in the dock for this Window
public virtual int DockButtonWidth { get; }
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; }
Whether to hide top bar elements when the window is sized too small so they would overlap
public virtual bool HideOverlappingTopBarItems { get; }
Minimum height of the window when resizing
public virtual int MinimumHeight { get; }
Minimum width of the window when resizing
public virtual int MinimumWidth { get; }
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; }
System.Collections.Generic.IReadOnlyList<ModHelperWindow>
Whether the options menu can be opened from right clicking on window content
public virtual bool RightClickOnContent { get; }
Whether to rotate the dock icon so that it's facing upwards in the 16x9 aspect ratio dock setup
public virtual bool RotateDockIcon { get; }
Whether the dock entry should show the icon
public virtual bool ShowIconInDock { get; }
Whether the window should show its icon in the upper left
public virtual bool ShowIconOnWindow { get; }
Whether the window should show its title in the upper left
public virtual bool ShowTitleOnWindow { get; }
Height of the top bar of the window which has the Close, Settings, and Minimize buttons by default
public virtual int TopBarHeight { get; }
The Mod Helper Info used to initially define the ModHelperWindow
public virtual BTD_Mod_Helper.Api.Components.Info WindowInfo { get; }
Whether this start menu entry should not appear in the menu at this time
public override bool IsHidden();
System.Boolean
whether it's hidden or not
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);
window
ModHelperWindow
the ModHelperWindow instance
saveData
Newtonsoft.Json.Linq.JObject
the save data for the window
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);
window
ModHelperWindow
the ModHelperWindow instance
menu
ModHelperPopupMenu
the right click menu
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);
window
ModHelperWindow
the ModHelperWindow instance being created
Called when the window is closed
public virtual void OnClose(BTD_Mod_Helper.Api.Components.ModHelperWindow window);
window
ModHelperWindow
the ModHelperWindow instance
Called when the window is minimized to the dock
public virtual void OnMinimized(BTD_Mod_Helper.Api.Components.ModHelperWindow window);
window
ModHelperWindow
the ModHelperWindow instance
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);
window
ModHelperWindow
the ModHelperWindow instance
oldPos
UnityEngine.Vector2
the old position of the window
newPos
UnityEngine.Vector2
the new position of the window
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);
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
Called when the window is unminimized from the deck
public virtual void OnUnMinimized(BTD_Mod_Helper.Api.Components.ModHelperWindow window);
window
ModHelperWindow
the ModHelperWindow instance
Called once each frame as long as any window of this type is open
public virtual void OnUpdate();
Called each frame for each window that is Open / Unminimized
public virtual void OnUpdate(BTD_Mod_Helper.Api.Components.ModHelperWindow window);
window
ModHelperWindow
the ModHelperWindow instance
Opens a new ModHelperWindow for this window in game
public BTD_Mod_Helper.Api.Components.ModHelperWindow Open();
ModHelperWindow
the ModModHelperWindow
Called when this window is saved for reuse
public virtual bool SaveWindow(BTD_Mod_Helper.Api.Components.ModHelperWindow window, ref JObject saveData);
window
ModHelperWindow
the ModHelperWindow instance
saveData
Newtonsoft.Json.Linq.JObject
necessary save data
System.Boolean
whether the window should be saved or not
What to do when the start menu entry is clicked. Not called if this has child entries
public override void StartMenuEntryClicked();