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

Public Member Functions

override bool OnInitialize ()
 
override void OnPopulate ()
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override int OnCalculateSize (bool force)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.MoveDefExternalNode
override void Remove ()
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.MoveDefEntryNode
override void Rebuild (bool force)
 
override bool OnInitialize ()
 
ActionEventInfo GetEventInfo (long id)
 
override void SortChildren ()
 
ResourceNode FindNode (int offset)
 
ResourceNode GetByOffsetID (int id)
 
virtual void PostProcess ()
 
- 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 ()
 

Public Attributes

List< AttributeInfo_info
 
string OldName
 
Dictionary< int, FDefListOffsetoffsets
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.MoveDefExternalNode
List< int > _offsets = new List<int>()
 
List< MoveDefEntryNode_refs = new List<MoveDefEntryNode>()
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.MoveDefEntryNode
int _lookupCount
 
List< int > _lookupOffsets = new List<int>()
 
VoidPtr _entryOffset = 0
 
int _entryLength
 
int _childLength
 
MoveDefExternalNode _extNode
 
bool _extOverride = false
 
int offsetID
 
bool isExtra = false
 
- 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
 

Properties

override ResourceType ResourceFileType [get]
 
override string Name [get, set]
 
UnsafeBuffer AttributeBuffer [get]
 
override string TreePathAbsolute [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.MoveDefExternalNode
override ResourceType ResourceFileType [get]
 
MoveDefEntryNode[] References [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.MoveDefEntryNode
VoidPtr _rebuildBase [get]
 
int _rebuildOffset [get]
 
VoidPtr Data [get]
 
VoidPtr BaseAddress [get]
 
MDL0Node Model [get]
 
MoveDefNode Root [get]
 
int IntOffset [get]
 
int _offset [get]
 
string HexOffset [get]
 
int Size [get]
 
bool External [get]
 
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.MoveDefEntryNode
static int Compare (ResourceNode n1, ResourceNode n2)
 
static int ActionCompare (ResourceNode n1, ResourceNode n2)
 
- 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)
 
- 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.MoveDefSectionParamNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

347 {
348 _lookupCount = 0;
349 _entryLength = attributeBuffer.Length;
350 //foreach (SectionDataGroupNode p in Children)
351 // _entryLength += p.CalculateSize(true);
352 return _entryLength;
353 }
int Length
Definition: UnsafeBuffer.cs:14
int _entryLength
Definition: MoveDefNode.cs:24
int _lookupCount
Definition: MoveDefNode.cs:20

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.MoveDefEntryNode.

58 {
59 offsets = new Dictionary<int, FDefListOffset>();
60
61 OldName = _name;
62
63 base.OnInitialize();
64
65 if (Size == 0)
66 {
68 }
69
70 SectionParamInfo data = null;
71 if (Parent is MoveDefArticleNode)
72 {
73 if (Root.Params.ContainsKey((Parent as MoveDefArticleNode).ArticleStringID + "/" + _name))
74 {
75 data = Root.Params[(Parent as MoveDefArticleNode).ArticleStringID + "/" + _name];
76 _info = data._attributes;
77 if (!string.IsNullOrEmpty(data._newName))
78 {
79 _name = data._newName;
80 }
81 }
82 else
83 {
84 _info = new List<AttributeInfo>();
85 }
86 }
87 else if (Parent is MoveDefSectionParamNode)
88 {
89 if (Root.Params.ContainsKey(TreePath))
90 {
91 data = Root.Params[TreePath];
92 _info = data._attributes;
93 if (!string.IsNullOrEmpty(data._newName))
94 {
95 _name = data._newName;
96 }
97 }
98 else
99 {
100 _info = new List<AttributeInfo>();
101 }
102 }
103 else if (Root != null && Root.Params.ContainsKey(Name))
104 {
105 data = Root.Params[Name];
106 _info = data._attributes;
107 if (!string.IsNullOrEmpty(data._newName))
108 {
109 _name = data._newName;
110 }
111 }
112 else
113 {
114 _info = new List<AttributeInfo>();
115 }
116
117 attributeBuffer = new UnsafeBuffer(Size);
118 byte* pOut = (byte*) attributeBuffer.Address;
119 byte* pIn = (byte*) Header;
120
121 //if (String.IsNullOrEmpty(_name = new String((sbyte*)Header)))
122 // _name = OldName;
123
124 for (int i = 0; i < Size; i++)
125 {
126 if (i % 4 == 0)
127 {
128 if (data == null)
129 {
130 AttributeInfo info = new AttributeInfo();
131
132 //Guess
133 if ((((uint) *(buint*) pIn >> 24) & 0xFF) != 0 && *(bint*) pIn != -1 &&
134 !float.IsNaN((float) *(bfloat*) pIn))
135 {
136 info._type = 0;
137 }
138 else
139 {
140 info._type = 1;
141 }
142
143 info._name = (info._type == 1 ? "*" : "" + (info._type > 3 ? "+" : "")) + "0x" +
144 i.ToString("X");
145 info._description = "No Description Available.";
146
147 _info.Add(info);
148 }
149
150 //if (_info.Count == i / 4)
151 // break;
152
153 //AttributeInfo n = _info[i / 4];
154 //if (n._type == 3)
155 //{
156 // int id = 0;
157 // if (!int.TryParse(n._description, out id))
158 // id = i / 4;
159 // if (!offsets.ContainsKey(id))
160 // offsets.Add(id, new FDefListOffset() { _startOffset = *(bint*)pIn, _listCount = 1 });
161 // else
162 // {
163 // FDefListOffset d = offsets[id];
164 // d._startOffset = *(bint*)pIn;
165 // offsets[id] = d;
166 // }
167 //}
168 //else if (n._type == 4)
169 //{
170 // int id = int.Parse(n._description);
171 // if (!offsets.ContainsKey(id))
172 // offsets.Add(id, new FDefListOffset() { _listCount = *(bint*)pIn });
173 // else
174 // {
175 // FDefListOffset d = offsets[id];
176 // d._listCount = *(bint*)pIn;
177 // offsets[id] = d;
178 // }
179 //}
180 }
181
182 *pOut++ = *pIn++;
183 }
184
185 if (Parent is MoveDefArticleNode)
186 {
187 string id = (Parent as MoveDefArticleNode).ArticleStringID + "/" + _name;
188 if (!Root.Params.ContainsKey(id))
189 {
190 Root.Params.Add(id, new SectionParamInfo());
191 Root.Params[id]._attributes = _info;
192 Root.Params[id]._newName = _name;
193 data = Root.Params[id];
194 }
195 }
196 else if (Parent is MoveDefSectionParamNode)
197 {
198 if (!Root.Params.ContainsKey(TreePath))
199 {
201 Root.Params[TreePath]._attributes = _info;
202 Root.Params[TreePath]._newName = _name;
203 data = Root.Params[TreePath];
204 }
205 }
206
207 return false;
208 //return offsets.Values.Count > 0;
209 }
Definition: AttributeInfo.cs:9
Definition: Helpers.cs:436
List< AttributeInfo > _attributes
Definition: Helpers.cs:438
string _newName
Definition: Helpers.cs:437
Definition: UnsafeBuffer.cs:7
VoidPtr Address
Definition: UnsafeBuffer.cs:9
MoveDefNode Root
Definition: MoveDefNode.cs:48
int Size
Definition: MoveDefNode.cs:87
Dictionary< string, SectionParamInfo > Params
Definition: MoveDefNode.cs:3443
string OldName
Definition: SectionParamsNode.cs:14
override string Name
Definition: SectionParamsNode.cs:17
Dictionary< int, FDefListOffset > offsets
Definition: SectionParamsNode.cs:55
List< AttributeInfo > _info
Definition: SectionParamsNode.cs:13
void SetSizeInternal(int size)
Definition: ResourceNode.cs:799
string _name
Definition: ResourceNode.cs:139
virtual string TreePath
Definition: ResourceNode.cs:202
ResourceNode Parent
Definition: ResourceNode.cs:245
Definition: BigEndianTypes.cs:109
Definition: BigEndianTypes.cs:9
Definition: BigEndianTypes.cs:59

◆ OnPopulate()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

212 {
213 int x = 0;
214 foreach (FDefListOffset list in offsets.Values)
215 {
216 if (list._startOffset <= 0)
217 {
218 continue;
219 }
220
221 string name = null;
222 int off = list._startOffset;
223 int count = list._listCount;
224 int size = Root.GetSize(off);
225 if (size <= 0)
226 {
227 MoveDefExternalNode ext = Root.IsExternal(off);
228 if (ext == null)
229 {
230 size = 4;
231 }
232 else
233 {
234 name = ext.Name;
235 size = ext.Size;
236 }
237 }
238 else
239 {
240 size /= count;
241 }
242
243 VoidPtr addr = BaseAddress + list._startOffset;
244 MoveDefRawDataNode data = new MoveDefRawDataNode("Data" + x);
245 data.Initialize(this, addr, size * count);
246 for (int i = 0; i < list._listCount; i++)
247 {
248 new MoveDefSectionParamNode {_name = name == null ? "Part" + i : name}.Initialize(data,
249 addr + i * size, size);
250 }
251
252 x++;
253 }
254 }
VoidPtr BaseAddress
Definition: MoveDefNode.cs:32
MoveDefExternalNode IsExternal(int offset)
Definition: MoveDefNode.cs:3112
int GetSize(int offset)
Definition: MoveDefNode.cs:3348
virtual string Name
Definition: ResourceNode.cs:223
Definition: VoidPtr.cs:9
Definition: FighterDefinition.cs:1088
bint _startOffset
Definition: FighterDefinition.cs:1089
bint _listCount
Definition: FighterDefinition.cs:1090

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

285 {
286 //Top:
287
288
289 //if (!notRoot)
290 //{
291 // int childLevels = 0;
292 // foreach (MoveDefEntryNode p in Children)
293 // ChildLevels(p, ref childLevels);
294
295 // VoidPtr addr = address;
296
297 // for (int i = childLevels; i >= 0; i--)
298 // foreach (MoveDefEntryNode p in Children)
299 // RebuildChildren(this, i, ref addr);
300 //}
301
302 _entryOffset = address;
303 byte* pIn = (byte*) attributeBuffer.Address;
304 byte* pOut = (byte*) address;
305 for (int i = 0; i < attributeBuffer.Length; i++)
306 {
307 *pOut++ = *pIn++;
308 }
309
310 //PostProcessOffsets(this);
311 }
VoidPtr _entryOffset
Definition: MoveDefNode.cs:23

Member Data Documentation

◆ _info

List<AttributeInfo> BrawlLib.SSBB.ResourceNodes.MoveDefSectionParamNode._info

◆ offsets

Dictionary<int, FDefListOffset> BrawlLib.SSBB.ResourceNodes.MoveDefSectionParamNode.offsets

◆ OldName

string BrawlLib.SSBB.ResourceNodes.MoveDefSectionParamNode.OldName

Property Documentation

◆ AttributeBuffer

UnsafeBuffer BrawlLib.SSBB.ResourceNodes.MoveDefSectionParamNode.AttributeBuffer
get
43 {
44 get
45 {
46 if (attributeBuffer != null)
47 {
48 return attributeBuffer;
49 }
50
51 return attributeBuffer = new UnsafeBuffer(0x2E4);
52 }
53 }

◆ Name

override string BrawlLib.SSBB.ResourceNodes.MoveDefSectionParamNode.Name
getset
17 {
18 get => base.Name;
19 set
20 {
21 base.Name = value;
22 if (Parent is MoveDefArticleNode)
23 {
24 Root.Params[(Parent as MoveDefArticleNode).ArticleStringID]._newName = value;
25 }
26 else if (Parent is MoveDefSectionParamNode)
27 {
28 Root.Params[TreePath]._newName = value;
29 }
30 else
31 {
32 Root.Params[OldName]._newName = value;
33 }
34
35 MoveDefNode._dictionaryChanged = true;
36 }
37 }

◆ ResourceFileType

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

◆ TreePathAbsolute

override string BrawlLib.SSBB.ResourceNodes.MoveDefSectionParamNode.TreePathAbsolute
get

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