BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode:
BrawlLib.SSBB.ResourceNodes.ResourceNode

Public Member Functions

override bool OnInitialize ()
 
override void OnPopulate ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 

Properties

override ResourceType ResourceFileType [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Member Function Documentation

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

97 {
98 int size = 0xC;
99 foreach (RBNKEntryNode g in Children)
100 {
101 size += 8 + g.CalculateSize(true);
102 }
103
104 return size.Align(0x20);
105 }
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

33 {
34 _name = "Data";
35
36 return Header->_list._numEntries > 0;
37 }
string _name
Definition: ResourceNode.cs:139

◆ OnPopulate()

override void BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode.OnPopulate ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

40 {
41 RBNK_DATAHeader* header = Header;
42 VoidPtr offset = &header->_list;
43 int count = header->_list._numEntries;
44
45 LabelItem[] list = ((RBNKNode) _parent)._labels; //Get labels from parent
46 ((RBNKNode) _parent)._labels = null; //Clear labels, no more use for them!
47
48 for (int i = 0; i < count; i++)
49 {
50 ruint entry = header->_list.Entries[i];
51 RBNKEntryNode e = null;
52 switch (entry._dataType) //RegionTableType
53 {
54 default:
55 e = new RBNKNullNode();
56 if (list != null)
57 {
58 (e as RBNKNullNode)._key = (byte) list[i].Tag;
59 }
60
61 (e as RBNKNullNode)._invalid = true;
62 break;
63 case 1: //InstParam
64 e = new RBNKDataInstParamNode();
65 if (list != null)
66 {
67 (e as RBNKDataInstParamNode)._key = (byte) list[i].Tag;
68 }
69
70 break;
71 case 2: //RangeTable
72 e = new RBNKDataRangeTableNode();
73 break;
74 case 3: //IndexTable
75 e = new RBNKDataIndexTableNode();
76 break;
77 case 4:
78 e = new RBNKNullNode();
79 (e as RBNKNullNode)._key = (byte) list[i].Tag;
80 break;
81 }
82
83 if (e != null)
84 {
85 e._offset = offset;
86 if (list != null)
87 {
88 e._name = list[i].String;
89 }
90
91 e.Initialize(this, header->_list.Get(offset, i), 0);
92 }
93 }
94 }
ResourceNode _parent
Definition: ResourceNode.cs:142
Definition: VoidPtr.cs:9
Definition: Common.cs:232
byte _dataType
Definition: Common.cs:241

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

108 {
109 RBNK_DATAHeader* header = (RBNK_DATAHeader*) address;
110
111 header->_tag = RBNK_DATAHeader.Tag;
112 header->_length = length;
113 header->_list._numEntries = Children.Count;
114
115 VoidPtr addr = address + 12 + 8 * Children.Count;
116 foreach (RBNKEntryNode g in Children)
117 {
118 g._rebuildBase = header->_list.Address;
119
120 if (g is RBNKDataInstParamNode)
121 {
122 header->_list.Entries[g.Index] = addr - header->_list.Address;
123 header->_list.Entries[g.Index]._dataType = 1;
124 }
125 else if (g is RBNKDataRangeTableNode)
126 {
127 header->_list.Entries[g.Index] = addr - header->_list.Address;
128 header->_list.Entries[g.Index]._dataType = 2;
129 }
130 else if (g is RBNKDataIndexTableNode)
131 {
132 header->_list.Entries[g.Index] = addr - header->_list.Address;
133 header->_list.Entries[g.Index]._dataType = 3;
134 }
135 else if (g is RBNKNullNode && !(g as RBNKNullNode)._invalid)
136 {
137 header->_list.Entries[g.Index] = 0;
138 header->_list.Entries[g.Index]._dataType = 4;
139 }
140 else
141 {
142 header->_list.Entries[g.Index] = 0;
143 header->_list.Entries[g.Index]._dataType = 0;
144 header->_list.Entries[g.Index]._refType = 0;
145 }
146
147 g.Rebuild(addr, g._calcSize, false);
148 addr += g._calcSize;
149 }
150 }

Property Documentation

◆ ResourceFileType

override ResourceType BrawlLib.SSBB.ResourceNodes.RBNKDataGroupNode.ResourceFileType
get

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