Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHeitmann committed Sep 7, 2024
1 parent f0fc0db commit 22cf218
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 7 additions & 2 deletions lib/stateManagement/hierarchy/FileHierarchy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ class OpenHierarchyManager with HasUuid, Undoable, HierarchyEntryBase implements
print("$e\n$s");
}
//check if extracted folder actually contains all dat files
if (datFilePaths == null || datFilePaths.isNotEmpty && await Future.any(datFilePaths.map((name) async => !await File(name).exists()))) {
var shouldExtractDatFiles = false;
if (!shouldExtractDatFiles)
shouldExtractDatFiles = datFilePaths == null;
if (!shouldExtractDatFiles)
shouldExtractDatFiles = datFilePaths.isNotEmpty && await Future.any(datFilePaths.map((name) async => !await File(name).exists()));
if (shouldExtractDatFiles) {
await extractDatFiles(datPath, shouldExtractPakFiles: true);
}
}
Expand Down Expand Up @@ -463,7 +468,7 @@ class OpenHierarchyManager with HasUuid, Undoable, HierarchyEntryBase implements
else {
wtpPath = join(datDir, wtpName);
if (!await File(wtpPath).exists()) {
showToast("Can't find corresponding WTP file");
messageLog.add("Can't find WTP file of ${basename(wtaPath)}");
throw Exception("Can't find corresponding WTP file");
}
}
Expand Down
2 changes: 0 additions & 2 deletions lib/stateManagement/hierarchy/types/DatHierarchyEntry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ class DatHierarchyEntry extends ExtractableHierarchyEntry {
rubyScriptGroup.isCollapsed.value = true;
}

for (var child in children)
print("${child.name.value} ${child.runtimeType} ${child.priority}");
sortChildren((a, b) {
if (a.priority != b.priority)
return b.priority - a.priority;
Expand Down
2 changes: 1 addition & 1 deletion lib/stateManagement/preferencesData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class SavableProp<T> extends ValueProp<T> {
if (T == ThemeType)
return val != null ? ThemeType.values[val as int] as T : null;
if (T == List || T == Map)
return val != null ? jsonDecode(val as String) as T : null;
return val is String ? jsonDecode(val) as T : val as T?;
return val as T?;
}

Expand Down

0 comments on commit 22cf218

Please sign in to comment.