mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-26 21:57:45 +00:00
exdpart: Make definition JSON optional, oops
This commit is contained in:
parent
c05d935c04
commit
9591b9a548
1 changed files with 21 additions and 14 deletions
|
@ -28,8 +28,10 @@ void EXDPart::loadSheet(const QString& name) {
|
|||
QFile definitionFile(QStringLiteral("Achievement.json"));
|
||||
definitionFile.open(QIODevice::ReadOnly);
|
||||
|
||||
QJsonArray definitionList;
|
||||
if (definitionFile.isOpen()) {
|
||||
auto document = QJsonDocument::fromJson(definitionFile.readAll());
|
||||
auto definitionList = document.object()[QLatin1String("definitions")].toArray();
|
||||
definitionList = document.object()[QLatin1String("definitions")].toArray();
|
||||
|
||||
for (auto definition : definitionList) {
|
||||
if (definition.toObject().contains(QLatin1String("converter"))
|
||||
|
@ -44,6 +46,7 @@ void EXDPart::loadSheet(const QString& name) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto exh = physis_gamedata_read_excel_sheet_header(data, name.toStdString().c_str());
|
||||
|
||||
|
@ -96,7 +99,9 @@ void EXDPart::loadSheet(const QString& name) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (definitionList.contains(z)) {
|
||||
columnType = definitionList[z].toObject()[QLatin1String("name")].toString();
|
||||
}
|
||||
|
||||
auto headerItem = new QTableWidgetItem();
|
||||
headerItem->setText(columnType);
|
||||
|
@ -154,6 +159,7 @@ void EXDPart::loadSheet(const QString& name) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (definitionList.contains(z)) {
|
||||
auto definition = definitionList[z].toObject();
|
||||
if (definition.contains(QLatin1String("converter"))
|
||||
&& definition[QLatin1String("converter")].toObject()[QLatin1String("type")].toString() == QLatin1String("link")) {
|
||||
|
@ -166,6 +172,7 @@ void EXDPart::loadSheet(const QString& name) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto newItem = new QTableWidgetItem(columnString);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue