Refactor Subdata function

This commit is contained in:
Michael Hinrichs 2024-07-27 16:04:27 -05:00
parent 0abfc8515a
commit cf7a9f6674
1 changed files with 18 additions and 13 deletions

View File

@ -35,25 +35,30 @@ namespace RPG_Maker_LDB_Printer
ContinueIndent(); ContinueIndent();
GetInt(); GetInt();
OpenIndent(); OpenIndent();
bool Data_end = false; ReadSubdata(PartID, data);
while (Data_end == false)
{
ContinueIndent();
int subData = GetInt();
if (subData == 0x00)
Data_end = true;
else if (PartID == 0x1D & data == 0x0A & subData == 0x01 | PartID == 0x20 & data == 0x0A & subData == 0x01 | PartID == 0x20 & data == 0x0A & subData == 0x02 | PartID == 0x20 & data == 0x0B & subData == 0x01 | PartID == 0x20 & data == 0x0B & subData == 0x02)
GetString();
else
GetBytes();
}
CloseIndent(); CloseIndent();
} }
CloseIndent(); CloseIndent();
} }
} }
public static int GetInt() public static void ReadSubdata(byte PartID, int data)
{
bool Data_end = false;
while (Data_end == false)
{
ContinueIndent();
int subData = GetInt();
if (subData == 0x00)
Data_end = true;
else if (PartID == 0x1D & data == 0x0A & subData == 0x01 | PartID == 0x20 & data == 0x0A & subData == 0x01 | PartID == 0x20 & data == 0x0A & subData == 0x02 | PartID == 0x20 & data == 0x0B & subData == 0x01 | PartID == 0x20 & data == 0x0B & subData == 0x02)
GetString();
else
GetBytes();
}
}
public static int GetInt()
{ {
return Convert7BitHex(0); return Convert7BitHex(0);
} }