Relax remaining MAP_ prefix assumptions

This commit is contained in:
GriffinR 2025-05-07 12:27:42 -04:00
parent a906783f68
commit a15daf6c14
3 changed files with 9 additions and 16 deletions

View File

@ -110,10 +110,10 @@ In addition to these files, there are some specific symbol and macro names that
``define_attribute_encounter``, ``METATILE_ATTRIBUTE_ENCOUNTER_TYPE``, name used to extract setting from ``symbol_attribute_table``
``define_metatile_label_prefix``, ``METATILE_``, expected prefix for metatile label macro names
``define_heal_locations_prefix``, ``HEAL_LOCATION_``, default prefix for heal location macro names
``define_layout_prefix``, ``LAYOUT_``, default prefix for layout macro names
``define_map_prefix``, ``MAP_``, expected prefix for map macro names
``define_map_dynamic``, ``DYNAMIC``, macro name after prefix for Dynamic maps
``define_map_empty``, ``UNDEFINED``, macro name after prefix for empty maps
``define_layout_prefix``, ``LAYOUT_``, default prefix for layout ID names
``define_map_prefix``, ``MAP_``, default prefix for map ID names
``define_map_dynamic``, ``MAP_DYNAMIC``, ID name for Dynamic maps
``define_map_empty``, ``MAP_UNDEFINED``, ID name for empty maps
``define_map_section_prefix``, ``MAPSEC_``, expected prefix for location macro names
``define_map_section_empty``, ``NONE``, macro name after prefix for empty region map sections
``define_species_prefix``, ``SPECIES_``, expected prefix for species macro names

View File

@ -110,8 +110,8 @@ const QMap<ProjectIdentifier, QPair<QString, QString>> ProjectConfig::defaultIde
{ProjectIdentifier::define_heal_locations_prefix, {"define_heal_locations_prefix", "HEAL_LOCATION_"}},
{ProjectIdentifier::define_layout_prefix, {"define_layout_prefix", "LAYOUT_"}},
{ProjectIdentifier::define_map_prefix, {"define_map_prefix", "MAP_"}},
{ProjectIdentifier::define_map_dynamic, {"define_map_dynamic", "DYNAMIC"}},
{ProjectIdentifier::define_map_empty, {"define_map_empty", "UNDEFINED"}},
{ProjectIdentifier::define_map_dynamic, {"define_map_dynamic", "MAP_DYNAMIC"}},
{ProjectIdentifier::define_map_empty, {"define_map_empty", "MAP_UNDEFINED"}},
{ProjectIdentifier::define_map_section_prefix, {"define_map_section_prefix", "MAPSEC_"}},
{ProjectIdentifier::define_map_section_empty, {"define_map_section_empty", "NONE"}},
{ProjectIdentifier::define_species_prefix, {"define_species_prefix", "SPECIES_"}},

View File

@ -974,14 +974,7 @@ bool Project::saveWildMonData() {
// Because of how event ID names are checked it doesn't guarantee that the name
// won't be in-use by some map that hasn't been loaded yet.
QString Project::getNewHealLocationName(const Map* map) const {
if (!map) return QString();
QString idName = map->constantName();
const QString mapPrefix = projectConfig.getIdentifier(ProjectIdentifier::define_map_prefix);
if (idName.startsWith(mapPrefix)) {
idName.remove(0, mapPrefix.length());
}
return toUniqueIdentifier(projectConfig.getIdentifier(ProjectIdentifier::define_heal_locations_prefix) + idName);
return !map ? QString() : toUniqueIdentifier(projectConfig.getIdentifier(ProjectIdentifier::define_heal_locations_prefix) + Util::toDefineCase(map->name()));
}
bool Project::saveHealLocations() {
@ -3380,11 +3373,11 @@ int Project::getMaxEvents(Event::Group group) const {
}
QString Project::getEmptyMapDefineName() {
return projectConfig.getIdentifier(ProjectIdentifier::define_map_prefix) + projectConfig.getIdentifier(ProjectIdentifier::define_map_empty);
return projectConfig.getIdentifier(ProjectIdentifier::define_map_empty);
}
QString Project::getDynamicMapDefineName() {
return projectConfig.getIdentifier(ProjectIdentifier::define_map_prefix) + projectConfig.getIdentifier(ProjectIdentifier::define_map_dynamic);
return projectConfig.getIdentifier(ProjectIdentifier::define_map_dynamic);
}
QString Project::getDynamicMapName() {