Skip to content

Commit 3b8a271

Browse files
committed
Add support for the new drop-in bnpc fields
1 parent 4d5f1db commit 3b8a271

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

parts/scene/objectpropertieswidget.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,22 @@ void ObjectPropertiesWidget::refreshDropInData(DropInObject *object)
342342

343343
const auto nonPopEdit = new BoolEdit(data->nonpop);
344344
layout->addRow(i18n("Nonpop"), nonPopEdit);
345+
346+
const auto aggressionModeEdit = new UIntEdit(data->aggressionMode);
347+
layout->addRow(i18n("Aggression Mode"), aggressionModeEdit);
348+
349+
const auto gimmickId = new ObjectIdEdit(m_appState);
350+
gimmickId->setObjectId(data->gimmickId);
351+
layout->addRow(i18n("Gimmick Id"), gimmickId);
352+
353+
const auto maxLinksEdit = new UIntEdit(data->maxLinks);
354+
layout->addRow(i18n("Max Links"), maxLinksEdit);
355+
356+
const auto linkFamilyEdit = new UIntEdit(data->linkFamily);
357+
layout->addRow(i18n("Link Family"), linkFamilyEdit);
358+
359+
const auto linkRangeEdit = new UIntEdit(data->linkRange);
360+
layout->addRow(i18n("Link Range"), linkRangeEdit);
345361
}
346362
}
347363

parts/scene/scenelistmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ void SceneListModel::processScene(SceneTreeInformation *parentNode, ObjectScene
484484
if (std::holds_alternative<DropInGatheringPoint>(dropInObject.data)) {
485485
dropinItem->name = i18n("Gathering Point");
486486
} else if (auto data = std::get_if<DropInBattleNpc>(&dropInObject.data)) {
487-
dropinItem->name = m_appState->lookupBNpcName(data->nameId);
487+
dropinItem->name = m_appState->lookupBNpcName(data->nameId) + (data->nonpop ? i18n(" (Nonpop)") : QString());
488488
}
489489
dropinItem->row = j;
490490
dropinItem->data = QVariant::fromValue(&dropInObject);

parts/scene/scenestate.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ void SceneState::loadDropIn(const QString &path)
203203
battleNpc.hp = jsonData["hp"_L1].toInteger();
204204
battleNpc.level = jsonData["level"_L1].toInt();
205205
battleNpc.nonpop = jsonData["nonpop"_L1].toBool();
206+
battleNpc.aggressionMode = jsonData["aggression_mode"_L1].toInteger();
207+
battleNpc.gimmickId = jsonData["gimmick_id"_L1].toInteger();
208+
battleNpc.maxLinks = jsonData["max_links"_L1].toInteger();
209+
battleNpc.linkFamily = jsonData["link_family"_L1].toInteger();
210+
battleNpc.linkRange = jsonData["link_range"_L1].toInteger();
206211

207212
obj.data = battleNpc;
208213
} else {
@@ -259,6 +264,11 @@ void SceneState::saveDropIns()
259264
{"hp"_L1, (qint64)data->hp},
260265
{"level"_L1, (qint64)data->level},
261266
{"nonpop"_L1, data->nonpop},
267+
{"aggression_mode"_L1, (qint64)data->aggressionMode},
268+
{"gimmick_id"_L1, (qint64)data->gimmickId},
269+
{"max_links"_L1, (qint64)data->maxLinks},
270+
{"link_family"_L1, (qint64)data->linkFamily},
271+
{"link_range"_L1, (qint64)data->linkRange},
262272
};
263273
}
264274

parts/scene/scenestate.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ struct DropInBattleNpc {
2121
uint32_t hp;
2222
uint32_t level;
2323
bool nonpop;
24+
uint32_t aggressionMode;
25+
uint32_t gimmickId;
26+
uint32_t maxLinks;
27+
uint32_t linkFamily;
28+
uint32_t linkRange;
2429
};
2530

2631
struct DropInObject {

0 commit comments

Comments
 (0)