BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Static Public Member Functions | Properties | List of all members
BrawlCrate.API.BrawlAPI Class Reference

Static Public Member Functions

static List< T > NodeListOfType< T > ()
 Returns a full list of all nodes of a given type in the open file. More...
 
static List< T > NodeWrapperListOfType< T > ()
 Returns a full list of all node wrappers of a given type in the open file. More...
 
static void ShowMessage (string msg, string title)
 Shows a MessageBox with the given message and title, and the default "OK" option. More...
 
static void ShowWarning (string msg, string title)
 Shows a MessageBox with the given message and title, the default "OK" option, and a Warning symbol. More...
 
static void ShowError (string msg, string title)
 Shows a MessageBox with the given message and title, the default "OK" option, and an Error symbol. More...
 
static bool ShowYesNoPrompt (string msg, string title)
 Shows a MessageBox with the given message and title, with options for "Yes" or "No". More...
 
static bool ShowYesNoWarning (string msg, string title)
 Shows a MessageBox with the given message and title, "Yes/No" options, and a Warning symbol. More...
 
static bool ShowYesNoError (string msg, string title)
 Shows a MessageBox with the given message and title, "Yes/No" options, and an Error symbol. More...
 
static bool ShowOKCancelPrompt (string msg, string title)
 Shows a MessageBox with the given message and title, with options for "OK" or "Cancel". More...
 
static bool ShowOKCancelWarning (string msg, string title)
 Shows a MessageBox with the given message and title, "OK/Cancel" options, and a Warning symbol. More...
 
static bool ShowOKCancelError (string msg, string title)
 Shows a MessageBox with the given message and title, "OK/Cancel" options, and an Error symbol. More...
 
static string OpenFileDialog ()
 Opens an open file dialog, prompting the user to select a file. More...
 
static string OpenFileDialog (string title)
 Opens an open file dialog, prompting the user to select a file. More...
 
static string OpenFileDialog (string title, string filter)
 Opens an open file dialog, prompting the user to select a file. More...
 
static string[] OpenMultiFileDialog ()
 Opens an open file dialog, prompting the user to select multiple files More...
 
static string[] OpenMultiFileDialog (string title)
 Opens an open file dialog, prompting the user to select multiple files More...
 
static string[] OpenMultiFileDialog (string title, string filter)
 Opens an open file dialog, prompting the user to select multiple files More...
 
static string OpenFolderDialog ()
 Opens an Open Folder Dialog, prompting the user to select a folder. More...
 
static string OpenFolderDialog (string description)
 Opens an Open Folder Dialog, prompting the user to select a folder. More...
 
static string SaveFileDialog ()
 Opens a save file dialog, prompting the user to save a file. More...
 
static string SaveFileDialog (string title)
 Opens a save file dialog, prompting the user to save a file. More...
 
static string SaveFileDialog (string title, string filter)
 Opens a save file dialog, prompting the user to save a file. More...
 
static string UserStringInput ()
 Prompts the user to input a string, with a default title and the last BrawlAPI-entered string as the default value. More...
 
static string UserStringInput (string title)
 Prompts the user to input a string, with the last BrawlAPI-entered string as the default value. More...
 
static string UserStringInput (string title, string defaultText)
 Prompts the user to input a string with a default starting value. More...
 
static int UserIntegerInput ()
 Prompts the user to input an integer. More...
 
static int UserIntegerInput (string title)
 Prompts the user to input an integer. More...
 
static int UserIntegerInput (string title, string description)
 Prompts the user to input an integer. More...
 
static int UserIntegerInput (string title, string description, int defaultValue)
 Prompts the user to input an integer. More...
 
static int UserIntegerInput (string title, string description, int defaultValue, int minimumValue)
 Prompts the user to input an integer. More...
 
static int UserIntegerInput (string title, string description, int defaultValue, int minimumValue, int maximumValue)
 Prompts the user to input an integer. More...
 
static float UserFloatInput (string title)
 Prompts the user to input a float. More...
 
static float UserFloatInput (string title, string description)
 Prompts the user to input a float. More...
 
static float UserFloatInput (string title, string description, float defaultValue)
 Prompts the user to input a float. More...
 
static float UserFloatInput (string title, string description, float defaultValue, float minimumValue)
 Prompts the user to input a float. More...
 
static float UserFloatInput (string title, string description, float defaultValue, float minimumValue, float maximumValue)
 Prompts the user to input a float. More...
 
static void AddContextMenuItem (Type wrapper, params ToolStripMenuItem[] items)
 To be called by API, adds context menu items to a wrapper. More...
 
static void AddContextMenuItem (Type wrapper, string subMenuName, string description, EventHandler conditional, params ToolStripMenuItem[] items)
 To be called by API, adds context menu items to a wrapper with additional options. More...
 
static void AddMultiSelectContextMenuItem (Type wrapper, params ToolStripMenuItem[] items)
 To be called by API, adds context menu items to a wrapper's multi-selection menu. More...
 
static void AddMultiSelectContextMenuItem (Type wrapper, string subMenuName, string description, EventHandler conditional, params ToolStripMenuItem[] items)
 To be called by API, adds context menu items to a wrapper's multi-selection menu with additional options. More...
 
static bool New< T > ()
 Creates a new ResourceNode of type T and attempts to set it as the root node. More...
 
static bool OpenFile (string path)
 Attempts to open the file using a given path. More...
 
static bool OpenFileNoErrors (string path)
 Attempts to open the file using a given path. Any error messages (including "file not found") are not shown to the user. More...
 
static bool OpenTemplate (string path)
 Attempts to open the file as a template using a given path. More...
 
static bool OpenTemplateNoErrors (string path)
 Attempts to open the file using a given path. Any error messages (including "file not found") are not shown to the user. More...
 
static bool SaveFile ()
 Attempts to save the opened file. More...
 
static bool SaveFileAs ()
 Prompts the user to save the open file to a directory. More...
 
static bool SaveFileAs (string path)
 Attempts to save the opened file to a given path. More...
 
static bool CloseFile ()
 Closes the open file, leaving the editor on the idle screen. More...
 
static bool ForceCloseFile ()
 Closes the open file, leaving the editor on the idle screen. More...
 
static void RefreshPreview ()
 Refreshes the preview on the main window. More...
 
static void Wait (int milliseconds)
 Causes the current thread to sleep for a number of milliseconds. More...
 
static void AddResourceParser (PluginResourceParser resourceParser)
 Adds parsing for a specific user-defined file type. More...
 
static void AddWrapper (ResourceType resourceType, PluginWrapper wrapper)
 Adds a wrapper for a specific user-defined file type. More...
 
static void AddWrapper< TypeNode > (PluginWrapper wrapper)
 Adds a wrapper for a specific user-defined node type. More...
 
static void WriteToConsole (string msg)
 Writes a message to the the console and debug log (if debugging) and the Trace log (if enabled). More...
 

Properties

static ResourceNode RootNode [get]
 The root node of the opened file. More...
 
static ResourceNode SelectedNode [get]
 The currently selected node on the Main Form. Useful for context menu items. More...
 
static List< ResourceNodeSelectedNodes [get]
 The currently selected nodes on the Main Form. More...
 
static List< ResourceNodeNodeList [get]
 Returns a full list of all nodes in the open file. More...
 
static BaseWrapper RootNodeWrapper [get]
 The wrapper for the root node of the opened file. More...
 
static BaseWrapper SelectedNodeWrapper [get]
 The wrapper for the currently selected node on the Main Form. Useful for context menu items. More...
 
static List< BaseWrapperSelectedNodeWrappers [get]
 The wrappers for the currently selected nodes on the Main Form. More...
 
static List< BaseWrapperNodeWrapperList [get]
 Returns a full list of all node wrappers in the open file. More...
 
static string AppPath [get]
 The folder in which the BrawlCrate installation is located. More...
 
static string APIPath [get]
 The folder in which the API folders are located. More...
 
static string LibPath [get]
 The folder in which API libraries are located. More...
 
static string PluginPath [get]
 The folder in which plugins are located. More...
 
static string LoaderPath [get]
 The folder in which loaders are located. More...
 
static string ResourcesPath [get]
 The folder in which API resources are located. More...
 

Member Function Documentation

◆ AddContextMenuItem() [1/2]

static void BrawlCrate.API.BrawlAPI.AddContextMenuItem ( Type  wrapper,
params ToolStripMenuItem[]  items 
)
inlinestatic

To be called by API, adds context menu items to a wrapper.

This is kept for compatibility purposes, the second definition for this function offers far more extensibility.

Parameters
wrapperThe wrapper which new items will be added to.
itemsOne or more ToolStrip menu items that will be added to the context menu. These should be defined as much as possible in the script itself.
957 {
958 if (BrawlAPIInternal.ContextMenuHooks.ContainsKey(wrapper))
959 {
960 if (items.Length == 1 && items[0].HasDropDownItems)
961 {
962 // Combine same-named submenus
963 for (int i = 0; i < BrawlAPIInternal.ContextMenuHooks[wrapper].Length; i++)
964 {
965 ToolStripMenuItem item = BrawlAPIInternal.ContextMenuHooks[wrapper][i];
966 if (!item.HasDropDownItems || item.Text != items[0].Text)
967 {
968 continue;
969 }
970
971 if (string.IsNullOrEmpty(item.ToolTipText))
972 {
973 item.ToolTipText = items[0].ToolTipText;
974 }
975
976 for (int j = 0; j < items[0].DropDownItems.Count; j++)
977 {
978 ToolStripItem item2 = items[0].DropDownItems[j];
979 item.DropDownItems.Add(item2);
980 }
981
982 return;
983 }
984 }
985
986 BrawlAPIInternal.ContextMenuHooks[wrapper] = BrawlAPIInternal.ContextMenuHooks[wrapper].Append(items);
987 }
988 else
989 {
990 BrawlAPIInternal.ContextMenuHooks.Add(wrapper, items);
991 }
992 }

◆ AddContextMenuItem() [2/2]

static void BrawlCrate.API.BrawlAPI.AddContextMenuItem ( Type  wrapper,
string  subMenuName,
string  description,
EventHandler  conditional,
params ToolStripMenuItem[]  items 
)
inlinestatic

To be called by API, adds context menu items to a wrapper with additional options.

Parameters
wrapperThe wrapper which new items will be added to.
subMenuName(Optional) If not null or empty, a submenu which nodes will be defined under.
description(Optional) If not null or empty, a string that will appear on mouseover. Will be added to the menu if the items are in a submenu, or added to all items otherwise.
conditional(Optional) If not null, a function that will be run every time the dropdown is activated. Most useful to change an item's enabled state.
itemsOne or more ToolStrip menu items that will be added to the context menu. These should be defined as much as possible in the script itself.
1017 {
1018 if (conditional != null)
1019 {
1020 foreach (ToolStripMenuItem item in items)
1021 {
1022 item.EnabledChanged += conditional;
1023 }
1024 }
1025
1026 if (!string.IsNullOrEmpty(subMenuName))
1027 {
1028 ToolStripMenuItem t = new ToolStripMenuItem(subMenuName);
1029 foreach (ToolStripMenuItem item in items)
1030 {
1031 t.DropDownItems.Add(item);
1032 }
1033
1034 if (!string.IsNullOrEmpty(description))
1035 {
1036 t.ToolTipText = description;
1037 }
1038
1039 AddContextMenuItem(wrapper, t);
1040 return;
1041 }
1042
1043 if (!string.IsNullOrEmpty(description))
1044 {
1045 foreach (ToolStripMenuItem item in items)
1046 {
1047 item.ToolTipText += description;
1048 }
1049 }
1050
1051 AddContextMenuItem(wrapper, items);
1052 }
static void AddContextMenuItem(Type wrapper, params ToolStripMenuItem[] items)
To be called by API, adds context menu items to a wrapper.
Definition: ExposedMembers.cs:956

◆ AddMultiSelectContextMenuItem() [1/2]

static void BrawlCrate.API.BrawlAPI.AddMultiSelectContextMenuItem ( Type  wrapper,
params ToolStripMenuItem[]  items 
)
inlinestatic

To be called by API, adds context menu items to a wrapper's multi-selection menu.

The second definition for this function offers far more extensibility.

Parameters
wrapperThe wrapper which new items will be added to.
itemsOne or more ToolStrip menu items that will be added to the context menu. These should be defined as much as possible in the script itself.
1067 {
1068 if (BrawlAPIInternal.MultiSelectContextMenuHooks.ContainsKey(wrapper))
1069 {
1070 if (items.Length == 1 && items[0].HasDropDownItems)
1071 {
1072 // Combine same-named submenus
1073 for (int i = 0; i < BrawlAPIInternal.MultiSelectContextMenuHooks[wrapper].Length; i++)
1074 {
1075 ToolStripMenuItem item = BrawlAPIInternal.MultiSelectContextMenuHooks[wrapper][i];
1076 if (!item.HasDropDownItems || item.Text != items[0].Text)
1077 {
1078 continue;
1079 }
1080
1081 if (string.IsNullOrEmpty(item.ToolTipText))
1082 {
1083 item.ToolTipText = items[0].ToolTipText;
1084 }
1085
1086 for (int j = 0; j < items[0].DropDownItems.Count; j++)
1087 {
1088 ToolStripItem item2 = items[0].DropDownItems[j];
1089 item.DropDownItems.Add(item2);
1090 }
1091
1092 return;
1093 }
1094 }
1095
1096 BrawlAPIInternal.MultiSelectContextMenuHooks[wrapper] =
1097 BrawlAPIInternal.MultiSelectContextMenuHooks[wrapper].Append(items);
1098 }
1099 else
1100 {
1101 BrawlAPIInternal.MultiSelectContextMenuHooks.Add(wrapper, items);
1102 }
1103 }

◆ AddMultiSelectContextMenuItem() [2/2]

static void BrawlCrate.API.BrawlAPI.AddMultiSelectContextMenuItem ( Type  wrapper,
string  subMenuName,
string  description,
EventHandler  conditional,
params ToolStripMenuItem[]  items 
)
inlinestatic

To be called by API, adds context menu items to a wrapper's multi-selection menu with additional options.

Parameters
wrapperThe wrapper which new items will be added to.
subMenuName(Optional) If not null or empty, a submenu which nodes will be defined under.
description(Optional) If not null or empty, a string that will appear on mouseover. Will be added to the menu if the items are in a submenu, or added to all items otherwise.
conditional(Optional) If not null, a function that will be run every time the dropdown is activated. Most useful to change an item's enabled state.
itemsOne or more ToolStrip menu items that will be added to the context menu. These should be defined as much as possible in the script itself.
1128 {
1129 if (conditional != null)
1130 {
1131 foreach (ToolStripMenuItem item in items)
1132 {
1133 item.EnabledChanged += conditional;
1134 }
1135 }
1136
1137 if (!string.IsNullOrEmpty(subMenuName))
1138 {
1139 ToolStripMenuItem t = new ToolStripMenuItem(subMenuName);
1140 foreach (ToolStripMenuItem item in items)
1141 {
1142 t.DropDownItems.Add(item);
1143 }
1144
1145 if (!string.IsNullOrEmpty(description))
1146 {
1147 t.ToolTipText = description;
1148 }
1149
1151 return;
1152 }
1153
1154 if (!string.IsNullOrEmpty(description))
1155 {
1156 foreach (ToolStripMenuItem item in items)
1157 {
1158 item.ToolTipText += description;
1159 }
1160 }
1161
1162 AddMultiSelectContextMenuItem(wrapper, items);
1163 }
static void AddMultiSelectContextMenuItem(Type wrapper, params ToolStripMenuItem[] items)
To be called by API, adds context menu items to a wrapper's multi-selection menu.
Definition: ExposedMembers.cs:1066

◆ AddResourceParser()

static void BrawlCrate.API.BrawlAPI.AddResourceParser ( PluginResourceParser  resourceParser)
inlinestatic

Adds parsing for a specific user-defined file type.

In bboxapi, this was originally "AddLoader"

Parameters
resourceParserThe PluginResourceParser to be added.
1370 {
1371 BrawlAPIInternal.ResourceParsers.Add(resourceParser);
1372 }

◆ AddWrapper()

static void BrawlCrate.API.BrawlAPI.AddWrapper ( ResourceType  resourceType,
PluginWrapper  wrapper 
)
inlinestatic

Adds a wrapper for a specific user-defined file type.

This variation requires reference to a pre-existing ResourceType. Will overwrite pre-existing ResourceType-based wrappers.

Parameters
resourceTypeThe resource file type to attach the wrapper to.
wrapperThe wrapper to be used.
1387 {
1388 NodeWrapperAttribute.AddWrapper(resourceType, wrapper);
1389 }

◆ AddWrapper< TypeNode >()

static void BrawlCrate.API.BrawlAPI.AddWrapper< TypeNode > ( PluginWrapper  wrapper)
inlinestatic

Adds a wrapper for a specific user-defined node type.

This variation bases wrappers off of the type of the resource node, offering more flexibility for new types. Will overwrite pre-existing Type-based wrappers. Type-based wrappers take priority over ResourceType-based wrappers.

Template Parameters
TypeNodeThe ResourceNode type to attach the wrapper to.
Parameters
wrapperThe wrapper to be used.
Type Constraints
TypeNode :ResourceNode 
1403 : ResourceNode
1404 {
1405 NodeWrapperAttribute.AddWrapper<TypeNode>(wrapper);
1406 }
Definition: ResourceNode.cs:129

◆ CloseFile()

static bool BrawlCrate.API.BrawlAPI.CloseFile ( )
inlinestatic

Closes the open file, leaving the editor on the idle screen.

If the open file has unsaved changes, prompts the user to save them.

Returns true if the file is successfully closed, and false otherwise.

1324 {
1325 return Program.Close();
1326 }

◆ ForceCloseFile()

static bool BrawlCrate.API.BrawlAPI.ForceCloseFile ( )
inlinestatic

Closes the open file, leaving the editor on the idle screen.

Will close regardless of unsaved changes.

Returns true if the file is successfully closed, and false otherwise.

1336 {
1337 return Program.Close(true);
1338 }

◆ New< T >()

static bool BrawlCrate.API.BrawlAPI.New< T > ( )
inlinestatic

Creates a new ResourceNode of type T and attempts to set it as the root node.

Template Parameters
TThe type of ResourceNode to create.
Returns
True if the file was successfully created, returns false otherwise.
Type Constraints
T :ResourceNode 
1208 : ResourceNode
1209 {
1210 return Program.New<T>();
1211 }

◆ NodeListOfType< T >()

static List< T > BrawlCrate.API.BrawlAPI.NodeListOfType< T > ( )
inlinestatic

Returns a full list of all nodes of a given type in the open file.

Returns an empty list if there is no open file

Type Constraints
T :ResourceNode 
90 {
91 List<T> nodes = new List<T>();
92
93 foreach (ResourceNode node in NodeList)
94 {
95 if (node is T typedNode)
96 {
97 nodes.Add(typedNode);
98 }
99 }
100
101 return nodes;
102 }
static List< ResourceNode > NodeList
Returns a full list of all nodes in the open file.
Definition: ExposedMembers.cs:70

◆ NodeWrapperListOfType< T >()

static List< T > BrawlCrate.API.BrawlAPI.NodeWrapperListOfType< T > ( )
inlinestatic

Returns a full list of all node wrappers of a given type in the open file.

Returns an empty list if there is no open file

Type Constraints
T :BaseWrapper 
187 {
188 List<T> wrappers = new List<T>();
189
190 foreach (BaseWrapper wrapper in NodeWrapperList)
191 {
192 if (wrapper is T typedWrapper)
193 {
194 wrappers.Add(typedWrapper);
195 }
196 }
197
198 return wrappers;
199 }
static List< BaseWrapper > NodeWrapperList
Returns a full list of all node wrappers in the open file.
Definition: ExposedMembers.cs:156
Definition: BaseWrapper.cs:71

◆ OpenFile()

static bool BrawlCrate.API.BrawlAPI.OpenFile ( string  path)
inlinestatic

Attempts to open the file using a given path.

Parameters
pathThe path of the file that is to be opened.
Returns
True if the file is successfully loaded, and false otherwise.
1223 {
1224 return Program.Open(path);
1225 }

◆ OpenFileDialog() [1/3]

static string BrawlCrate.API.BrawlAPI.OpenFileDialog ( )
inlinestatic

Opens an open file dialog, prompting the user to select a file.

Returns the path of the file that the user chose, or an empty string if the dialog was cancelled.

373 {
374 using (OpenFileDialog dlg = new OpenFileDialog())
375 {
376 dlg.Title = "Open File";
377 dlg.Multiselect = false;
378 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileName : string.Empty;
379 }
380 }
static string OpenFileDialog()
Opens an open file dialog, prompting the user to select a file.
Definition: ExposedMembers.cs:372

◆ OpenFileDialog() [2/3]

static string BrawlCrate.API.BrawlAPI.OpenFileDialog ( string  title)
inlinestatic

Opens an open file dialog, prompting the user to select a file.

Returns the path of the file that the user chose, or an empty string if the dialog was cancelled.

Parameters
titleThe title text that will show in the TitleBar of the form.
391 {
392 using (OpenFileDialog dlg = new OpenFileDialog())
393 {
394 dlg.Multiselect = false;
395 dlg.Title = title;
396 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileName : string.Empty;
397 }
398 }

◆ OpenFileDialog() [3/3]

static string BrawlCrate.API.BrawlAPI.OpenFileDialog ( string  title,
string  filter 
)
inlinestatic

Opens an open file dialog, prompting the user to select a file.

Returns the path of the file that the user chose, or an empty string if the dialog was cancelled.

Parameters
titleThe title text that will show in the TitleBar of the form.
filterThe file filter to use for the open file dialog. Use the formatting found here: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog.filter

You can also reference the pre-programmed filters from FileFilters.cs

415 {
416 using (OpenFileDialog dlg = new OpenFileDialog())
417 {
418 dlg.Multiselect = false;
419 dlg.Title = title;
420 dlg.Filter = filter;
421 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileName : string.Empty;
422 }
423 }

◆ OpenFileNoErrors()

static bool BrawlCrate.API.BrawlAPI.OpenFileNoErrors ( string  path)
inlinestatic

Attempts to open the file using a given path. Any error messages (including "file not found") are not shown to the user.

Parameters
pathThe path of the file that is to be opened.
Returns
True if the file is successfully loaded, and false otherwise.
1236 {
1237 return Program.Open(path, false);
1238 }

◆ OpenFolderDialog() [1/2]

static string BrawlCrate.API.BrawlAPI.OpenFolderDialog ( )
inlinestatic

Opens an Open Folder Dialog, prompting the user to select a folder.

Returns the path of the folder that the user chose, or an empty string if the dialog was cancelled.

497 {
498#if !MONO
499 using (VistaFolderBrowserDialog dlg = new VistaFolderBrowserDialog {UseDescriptionForTitle = true})
500#else
501 using (FolderBrowserDialog dlg = new FolderBrowserDialog())
502#endif
503 {
504 dlg.Description = "Open Folder";
505 return dlg.ShowDialog() == DialogResult.OK ? dlg.SelectedPath : string.Empty;
506 }
507 }

◆ OpenFolderDialog() [2/2]

static string BrawlCrate.API.BrawlAPI.OpenFolderDialog ( string  description)
inlinestatic

Opens an Open Folder Dialog, prompting the user to select a folder.

Returns the path of the folder that the user chose, or an empty string if the dialog was cancelled.

Parameters
descriptionThe description of the folder dialog.

For Windows-based devices, this will appear as the title of the window. For others, this will appear as a description box.

521 {
522#if !MONO
523 using (VistaFolderBrowserDialog dlg = new VistaFolderBrowserDialog {UseDescriptionForTitle = true})
524#else
525 using (FolderBrowserDialog dlg = new FolderBrowserDialog())
526#endif
527 {
528 dlg.Description = description;
529 return dlg.ShowDialog() == DialogResult.OK ? dlg.SelectedPath : string.Empty;
530 }
531 }

◆ OpenMultiFileDialog() [1/3]

static string[] BrawlCrate.API.BrawlAPI.OpenMultiFileDialog ( )
inlinestatic

Opens an open file dialog, prompting the user to select multiple files

Returns the paths of the files that the user chose, or null if the dialog was cancelled.

435 {
436 using (OpenFileDialog dlg = new OpenFileDialog())
437 {
438 dlg.Title = "Open Files";
439 dlg.Multiselect = true;
440 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileNames : null;
441 }
442 }

◆ OpenMultiFileDialog() [2/3]

static string[] BrawlCrate.API.BrawlAPI.OpenMultiFileDialog ( string  title)
inlinestatic

Opens an open file dialog, prompting the user to select multiple files

Returns the paths of the files that the user chose, or null if the dialog was cancelled.

Parameters
titleThe title text that will show in the TitleBar of the form.
453 {
454 using (OpenFileDialog dlg = new OpenFileDialog())
455 {
456 dlg.Multiselect = true;
457 dlg.Title = title;
458 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileNames : null;
459 }
460 }

◆ OpenMultiFileDialog() [3/3]

static string[] BrawlCrate.API.BrawlAPI.OpenMultiFileDialog ( string  title,
string  filter 
)
inlinestatic

Opens an open file dialog, prompting the user to select multiple files

Returns the paths of the files that the user chose, or null if the dialog was cancelled.

Parameters
titleThe title text that will show in the TitleBar of the form.
filterThe file filter to use for the open file dialog. Use the formatting found here: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog.filter

You can also reference the pre-programmed filters from FileFilters.cs

477 {
478 using (OpenFileDialog dlg = new OpenFileDialog())
479 {
480 dlg.Multiselect = true;
481 dlg.Title = title;
482 dlg.Filter = filter;
483 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileNames : null;
484 }
485 }

◆ OpenTemplate()

static bool BrawlCrate.API.BrawlAPI.OpenTemplate ( string  path)
inlinestatic

Attempts to open the file as a template using a given path.

Templates do not set the save path, meaning that the user will be prompted for "Save As" on first save.

Returns true if the file is successfully loaded, and false otherwise.

Parameters
pathThe path of the template file that is to be opened.
1251 {
1252 return Program.OpenTemplate(path);
1253 }

◆ OpenTemplateNoErrors()

static bool BrawlCrate.API.BrawlAPI.OpenTemplateNoErrors ( string  path)
inlinestatic

Attempts to open the file using a given path. Any error messages (including "file not found") are not shown to the user.

Templates do not set the save path, meaning that the user will be prompted for "Save As" on first save.

Returns true if the file is successfully loaded, and false otherwise.

Parameters
pathThe path of the template file that is to be opened.
1267 {
1268 return Program.OpenTemplate(path, false);
1269 }

◆ RefreshPreview()

static void BrawlCrate.API.BrawlAPI.RefreshPreview ( )
inlinestatic

Refreshes the preview on the main window.

1344 {
1346 }
Definition: MainForm.cs:34
unsafe void resourceTree_SelectionChanged(object sender, EventArgs e)
Definition: MainForm.cs:533
static MainForm Instance
Definition: MainForm.cs:36

◆ SaveFile()

static bool BrawlCrate.API.BrawlAPI.SaveFile ( )
inlinestatic

Attempts to save the opened file.

Returns true if the file is successfully saved, and false otherwise.

1277 {
1278 return Program.Save(false);
1279 }

◆ SaveFileAs() [1/2]

static bool BrawlCrate.API.BrawlAPI.SaveFileAs ( )
inlinestatic

Prompts the user to save the open file to a directory.

Returns true if the file is successfully saved, and false otherwise.

1287 {
1288 return Program.SaveAs();
1289 }

◆ SaveFileAs() [2/2]

static bool BrawlCrate.API.BrawlAPI.SaveFileAs ( string  path)
inlinestatic

Attempts to save the opened file to a given path.

Returns true if the file is successfully saved, and false otherwise.

Parameters
pathThe path to which the file should be saved
1300 {
1301 try
1302 {
1304 Program._rootPath = path;
1306 }
1307 catch (Exception e)
1308 {
1309 MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
1310 return false;
1311 }
1312
1313 return true;
1314 }
ResourceNode Resource
Definition: BaseWrapper.cs:77
BaseWrapper RootNode
Definition: MainForm.cs:40
void UpdateName()
Definition: MainForm.cs:506
virtual void Export(string outPath)
Definition: ResourceNode.cs:909

◆ SaveFileDialog() [1/3]

static string BrawlCrate.API.BrawlAPI.SaveFileDialog ( )
inlinestatic

Opens a save file dialog, prompting the user to save a file.

DOES NOT ACTUALLY SAVE ANYTHING BY ITSELF! Additional scripting must be done if you want to actually save anything.

Returns the save path that the user chose, or an empty string if the dialog was cancelled.

548 {
549 using (SaveFileDialog dlg = new SaveFileDialog())
550 {
551 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileName : string.Empty;
552 }
553 }
static string SaveFileDialog()
Opens a save file dialog, prompting the user to save a file.
Definition: ExposedMembers.cs:547

◆ SaveFileDialog() [2/3]

static string BrawlCrate.API.BrawlAPI.SaveFileDialog ( string  title)
inlinestatic

Opens a save file dialog, prompting the user to save a file.

DOES NOT ACTUALLY SAVE ANYTHING BY ITSELF! Additional scripting must be done if you want to actually save anything.

Returns the save path that the user chose, or an empty string if the dialog was cancelled.

Parameters
titleThe title text that will show in the TitleBar of the form.
567 {
568 using (SaveFileDialog dlg = new SaveFileDialog())
569 {
570 dlg.Title = title;
571 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileName : string.Empty;
572 }
573 }

◆ SaveFileDialog() [3/3]

static string BrawlCrate.API.BrawlAPI.SaveFileDialog ( string  title,
string  filter 
)
inlinestatic

Opens a save file dialog, prompting the user to save a file.

DOES NOT ACTUALLY SAVE ANYTHING BY ITSELF! Additional scripting must be done if you want to actually save anything.

Returns the save path that the user chose, or an empty string if the dialog was cancelled.

Parameters
titleThe title text that will show in the TitleBar of the form.
filterThe file filter to use for the open file dialog. Use the formatting found here: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.filedialog.filter

You can also reference the pre-programmed filters from FileFilters.cs

593 {
594 using (SaveFileDialog dlg = new SaveFileDialog())
595 {
596 dlg.Title = title;
597 dlg.Filter = filter;
598 return dlg.ShowDialog() == DialogResult.OK ? dlg.FileName : string.Empty;
599 }
600 }

◆ ShowError()

static void BrawlCrate.API.BrawlAPI.ShowError ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, the default "OK" option, and an Error symbol.

Doesn't return a value, and is just used to show the user messages.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
251 {
252 MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
253 }

◆ ShowMessage()

static void BrawlCrate.API.BrawlAPI.ShowMessage ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, and the default "OK" option.

Doesn't return a value, and is just used to show the user messages.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
219 {
220 MessageBox.Show(MainForm.Instance, msg, title);
221 }

◆ ShowOKCancelError()

static bool BrawlCrate.API.BrawlAPI.ShowOKCancelError ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, "OK/Cancel" options, and an Error symbol.

Returns true if "OK" is clicked, and false otherwise.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
354 {
355 return MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
356 == DialogResult.OK;
357 }

◆ ShowOKCancelPrompt()

static bool BrawlCrate.API.BrawlAPI.ShowOKCancelPrompt ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, with options for "OK" or "Cancel".

Returns true if "OK" is clicked, and false otherwise.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
321 {
322 return MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.OKCancel) == DialogResult.OK;
323 }

◆ ShowOKCancelWarning()

static bool BrawlCrate.API.BrawlAPI.ShowOKCancelWarning ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, "OK/Cancel" options, and a Warning symbol.

Returns true if "OK" is clicked, and false otherwise.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
337 {
338 return MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)
339 == DialogResult.OK;
340 }

◆ ShowWarning()

static void BrawlCrate.API.BrawlAPI.ShowWarning ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, the default "OK" option, and a Warning symbol.

Doesn't return a value, and is just used to show the user messages.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
235 {
236 MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
237 }

◆ ShowYesNoError()

static bool BrawlCrate.API.BrawlAPI.ShowYesNoError ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, "Yes/No" options, and an Error symbol.

Returns true if "Yes" is clicked, and false otherwise.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
304 {
305 return MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.YesNo, MessageBoxIcon.Error)
306 == DialogResult.Yes;
307 }

◆ ShowYesNoPrompt()

static bool BrawlCrate.API.BrawlAPI.ShowYesNoPrompt ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, with options for "Yes" or "No".

Returns true if "Yes" is clicked, and false otherwise.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
271 {
272 return MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.YesNo) == DialogResult.Yes;
273 }

◆ ShowYesNoWarning()

static bool BrawlCrate.API.BrawlAPI.ShowYesNoWarning ( string  msg,
string  title 
)
inlinestatic

Shows a MessageBox with the given message and title, "Yes/No" options, and a Warning symbol.

Returns true if "Yes" is clicked, and false otherwise.

Parameters
msgThe message that will appear in the body of the MessageBox.
titleThe title text that will show in the TitleBar of the MessageBox.
287 {
288 return MessageBox.Show(MainForm.Instance, msg, title, MessageBoxButtons.YesNo, MessageBoxIcon.Warning)
289 == DialogResult.Yes;
290 }

◆ UserFloatInput() [1/5]

static float BrawlCrate.API.BrawlAPI.UserFloatInput ( string  title)
inlinestatic

Prompts the user to input a float.

Parameters
titleThe title of the dialog box
Returns
The user-inputted float
818 {
819 return UserFloatInput(title, "Value:", _lastFloatInput, float.MinValue, float.MaxValue);
820 }
static float UserFloatInput(string title)
Prompts the user to input a float.
Definition: ExposedMembers.cs:817

◆ UserFloatInput() [2/5]

static float BrawlCrate.API.BrawlAPI.UserFloatInput ( string  title,
string  description 
)
inlinestatic

Prompts the user to input a float.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
Returns
The user-inputted float
835 {
836 return UserFloatInput(title, description, _lastFloatInput, float.MinValue, float.MaxValue);
837 }

◆ UserFloatInput() [3/5]

static float BrawlCrate.API.BrawlAPI.UserFloatInput ( string  title,
string  description,
float  defaultValue 
)
inlinestatic

Prompts the user to input a float.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
defaultValueThe default value that the NumericInputBox will be set to
Returns
The user-inputted float
855 {
856 return UserFloatInput(title, description, defaultValue, float.MinValue, float.MaxValue);
857 }

◆ UserFloatInput() [4/5]

static float BrawlCrate.API.BrawlAPI.UserFloatInput ( string  title,
string  description,
float  defaultValue,
float  minimumValue 
)
inlinestatic

Prompts the user to input a float.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
defaultValueThe default value that the NumericInputBox will be set to
minimumValueThe lowest possible number allowed
Returns
The user-inputted float
878 {
879 return UserFloatInput(title, description, defaultValue, minimumValue, float.MaxValue);
880 }

◆ UserFloatInput() [5/5]

static float BrawlCrate.API.BrawlAPI.UserFloatInput ( string  title,
string  description,
float  defaultValue,
float  minimumValue,
float  maximumValue 
)
inlinestatic

Prompts the user to input a float.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
defaultValueThe default value that the NumericInputBox will be set to
minimumValueThe lowest possible number allowed
maximumValueThe highest possible number allowed
Returns
The user-inputted float
905 {
906 using (NumericInputForm dialog = new NumericInputForm())
907 {
908 dialog.Cancellable = false;
909 dialog.numNewCount.Integer = false;
910 dialog.numNewCount.Integral = false;
911 // Set minimum and maximum values if applicable
912 if (minimumValue != maximumValue)
913 {
914 dialog.numNewCount.MinimumValue = minimumValue;
915 dialog.numNewCount.MaximumValue = maximumValue;
916 // Ensure value stays within the boundaries set
917 if (defaultValue < minimumValue || defaultValue > maximumValue)
918 {
919 defaultValue = minimumValue;
920 }
921 }
922 else
923 {
924 dialog.numNewCount.MinimumValue = float.MinValue;
925 dialog.numNewCount.MaximumValue = float.MaxValue;
926 }
927
928 dialog.ShowDialog(title, description, defaultValue);
929 _lastFloatInput = dialog.NewFloatValue;
930 return dialog.NewFloatValue;
931 }
932 }
Definition: NumericInputForm.cs:7
new DialogResult ShowDialog()
Definition: NumericInputForm.cs:20
float NewFloatValue
Definition: NumericInputForm.cs:18

◆ UserIntegerInput() [1/6]

static int BrawlCrate.API.BrawlAPI.UserIntegerInput ( )
inlinestatic

Prompts the user to input an integer.

Returns
The user-inputted integer
677 {
678 return UserIntegerInput("BrawlAPI Integer Input", "Value:", _lastIntegerInput, 0, 0);
679 }
static int UserIntegerInput()
Prompts the user to input an integer.
Definition: ExposedMembers.cs:676

◆ UserIntegerInput() [2/6]

static int BrawlCrate.API.BrawlAPI.UserIntegerInput ( string  title)
inlinestatic

Prompts the user to input an integer.

Parameters
titleThe title of the dialog box
Returns
The user-inputted integer
691 {
692 return UserIntegerInput(title, "Value:", _lastIntegerInput, 0, 0);
693 }

◆ UserIntegerInput() [3/6]

static int BrawlCrate.API.BrawlAPI.UserIntegerInput ( string  title,
string  description 
)
inlinestatic

Prompts the user to input an integer.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
Returns
The user-inputted integer
708 {
709 return UserIntegerInput(title, description, _lastIntegerInput, 0, 0);
710 }

◆ UserIntegerInput() [4/6]

static int BrawlCrate.API.BrawlAPI.UserIntegerInput ( string  title,
string  description,
int  defaultValue 
)
inlinestatic

Prompts the user to input an integer.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
defaultValueThe default value that the NumericInputBox will be set to
Returns
The user-inputted integer
728 {
729 return UserIntegerInput(title, description, defaultValue, 0, 0);
730 }

◆ UserIntegerInput() [5/6]

static int BrawlCrate.API.BrawlAPI.UserIntegerInput ( string  title,
string  description,
int  defaultValue,
int  minimumValue 
)
inlinestatic

Prompts the user to input an integer.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
defaultValueThe default value that the NumericInputBox will be set to
minimumValueThe lowest possible number allowed
Returns
The user-inputted integer
751 {
752 return UserIntegerInput(title, description, defaultValue, minimumValue, int.MaxValue);
753 }

◆ UserIntegerInput() [6/6]

static int BrawlCrate.API.BrawlAPI.UserIntegerInput ( string  title,
string  description,
int  defaultValue,
int  minimumValue,
int  maximumValue 
)
inlinestatic

Prompts the user to input an integer.

Parameters
titleThe title of the dialog box
descriptionA short description printed next to the NumericEntryBox
defaultValueThe default value that the NumericInputBox will be set to
minimumValueThe lowest possible number allowed
maximumValueThe highest possible number allowed
Returns
The user-inputted integer
778 {
779 using (NumericInputForm dialog = new NumericInputForm())
780 {
781 dialog.Cancellable = false;
782 dialog.numNewCount.Integer = true;
783 // Set minimum and maximum values if applicable
784 if (minimumValue != maximumValue)
785 {
786 dialog.numNewCount.MinimumValue = minimumValue;
787 dialog.numNewCount.MaximumValue = maximumValue;
788 // Ensure value stays within the boundaries set
789 if (defaultValue < minimumValue || defaultValue > maximumValue)
790 {
791 defaultValue = minimumValue;
792 }
793 }
794
795 dialog.ShowDialog(title, description, defaultValue);
796 _lastIntegerInput = dialog.NewValue;
797 return dialog.NewValue;
798 }
799 }
int NewValue
Definition: NumericInputForm.cs:16

◆ UserStringInput() [1/3]

static string BrawlCrate.API.BrawlAPI.UserStringInput ( )
inlinestatic

Prompts the user to input a string, with a default title and the last BrawlAPI-entered string as the default value.

Returns
The user-inputted string
620 {
621 return UserStringInput("BrawlAPI String Input", _lastStringInput);
622 }
static string UserStringInput()
Prompts the user to input a string, with a default title and the last BrawlAPI-entered string as the ...
Definition: ExposedMembers.cs:619

◆ UserStringInput() [2/3]

static string BrawlCrate.API.BrawlAPI.UserStringInput ( string  title)
inlinestatic

Prompts the user to input a string, with the last BrawlAPI-entered string as the default value.

Parameters
titleThe title of the string input dialog box
Returns
The user-inputted string
634 {
635 return UserStringInput(title, _lastStringInput);
636 }

◆ UserStringInput() [3/3]

static string BrawlCrate.API.BrawlAPI.UserStringInput ( string  title,
string  defaultText 
)
inlinestatic

Prompts the user to input a string with a default starting value.

Parameters
titleThe title of the string input dialog box
defaultTextThe default text to use for the input
Returns
The user-inputted string
651 {
652 using (StringInputDialog dialog = new StringInputDialog(title, defaultText))
653 {
654 dialog.Cancellable = false;
655 dialog.ShowDialog();
656 _lastStringInput = dialog.resultString;
657 return dialog.resultString;
658 }
659 }
Definition: StringInputDialog.cs:7
string resultString
Definition: StringInputDialog.cs:20

◆ Wait()

static void BrawlCrate.API.BrawlAPI.Wait ( int  milliseconds)
inlinestatic

Causes the current thread to sleep for a number of milliseconds.

Parameters
millisecondsThe amount of time to wait, in milliseconds
1353 {
1354 System.Threading.Thread.Sleep(milliseconds);
1355 }

◆ WriteToConsole()

static void BrawlCrate.API.BrawlAPI.WriteToConsole ( string  msg)
inlinestatic

Writes a message to the the console and debug log (if debugging) and the Trace log (if enabled).

To be used for debugging purposes only. This function call will do nothing in release builds. For compatibility purposes, this function will still be callable in release builds.

Parameters
msgThe string to be written to the console.
1422 {
1423#if DEBUG
1424 Console.WriteLine(msg);
1425 System.Diagnostics.Debug.WriteLine(msg);
1426#endif
1427#if TRACE
1428 System.Diagnostics.Trace.WriteLine(msg);
1429#endif
1430 }

Property Documentation

◆ APIPath

string BrawlCrate.API.BrawlAPI.APIPath
staticget

The folder in which the API folders are located.

◆ AppPath

string BrawlCrate.API.BrawlAPI.AppPath
staticget

The folder in which the BrawlCrate installation is located.

◆ LibPath

string BrawlCrate.API.BrawlAPI.LibPath
staticget

The folder in which API libraries are located.

◆ LoaderPath

string BrawlCrate.API.BrawlAPI.LoaderPath
staticget

The folder in which loaders are located.

◆ NodeList

List<ResourceNode> BrawlCrate.API.BrawlAPI.NodeList
staticget

Returns a full list of all nodes in the open file.

Returns an empty list if there is no open file.

70 {
71 get
72 {
73 List<ResourceNode> nodes = new List<ResourceNode>();
74
75 if (RootNode != null)
76 {
77 nodes.AddRange(ResourceNode.FindAllSubNodes(RootNode));
78 }
79
80 return nodes;
81 }
82 }
static ResourceNode RootNode
The root node of the opened file.
Definition: ExposedMembers.cs:29
static ResourceNode[] FindAllSubNodes(ResourceNode root)
Definition: ResourceNode.cs:1241

◆ NodeWrapperList

List<BaseWrapper> BrawlCrate.API.BrawlAPI.NodeWrapperList
staticget

Returns a full list of all node wrappers in the open file.

Note that this function is generally slow due to the implementation of ResourceTrees; for general usage, NodeList works best.

Returns an empty list if there is no open file.

156 {
157 get
158 {
159 List<BaseWrapper> wrappers = new List<BaseWrapper>();
160
161 if (RootNodeWrapper != null)
162 {
164
165 TreeNodeCollection treeNodes = RootNodeWrapper.TreeView.Nodes;
166 foreach (TreeNode n in treeNodes)
167 {
168 if (n is BaseWrapper b)
169 {
170 wrappers.AddRange(BaseWrapper.GetAllNodes(b));
171 }
172 }
173
175 }
176
177 return wrappers;
178 }
179 }
static BaseWrapper RootNodeWrapper
The wrapper for the root node of the opened file.
Definition: ExposedMembers.cs:113
static BaseWrapper[] GetAllNodes(BaseWrapper root)
Definition: BaseWrapper.cs:221
ResourceTree resourceTree
Definition: MainForm.cs:2418

◆ PluginPath

string BrawlCrate.API.BrawlAPI.PluginPath
staticget

The folder in which plugins are located.

◆ ResourcesPath

string BrawlCrate.API.BrawlAPI.ResourcesPath
staticget

The folder in which API resources are located.

◆ RootNode

ResourceNode BrawlCrate.API.BrawlAPI.RootNode
staticget

The root node of the opened file.

Returns
The current Root Node, or null if there is no current nodetree.

◆ RootNodeWrapper

BaseWrapper BrawlCrate.API.BrawlAPI.RootNodeWrapper
staticget

The wrapper for the root node of the opened file.

Returns null if there is no open file.

◆ SelectedNode

ResourceNode BrawlCrate.API.BrawlAPI.SelectedNode
staticget

The currently selected node on the Main Form. Useful for context menu items.

Returns
The currently selected node, or null if no node is currently selected.

◆ SelectedNodes

List<ResourceNode> BrawlCrate.API.BrawlAPI.SelectedNodes
staticget

The currently selected nodes on the Main Form.

Returns
A list of all current selected nodes, or an empty list if no nodes are selected.
48 {
49 get
50 {
51 List<ResourceNode> nodes = new List<ResourceNode>();
53 {
55 {
56 nodes.Add(b.Resource);
57 }
58 }
59
60 return nodes;
61 }
62 }
new List< TreeNode > SelectedNodes
Definition: ResourceTree.cs:58

◆ SelectedNodeWrapper

BaseWrapper BrawlCrate.API.BrawlAPI.SelectedNodeWrapper
staticget

The wrapper for the currently selected node on the Main Form. Useful for context menu items.

Returns null if there is no selected node.

◆ SelectedNodeWrappers

List<BaseWrapper> BrawlCrate.API.BrawlAPI.SelectedNodeWrappers
staticget

The wrappers for the currently selected nodes on the Main Form.

Returns null if there are no selected nodes.

128 {
129 get
130 {
131 List<BaseWrapper> wrappers = new List<BaseWrapper>();
133 {
134 foreach (TreeNode treeNode in MainForm.Instance?.resourceTree.SelectedNodes)
135 {
136 if (treeNode is BaseWrapper b)
137 {
138 wrappers.Add(b);
139 }
140 }
141 }
142
143 return wrappers;
144 }
145 }

The documentation for this class was generated from the following file: