BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Properties | List of all members
BrawlCrate.NodeWrappers.U8FolderWrapper Class Reference
Inheritance diagram for BrawlCrate.NodeWrappers.U8FolderWrapper:
BrawlCrate.NodeWrappers.GenericWrapper BrawlCrate.NodeWrappers.BaseWrapper BrawlCrate.NodeWrappers.MultiSelectableWrapper

Public Member Functions

 U8FolderWrapper ()
 
void NewTpl ()
 
void NewRfnt ()
 
void NewWav ()
 
U8FolderNode NewFolder ()
 
BRRESNode NewBrres ()
 
void ImportRlyt ()
 
void ImportTpl ()
 
void ImportRfnt ()
 
void ImportWav ()
 
void ImportU8 ()
 
void ImportBrres ()
 
void ExportAll ()
 
void searchU8Folder (U8FolderNode u8, out bool hasModels, out bool hasTextures)
 
void EditAll ()
 
void ReplaceAll ()
 
void ImportFolder ()
 
void PreviewAll ()
 
- Public Member Functions inherited from BrawlCrate.NodeWrappers.GenericWrapper
 GenericWrapper (IWin32Window owner)
 
 GenericWrapper ()
 
virtual void Sort ()
 
void MoveUp ()
 
virtual void MoveUp (bool select)
 
void MoveDown ()
 
virtual void MoveDown (bool select)
 
void DeleteSelected ()
 
void ExportSelected ()
 
virtual string Export ()
 
virtual void OnExport (string outPath)
 
virtual void Replace ()
 
virtual void OnReplace (string inStream)
 
void Restore ()
 
virtual void Delete ()
 
void Rename ()
 
virtual ResourceNode Duplicate ()
 
virtual ResourceNode Duplicate (bool changeName)
 
- Public Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
void Link (ResourceNode res)
 
void Unlink ()
 

Static Protected Member Functions

static void NewTplAction (object sender, EventArgs e)
 
static void NewRfntAction (object sender, EventArgs e)
 
static void NewWavAction (object sender, EventArgs e)
 
static void NewBrresAction (object sender, EventArgs e)
 
static void NewFolderAction (object sender, EventArgs e)
 
static void ImportBrresAction (object sender, EventArgs e)
 
static void ImportRlytAction (object sender, EventArgs e)
 
static void ImportTplAction (object sender, EventArgs e)
 
static void ImportRfntAction (object sender, EventArgs e)
 
static void ImportWavAction (object sender, EventArgs e)
 
static void ImportU8Action (object sender, EventArgs e)
 
static void ExportAllAction (object sender, EventArgs e)
 
static void ImportFolderAction (object sender, EventArgs e)
 
static void ReplaceAllAction (object sender, EventArgs e)
 
static void EditAllAction (object sender, EventArgs e)
 
static void PreviewAllAction (object sender, EventArgs e)
 
- Static Protected Member Functions inherited from BrawlCrate.NodeWrappers.GenericWrapper
static void MoveUpAction (object sender, EventArgs e)
 
static void MoveDownAction (object sender, EventArgs e)
 
static void ExportAction (object sender, EventArgs e)
 
static void ExportSelectedAction (object sender, EventArgs e)
 
static void DeleteSelectedAction (object sender, EventArgs e)
 
static void DuplicateAction (object sender, EventArgs e)
 
static void ReplaceAction (object sender, EventArgs e)
 
static void RestoreAction (object sender, EventArgs e)
 
static void DeleteAction (object sender, EventArgs e)
 
static void RenameAction (object sender, EventArgs e)
 
static void SortAction (object sender, EventArgs e)
 
- Static Protected Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
static T GetInstance< T > ()
 
static IEnumerable< T > GetInstances< T > ()
 

Properties

override string ExportFilter [get]
 
override string ImportFilter [get]
 
- Properties inherited from BrawlCrate.NodeWrappers.GenericWrapper
virtual ContextMenuStrip MultiSelectMenuStrip [get]
 
virtual string DefaultName [get]
 
virtual string ExportFilter [get]
 
virtual string ImportFilter [get]
 
virtual string ReplaceFilter [get]
 
- Properties inherited from BrawlCrate.NodeWrappers.BaseWrapper
ResourceNode Resource [get]
 
virtual ? Color DefaultBackColor [get]
 
virtual ? Color DefaultForeColor [get]
 
- Properties inherited from BrawlCrate.NodeWrappers.MultiSelectableWrapper
ContextMenuStrip MultiSelectMenuStrip [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
static BaseWrapper[] GetAllNodes (BaseWrapper root)
 
static BaseWrapper Wrap (ResourceNode node)
 
static BaseWrapper Wrap (IWin32Window owner, ResourceNode node)
 
- Static Public Attributes inherited from BrawlCrate.NodeWrappers.BaseWrapper
static IWin32Window _owner
 
- Protected Member Functions inherited from BrawlCrate.NodeWrappers.BaseWrapper
 BaseWrapper ()
 
- Protected Attributes inherited from BrawlCrate.NodeWrappers.BaseWrapper
bool _discovered
 
ResourceNode _resource
 
- Static Protected Attributes inherited from BrawlCrate.NodeWrappers.BaseWrapper
static readonly ContextMenuStrip _emptyMenu = new ContextMenuStrip()
 

Constructor & Destructor Documentation

◆ U8FolderWrapper()

BrawlCrate.NodeWrappers.U8FolderWrapper.U8FolderWrapper ( )
inline
180 {
181 ContextMenuStrip = _menu;
182 }

Member Function Documentation

◆ EditAll()

void BrawlCrate.NodeWrappers.U8FolderWrapper.EditAll ( )
inline
440 {
441 EditAllDialog ctd = new EditAllDialog();
443 }
ResourceNode _resource
Definition: BaseWrapper.cs:76
static IWin32Window _owner
Definition: BaseWrapper.cs:398
Definition: EditAllDialog.cs:11
void ShowDialog(IWin32Window owner, ResourceNode resource)
Definition: EditAllDialog.cs:109

◆ EditAllAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.EditAllAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
143 {
144 GetInstance<U8FolderWrapper>().EditAll();
145 }

◆ ExportAll()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ExportAll ( )
inline
321 {
322 string path = Program.ChooseFolder();
323 if (path == null)
324 {
325 return;
326 }
327
328 bool hasModels = false;
329 bool hasTextures = false;
330 foreach (ResourceNode r in _resource.Children)
331 {
332 if (hasModels && hasTextures)
333 {
334 break;
335 }
336
337 if (r is BRRESNode)
338 {
339 foreach (BRESGroupNode e in r.Children)
340 {
341 if (e.Type == BRESGroupNode.BRESGroupType.Textures)
342 {
343 hasTextures = true;
344 }
345 else if (e.Type == BRESGroupNode.BRESGroupType.Models)
346 {
347 hasModels = true;
348 }
349
350 if (hasModels && hasTextures)
351 {
352 break;
353 }
354 }
355 }
356 else if (r is U8FolderNode)
357 {
358 searchU8Folder((U8FolderNode) r, out bool hasModelsTemp, out bool hasTexturesTemp);
359 hasModels = hasModels || hasModelsTemp;
360 hasTextures = hasTextures || hasTexturesTemp;
361 }
362 }
363
364 string extensionTEX0 = ".tex0";
365 string extensionMDL0 = ".mdl0";
366
367 if (hasTextures)
368 {
369 ExportAllFormatDialog dialog =
370 new ExportAllFormatDialog("Export All", typeof(TEX0Node), FileFilters.TEX0);
371
372 if (dialog.ShowDialog() == DialogResult.OK)
373 {
374 extensionTEX0 = dialog.SelectedExtension;
375 }
376 else
377 {
378 return;
379 }
380 }
381
382 if (hasModels)
383 {
384 ExportAllFormatDialog dialog =
385 new ExportAllFormatDialog("Export All", typeof(MDL0Node), FileFilters.MDL0Export);
386
387 if (dialog.ShowDialog() == DialogResult.OK)
388 {
389 extensionMDL0 = dialog.SelectedExtension;
390 }
391 else
392 {
393 return;
394 }
395 }
396
397 ((U8FolderNode) _resource).ExportToFolder(path, extensionTEX0, extensionMDL0);
398 }
void searchU8Folder(U8FolderNode u8, out bool hasModels, out bool hasTextures)
Definition: U8FolderWrapper.cs:400
string SelectedExtension
Definition: ExportAllAskFormat.cs:31
Definition: FileFilters.cs:8
static string TEX0
Definition: FileFilters.cs:38
static string MDL0Export
Definition: FileFilters.cs:35
Definition: BRRESNode.cs:777
BRESGroupType Type
Definition: BRRESNode.cs:828
BRESGroupType
Definition: BRRESNode.cs:857
Definition: BRRESNode.cs:19
Definition: MDL0Node.cs:24
Definition: ResourceNode.cs:129
List< ResourceNode > Children
Definition: ResourceNode.cs:262
Definition: TEX0Node.cs:22

◆ ExportAllAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ExportAllAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
128 {
129 GetInstance<U8FolderWrapper>().ExportAll();
130 }

◆ ImportBrres()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportBrres ( )
inline
308 {
309 if (Program.OpenFile(FileFilters.BRES, out string path))
310 {
311 BRRESNode node = NodeFactory.FromFile(null, path) as BRRESNode;
313
314 BaseWrapper w = FindResource(node, true);
315 w.EnsureVisible();
316 w.TreeView.SelectedNode = w;
317 }
318 }
BaseWrapper()
Definition: BaseWrapper.cs:79
static string BRES
Definition: FileFilters.cs:28
Definition: NodeFactory.cs:18
static ResourceNode FromFile(ResourceNode parent, string path)
Definition: NodeFactory.cs:69
virtual void AddChild(ResourceNode child)
Definition: ResourceNode.cs:757

◆ ImportBrresAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportBrresAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
98 {
99 GetInstance<U8FolderWrapper>().ImportBrres();
100 }

◆ ImportFolder()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportFolder ( )
inline
463 {
464 string path = Program.ChooseFolder();
465 if (path == null)
466 {
467 return;
468 }
469
470 ((BRRESNode) _resource).ImportFolder(path);
471 }

◆ ImportFolderAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportFolderAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
133 {
134 GetInstance<U8FolderWrapper>().ImportFolder();
135 }

◆ ImportRfnt()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportRfnt ( )
inline
260 {
261 //string path;
262 //if (Program.OpenFile(ExportFilters.SRT0, out path) > 0)
263 //{
264 // RLYTNode node = NodeFactory.FromFile(null, path) as RLYTNode;
265 // ((U8FolderNode)_resource).AddChild(node);
266
267 // BaseWrapper w = this.FindResource(node, true);
268 // w.EnsureVisible();
269 // w.TreeView.SelectedNode = w;
270 //}
271 }

◆ ImportRfntAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportRfntAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
113 {
114 GetInstance<U8FolderWrapper>().ImportRfnt();
115 }

◆ ImportRlyt()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportRlyt ( )
inline
232 {
233 //string path;
234 //if (Program.OpenFile(ExportFilters.SRT0, out path) > 0)
235 //{
236 // RLYTNode node = NodeFactory.FromFile(null, path) as RLYTNode;
237 // ((U8FolderNode)_resource).AddChild(node);
238
239 // BaseWrapper w = this.FindResource(node, true);
240 // w.EnsureVisible();
241 // w.TreeView.SelectedNode = w;
242 //}
243 }

◆ ImportRlytAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportRlytAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
103 {
104 GetInstance<U8FolderWrapper>().ImportRlyt();
105 }

◆ ImportTpl()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportTpl ( )
inline
246 {
247 //string path;
248 //if (Program.OpenFile(ExportFilters.SRT0, out path) > 0)
249 //{
250 // TPLNode node = NodeFactory.FromFile(null, path) as TPLNode;
251 // ((U8FolderNode)_resource).AddChild(node);
252
253 // BaseWrapper w = this.FindResource(node, true);
254 // w.EnsureVisible();
255 // w.TreeView.SelectedNode = w;
256 //}
257 }

◆ ImportTplAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportTplAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
108 {
109 GetInstance<U8FolderWrapper>().ImportTpl();
110 }

◆ ImportU8()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportU8 ( )
inline
288 {
289 if (Program.OpenFile(FileFilters.U8Import, out string path))
290 {
291 U8Node node = NodeFactory.FromFile(null, path) as U8Node;
292 U8FolderNode n = new U8FolderNode();
293 foreach (ResourceNode r in node.Children)
294 {
295 n.AddChild(r);
296 }
297
298 n.Name = node.Name;
299 ((U8FolderNode) _resource).AddChild(n);
300
301 BaseWrapper w = FindResource(n, true);
302 w.EnsureVisible();
303 w.TreeView.SelectedNode = w;
304 }
305 }
static string U8Import
Definition: FileFilters.cs:25
virtual string Name
Definition: ResourceNode.cs:223
Definition: U8Node.cs:14

◆ ImportU8Action()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportU8Action ( object  sender,
EventArgs  e 
)
inlinestaticprotected
123 {
124 GetInstance<U8FolderWrapper>().ImportU8();
125 }

◆ ImportWav()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportWav ( )
inline
274 {
275 //string path;
276 //if (Program.OpenFile(ExportFilters.SRT0, out path) > 0)
277 //{
278 // RLYTNode node = NodeFactory.FromFile(null, path) as RLYTNode;
279 // ((U8FolderNode)_resource).AddChild(node);
280
281 // BaseWrapper w = this.FindResource(node, true);
282 // w.EnsureVisible();
283 // w.TreeView.SelectedNode = w;
284 //}
285 }

◆ ImportWavAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ImportWavAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
118 {
119 GetInstance<U8FolderWrapper>().ImportWav();
120 }

◆ NewBrres()

BRRESNode BrawlCrate.NodeWrappers.U8FolderWrapper.NewBrres ( )
inline
222 {
223 BRRESNode node = ((U8FolderNode) _resource).CreateResource<BRRESNode>("NewBrres");
224 BaseWrapper res = FindResource(node, true);
225 res = res.FindResource(node, false);
226 res.EnsureVisible();
227 res.TreeView.SelectedNode = res;
228 return node;
229 }

◆ NewBrresAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.NewBrresAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
88 {
89 GetInstance<U8FolderWrapper>().NewBrres();
90 }

◆ NewFolder()

U8FolderNode BrawlCrate.NodeWrappers.U8FolderWrapper.NewFolder ( )
inline
212 {
213 U8FolderNode node = ((U8FolderNode) _resource).CreateResource<U8FolderNode>("NewFolder");
214 BaseWrapper res = FindResource(node, true);
215 res = res.FindResource(node, false);
216 res.EnsureVisible();
217 res.TreeView.SelectedNode = res;
218 return node;
219 }

◆ NewFolderAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.NewFolderAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
93 {
94 GetInstance<U8FolderWrapper>().NewFolder();
95 }

◆ NewRfnt()

void BrawlCrate.NodeWrappers.U8FolderWrapper.NewRfnt ( )
inline
194 {
195 //RlytNode node = ((U8FolderNode)_resource).CreateResource<RlytNode>("NewRLYT");
196 //BaseWrapper res = this.FindResource(node, true);
197 //res = res.FindResource(node, false);
198 //res.EnsureVisible();
199 //res.TreeView.SelectedNode = res;
200 }

◆ NewRfntAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.NewRfntAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
78 {
79 GetInstance<U8FolderWrapper>().NewRfnt();
80 }

◆ NewTpl()

void BrawlCrate.NodeWrappers.U8FolderWrapper.NewTpl ( )
inline
185 {
186 TPLNode node = ((U8FolderNode) _resource).CreateResource<TPLNode>("TPL");
187 BaseWrapper res = FindResource(node, true);
188 res = res.FindResource(node, false);
189 res.EnsureVisible();
190 res.TreeView.SelectedNode = res;
191 }
Definition: TPLNode.cs:16

◆ NewTplAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.NewTplAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
73 {
74 GetInstance<U8FolderWrapper>().NewTpl();
75 }

◆ NewWav()

void BrawlCrate.NodeWrappers.U8FolderWrapper.NewWav ( )
inline
203 {
204 //RlytNode node = ((U8FolderNode)_resource).CreateResource<RlytNode>("NewRLYT");
205 //BaseWrapper res = this.FindResource(node, true);
206 //res = res.FindResource(node, false);
207 //res.EnsureVisible();
208 //res.TreeView.SelectedNode = res;
209 }

◆ NewWavAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.NewWavAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
83 {
84 GetInstance<U8FolderWrapper>().NewWav();
85 }

◆ PreviewAll()

void BrawlCrate.NodeWrappers.U8FolderWrapper.PreviewAll ( )
inline
496 {
497 new ModelForm().ShowDialog(_owner, ModelPanel.CollectModels(_resource));
498 }
static List< IModel > CollectModels(ResourceNode node)
Definition: ModelPanel.cs:1044

◆ PreviewAllAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.PreviewAllAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
148 {
149 GetInstance<U8FolderWrapper>().PreviewAll();
150 }

◆ ReplaceAll()

void BrawlCrate.NodeWrappers.U8FolderWrapper.ReplaceAll ( )
inline
446 {
447 string path = Program.ChooseFolder();
448 if (path == null)
449 {
450 return;
451 }
452
453 ExportAllFormatDialog dialog = new ExportAllFormatDialog("Replace All", typeof(TEX0Node), FileFilters.TEX0);
454 dialog.label1.Text = "Input format for textures:";
455
456 if (dialog.ShowDialog() == DialogResult.OK)
457 {
458 ((BRRESNode) _resource).ReplaceFromFolder(path, dialog.SelectedExtension);
459 }
460 }

◆ ReplaceAllAction()

static void BrawlCrate.NodeWrappers.U8FolderWrapper.ReplaceAllAction ( object  sender,
EventArgs  e 
)
inlinestaticprotected
138 {
139 GetInstance<U8FolderWrapper>().ReplaceAll();
140 }

◆ searchU8Folder()

void BrawlCrate.NodeWrappers.U8FolderWrapper.searchU8Folder ( U8FolderNode  u8,
out bool  hasModels,
out bool  hasTextures 
)
inline
401 {
402 hasModels = false;
403 hasTextures = false;
404 foreach (ResourceNode r in u8.Children)
405 {
406 if (hasModels && hasTextures)
407 {
408 break;
409 }
410
411 if (r is BRRESNode)
412 {
413 foreach (BRESGroupNode e in r.Children)
414 {
415 if (e.Type == BRESGroupNode.BRESGroupType.Textures)
416 {
417 hasTextures = true;
418 }
419 else if (e.Type == BRESGroupNode.BRESGroupType.Models)
420 {
421 hasModels = true;
422 }
423
424 if (hasModels && hasTextures)
425 {
426 break;
427 }
428 }
429 }
430 else if (r is U8FolderNode)
431 {
432 searchU8Folder((U8FolderNode) r, out bool hasModelsTemp, out bool hasTexturesTemp);
433 hasModels = hasModels || hasModelsTemp;
434 hasTextures = hasTextures || hasTexturesTemp;
435 }
436 }
437 }

Property Documentation

◆ ExportFilter

override string BrawlCrate.NodeWrappers.U8FolderWrapper.ExportFilter
get

◆ ImportFilter

override string BrawlCrate.NodeWrappers.U8FolderWrapper.ImportFilter
get

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