Refactor GetEvent function.

Closes #4.
This commit is contained in:
Michael Hinrichs 2024-07-27 16:11:48 -05:00
parent cf7a9f6674
commit 9bb648d099
1 changed files with 15 additions and 30 deletions

View File

@ -34,18 +34,10 @@ namespace RPG_Maker_LDB_Printer
break; break;
case 12010://DD 6A case 12010://DD 6A
case 13310://E7 7E case 13310://E7 7E
while (stop == false) CheckEnd();
{
GetEvent();
}
stop = false;
if (gotInts[5] == 1) if (gotInts[5] == 1)
{ {
while (stop == false) CheckEnd();
{
GetEvent();
}
stop = false;
} }
GetEvent(); GetEvent();
break; break;
@ -53,17 +45,9 @@ namespace RPG_Maker_LDB_Printer
if (gotInts[3] == 2 || gotInts[4] == 1) if (gotInts[3] == 2 || gotInts[4] == 1)
{ {
GetEvent(); GetEvent();
while (stop == false) CheckEnd();
{
GetEvent(); GetEvent();
} CheckEnd();
stop = false;
GetEvent();
while (stop == false)
{
GetEvent();
}
stop = false;
GetEvent(); GetEvent();
} }
break; break;
@ -73,17 +57,9 @@ namespace RPG_Maker_LDB_Printer
{ {
stop = false; stop = false;
GetEvent(); GetEvent();
while (stop == false) CheckEnd();
{
GetEvent(); GetEvent();
} CheckEnd();
stop = false;
GetEvent();
while (stop == false)
{
GetEvent();
}
stop = false;
GetEvent(); GetEvent();
} }
break; break;
@ -99,5 +75,14 @@ namespace RPG_Maker_LDB_Printer
Formating.CloseIndent(); Formating.CloseIndent();
Formating.CloseIndent(); Formating.CloseIndent();
} }
static void CheckEnd()
{
while (stop == false)
{
GetEvent();
}
stop = false;
}
} }
} }