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

Public Member Functions

override string ToString ()
 
 MoveDefActionNode (string name, bool blank, ResourceNode parent)
 
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.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

bool _isBlank
 
bool _build
 
List< ResourceNode_actionRefs = new List<ResourceNode>()
 
- 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]
 
bool ForceWrite [get, set]
 
ResourceNode[] ActionRefs [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
 

Constructor & Destructor Documentation

◆ MoveDefActionNode()

BrawlLib.SSBB.ResourceNodes.MoveDefActionNode.MoveDefActionNode ( string  name,
bool  blank,
ResourceNode  parent 
)
inline
88 {
89 _name = name;
90 _isBlank = blank;
91 _build = false;
92 if (_isBlank) //Initialize will not be called, because there is no data to read
93 {
94 _parent = parent;
95
96 if (_name == null)
97 {
98 if (Parent.Parent.Name == "Action Scripts")
99 {
100 if (Index == 0)
101 {
102 _name = "Entry";
103 }
104 else if (Index == 1)
105 {
106 _name = "Exit";
107 }
108 }
109 else if (Parent.Parent.Name == "SubAction Scripts")
110 {
111 if (Index == 0)
112 {
113 _name = "Main";
114 }
115 else if (Index == 1)
116 {
117 _name = "GFX";
118 }
119 else if (Index == 2)
120 {
121 _name = "SFX";
122 }
123 else if (Index == 3)
124 {
125 _name = "Other";
126 }
127 }
128
129 if (_name == null)
130 {
131 _name = "Action" + Index;
132 }
133 }
134 }
135 }
bool _isBlank
Definition: MoveDefActionNode.cs:74
bool _build
Definition: MoveDefActionNode.cs:75
ResourceNode _parent
Definition: ResourceNode.cs:142
string _name
Definition: ResourceNode.cs:139
ResourceNode Parent
Definition: ResourceNode.cs:245
int Index
Definition: ResourceNode.cs:301
virtual string Name
Definition: ResourceNode.cs:223

Member Function Documentation

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

207 {
208 _lookupCount = 0;
209 int size = 8; //Terminator event size
210 foreach (MoveDefEventNode e in Children)
211 {
212 if (e.EventID == 0xFADEF00D || e.EventID == 0xFADE0D8A)
213 {
214 continue;
215 }
216
217 size += e.CalculateSize(true);
218 _lookupCount += e._lookupCount;
219 }
220
221 return size;
222 }
int _lookupCount
Definition: MoveDefNode.cs:20
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

138 {
139 _offsets.Add(_offset);
140 _build = true;
141 if (_offset > Root.dataSize)
142 {
143 return false;
144 }
145
146 if (_name == null)
147 {
148 if (Parent.Parent.Name == "Action Scripts")
149 {
150 if (Index == 0)
151 {
152 _name = "Entry";
153 }
154 else if (Index == 1)
155 {
156 _name = "Exit";
157 }
158 }
159 else if (Parent.Parent.Name == "SubAction Scripts")
160 {
161 if (Index == 0)
162 {
163 _name = "Main";
164 }
165 else if (Index == 1)
166 {
167 _name = "GFX";
168 }
169 else if (Index == 2)
170 {
171 _name = "SFX";
172 }
173 else if (Index == 3)
174 {
175 _name = "Other";
176 }
177 }
178
179 if (_name == null)
180 {
181 _name = "Action" + Index;
182 }
183 }
184
185 base.OnInitialize();
186
187 //Root._paths[_offset] = TreePath;
188
189 return Header->_nameSpace != 0 || Header->_id != 0;
190 }
int _offset
Definition: MoveDefNode.cs:67
MoveDefNode Root
Definition: MoveDefNode.cs:48
List< int > _offsets
Definition: MoveDefNode.cs:270
byte _nameSpace
Definition: FighterDefinition.cs:705
byte _id
Definition: FighterDefinition.cs:706

◆ OnPopulate()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

193 {
194 FDefEvent* ev = Header;
195 if (!_isBlank)
196 {
197 while (ev->_nameSpace != 0 || ev->_id != 0)
198 {
199 new MoveDefEventNode().Initialize(this, new DataSource((VoidPtr) ev++, 8));
200 }
201 }
202
203 SetSizeInternal(Children.Count * 8 + 8);
204 }
void SetSizeInternal(int size)
Definition: ResourceNode.cs:799
Definition: VoidPtr.cs:9
Definition: FighterDefinition.cs:704

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

225 {
226 int off = 0;
227 foreach (MoveDefEventNode e in Children)
228 {
229 off += e.Children.Count * 8;
230 }
231
232 FDefEventArgument* paramAddr = (FDefEventArgument*) address;
233 FDefEvent* eventAddr = (FDefEvent*) (address + off);
234
235 _entryOffset = eventAddr;
236
237 foreach (MoveDefEventNode e in Children)
238 {
239 if (e._name == "FADEF00D" || e._name == "FADE0D8A")
240 {
241 continue;
242 }
243
244 e._entryOffset = eventAddr;
245 *eventAddr = new FDefEvent
246 {_id = e.id, _nameSpace = e.nameSpace, _numArguments = (byte) e.Children.Count, _unk1 = e.unk1};
247 if (e.Children.Count > 0)
248 {
249 eventAddr->_argumentOffset = (uint) paramAddr - (uint) _rebuildBase;
250 _lookupOffsets.Add((int) eventAddr->_argumentOffset.Address - (int) _rebuildBase);
251 }
252 else
253 {
254 eventAddr->_argumentOffset = 0;
255 }
256
257 eventAddr++;
258 foreach (MoveDefEventParameterNode p in e.Children)
259 {
260 p._entryOffset = paramAddr;
261 if (p._type != ArgVarType.Offset)
262 {
263 *paramAddr = new FDefEventArgument {_type = (int) p._type, _data = p._value};
264 }
265 else
266 {
267 Root._postProcessNodes.Add(p);
268 //if ((p as MoveDefEventOffsetNode).action != null)
269 // _lookupOffsets.Add(0);
270 }
271
272 paramAddr++;
273 }
274 }
275
276 eventAddr++; //Terminate
277 }
VoidPtr _rebuildBase
Definition: MoveDefNode.cs:18
List< int > _lookupOffsets
Definition: MoveDefNode.cs:21
VoidPtr _entryOffset
Definition: MoveDefNode.cs:23
List< MoveDefEntryNode > _postProcessNodes
Definition: MoveDefNode.cs:4740
ArgVarType
Definition: FighterDefEnums.cs:6
VoidPtr Address
Definition: BigEndianTypes.cs:83
Definition: FighterDefinition.cs:725
bint _type
Definition: FighterDefinition.cs:726
buint _argumentOffset
Definition: FighterDefinition.cs:709

◆ ToString()

override string BrawlLib.SSBB.ResourceNodes.MoveDefActionNode.ToString ( )
inline
65 {
66 if (Name.StartsWith("SubRoutine"))
67 {
68 return Name;
69 }
70
71 return base.ToString();
72 }

Member Data Documentation

◆ _actionRefs

List<ResourceNode> BrawlLib.SSBB.ResourceNodes.MoveDefActionNode._actionRefs = new List<ResourceNode>()

◆ _build

bool BrawlLib.SSBB.ResourceNodes.MoveDefActionNode._build

◆ _isBlank

bool BrawlLib.SSBB.ResourceNodes.MoveDefActionNode._isBlank

Property Documentation

◆ ActionRefs

ResourceNode [] BrawlLib.SSBB.ResourceNodes.MoveDefActionNode.ActionRefs
get

◆ ForceWrite

bool BrawlLib.SSBB.ResourceNodes.MoveDefActionNode.ForceWrite
getset
79 {
80 get => _build;
81 set => _build = value;
82 }

◆ ResourceFileType

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

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