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

Public Types

enum  BRESGroupType
 

Public Member Functions

Bitmap GetImage (int index)
 
 BRESGroupNode ()
 
 BRESGroupNode (string name)
 
 BRESGroupNode (string name, BRESGroupType type)
 
override void RemoveChild (ResourceNode child)
 
override bool OnInitialize ()
 
void GetFileType ()
 
override void OnPopulate ()
 
- 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 ()
 
Bitmap GetImage (int index)
 

Public Attributes

BRESGroupType _type = BRESGroupType.None
 
- 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]
 
int ImageCount [get]
 
override Type[] AllowedChildTypes [get]
 
BRESGroupType Type [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.IImageSource
int ImageCount [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
 

Member Enumeration Documentation

◆ BRESGroupType

857 {
858 Textures,
859 Palettes,
860 Models,
861 CHR0,
862 CLR0,
863 SRT0,
864 SHP0,
865 VIS0,
866 SCN0,
867 PAT0,
868 External,
869 None
870 }

Constructor & Destructor Documentation

◆ BRESGroupNode() [1/3]

BrawlLib.SSBB.ResourceNodes.BRESGroupNode.BRESGroupNode ( )
inline
841 : base()
842 {
843 }

◆ BRESGroupNode() [2/3]

BrawlLib.SSBB.ResourceNodes.BRESGroupNode.BRESGroupNode ( string  name)
inline
845 : base()
846 {
847 _name = name;
848 }
string _name
Definition: ResourceNode.cs:139

◆ BRESGroupNode() [3/3]

BrawlLib.SSBB.ResourceNodes.BRESGroupNode.BRESGroupNode ( string  name,
BRESGroupType  type 
)
inline
850 : base()
851 {
852 _name = name;
853 Type = type;
854 }
BRESGroupType Type
Definition: BRRESNode.cs:828

Member Function Documentation

◆ GetFileType()

void BrawlLib.SSBB.ResourceNodes.BRESGroupNode.GetFileType ( )
inline
889 {
890 if (_name == "Textures(NW4R)" || (Children.Count > 0 && Children[0] is TEX0Node))
891 {
892 Type = BRESGroupType.Textures;
893 }
894 else if (_name == "Palettes(NW4R)" || (Children.Count > 0 && Children[0] is PLT0Node))
895 {
896 Type = BRESGroupType.Palettes;
897 }
898 else if (_name == "3DModels(NW4R)" || (Children.Count > 0 && Children[0] is MDL0Node))
899 {
900 Type = BRESGroupType.Models;
901 }
902 else if (_name == "AnmChr(NW4R)" || (Children.Count > 0 && Children[0] is CHR0Node))
903 {
904 Type = BRESGroupType.CHR0;
905 }
906 else if (_name == "AnmClr(NW4R)" || (Children.Count > 0 && Children[0] is CLR0Node))
907 {
908 Type = BRESGroupType.CLR0;
909 }
910 else if (_name == "AnmTexSrt(NW4R)" || (Children.Count > 0 && Children[0] is SRT0Node))
911 {
912 Type = BRESGroupType.SRT0;
913 }
914 else if (_name == "AnmShp(NW4R)" || (Children.Count > 0 && Children[0] is SHP0Node))
915 {
916 Type = BRESGroupType.SHP0;
917 }
918 else if (_name == "AnmVis(NW4R)" || (Children.Count > 0 && Children[0] is VIS0Node))
919 {
920 Type = BRESGroupType.VIS0;
921 }
922 else if (_name == "AnmScn(NW4R)" || (Children.Count > 0 && Children[0] is SCN0Node))
923 {
924 Type = BRESGroupType.SCN0;
925 }
926 else if (_name == "AnmPat(NW4R)" || (Children.Count > 0 && Children[0] is PAT0Node))
927 {
928 Type = BRESGroupType.PAT0;
929 }
930 else if (_name == "External" || (Children.Count > 0 && Children[0] is RASDNode))
931 {
932 Type = BRESGroupType.External;
933 }
934 }
BRESGroupType
Definition: BRRESNode.cs:857
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ GetImage()

Bitmap BrawlLib.SSBB.ResourceNodes.BRESGroupNode.GetImage ( int  index)
inline

Implements BrawlLib.Imaging.IImageSource.

785 {
786 if (Children.Count <= index || !(Children[index] is IImageSource))
787 {
788 return null;
789 }
790
791 return (Children[index] as IImageSource).GetImage(0);
792 }
Definition: IImageSource.cs:7

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

884 {
885 return Group->_numEntries > 0;
886 }
bint _numEntries
Definition: Common.cs:384

◆ OnPopulate()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

937 {
938 ResourceGroup* group = Group;
939 for (int i = 0; i < group->_numEntries; i++)
940 {
942 if (NodeFactory.FromAddress(this, hdr, hdr->_size) == null)
943 {
944 switch (Type)
945 {
946 case BRESGroupType.Textures:
947 new TEX0Node().Initialize(this, hdr, hdr->_size);
948 break;
949 case BRESGroupType.Models:
950 new MDL0Node().Initialize(this, hdr, hdr->_size);
951 break;
952 case BRESGroupType.Palettes:
953 new PLT0Node().Initialize(this, hdr, hdr->_size);
954 break;
955 case BRESGroupType.CHR0:
956 new CHR0Node().Initialize(this, hdr, hdr->_size);
957 break;
958 case BRESGroupType.CLR0:
959 new CLR0Node().Initialize(this, hdr, hdr->_size);
960 break;
961 case BRESGroupType.SHP0:
962 new SHP0Node().Initialize(this, hdr, hdr->_size);
963 break;
964 case BRESGroupType.VIS0:
965 new VIS0Node().Initialize(this, hdr, hdr->_size);
966 break;
967 case BRESGroupType.PAT0:
968 new PAT0Node().Initialize(this, hdr, hdr->_size);
969 break;
970 case BRESGroupType.SCN0:
971 new SCN0Node().Initialize(this, hdr, hdr->_size);
972 break;
973 case BRESGroupType.SRT0:
974 new SRT0Node().Initialize(this, hdr, hdr->_size);
975 break;
976 default:
977 new BRESEntryNode().Initialize(this, hdr, hdr->_size);
978 break;
979 }
980 }
981 }
982
983 if (Type == BRESGroupType.None)
984 {
985 GetFileType();
986 }
987 }
void GetFileType()
Definition: BRRESNode.cs:888
bint _size
Definition: BRES.cs:80
VoidPtr DataAddress
Definition: Common.cs:524
Definition: Common.cs:380
ResourceEntry * First
Definition: Common.cs:405

◆ RemoveChild()

override void BrawlLib.SSBB.ResourceNodes.BRESGroupNode.RemoveChild ( ResourceNode  child)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

875 {
876 base.RemoveChild(child);
877 if (Children.Count == 0)
878 {
879 Parent?.RemoveChild(this);
880 }
881 }
ResourceNode Parent
Definition: ResourceNode.cs:245
virtual void RemoveChild(ResourceNode child)
Definition: ResourceNode.cs:746

Member Data Documentation

◆ _type

BRESGroupType BrawlLib.SSBB.ResourceNodes.BRESGroupNode._type = BRESGroupType.None

Property Documentation

◆ AllowedChildTypes

override Type [] BrawlLib.SSBB.ResourceNodes.BRESGroupNode.AllowedChildTypes
get
795 {
796 get
797 {
798 switch (Type)
799 {
800 case BRESGroupType.Textures:
801 return new Type[] {typeof(TEX0Node)};
802 case BRESGroupType.Palettes:
803 return new Type[] {typeof(PLT0Node)};
804 case BRESGroupType.Models:
805 return new Type[] {typeof(MDL0Node)};
806 case BRESGroupType.CHR0:
807 return new Type[] {typeof(CHR0Node)};
808 case BRESGroupType.CLR0:
809 return new Type[] {typeof(CLR0Node)};
810 case BRESGroupType.SRT0:
811 return new Type[] {typeof(SRT0Node)};
812 case BRESGroupType.SHP0:
813 return new Type[] {typeof(SHP0Node)};
814 case BRESGroupType.VIS0:
815 return new Type[] {typeof(VIS0Node)};
816 case BRESGroupType.SCN0:
817 return new Type[] {typeof(SCN0Node)};
818 case BRESGroupType.PAT0:
819 return new Type[] {typeof(PAT0Node)};
820 default:
821 return new Type[] { };
822 }
823 }
824 }

◆ ImageCount

int BrawlLib.SSBB.ResourceNodes.BRESGroupNode.ImageCount
get

◆ ResourceFileType

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

◆ Type

BRESGroupType BrawlLib.SSBB.ResourceNodes.BRESGroupNode.Type
getset
828 {
829 get
830 {
831 if (_type == BRESGroupType.None)
832 {
833 GetFileType();
834 }
835
836 return _type;
837 }
838 set => _type = value;
839 }
BRESGroupType _type
Definition: BRRESNode.cs:872

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