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

Public Member Functions

 PLT0Node ()
 
override bool OnInitialize ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
bool HasPrimary (int id)
 
ARGBPixel GetPrimaryColor (int id)
 
void SetPrimaryColor (int id, ARGBPixel color)
 
string PrimaryColorName (int id)
 
int ColorCount (int id)
 
ARGBPixel GetColor (int index, int id)
 
void SetColor (int index, int id, ARGBPixel color)
 
bool GetColorConstant (int id)
 
void SetColorConstant (int id, bool constant)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.BRESEntryNode
override bool OnInitialize ()
 
override void Export (string outPath)
 
override byte[] MD5 ()
 Find the MD5 checksum of this node's data. Before calculating the checksum, the data will be copied to a temporary area in memory and PostProcess will be run just as in Export(). More...
 
- 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 ()
 
bool HasPrimary (int id)
 
ARGBPixel GetPrimaryColor (int id)
 
void SetPrimaryColor (int id, ARGBPixel color)
 
string PrimaryColorName (int id)
 
int ColorCount (int id)
 
ARGBPixel GetColor (int index, int id)
 
void SetColor (int index, int id, ARGBPixel color)
 
bool GetColorConstant (int id)
 
void SetColorConstant (int id, bool constant)
 

Properties

override ResourceType ResourceFileType [get]
 
override int DataAlign [get]
 
override int[] SupportedVersions [get]
 
override string Tag [get]
 
ColorPalette Palette [get, set]
 
int Colors [get]
 
WiiPaletteFormat Format [get, set]
 
int TypeCount [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.BRESEntryNode
virtual int DataAlign [get]
 
BRRESNode BRESNode [get]
 
virtual int[] SupportedVersions [get]
 
virtual string Tag [get]
 
int Version [get, set]
 
string OriginalPath [get, set]
 
UserDataCollection UserEntries [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]
 
- Properties inherited from BrawlLib.Imaging.IColorSource
int TypeCount [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.BRESEntryNode
int _version
 
string _originalPath
 
- 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.BRESEntryNode
virtual void OnVersionChanged (int previousVersion)
 
- 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

◆ PLT0Node()

BrawlLib.SSBB.ResourceNodes.PLT0Node.PLT0Node ( )
inline
22 {
23 _version = 1;
24 }
int _version
Definition: BRRESNode.cs:1045

Member Function Documentation

◆ ColorCount()

int BrawlLib.SSBB.ResourceNodes.PLT0Node.ColorCount ( int  id)
inline

Implements BrawlLib.Imaging.IColorSource.

142 {
143 return Palette.Entries.Length;
144 }
ColorPalette Palette
Definition: PLT0Node.cs:31

◆ GetColor()

ARGBPixel BrawlLib.SSBB.ResourceNodes.PLT0Node.GetColor ( int  index,
int  id 
)
inline

Implements BrawlLib.Imaging.IColorSource.

147 {
148 return (ARGBPixel) Palette.Entries[index];
149 }
Definition: PixelTypes.cs:16

◆ GetColorConstant()

bool BrawlLib.SSBB.ResourceNodes.PLT0Node.GetColorConstant ( int  id)
inline

Implements BrawlLib.Imaging.IColorSource.

158 {
159 return false;
160 }

◆ GetPrimaryColor()

ARGBPixel BrawlLib.SSBB.ResourceNodes.PLT0Node.GetPrimaryColor ( int  id)
inline

Implements BrawlLib.Imaging.IColorSource.

124 {
125 return new ARGBPixel();
126 }

◆ HasPrimary()

bool BrawlLib.SSBB.ResourceNodes.PLT0Node.HasPrimary ( int  id)
inline

Implements BrawlLib.Imaging.IColorSource.

119 {
120 return false;
121 }

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

90 {
91 int count = Palette.Entries.Length.Align(16);
92 return 0x40 + count * 2;
93 }

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.BRESEntryNode.

54 {
55 base.OnInitialize();
56
57 _palette = null;
58
59 if (_name == null && Header1->_stringOffset != 0)
60 {
61 _name = Header1->ResourceString;
62 }
63
64 _format = Header1->PaletteFormat;
65
66 if (_version == 3)
67 {
68 (_userEntries = new UserDataCollection()).Read(Header3->UserData, WorkingUncompressed);
69 }
70
71 return false;
72 }
string _name
Definition: ResourceNode.cs:139
DataSource WorkingUncompressed
Definition: ResourceNode.cs:183
buint _stringOffset
Definition: PLT0.cs:15
WiiPaletteFormat PaletteFormat
Definition: PLT0.cs:53
string ResourceString
Definition: PLT0.cs:41
UserData * UserData
Definition: PLT0.cs:112

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

96 {
97 PLT0v1* header = (PLT0v1*) address;
98 *header = new PLT0v1(Palette.Entries.Length, _format);
99
100 TextureConverter.EncodePalette(address + 0x40, Palette, _format);
101 }
Definition: TextureConverter.cs:15
static FileMap EncodePalette(ColorPalette pal, WiiPaletteFormat format)
Definition: TextureConverter.cs:499
Definition: PLT0.cs:9

◆ PrimaryColorName()

string BrawlLib.SSBB.ResourceNodes.PLT0Node.PrimaryColorName ( int  id)
inline

Implements BrawlLib.Imaging.IColorSource.

134 {
135 return null;
136 }

◆ SetColor()

void BrawlLib.SSBB.ResourceNodes.PLT0Node.SetColor ( int  index,
int  id,
ARGBPixel  color 
)
inline

Implements BrawlLib.Imaging.IColorSource.

152 {
153 Palette.Entries[index] = (Color) color;
155 }
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313

◆ SetColorConstant()

void BrawlLib.SSBB.ResourceNodes.PLT0Node.SetColorConstant ( int  id,
bool  constant 
)
inline

Implements BrawlLib.Imaging.IColorSource.

163 {
164 }

◆ SetPrimaryColor()

void BrawlLib.SSBB.ResourceNodes.PLT0Node.SetPrimaryColor ( int  id,
ARGBPixel  color 
)
inline

Implements BrawlLib.Imaging.IColorSource.

129 {
130 }

Property Documentation

◆ Colors

int BrawlLib.SSBB.ResourceNodes.PLT0Node.Colors
get

◆ DataAlign

override int BrawlLib.SSBB.ResourceNodes.PLT0Node.DataAlign
get

◆ Format

WiiPaletteFormat BrawlLib.SSBB.ResourceNodes.PLT0Node.Format
getset
44 {
45 get => _format;
46 set
47 {
48 _format = value;
50 }
51 }

◆ Palette

ColorPalette BrawlLib.SSBB.ResourceNodes.PLT0Node.Palette
getset
31 {
32 get => _palette ?? (_palette = TextureConverter.DecodePalette(Header1));
33 set
34 {
35 _palette = value;
37 }
38 }
static ColorPalette DecodePalette(PLT0v1 *palette)
Definition: TextureConverter.cs:558

◆ ResourceFileType

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

◆ SupportedVersions

override int [] BrawlLib.SSBB.ResourceNodes.PLT0Node.SupportedVersions
get

◆ Tag

override string BrawlLib.SSBB.ResourceNodes.PLT0Node.Tag
get

◆ TypeCount

int BrawlLib.SSBB.ResourceNodes.PLT0Node.TypeCount
get

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