diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-09-14 20:13:38 +0200 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-09-14 20:13:38 +0200 |
| commit | 0dd12964fc3b7b14736d5ec29d583bf30c6af0c5 (patch) | |
| tree | 56213b089dd9175075ce7c0d024ef726e821dc07 /src/main/kotlin/gui | |
| parent | 0a96dd618acba15269627c7eae8a2291fb2dc84a (diff) | |
| download | Firmament-0dd12964fc3b7b14736d5ec29d583bf30c6af0c5.tar.gz Firmament-0dd12964fc3b7b14736d5ec29d583bf30c6af0c5.tar.bz2 Firmament-0dd12964fc3b7b14736d5ec29d583bf30c6af0c5.zip | |
finishing touches
Diffstat (limited to 'src/main/kotlin/gui')
| -rw-r--r-- | src/main/kotlin/gui/config/storage/LegacyImporter.kt | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/kotlin/gui/config/storage/LegacyImporter.kt b/src/main/kotlin/gui/config/storage/LegacyImporter.kt index 942fd2a..d06afcc 100644 --- a/src/main/kotlin/gui/config/storage/LegacyImporter.kt +++ b/src/main/kotlin/gui/config/storage/LegacyImporter.kt @@ -26,20 +26,26 @@ object LegacyImporter { } } + val legacyStorage = listOf( + "inventory-buttons", + "macros", + ) + fun importFromLegacy() { configFolder.moveTo(backupPath) configFolder.createDirectories() - copyIf( - backupPath.resolve("inventory-buttons.json"), - storageFolder.resolve("inventory-buttons.json") - ) + legacyStorage.forEach { + copyIf( + backupPath.resolve("$it.json"), + storageFolder.resolve("$it.json") + ) + } backupPath.listDirectoryEntries("*.json") + .filter { it.nameWithoutExtension !in legacyStorage } .forEach { path -> val name = path.name - if (name == "inventory-buttons.json") - return@forEach path.copyTo(configFolder.resolve(name)) } |
