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

Public Member Functions

void CheckNext ()
 
void CheckPrev ()
 
override bool OnInitialize ()
 
void GetStrings ()
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override int OnCalculateSize (bool force)
 
Bitmap GetImage (int index)
 
- 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

float _frame
 
ushort _texFileIndex
 
ushort _pltFileIndex
 
string _tex
 
string _plt
 
TEX0Node _textureNode
 
PLT0Node _paletteNode
 
- 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 bool AllowDuplicateNames [get]
 
float FrameIndex [get, set]
 
string Texture [get, set]
 
string Palette [get, set]
 
override string Name [get, set]
 
int ImageCount [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]
 
- 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 Function Documentation

◆ CheckNext()

void BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.CheckNext ( )
inline
1251 {
1252 if (Parent == null || Index == Parent.Children.Count - 1)
1253 {
1254 return;
1255 }
1256
1257 int index = Index;
1258 if (_frame > ((PAT0TextureEntryNode) Parent.Children[Index + 1])._frame)
1259 {
1260 DoMoveDown();
1261 if (index != Index)
1262 {
1263 CheckNext();
1264 }
1265 }
1266 }
void CheckNext()
Definition: PAT0Node.cs:1250
float _frame
Definition: PAT0Node.cs:1209
ResourceNode Parent
Definition: ResourceNode.cs:245
int Index
Definition: ResourceNode.cs:301
virtual void DoMoveDown()
Definition: ResourceNode.cs:531
List< ResourceNode > Children
Definition: ResourceNode.cs:262

◆ CheckPrev()

void BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.CheckPrev ( )
inline
1269 {
1270 if (Parent == null || Index == 0)
1271 {
1272 return;
1273 }
1274
1275 int index = Index;
1276 if (_frame < ((PAT0TextureEntryNode) Parent.Children[Index - 1])._frame)
1277 {
1278 DoMoveUp();
1279 if (index != Index)
1280 {
1281 CheckPrev();
1282 }
1283 }
1284 }
void CheckPrev()
Definition: PAT0Node.cs:1268
virtual void DoMoveUp()
Definition: ResourceNode.cs:548

◆ GetImage()

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

Implements BrawlLib.Imaging.IImageSource.

1434 {
1435 if (string.IsNullOrEmpty(_tex))
1436 {
1437 return null;
1438 }
1439
1440 if (_textureNode == null)
1441 {
1442 _textureNode = RootNode.FindChildByType(_tex, true, ResourceType.TEX0) as TEX0Node;
1443 if (_textureNode == null)
1444 {
1445 return null;
1446 }
1447 }
1448
1449 if (!string.IsNullOrEmpty(_plt) && _paletteNode == null)
1450 {
1451 _paletteNode = RootNode.FindChildByType(_plt, true, ResourceType.PLT0) as PLT0Node;
1452 }
1453
1454 return _textureNode.GetImage(index, _paletteNode);
1455 }
string _plt
Definition: PAT0Node.cs:1212
string _tex
Definition: PAT0Node.cs:1212
TEX0Node _textureNode
Definition: PAT0Node.cs:1457
PLT0Node _paletteNode
Definition: PAT0Node.cs:1458
ResourceNode FindChildByType(string path, bool searchChildren, params ResourceType[] types)
Definition: ResourceNode.cs:1277
ResourceNode RootNode
Definition: ResourceNode.cs:175
Bitmap GetImage(int index)
Definition: TEX0Node.cs:311
ResourceType
Definition: ResourceType.cs:6

◆ GetStrings()

void BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.GetStrings ( )
inline
1363 {
1364 if (Parent == null)
1365 {
1366 _name = "<null>";
1367 return;
1368 }
1369
1370 PAT0Node node = (PAT0Node) Parent.Parent.Parent;
1371
1372 if (((PAT0TextureNode) Parent)._hasPlt && _pltFileIndex < node._paletteFiles.Count)
1373 {
1374 _plt = node._paletteFiles[_pltFileIndex];
1375 _paletteNode = null;
1376 }
1377
1378 if (((PAT0TextureNode) Parent)._hasTex && _texFileIndex < node._textureFiles.Count)
1379 {
1380 _name = _tex = node._textureFiles[_texFileIndex];
1381 _textureNode = null;
1382 }
1383
1384 if (_name == null && _plt != null)
1385 {
1386 _name = _plt;
1387 }
1388
1389 if (_name == null)
1390 {
1391 _name = "<null>";
1392 }
1393 }
ushort _pltFileIndex
Definition: PAT0Node.cs:1210
ushort _texFileIndex
Definition: PAT0Node.cs:1210
string _name
Definition: ResourceNode.cs:139

◆ OnCalculateSize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

1411 {
1412 return PAT0Texture.Size;
1413 }
const int Size
Definition: PAT0.cs:246

◆ OnInitialize()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

1352 {
1353 _frame = Header->_key;
1354 _texFileIndex = Header->_texFileIndex;
1355 _pltFileIndex = Header->_pltFileIndex;
1356
1357 GetStrings();
1358
1359 return false;
1360 }
void GetStrings()
Definition: PAT0Node.cs:1362
bushort _pltFileIndex
Definition: PAT0.cs:250
bushort _texFileIndex
Definition: PAT0.cs:249
bfloat _key
Definition: PAT0.cs:248

◆ OnRebuild()

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

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

1396 {
1397 PAT0Node node = (PAT0Node) Parent.Parent.Parent;
1398
1399 PAT0Texture* header = (PAT0Texture*) address;
1400
1401 header->_key = _frame;
1402 header->_texFileIndex = ((PAT0TextureNode) Parent)._hasTex && !string.IsNullOrEmpty(_tex)
1404 : (ushort) 0;
1405 header->_pltFileIndex = ((PAT0TextureNode) Parent)._hasPlt && !string.IsNullOrEmpty(_plt)
1407 : (ushort) 0;
1408 }

Member Data Documentation

◆ _frame

float BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._frame

◆ _paletteNode

PLT0Node BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._paletteNode

◆ _plt

string BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._plt

◆ _pltFileIndex

ushort BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._pltFileIndex

◆ _tex

string BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._tex

◆ _texFileIndex

ushort BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._texFileIndex

◆ _textureNode

TEX0Node BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode._textureNode

Property Documentation

◆ AllowDuplicateNames

override bool BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.AllowDuplicateNames
get

◆ FrameIndex

float BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.FrameIndex
getset
1219 {
1220 get => _frame;
1221 set
1222 {
1223 if (Index == 0)
1224 {
1225 if (Index >= Children.Count - 1)
1226 {
1227 _frame = 0;
1228 }
1229 else if (value >= ((PAT0TextureEntryNode) Parent.Children[Index + 1])._frame)
1230 {
1231 ((PAT0TextureEntryNode) Parent.Children[Index + 1])._frame = 0;
1232 Parent.Children[Index + 1].SignalPropertyChange();
1233
1234 _frame = value;
1235 CheckNext();
1236 }
1237
1239 return;
1240 }
1241
1242 _frame = value;
1243 CheckPrev();
1244 CheckNext();
1245
1247 }
1248 }
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313

◆ ImageCount

int BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.ImageCount
get

Implements BrawlLib.Imaging.IImageSource.

1417 {
1418 get
1419 {
1420 if (_textureNode == null)
1421 {
1422 _textureNode = RootNode.FindChildByType(_tex, true, ResourceType.TEX0) as TEX0Node;
1423 if (_textureNode == null)
1424 {
1425 return 0;
1426 }
1427 }
1428
1429 return _textureNode.ImageCount;
1430 }
1431 }
int ImageCount
Definition: TEX0Node.cs:309

◆ Name

override string BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.Name
getset
1342 {
1343 get => base.Name;
1344 set
1345 {
1346 base.Name = value;
1347 SetTexture(value);
1348 }
1349 }

◆ Palette

string BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.Palette
getset
1316 {
1317 get => _plt;
1318 set
1319 {
1320 if (Parent == null || !(Parent as PAT0TextureNode)._hasPlt || value == _plt)
1321 {
1322 return;
1323 }
1324
1325 _plt = value;
1326 _paletteNode = null;
1327 ((PAT0Node) Parent?.Parent?.Parent)?.RegeneratePaletteList();
1328
1330 }
1331 }

◆ ResourceFileType

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

◆ Texture

string BrawlLib.SSBB.ResourceNodes.PAT0TextureEntryNode.Texture
getset
1290 {
1291 get => _tex;
1292 set
1293 {
1294 if (Parent == null || !(Parent as PAT0TextureNode)._hasTex || value == _tex)
1295 {
1296 return;
1297 }
1298
1299 if (!string.IsNullOrEmpty(value))
1300 {
1301 Name = value;
1302 }
1303 else
1304 {
1305 SetTexture(value);
1306 }
1307
1309 }
1310 }
override string Name
Definition: PAT0Node.cs:1342

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