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

Public Member Functions

 MasqueradeEntryNode ()
 
 MasqueradeEntryNode (bool end)
 
override int OnCalculateSize (bool force)
 
override bool OnInitialize ()
 
void regenName ()
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
List< string > GetCostumeFilePath (string currentPath)
 
- 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

byte _colorID
 
byte _costumeID
 
- 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]
 
byte? CostumeID [get, set]
 
byte Color [get, set]
 
- 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)
 
- 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

◆ MasqueradeEntryNode() [1/2]

BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode.MasqueradeEntryNode ( )
inline
179 {
180 _colorID = 0x00;
181 _costumeID = 0x00;
182 }
byte _colorID
Definition: MasqueradeNode.cs:175
byte _costumeID
Definition: MasqueradeNode.cs:176

◆ MasqueradeEntryNode() [2/2]

BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode.MasqueradeEntryNode ( bool  end)
inline
186 {
187 _colorID = (byte) (end ? 0x0C : 0x00);
188 _costumeID = 0x00;
189 }

Member Function Documentation

◆ GetCostumeFilePath()

List< string > BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode.GetCostumeFilePath ( string  currentPath)
inline
272 {
273 List<string> files = new List<string>();
274 if (((MasqueradeNode) Parent)._cosmeticSlot >= MasqueradeNode.MasqueradeInternalNames.Length)
275 {
276 return files;
277 }
278
279 if ((currentPath = currentPath.Substring(0, currentPath.LastIndexOf('\\'))).EndsWith(
280 "pf\\info\\costumeslots", StringComparison.OrdinalIgnoreCase))
281 {
282 currentPath = currentPath.Substring(0,
283 currentPath.LastIndexOf("info", StringComparison.OrdinalIgnoreCase));
284 List<string> internalNames = MasqueradeNode
285 .MasqueradeInternalNames[((MasqueradeNode) Parent)._cosmeticSlot]
286 .Split('/').ToList();
287 foreach (string s in internalNames)
288 {
289 if (File.Exists($"{currentPath}\\fighter\\{s}\\Fit{s}{_costumeID:00}.pac"))
290 {
291 files.Add($"{currentPath}\\fighter\\{s}\\Fit{s}{_costumeID:00}.pac");
292 }
293 }
294 }
295
296 return files;
297 }
ResourceNode Parent
Definition: ResourceNode.cs:245

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

236 {
237 return CSSCEntry.Size;
238 }
Definition: CSSC.cs:48
const int Size
Definition: CSSC.cs:49

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

241 {
242 _colorID = Header->_colorID;
243 _costumeID = Header->_costumeID;
244 if (_name == null)
245 {
246 regenName();
247 IsDirty = false;
248 }
249
250 return false;
251 }
void regenName()
Definition: MasqueradeNode.cs:253
virtual bool IsDirty
Definition: ResourceNode.cs:344
string _name
Definition: ResourceNode.cs:139
byte _colorID
Definition: CSSC.cs:52
byte _costumeID
Definition: CSSC.cs:53

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

265 {
266 CSSCEntry* hdr = (CSSCEntry*) address;
267 hdr->_colorID = _colorID;
268 hdr->_costumeID = _costumeID;
269 }

◆ regenName()

void BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode.regenName ( )
inline
254 {
255 Name = "Fit" +
256 (((MasqueradeNode) Parent)._cosmeticSlot >= MasqueradeNode.MasqueradeInternalNames.Length
257 ? $"Fighter{((MasqueradeNode) Parent)._cosmeticSlot}_"
258 : MasqueradeNode.MasqueradeInternalNames[((MasqueradeNode) Parent)._cosmeticSlot]) +
259 _costumeID.ToString("00") + (BrawlExColorID.Colors.Length > _colorID
261 : "");
262 }
Definition: BrawlExDropDownLists.cs:54
string Name
Definition: BrawlExDropDownLists.cs:56
static readonly BrawlExColorID[] Colors
Definition: BrawlExDropDownLists.cs:69
virtual string Name
Definition: ResourceNode.cs:223

Member Data Documentation

◆ _colorID

byte BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode._colorID

◆ _costumeID

byte BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode._costumeID

Property Documentation

◆ Color

byte BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode.Color
getset
225 {
226 get => _colorID;
227 set
228 {
229 _colorID = value;
230 regenName();
232 }
233 }
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313

◆ CostumeID

byte? BrawlLib.SSBB.ResourceNodes.MasqueradeEntryNode.CostumeID
getset
194 {
195 get => _costumeID;
196 set
197 {
198 if (((MasqueradeNode) Parent)._cosmeticSlot == 21 && (
199 value == 15 ||
200 value == 31 ||
201 value == 47 ||
202 value == 63))
203 {
204 if (System.Windows.Forms.MessageBox.Show(
205 "Costume slot " + value +
206 " is known to be bugged for WarioMan. Are you sure you'd like to proceed?",
207 "Warning",
208 System.Windows.Forms.MessageBoxButtons.YesNo) !=
209 System.Windows.Forms.DialogResult.Yes)
210 {
211 return;
212 }
213 }
214
215 _costumeID = value;
216 regenName();
218 }
219 }

◆ ResourceFileType

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

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