mirror of
https://github.com/huderlem/porymap.git
synced 2026-07-02 00:02:04 -05:00
Stop writing map_groups.h
This commit is contained in:
parent
c9695521c7
commit
18308fa9de
|
|
@ -45,7 +45,6 @@ The filepath that Porymap expects for each file can be overridden on the ``Files
|
|||
src/data/region_map/region_map_sections.json, yes, yes, ``json_region_map_entries``,
|
||||
src/data/region_map/porymap_config.json, yes, yes, ``json_region_porymap_cfg``,
|
||||
include/constants/global.h, yes, no, ``constants_global``, reads ``define_obj_event_count``
|
||||
include/constants/map_groups.h, no, yes, ``constants_map_groups``,
|
||||
include/constants/items.h, yes, no, ``constants_items``, for Hidden Item events
|
||||
include/constants/flags.h, yes, no, ``constants_flags``, for Object and Hidden Item events
|
||||
include/constants/vars.h, yes, no, ``constants_vars``, for Trigger events
|
||||
|
|
|
|||
|
|
@ -254,7 +254,6 @@ enum ProjectFilePath {
|
|||
data_pokemon_gfx,
|
||||
data_heal_locations,
|
||||
constants_global,
|
||||
constants_map_groups,
|
||||
constants_items,
|
||||
constants_flags,
|
||||
constants_vars,
|
||||
|
|
|
|||
|
|
@ -172,7 +172,6 @@ public:
|
|||
void saveMapGroups();
|
||||
void saveRegionMapSections();
|
||||
void saveWildMonData();
|
||||
void saveMapConstantsHeader();
|
||||
void saveHealLocations(Map*);
|
||||
void saveTilesets(Tileset*, Tileset*);
|
||||
void saveTilesetMetatileLabels(Tileset*, Tileset*);
|
||||
|
|
|
|||
|
|
@ -152,7 +152,6 @@ const QMap<ProjectFilePath, QPair<QString, QString>> ProjectConfig::defaultPaths
|
|||
{ProjectFilePath::data_pokemon_gfx, { "data_pokemon_gfx", "src/data/graphics/pokemon.h"}},
|
||||
{ProjectFilePath::data_heal_locations, { "data_heal_locations", "src/data/heal_locations.h"}},
|
||||
{ProjectFilePath::constants_global, { "constants_global", "include/constants/global.h"}},
|
||||
{ProjectFilePath::constants_map_groups, { "constants_map_groups", "include/constants/map_groups.h"}},
|
||||
{ProjectFilePath::constants_items, { "constants_items", "include/constants/items.h"}},
|
||||
{ProjectFilePath::constants_flags, { "constants_flags", "include/constants/flags.h"}},
|
||||
{ProjectFilePath::constants_vars, { "constants_vars", "include/constants/vars.h"}},
|
||||
|
|
|
|||
|
|
@ -840,43 +840,6 @@ void Project::saveWildMonData() {
|
|||
wildEncountersFile.close();
|
||||
}
|
||||
|
||||
void Project::saveMapConstantsHeader() {
|
||||
QString text = QString("#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n");
|
||||
text += QString("#define GUARD_CONSTANTS_MAP_GROUPS_H\n");
|
||||
text += QString("\n//\n// DO NOT MODIFY THIS FILE! It is auto-generated from %1\n//\n\n")
|
||||
.arg(projectConfig.getFilePath(ProjectFilePath::json_map_groups));
|
||||
|
||||
int groupNum = 0;
|
||||
for (QStringList mapNames : groupedMapNames) {
|
||||
text += "// " + groupNames.at(groupNum) + "\n";
|
||||
int maxLength = 0;
|
||||
for (QString mapName : mapNames) {
|
||||
QString mapConstantName = mapNamesToMapConstants.value(mapName);
|
||||
if (mapConstantName.length() > maxLength)
|
||||
maxLength = mapConstantName.length();
|
||||
}
|
||||
int groupIndex = 0;
|
||||
for (QString mapName : mapNames) {
|
||||
QString mapConstantName = mapNamesToMapConstants.value(mapName);
|
||||
text += QString("#define %1%2(%3 | (%4 << 8))\n")
|
||||
.arg(mapConstantName)
|
||||
.arg(QString(" ").repeated(maxLength - mapConstantName.length() + 1))
|
||||
.arg(groupIndex)
|
||||
.arg(groupNum);
|
||||
groupIndex++;
|
||||
}
|
||||
text += QString("\n");
|
||||
groupNum++;
|
||||
}
|
||||
|
||||
text += QString("#define MAP_GROUPS_COUNT %1\n\n").arg(groupNum);
|
||||
text += QString("#endif // GUARD_CONSTANTS_MAP_GROUPS_H\n");
|
||||
|
||||
QString mapGroupFilepath = root + "/" + projectConfig.getFilePath(ProjectFilePath::constants_map_groups);
|
||||
ignoreWatchedFileTemporarily(mapGroupFilepath);
|
||||
saveTextFile(mapGroupFilepath, text);
|
||||
}
|
||||
|
||||
void Project::saveHealLocations(Map *map) {
|
||||
this->saveHealLocationsData(map);
|
||||
this->saveHealLocationsConstants();
|
||||
|
|
@ -1469,7 +1432,6 @@ void Project::saveAllDataStructures() {
|
|||
saveMapLayouts();
|
||||
saveMapGroups();
|
||||
saveRegionMapSections();
|
||||
saveMapConstantsHeader();
|
||||
saveWildMonData();
|
||||
saveConfig();
|
||||
this->hasUnsavedDataChanges = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user