Rework patch-list code so that it actually works properly, fuck.

main
Síle Ekaterin Liszka 2021-05-29 07:33:38 -05:00
parent 61551d2407
commit 03b4cf5ab2
4 changed files with 29 additions and 34 deletions

View File

@ -4,7 +4,6 @@
<file>patches/unlock.ips</file> <file>patches/unlock.ips</file>
<file>patches/balance.ips</file> <file>patches/balance.ips</file>
<file>patches/custom_classes.ips</file> <file>patches/custom_classes.ips</file>
<file>patches/cc_spellblade.ips</file>
<file>patches/waddle.ips</file> <file>patches/waddle.ips</file>
<file>patches/portraits.ips</file> <file>patches/portraits.ips</file>
<file>patches/sound_restoration.ips</file> <file>patches/sound_restoration.ips</file>

Binary file not shown.

Binary file not shown.

View File

@ -72,10 +72,10 @@ void Exdeath::initMain(void) {
selMode = new QComboBox(); selMode = new QComboBox();
selMode->addItem("Base"); selMode->addItem("Base");
selMode->addItem("Unlocked Jobs"); selMode->addItem("Unlocked Jobs", "unlock.ips");
selMode->addItem("Balance"); selMode->addItem("Balance", "balance.ips");
selMode->addItem("Custom Classes"); selMode->addItem("Custom Classes", "custom_classes.ips");
selMode->addItem("Waddler Balance"); selMode->addItem("Waddler Rebalance", "waddle.ips");
chkPortraits = new QCheckBox("Yes"); chkPortraits = new QCheckBox("Yes");
chkSound = new QCheckBox("Yes"); chkSound = new QCheckBox("Yes");
@ -202,15 +202,10 @@ void Exdeath::btnApply_clicked(bool trigger) {
"GBA ROM images (*.gba)" "GBA ROM images (*.gba)"
); );
QFile::copy(filename, output); QFile::copy(filename, output);
QString mode = selMode->currentText(); int mode = selMode->currentIndex();
if (mode.compare("Unlocked Jobs")) { if (mode > 0) {
patches << ":/patches/unlock.ips"; patches << ":/patches/" + selMode->itemData(mode).toString();
} else if (mode.compare("Balance")) {
patches << ":/patches/balance.ips";
} else if (mode.compare("Custom Classes")) {
patches << ":/patches/custom_classes.ips";
patches << ":/patches/cc_spellblade.ips";
} }
if (chkPortraits->isChecked()) { if (chkPortraits->isChecked()) {
patches << ":/patches/portraits.ips"; patches << ":/patches/portraits.ips";
@ -223,27 +218,28 @@ void Exdeath::btnApply_clicked(bool trigger) {
idx = rand->bounded(1, selNED->count() - 1); idx = rand->bounded(1, selNED->count() - 1);
} }
if (idx > 1) { if (idx > 1) {
QString temp = QString(":/patches/ned/"); patches << ":/patches/ned/" + selNED->itemData(idx).toString();
temp.append(selNED->itemData(idx).toString());
patches << temp;
} }
if (!butsXP->checkedButton()->text().compare("1x")) { char *XP = butsXP->checkedButton()->text().toLatin1().data();
QString temp = QString(":/patches/xp/"); if (strncmp(XP, "1", 2)) {
temp.append(butsXP->checkedButton()->text()); QString temp = ":/patches/xp/";
temp.append(".ips"); temp.append(XP);
patches << temp; temp.append("x.ips");
patches << temp.toLatin1().data();
} }
if (!butsAP->checkedButton()->text().compare("1x")) { char *AP = butsAP->checkedButton()->text().toLatin1().data();
QString temp = QString(":/patches/ap/"); if (strncmp(AP, "1", 2)) {
temp.append(butsAP->checkedButton()->text()); QString temp = ":/patches/ap/";
temp.append(".ips"); temp.append(AP);
patches << temp; temp.append("x.ips");
patches << temp.toLatin1().data();
} }
if (!butsGil->checkedButton()->text().compare("1x")) { char *Gil = butsGil->checkedButton()->text().toLatin1().data();
QString temp = QString(":/patches/gil/"); if (strncmp(Gil, "1", 2)) {
temp.append(butsGil->checkedButton()->text()); QString temp = ":/patches/gil/";
temp.append(".ips"); temp.append(Gil);
patches << temp; temp.append("x.ips");
patches << temp.toLatin1().data();
} }
target = new QFile(output); target = new QFile(output);
@ -301,10 +297,10 @@ void Exdeath::applyPatch(QFile *file, QString patch) {
} }
void Exdeath::applyInnates(QFile *file) { void Exdeath::applyInnates(QFile *file) {
unsigned char base = 0; unsigned char base = 0;
QString mode = selMode->currentText(); int mode = selMode->currentIndex();
if (!(mode.compare("Base") || mode.compare("Unlocked Jobs"))) { if (mode > 1) {
error->showMessage("You must use Base or Fiesta to use these options."); error->showMessage("You must use Base or Unlocked Jobs to use these options.");
return; return;
} }