Window Framework v1.2.4
Window Framework for Unity UI Toolkit
Loading...
Searching...
No Matches
GWG.WindowFramework.Demo.CustomWindowWithMemory Class Reference

Rules for creating windows that have memory and location memory enabled:

. More...

Inheritance diagram for GWG.WindowFramework.Demo.CustomWindowWithMemory:

Public Member Functions

 CustomWindowWithMemory ()
 Basic constructor for a custom window that has memory enabled with minimum settings.
VisualElement InventoryContentExample ()
Public Member Functions inherited from GWG.WindowFramework.WindowFrame
 WindowFrame ()
 Represents a custom UI element serving as a container for window-based content, including a header, content, and footer, providing event handling and theme adaptability for Unity's UI Toolkit.
void CloseWindow (bool forceAll=false)
 Closes the window if allowed.
void Hide ()
 Hides the window while keeping it in memory.
void SetOpeningPosition ()
 Sets the opening position of the window based on the selected position. Options include: TopLeft, Top, TopRight, Left, Center, Right, BottomLeft, Bottom, BottomRight.
void Show ()
 Shows the window by setting its display style to flex and opacity to 1.0f.

Properties

List< InventoryIteminventoryData [get]
Properties inherited from GWG.WindowFramework.WindowFrame
bool Active [get, set]
 Gets or sets whether the window is active.
bool AllowClose = true [get, set]
 Gets or sets whether the window can be closed.
bool AllowFullscreen = true [get, set]
 Determines whether the window frame can toggle to fullscreen mode.
bool AllowLock [get, set]
 Gets or sets whether the window can be locked.
bool AllowMove = true [get, set]
 Gets or sets whether the window can be moved.
bool AllowMultipleInstances = true [get, set]
 Gets or sets whether multiple instances of this window are allowed.
bool AllowResize [get, set]
 Gets or sets whether the window can be resized.
VisualElement Content [get, set]
 Gets or sets the content area of the window.
override VisualElement contentContainer [get]
 Overrides the contentContainer to return the window's content area instead of the root.
ContextMenuConfig ContextMenuConfig [get, set]
 Gets or sets the context menu configuration for this window.
float DefaultHeight = 300 [get, set]
 Gets or sets the default height of the window.
float DefaultWidth = 300 [get, set]
 Gets or sets the default width of the window.
VisualElement FooterToolbar [get, set]
 Gets or sets the toolbar in the footer area of the window.
bool Fullscreen [get, set]
 Gets or sets whether the window is in fullscreen mode.
bool Locked [get, set]
 Gets or sets whether the window is locked.
bool LockedFullscreen [get, set]
 Determines whether the fullscreen mode of the window is locked, preventing the user from toggling fullscreen on or off.
bool LockedToStartPosition [get, set]
 Gets or sets whether the window is locked to its start position.
float MinHeight [get, set]
 Gets or sets the minimum height of the window.
float MinWidth [get, set]
 Gets or sets the minimum width of the window.
string OptionsMenuTooltip [get, set]
 Gets or sets the tooltip for the options menu button.
string ParentObjectId [get, set]
 Gets or sets the ID of the parent object associated with the window.
string ResizeAreaTooltip [get, set]
 Gets or sets the tooltip for the resize area.
bool ShowFooter [get, set]
 Gets or sets whether the footer is visible.
bool ShowHeader [get, set]
 Gets or sets whether the header is visible.
WindowFramePosition StartPosition [get, set]
 Gets or sets the position of the window frame.
List< StyleSheet > StyleSheet [get, set]
 Gets or sets the stylesheet applied to the window.
string Title [get, set]
 Gets or sets the title of the window.
string WindowId [get, set]
 Gets or sets the unique ID of the window.
bool WindowMemoryEnabled = false [get, set]
 Gets or sets whether the window memory is enabled.

Private Member Functions

ContextMenuConfig CreateContextMenuConfig ()
VisualElement CreateUxmlContent ()
ContextMenuConfig InventoryContextMenuExample (InventoryItem item)
void test ()

Additional Inherited Members

Events inherited from GWG.WindowFramework.WindowFrame
static Action< WindowFrameOnWindowFrameAdded
 Event triggered when a new WindowFrame is added to the panel.
static Action< WindowFrameOnWindowFrameRemoved
 Event triggered when a WindowFrame is removed from the panel.

Detailed Description

  1. The window must have the WindowMemoryEnabled property set to true.
  2. Set a WindowId for the window, this can be static in the custom type or set dynamically if you want to track windows in some other way.
    (Optional) Also set a Parent ID to link this window to a specific in game item such as a chest or crafting station.
    WindowMemoryEnabled = true;<br/>
    WindowId = "CustomWindowWithMemory";<br/>
    ParentObjectId = "SomeParentId"; // Optional
    string ParentObjectId
    Gets or sets the ID of the parent object associated with the window.
    Definition WindowFrame.cs:457
    string WindowId
    Gets or sets the unique ID of the window.
    Definition WindowFrame.cs:437
    bool WindowMemoryEnabled
    Gets or sets whether the window memory is enabled.
    Definition WindowFrame.cs:533

  3. The window must be a custom class (window type) that extends WindowFrame.

  4. MemoryEnabled must be set to true in the WindowFrameController.

  5. If you want the window to reopen on load then you must call the reload at the proper time in your code.
    The WindowFrameController is the central management component for the Window Framework system....
    Definition WindowFrameController.cs:77
    static WindowFrameController Instance
    Gets the singleton instance of the WindowFrameController.
    Definition WindowFrameController.cs:221

Constructor & Destructor Documentation

◆ CustomWindowWithMemory()

GWG.WindowFramework.Demo.CustomWindowWithMemory.CustomWindowWithMemory ( )

Member Function Documentation

◆ CreateContextMenuConfig()

ContextMenuConfig GWG.WindowFramework.Demo.CustomWindowWithMemory.CreateContextMenuConfig ( )
private

◆ CreateUxmlContent()

VisualElement GWG.WindowFramework.Demo.CustomWindowWithMemory.CreateUxmlContent ( )
private

◆ InventoryContentExample()

VisualElement GWG.WindowFramework.Demo.CustomWindowWithMemory.InventoryContentExample ( )

◆ InventoryContextMenuExample()

ContextMenuConfig GWG.WindowFramework.Demo.CustomWindowWithMemory.InventoryContextMenuExample ( InventoryItem item)
private

◆ test()

void GWG.WindowFramework.Demo.CustomWindowWithMemory.test ( )
private

Property Documentation

◆ inventoryData

List<InventoryItem> GWG.WindowFramework.Demo.CustomWindowWithMemory.inventoryData
getprivate