Fix some problems with layout directory creation

This commit is contained in:
GriffinR
2024-11-27 02:42:14 -05:00
parent 06a263c689
commit 83ef14a242
9 changed files with 76 additions and 83 deletions

View File

@@ -67,12 +67,10 @@ public:
QString sharedEventsMap() const { return m_sharedEventsMap; }
QString sharedScriptsMap() const { return m_sharedScriptsMap; }
void setNeedsLayoutDir(bool needsLayoutDir) { m_needsLayoutDir = needsLayoutDir; }
void setNeedsHealLocation(bool needsHealLocation) { m_needsHealLocation = needsHealLocation; }
void setIsPersistedToFile(bool persistedToFile) { m_isPersistedToFile = persistedToFile; }
void setHasUnsavedDataChanges(bool unsavedDataChanges) { m_hasUnsavedDataChanges = unsavedDataChanges; }
bool needsLayoutDir() const { return m_needsLayoutDir; }
bool needsHealLocation() const { return m_needsHealLocation; }
bool isPersistedToFile() const { return m_isPersistedToFile; }
bool hasUnsavedDataChanges() const { return m_hasUnsavedDataChanges; }
@@ -121,7 +119,6 @@ private:
bool m_isPersistedToFile = true;
bool m_hasUnsavedDataChanges = false;
bool m_needsLayoutDir = true;
bool m_needsHealLocation = false;
bool m_scriptsLoaded = false;

View File

@@ -22,8 +22,9 @@ public:
Layout() {}
Layout(const Layout &other);
static QString layoutNameFromMapName(const QString &mapName);
static QString layoutConstantFromName(QString mapName);
static QString defaultSuffix();
bool loaded = false;
@@ -77,6 +78,9 @@ public:
struct Settings {
QString id;
QString name;
// The name of a new layout's folder in `data/layouts/` is not always the same as the layout's name
// (e.g. the majority of the default layouts use the name of their associated map).
QString folderName;
int width;
int height;
int borderWidth;