update to use new object event file and variable names

This commit is contained in:
garak 2019-11-22 11:06:11 -05:00 committed by Marcus Huderle
parent 342bcae174
commit b83ead44d0
2 changed files with 8 additions and 8 deletions

View file

@ -1471,7 +1471,7 @@ void MainWindow::updateSelectedObjects() {
combo->addItem("NONE", "0"); combo->addItem("NONE", "0");
combo->addItem("NORMAL", "1"); combo->addItem("NORMAL", "1");
combo->addItem("SEE ALL DIRECTIONS", "3"); combo->addItem("SEE ALL DIRECTIONS", "3");
combo->setToolTip("The trainer type of this event object.\n" combo->setToolTip("The trainer type of this object event.\n"
"If it is not a trainer, use NONE. SEE ALL DIRECTIONS\n" "If it is not a trainer, use NONE. SEE ALL DIRECTIONS\n"
"should only be used with a sight radius of 1."); "should only be used with a sight radius of 1.");
combo->setMinimumContentsLength(10); combo->setMinimumContentsLength(10);

View file

@ -1852,7 +1852,7 @@ bool Project::readVarNames() {
bool Project::readMovementTypes() { bool Project::readMovementTypes() {
movementTypes->clear(); movementTypes->clear();
QStringList prefixes = (QStringList() << "MOVEMENT_TYPE_"); QStringList prefixes = (QStringList() << "MOVEMENT_TYPE_");
QString filename = "include/constants/event_object_movement_constants.h"; QString filename = "include/constants/event_object_movement.h";
parser.readCDefinesSorted(filename, prefixes, movementTypes); parser.readCDefinesSorted(filename, prefixes, movementTypes);
if (movementTypes->isEmpty()) { if (movementTypes->isEmpty()) {
logError(QString("Failed to read movement type constants from %1").arg(filename)); logError(QString("Failed to read movement type constants from %1").arg(filename));
@ -1934,7 +1934,7 @@ bool Project::readSecretBaseIds() {
bool Project::readBgEventFacingDirections() { bool Project::readBgEventFacingDirections() {
bgEventFacingDirections->clear(); bgEventFacingDirections->clear();
QStringList prefixes = (QStringList() << "BG_EVENT_PLAYER_FACING_"); QStringList prefixes = (QStringList() << "BG_EVENT_PLAYER_FACING_");
QString filename = "include/constants/bg_event_constants.h"; QString filename = "include/constants/event_bg.h";
parser.readCDefinesSorted(filename, prefixes, bgEventFacingDirections); parser.readCDefinesSorted(filename, prefixes, bgEventFacingDirections);
if (bgEventFacingDirections->isEmpty()) { if (bgEventFacingDirections->isEmpty()) {
logError(QString("Failed to read bg event facing direction constants from %1").arg(filename)); logError(QString("Failed to read bg event facing direction constants from %1").arg(filename));
@ -1972,7 +1972,7 @@ QStringList Project::getSongNames() {
QMap<QString, int> Project::getEventObjGfxConstants() { QMap<QString, int> Project::getEventObjGfxConstants() {
QStringList eventObjGfxPrefixes; QStringList eventObjGfxPrefixes;
eventObjGfxPrefixes << "EVENT_OBJ_GFX_"; eventObjGfxPrefixes << "OBJ_EVENT_GFX_";
QMap<QString, int> constants = parser.readCDefines("include/constants/event_objects.h", eventObjGfxPrefixes); QMap<QString, int> constants = parser.readCDefines("include/constants/event_objects.h", eventObjGfxPrefixes);
@ -2029,7 +2029,7 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
QMap<QString, int> constants = getEventObjGfxConstants(); QMap<QString, int> constants = getEventObjGfxConstants();
QMap<QString, QString> pointerHash = parser.readNamedIndexCArray("src/data/field_event_obj/event_object_graphics_info_pointers.h", "gEventObjectGraphicsInfoPointers"); QMap<QString, QString> pointerHash = parser.readNamedIndexCArray("src/data/object_event/event_object_graphics_info_pointers.h", "gObjectEventGraphicsInfoPointers");
for (Event *object : objects) { for (Event *object : objects) {
if (!object->pixmap.isNull()) { if (!object->pixmap.isNull()) {
@ -2054,13 +2054,13 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
if (event_type == EventType::Object) { if (event_type == EventType::Object) {
QString info_label = pointerHash[object->get("sprite")].replace("&", ""); QString info_label = pointerHash[object->get("sprite")].replace("&", "");
QStringList gfx_info = parser.readCArray("src/data/field_event_obj/event_object_graphics_info.h", info_label); QStringList gfx_info = parser.readCArray("src/data/object_event/event_object_graphics_info.h", info_label);
QString pic_label = gfx_info.value(14); QString pic_label = gfx_info.value(14);
QString dimensions_label = gfx_info.value(11); QString dimensions_label = gfx_info.value(11);
QString subsprites_label = gfx_info.value(12); QString subsprites_label = gfx_info.value(12);
QString gfx_label = parser.readCArray("src/data/field_event_obj/event_object_pic_tables.h", pic_label).value(0); QString gfx_label = parser.readCArray("src/data/object_event/event_object_pic_tables.h", pic_label).value(0);
gfx_label = gfx_label.section(QRegExp("[\\(\\)]"), 1, 1); gfx_label = gfx_label.section(QRegExp("[\\(\\)]"), 1, 1);
QString path = parser.readCIncbin("src/data/field_event_obj/event_object_graphics.h", gfx_label); QString path = parser.readCIncbin("src/data/object_event/event_object_graphics.h", gfx_label);
if (!path.isNull()) { if (!path.isNull()) {
path = fixGraphicPath(path); path = fixGraphicPath(path);