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

Public Member Functions

 CEGroupNode ()
 
 CEGroupNode (string name)
 
override bool OnInitialize ()
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override void OnPopulate ()
 
override int OnCalculateSize (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 ()
 

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 ()
 
- 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]
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Constructor & Destructor Documentation

◆ CEGroupNode() [1/2]

BrawlLib.SSBB.ResourceNodes.CEGroupNode.CEGroupNode ( )
inline
105 : base()
106 {
107 }

◆ CEGroupNode() [2/2]

BrawlLib.SSBB.ResourceNodes.CEGroupNode.CEGroupNode ( string  name)
inline
109 : base()
110 {
111 _name = name;
112 }
string _name
Definition: ResourceNode.cs:139

Member Function Documentation

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

203 {
204 int size = 0;
205 if (_name == "Events") //calculate size of all CEEntryNode
206 {
207 foreach (CEEntryNode n in Children)
208 {
209 size += n.CalculateSize(true);
210 }
211 }
212 else //calculate size of all CEStringNode
213 {
214 foreach (CEStringNode n in Children)
215 {
216 size += n.CalculateSize(true);
217 }
218 }
219
220 return size;
221 }
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

116 {
117 return true;
118 }

◆ OnPopulate()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

161 {
162 Type t = null; //switch by name
163 if (_name == "Events")
164 {
165 t = typeof(CEEntryNode);
166 }
167 else if (_name == "Strings")
168 {
169 t = typeof(CEStringNode);
170 }
171 else
172 {
173 return;
174 }
175
176 if (t == typeof(CEEntryNode)) //is this CEEntryNode?
177 {
178 for (int i = 0; i < Header->_numEntries; i++)
179 {
180 VoidPtr entry = (VoidPtr) Header + Header->entryOffsets[i];
181 CEEntryNode node = new CEEntryNode
182 {
183 NextAddress = (VoidPtr) Header + Header->entryOffsets[i + 1]
184 };
185 node.Initialize(this, new DataSource(entry, node.NextAddress - entry));
186 }
187 }
188 else //this is CEStringNode
189 {
190 bint* offset = &Header->entryOffsets[Header->_numEntries];
191 for (; offset < (VoidPtr) Header + Header->entryOffsets[0]; offset++)
192 {
193 if (*offset != 0x0)
194 {
195 CEStringNode node = new CEStringNode();
196 node.Initialize(this, new DataSource((VoidPtr) Header + *offset, 0x0));
197 }
198 }
199 }
200 }
Definition: VoidPtr.cs:9
Definition: BigEndianTypes.cs:9

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

122 {
123 CEHeader* header = (CEHeader*) address;
124 VoidPtr entry = null;
125 int offset = 0x10 + Children.Count * 0x4 + Parent.Children[1].Children.Count * 0x4;
126 if (offset % 0x10 != 0)
127 {
128 entry = address + offset + 0x10 - offset % 0x10;
129 }
130 else
131 {
132 entry = address + offset;
133 }
134
135 int count = 0;
136 header->entryOffsets[count] = entry - address; //write offset of first entry
137 if (_name == "Events")
138 {
139 foreach (CEEntryNode n in Children)
140 {
141 int entrySize = n.CalculateSize(true);
142 n.Rebuild(entry, entrySize, true);
143 entry += entrySize;
144 count++;
145 header->entryOffsets[count] = entry - address; //write each offset of entries
146 }
147 }
148
149 if (_name == "Strings")
150 {
151 foreach (CEStringNode n in Children) //"address" is first address of CEString
152 {
153 int entrySize = n.CalculateSize(true);
154 n.Rebuild(address, entrySize, true);
155 address += entrySize;
156 }
157 }
158 }
ResourceNode Parent
Definition: ResourceNode.cs:245

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