diff --git a/.gitignore b/.gitignore index 16a8dad3..d3d1e44e 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,5 @@ app.*.map.json /android/app/release .vscode -extractedFonts \ No newline at end of file +extractedFonts +assets/bins/* \ No newline at end of file diff --git a/lib/background/IdLookup.dart b/lib/background/IdLookup.dart index 3f095c56..f97fae1b 100644 --- a/lib/background/IdLookup.dart +++ b/lib/background/IdLookup.dart @@ -6,7 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import '../stateManagement/miscValues.dart'; import '../stateManagement/openFileTypes.dart'; import '../stateManagement/openFilesManager.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'IdsIndexer.dart'; import 'Initializable.dart'; import 'isolateCommunicator.dart'; diff --git a/lib/background/IdsIndexer.dart b/lib/background/IdsIndexer.dart index 7a1ceb69..a61d6d7d 100644 --- a/lib/background/IdsIndexer.dart +++ b/lib/background/IdsIndexer.dart @@ -10,7 +10,7 @@ import 'package:xml/xml.dart'; import '../../fileTypeUtils/dat/datExtractor.dart'; import '../../fileTypeUtils/utils/ByteDataWrapper.dart'; import '../../fileTypeUtils/yax/yaxToXml.dart'; -import '../../utils.dart'; +import '../utils/utils.dart'; import '../fileTypeUtils/pak/pakExtractor.dart'; import '../fileTypeUtils/yax/hashToStringMap.dart'; diff --git a/lib/background/isolateCommunicator.dart b/lib/background/isolateCommunicator.dart index 7ae2b662..e029fcf9 100644 --- a/lib/background/isolateCommunicator.dart +++ b/lib/background/isolateCommunicator.dart @@ -3,7 +3,7 @@ import 'dart:async'; import 'dart:isolate'; import '../stateManagement/statusInfo.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'IdsIndexer.dart'; import 'Initializable.dart'; import 'IndexingGroup.dart'; diff --git a/lib/background/searchService.dart b/lib/background/searchService.dart index ac587954..8a585fdd 100644 --- a/lib/background/searchService.dart +++ b/lib/background/searchService.dart @@ -9,7 +9,7 @@ import 'package:xml/xml.dart'; import '../fileTypeUtils/tmd/tmdReader.dart'; import '../fileTypeUtils/yax/hashToStringMap.dart'; import '../stateManagement/Property.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'IdLookup.dart'; import 'IdsIndexer.dart'; diff --git a/lib/fileTypeUtils/dat/datHashGenerator.dart b/lib/fileTypeUtils/dat/datHashGenerator.dart index a5f58796..7cd4ea3c 100644 --- a/lib/fileTypeUtils/dat/datHashGenerator.dart +++ b/lib/fileTypeUtils/dat/datHashGenerator.dart @@ -1,5 +1,5 @@ -import '../../utils.dart'; +import '../../utils/utils.dart'; // From https://github.com/xxk-i/DATrepacker class HashInfo { diff --git a/lib/fileTypeUtils/dat/datRepacker.dart b/lib/fileTypeUtils/dat/datRepacker.dart index 8439191d..05e36b16 100644 --- a/lib/fileTypeUtils/dat/datRepacker.dart +++ b/lib/fileTypeUtils/dat/datRepacker.dart @@ -5,7 +5,7 @@ import 'dart:typed_data'; import 'package:path/path.dart' as path; import '../../stateManagement/statusInfo.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../utils/ByteDataWrapper.dart'; import 'datHashGenerator.dart'; diff --git a/lib/fileTypeUtils/ruby/pythonRuby.dart b/lib/fileTypeUtils/ruby/pythonRuby.dart index 6e64a656..5e634cf8 100644 --- a/lib/fileTypeUtils/ruby/pythonRuby.dart +++ b/lib/fileTypeUtils/ruby/pythonRuby.dart @@ -5,45 +5,16 @@ import 'dart:io'; import 'package:path/path.dart'; import '../../stateManagement/statusInfo.dart'; -import '../../utils.dart'; - -String? _assetsDir; -Completer _assetDirSearchCompleter = Completer(); -Future _assetDirSearch = _assetDirSearchCompleter.future; - -const _assetsDirName = "assets"; -const _assetsDirSubDirs = { "fonts", "MrubyDecompiler" }; -Future findAssetsDir() async { - var path = Directory.current.path; - // search cwd breadth first - List searchPathsQueue = [path]; - while (searchPathsQueue.isNotEmpty) { - path = searchPathsQueue.removeAt(0); - var subDirs = await Directory(path) - .list() - .where((f) => f is Directory) - .map((f) => f.path) - .toList(); - var subDirNames = subDirs.map((p) => basename(p)).toSet(); - if (basename(path) == _assetsDirName && _assetsDirSubDirs.every((subDir) => subDirNames.contains(subDir))) { - _assetsDir = path; - _assetDirSearchCompleter.complete(); - print("Found assets dir at $path"); - return true; - } - searchPathsQueue.addAll(subDirs); - } - print("Couldn't find assets dir"); - return false; -} +import '../../utils/utils.dart'; +import '../../utils/assetDirFinder.dart'; Future _processFile(String filePath) async { - await _assetDirSearch; - if (_assetsDir == null) { + await assetDirDone; + if (assetsDir == null) { showToast("Assets directory not found"); return false; } - var pyToolPath = join(_assetsDir!, "MrubyDecompiler", "__init__.py"); + var pyToolPath = join(assetsDir!, "MrubyDecompiler", "__init__.py"); var result = await Process.run("python", [pyToolPath, filePath]); return result.exitCode == 0; } diff --git a/lib/fileTypeUtils/yax/xmlToYax.dart b/lib/fileTypeUtils/yax/xmlToYax.dart index c1df9a62..c89ba84c 100644 --- a/lib/fileTypeUtils/yax/xmlToYax.dart +++ b/lib/fileTypeUtils/yax/xmlToYax.dart @@ -5,7 +5,7 @@ import 'package:path/path.dart' as path; import 'package:xml/xml.dart'; import '../../stateManagement/statusInfo.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../utils/ByteDataWrapper.dart'; int _getTagId(XmlElement tag) { diff --git a/lib/fileTypeUtils/yax/yaxToXml.dart b/lib/fileTypeUtils/yax/yaxToXml.dart index d681bc68..24c445d4 100644 --- a/lib/fileTypeUtils/yax/yaxToXml.dart +++ b/lib/fileTypeUtils/yax/yaxToXml.dart @@ -4,7 +4,7 @@ import 'package:path/path.dart' as path; import 'package:xml/xml.dart'; import '../../stateManagement/statusInfo.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import 'hashToStringMap.dart'; import 'japToEng.dart'; import '../utils/ByteDataWrapper.dart'; diff --git a/lib/keyboardEvents/actions.dart b/lib/keyboardEvents/actions.dart index 6e7a8fa0..89b20ece 100644 --- a/lib/keyboardEvents/actions.dart +++ b/lib/keyboardEvents/actions.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import '../stateManagement/openFilesManager.dart'; import '../stateManagement/undoable.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'intents.dart'; class TabChangeAction extends Action { diff --git a/lib/keyboardEvents/globalShortcutsWrapper.dart b/lib/keyboardEvents/globalShortcutsWrapper.dart index 918ee01b..80573a45 100644 --- a/lib/keyboardEvents/globalShortcutsWrapper.dart +++ b/lib/keyboardEvents/globalShortcutsWrapper.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'actions.dart'; import 'intents.dart'; diff --git a/lib/keyboardEvents/intents.dart b/lib/keyboardEvents/intents.dart index d7cbf2a6..bbd75b0b 100644 --- a/lib/keyboardEvents/intents.dart +++ b/lib/keyboardEvents/intents.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; class TabChangeIntent extends Intent { final HorizontalDirection direction; diff --git a/lib/main.dart b/lib/main.dart index 3eb326f5..144dfe45 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -6,9 +6,9 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:window_manager/window_manager.dart'; import 'background/IdLookup.dart'; -import 'fileTypeUtils/ruby/pythonRuby.dart'; import 'stateManagement/ChangeNotifierWidget.dart'; -import 'utils.dart'; +import 'utils/utils.dart'; +import 'utils/assetDirFinder.dart'; import 'widgets/theme/customTheme.dart'; import 'keyboardEvents/globalShortcutsWrapper.dart'; import 'stateManagement/preferencesData.dart'; diff --git a/lib/stateManagement/FileHierarchy.dart b/lib/stateManagement/FileHierarchy.dart index 2cf71de4..01a167e4 100644 --- a/lib/stateManagement/FileHierarchy.dart +++ b/lib/stateManagement/FileHierarchy.dart @@ -7,7 +7,7 @@ import '../fileTypeUtils/dat/datExtractor.dart'; import '../fileTypeUtils/ruby/pythonRuby.dart'; import '../fileTypeUtils/yax/yaxToXml.dart'; import '../main.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import '../widgets/misc/confirmDialog.dart'; import '../widgets/propEditors/xmlActions/XmlActionPresets.dart'; import 'Property.dart'; diff --git a/lib/stateManagement/Property.dart b/lib/stateManagement/Property.dart index 44feafa5..2f05d2c8 100644 --- a/lib/stateManagement/Property.dart +++ b/lib/stateManagement/Property.dart @@ -4,7 +4,7 @@ import 'dart:collection'; import 'package:flutter/foundation.dart'; import '../fileTypeUtils/yax/hashToStringMap.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'miscValues.dart'; import 'undoable.dart'; diff --git a/lib/stateManagement/changesExporter.dart b/lib/stateManagement/changesExporter.dart index 050aa1f3..e3aaa679 100644 --- a/lib/stateManagement/changesExporter.dart +++ b/lib/stateManagement/changesExporter.dart @@ -7,7 +7,7 @@ import '../fileTypeUtils/dat/datRepacker.dart'; import '../fileTypeUtils/pak/pakRepacker.dart'; import '../fileTypeUtils/ruby/pythonRuby.dart'; import '../fileTypeUtils/yax/xmlToYax.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'openFileTypes.dart'; import 'preferencesData.dart'; diff --git a/lib/stateManagement/charNamesXmlWrapper.dart b/lib/stateManagement/charNamesXmlWrapper.dart index a0a3377f..4293f6d3 100644 --- a/lib/stateManagement/charNamesXmlWrapper.dart +++ b/lib/stateManagement/charNamesXmlWrapper.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import 'package:convert/convert.dart'; import '../fileTypeUtils/utils/ByteDataWrapper.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import '../widgets/propEditors/otherFileTypes/genericTable/tableEditor.dart'; import 'Property.dart'; import 'hasUuid.dart'; diff --git a/lib/stateManagement/hasUuid.dart b/lib/stateManagement/hasUuid.dart index a776dc5d..4d1c24b2 100644 --- a/lib/stateManagement/hasUuid.dart +++ b/lib/stateManagement/hasUuid.dart @@ -1,5 +1,5 @@ -import '../utils.dart'; +import '../utils/utils.dart'; mixin HasUuid { String _uuid = uuidGen.v1(); diff --git a/lib/stateManagement/openFileTypes.dart b/lib/stateManagement/openFileTypes.dart index 6103760a..977071d3 100644 --- a/lib/stateManagement/openFileTypes.dart +++ b/lib/stateManagement/openFileTypes.dart @@ -9,7 +9,7 @@ import '../fileTypeUtils/smd/smdReader.dart'; import '../fileTypeUtils/smd/smdWriter.dart'; import '../fileTypeUtils/tmd/tmdReader.dart'; import '../fileTypeUtils/tmd/tmdWriter.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import '../widgets/filesView/FileType.dart'; import 'FileHierarchy.dart'; import 'Property.dart'; diff --git a/lib/stateManagement/otherFileTypes/McdData.dart b/lib/stateManagement/otherFileTypes/McdData.dart index d6e32067..66f05a36 100644 --- a/lib/stateManagement/otherFileTypes/McdData.dart +++ b/lib/stateManagement/otherFileTypes/McdData.dart @@ -6,7 +6,7 @@ import 'dart:math'; import 'package:path/path.dart'; import '../../fileTypeUtils/mcd/mcdReader.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../Property.dart'; import '../hasUuid.dart'; import '../nestedNotifier.dart'; @@ -22,6 +22,27 @@ class McdFontSymbol { McdFontSymbol(this.code, this.char, this.x, this.y, this.width, this.height); } +class UsedFontSymbol { + final int code; + final String char; + final int fontId; + + UsedFontSymbol(this.code, this.char, [this.fontId = -1]); + + UsedFontSymbol.withFont(UsedFontSymbol other, this.fontId) : + code = other.code, + char = other.char; + + @override + bool operator ==(Object other) => + other is UsedFontSymbol && + code == other.code && + fontId == other.fontId; + + @override + int get hashCode => Object.hash(code, fontId); +} + class McdFont { late final int fontId; late final int fontWidth; @@ -93,6 +114,15 @@ class McdLine with HasUuid { void dispose() { text.dispose(); } + + Set getUsedSymbolCodes() { + var charMatcher = RegExp(r"<[^>]+>|[^ ≡]"); + var symbols = charMatcher.allMatches(text.value) + .map((m) => m.group(0)!) + .map((c) => UsedFontSymbol(c != "…" ? c.codeUnitAt(0) : 0x80, c)) + .toSet(); + return symbols; + } } class McdParagraph with HasUuid { @@ -122,6 +152,17 @@ class McdParagraph with HasUuid { line.dispose(); lines.dispose(); } + + Set getUsedSymbols() { + Set symbols = {}; + for (var line in lines) { + var lineSymbols = line + .getUsedSymbolCodes() + .map((c) => UsedFontSymbol.withFont(c, font.fontId)); + symbols.addAll(lineSymbols); + } + return symbols; + } } class McdEvent with HasUuid { @@ -163,6 +204,13 @@ class McdEvent with HasUuid { paragraph.dispose(); paragraphs.dispose(); } + + Set getUsedSymbols() { + Set symbols = {}; + for (var paragraph in paragraphs) + symbols.addAll(paragraph.getUsedSymbols()); + return symbols; + } } class McdData { @@ -214,6 +262,15 @@ class McdData { ); } + void dispose() { + textureWtaPath?.dispose(); + textureWtpPath?.dispose(); + usedFonts.dispose(); + for (var event in events) + event.dispose(); + events.dispose(); + } + void addEvent() { events.add(McdEvent( HexProp(events.isNotEmpty ? events.last.eventId.value + 1 : randomId()), @@ -234,12 +291,30 @@ class McdData { .reduce(max); } - void dispose() { - textureWtaPath?.dispose(); - textureWtpPath?.dispose(); - usedFonts.dispose(); + Set getUsedSymbols() { + Set symbols = {}; for (var event in events) - event.dispose(); - events.dispose(); + symbols.addAll(event.getUsedSymbols()); + return symbols; + } + + Set getLocalFontUnsupportedSymbols() { + var usedSymbols = getUsedSymbols(); + return usedSymbols + .where((usedSym) => !usedFonts + .firstWhere((f) => f.fontId == usedSym.fontId) + .supportedSymbols + .any((supSym) => supSym.code == usedSym.code)) + .toSet(); + } + + Set getGlobalFontUnsupportedSymbols() { + var usedSymbols = getUsedSymbols(); + return usedSymbols + .where((usedSym) => !availableFonts + .firstWhere((f) => f.fontId == usedSym.fontId) + .supportedSymbols + .any((supSym) => supSym.code == usedSym.code)) + .toSet(); } } diff --git a/lib/stateManagement/sync/syncObjects.dart b/lib/stateManagement/sync/syncObjects.dart index 6115eb29..3da7e6fb 100644 --- a/lib/stateManagement/sync/syncObjects.dart +++ b/lib/stateManagement/sync/syncObjects.dart @@ -4,7 +4,7 @@ import 'dart:convert'; import 'package:xml/xml.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../Property.dart'; import '../xmlProps/xmlProp.dart'; import 'syncServer.dart'; diff --git a/lib/stateManagement/undoable.dart b/lib/stateManagement/undoable.dart index b12a60a0..1874ce61 100644 --- a/lib/stateManagement/undoable.dart +++ b/lib/stateManagement/undoable.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; import 'FileHierarchy.dart'; import 'miscValues.dart'; import 'openFilesManager.dart'; diff --git a/lib/stateManagement/xmlProps/xmlProp.dart b/lib/stateManagement/xmlProps/xmlProp.dart index 4ecb5880..6c3016ca 100644 --- a/lib/stateManagement/xmlProps/xmlProp.dart +++ b/lib/stateManagement/xmlProps/xmlProp.dart @@ -4,7 +4,7 @@ import 'package:xml/xml.dart'; import '../../fileTypeUtils/yax/hashToStringMap.dart'; import '../../fileTypeUtils/yax/japToEng.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../Property.dart'; import '../charNamesXmlWrapper.dart'; import '../nestedNotifier.dart'; diff --git a/lib/utils/assetDirFinder.dart b/lib/utils/assetDirFinder.dart new file mode 100644 index 00000000..64ad15d1 --- /dev/null +++ b/lib/utils/assetDirFinder.dart @@ -0,0 +1,35 @@ + +import 'dart:async'; +import 'dart:io'; + +import 'package:path/path.dart'; + +String? assetsDir; +Completer _assetDirSearchCompleter = Completer(); +Future assetDirDone = _assetDirSearchCompleter.future; + +const _assetsDirName = "assets"; +const _assetsDirSubDirs = { "fonts", "MrubyDecompiler" }; +Future findAssetsDir() async { + var path = Directory.current.path; + // search cwd breadth first + List searchPathsQueue = [path]; + while (searchPathsQueue.isNotEmpty) { + path = searchPathsQueue.removeAt(0); + var subDirs = await Directory(path) + .list() + .where((f) => f is Directory) + .map((f) => f.path) + .toList(); + var subDirNames = subDirs.map((p) => basename(p)).toSet(); + if (basename(path) == _assetsDirName && _assetsDirSubDirs.every((subDir) => subDirNames.contains(subDir))) { + assetsDir = path; + _assetDirSearchCompleter.complete(); + print("Found assets dir at $path"); + return true; + } + searchPathsQueue.addAll(subDirs); + } + print("Couldn't find assets dir"); + return false; +} \ No newline at end of file diff --git a/lib/utils.dart b/lib/utils/utils.dart similarity index 98% rename from lib/utils.dart rename to lib/utils/utils.dart index 28ac4236..d5c27236 100644 --- a/lib/utils.dart +++ b/lib/utils/utils.dart @@ -15,13 +15,13 @@ import 'package:uuid/uuid.dart'; import 'package:path/path.dart' as path; import 'package:xml/xml.dart'; -import 'fileTypeUtils/utils/ByteDataWrapper.dart'; -import 'fileTypeUtils/yax/hashToStringMap.dart'; -import 'fileTypeUtils/yax/japToEng.dart'; -import 'main.dart'; -import 'stateManagement/Property.dart'; -import 'stateManagement/miscValues.dart'; -import 'stateManagement/xmlProps/xmlProp.dart'; +import '../fileTypeUtils/utils/ByteDataWrapper.dart'; +import '../fileTypeUtils/yax/hashToStringMap.dart'; +import '../fileTypeUtils/yax/japToEng.dart'; +import '../main.dart'; +import '../stateManagement/Property.dart'; +import '../stateManagement/miscValues.dart'; +import '../stateManagement/xmlProps/xmlProp.dart'; const uuidGen = Uuid(); diff --git a/lib/widgets/FileHierarchyExplorer/FileExplorer.dart b/lib/widgets/FileHierarchyExplorer/FileExplorer.dart index 61724f6d..3e893aa3 100644 --- a/lib/widgets/FileHierarchyExplorer/FileExplorer.dart +++ b/lib/widgets/FileHierarchyExplorer/FileExplorer.dart @@ -4,7 +4,7 @@ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import '../../stateManagement/statusInfo.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../../widgets/theme/customTheme.dart'; import '../../stateManagement/ChangeNotifierWidget.dart'; import '../../stateManagement/FileHierarchy.dart'; diff --git a/lib/widgets/FileHierarchyExplorer/HierarchyEntryWidget.dart b/lib/widgets/FileHierarchyExplorer/HierarchyEntryWidget.dart index aa514ff8..47ad2f0e 100644 --- a/lib/widgets/FileHierarchyExplorer/HierarchyEntryWidget.dart +++ b/lib/widgets/FileHierarchyExplorer/HierarchyEntryWidget.dart @@ -13,7 +13,7 @@ import '../../stateManagement/FileHierarchy.dart'; import '../../stateManagement/miscValues.dart'; import '../../stateManagement/openFilesManager.dart'; import '../../stateManagement/preferencesData.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; class HierarchyEntryWidget extends ChangeNotifierWidget { final HierarchyEntry entry; diff --git a/lib/widgets/FileHierarchyExplorer/fileMetaEditor.dart b/lib/widgets/FileHierarchyExplorer/fileMetaEditor.dart index 11371f64..054469c4 100644 --- a/lib/widgets/FileHierarchyExplorer/fileMetaEditor.dart +++ b/lib/widgets/FileHierarchyExplorer/fileMetaEditor.dart @@ -7,7 +7,7 @@ import '../../stateManagement/FileHierarchy.dart'; import '../../stateManagement/openFileTypes.dart'; import '../../stateManagement/openFilesManager.dart'; import '../../stateManagement/xmlProps/xmlProp.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../misc/SmoothScrollBuilder.dart'; import '../misc/smallButton.dart'; import '../propEditors/simpleProps/XmlPropEditorFactory.dart'; diff --git a/lib/widgets/ResizableWidget.dart b/lib/widgets/ResizableWidget.dart index 526683d7..741b7852 100644 --- a/lib/widgets/ResizableWidget.dart +++ b/lib/widgets/ResizableWidget.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import '../widgets/theme/customTheme.dart'; -import '../utils.dart'; +import '../utils/utils.dart'; class ResizableWidget extends StatefulWidget { final List children; diff --git a/lib/widgets/filesView/FileTabEntry.dart b/lib/widgets/filesView/FileTabEntry.dart index 8d0d54b6..522880c8 100644 --- a/lib/widgets/filesView/FileTabEntry.dart +++ b/lib/widgets/filesView/FileTabEntry.dart @@ -1,7 +1,7 @@ import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../../widgets/theme/customTheme.dart'; import '../../stateManagement/ChangeNotifierWidget.dart'; import '../../stateManagement/openFileTypes.dart'; diff --git a/lib/widgets/filesView/XmlActionsEditor.dart b/lib/widgets/filesView/XmlActionsEditor.dart index ff047d94..2765b851 100644 --- a/lib/widgets/filesView/XmlActionsEditor.dart +++ b/lib/widgets/filesView/XmlActionsEditor.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import '../../stateManagement/Property.dart'; import '../../stateManagement/xmlProps/xmlProp.dart'; import '../../stateManagement/xmlProps/xmlActionProp.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../misc/FlexReorderable.dart'; import '../misc/SmoothScrollBuilder.dart'; import '../misc/nestedContextMenu.dart'; diff --git a/lib/widgets/filesView/fileTabView.dart b/lib/widgets/filesView/fileTabView.dart index d7aac7c7..9fd48121 100644 --- a/lib/widgets/filesView/fileTabView.dart +++ b/lib/widgets/filesView/fileTabView.dart @@ -18,7 +18,7 @@ import 'FileType.dart'; import '../../stateManagement/ChangeNotifierWidget.dart'; import '../../stateManagement/openFilesManager.dart'; import '../../widgets/theme/customTheme.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; class FileTabView extends ChangeNotifierWidget { diff --git a/lib/widgets/filesView/outliner.dart b/lib/widgets/filesView/outliner.dart index 48ad5213..2beb81e5 100644 --- a/lib/widgets/filesView/outliner.dart +++ b/lib/widgets/filesView/outliner.dart @@ -7,7 +7,7 @@ import '../../stateManagement/openFileTypes.dart'; import '../../stateManagement/openFilesManager.dart'; import '../../stateManagement/xmlProps/xmlActionProp.dart'; import '../../stateManagement/xmlProps/xmlProp.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../misc/SmoothScrollBuilder.dart'; import '../propEditors/xmlActions/XmlActionEditor.dart'; import 'FileType.dart'; diff --git a/lib/widgets/filesView/searchPanel.dart b/lib/widgets/filesView/searchPanel.dart index 116ee2bc..f59c05d3 100644 --- a/lib/widgets/filesView/searchPanel.dart +++ b/lib/widgets/filesView/searchPanel.dart @@ -13,7 +13,7 @@ import '../../stateManagement/FileHierarchy.dart'; import '../../stateManagement/Property.dart'; import '../../stateManagement/nestedNotifier.dart'; import '../../stateManagement/openFilesManager.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import '../misc/RowSeparated.dart'; import '../misc/SmoothScrollBuilder.dart'; import '../misc/nestedContextMenu.dart'; diff --git a/lib/widgets/misc/FlexReorderable.dart b/lib/widgets/misc/FlexReorderable.dart index 4cf98661..b235ee6f 100644 --- a/lib/widgets/misc/FlexReorderable.dart +++ b/lib/widgets/misc/FlexReorderable.dart @@ -4,7 +4,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import 'WidgetSizeWrapper.dart'; import 'mousePosition.dart'; diff --git a/lib/widgets/misc/Selectable.dart b/lib/widgets/misc/Selectable.dart index ccbf2cf4..8ccb6dcf 100644 --- a/lib/widgets/misc/Selectable.dart +++ b/lib/widgets/misc/Selectable.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import '../../widgets/theme/customTheme.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; class _SelectedData { final T? data; diff --git a/lib/widgets/misc/SmoothScrollBuilder.dart b/lib/widgets/misc/SmoothScrollBuilder.dart index 695c1670..2578c384 100644 --- a/lib/widgets/misc/SmoothScrollBuilder.dart +++ b/lib/widgets/misc/SmoothScrollBuilder.dart @@ -5,7 +5,7 @@ import 'dart:async'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; class SmoothScrollBuilder extends StatefulWidget { final ScrollController controller; diff --git a/lib/widgets/misc/nestedContextMenu.dart b/lib/widgets/misc/nestedContextMenu.dart index 7625af4e..8b610da1 100644 --- a/lib/widgets/misc/nestedContextMenu.dart +++ b/lib/widgets/misc/nestedContextMenu.dart @@ -2,7 +2,7 @@ import 'package:context_menus/context_menus.dart'; import 'package:flutter/material.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; class _NestedContextMenuIW extends InheritedWidget { final List contextChildren; diff --git a/lib/widgets/propEditors/customXmlProps/areaEditor.dart b/lib/widgets/propEditors/customXmlProps/areaEditor.dart index ecd75e2a..16dcca56 100644 --- a/lib/widgets/propEditors/customXmlProps/areaEditor.dart +++ b/lib/widgets/propEditors/customXmlProps/areaEditor.dart @@ -7,7 +7,7 @@ import '../../../widgets/theme/customTheme.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/CustomIcons.dart'; import '../../misc/nestedContextMenu.dart'; import '../../misc/selectionPopup.dart'; diff --git a/lib/widgets/propEditors/customXmlProps/commandEditor.dart b/lib/widgets/propEditors/customXmlProps/commandEditor.dart index acd1ef67..a6d56aed 100644 --- a/lib/widgets/propEditors/customXmlProps/commandEditor.dart +++ b/lib/widgets/propEditors/customXmlProps/commandEditor.dart @@ -6,7 +6,7 @@ import '../../../widgets/theme/customTheme.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/nestedContextMenu.dart'; import '../simpleProps/XmlPropEditorFactory.dart'; import '../simpleProps/propEditorFactory.dart'; diff --git a/lib/widgets/propEditors/customXmlProps/conditionEditor.dart b/lib/widgets/propEditors/customXmlProps/conditionEditor.dart index f99ad4c2..cfc855ff 100644 --- a/lib/widgets/propEditors/customXmlProps/conditionEditor.dart +++ b/lib/widgets/propEditors/customXmlProps/conditionEditor.dart @@ -5,7 +5,7 @@ import '../../../widgets/theme/customTheme.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/nestedContextMenu.dart'; import '../simpleProps/XmlPropEditorFactory.dart'; import '../simpleProps/propEditorFactory.dart'; diff --git a/lib/widgets/propEditors/customXmlProps/entityEditor.dart b/lib/widgets/propEditors/customXmlProps/entityEditor.dart index f000c967..ad5018b2 100644 --- a/lib/widgets/propEditors/customXmlProps/entityEditor.dart +++ b/lib/widgets/propEditors/customXmlProps/entityEditor.dart @@ -7,7 +7,7 @@ import '../../../widgets/theme/customTheme.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/nestedContextMenu.dart'; import '../simpleProps/UnderlinePropTextField.dart'; import '../simpleProps/XmlPropEditorFactory.dart'; diff --git a/lib/widgets/propEditors/customXmlProps/puidReferenceEditor.dart b/lib/widgets/propEditors/customXmlProps/puidReferenceEditor.dart index d69707e4..e15cf6a7 100644 --- a/lib/widgets/propEditors/customXmlProps/puidReferenceEditor.dart +++ b/lib/widgets/propEditors/customXmlProps/puidReferenceEditor.dart @@ -10,7 +10,7 @@ import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/openFilesManager.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/nestedContextMenu.dart'; import '../simpleProps/UnderlinePropTextField.dart'; import '../simpleProps/propEditorFactory.dart'; diff --git a/lib/widgets/propEditors/customXmlProps/transformsEditor.dart b/lib/widgets/propEditors/customXmlProps/transformsEditor.dart index 403cd40a..4c4801fe 100644 --- a/lib/widgets/propEditors/customXmlProps/transformsEditor.dart +++ b/lib/widgets/propEditors/customXmlProps/transformsEditor.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../simpleProps/XmlPropEditorFactory.dart'; import '../simpleProps/optionalPropEditor.dart'; import '../simpleProps/propEditorFactory.dart'; diff --git a/lib/widgets/propEditors/otherFileTypes/genericTable/tableExporter.dart b/lib/widgets/propEditors/otherFileTypes/genericTable/tableExporter.dart index 96c9e367..f6c67e10 100644 --- a/lib/widgets/propEditors/otherFileTypes/genericTable/tableExporter.dart +++ b/lib/widgets/propEditors/otherFileTypes/genericTable/tableExporter.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'package:file_picker/file_picker.dart'; -import '../../../../utils.dart'; +import '../../../../utils/utils.dart'; import 'tableEditor.dart'; List> _tablePropsToStrings(CustomTableConfig tableConfig) { diff --git a/lib/widgets/propEditors/otherFileTypes/mcdEditor.dart b/lib/widgets/propEditors/otherFileTypes/mcdEditor.dart index 9a4695d0..ef4c2371 100644 --- a/lib/widgets/propEditors/otherFileTypes/mcdEditor.dart +++ b/lib/widgets/propEditors/otherFileTypes/mcdEditor.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/openFileTypes.dart'; import '../../../stateManagement/otherFileTypes/McdData.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/RowSeparated.dart'; import '../../misc/SmoothScrollBuilder.dart'; import '../../misc/nestedContextMenu.dart'; @@ -130,7 +130,7 @@ class _McdEventEditorState extends ChangeNotifierState<_McdEventEditor> { return Material( color: widget.altColor ? getTheme(context).tableBgAltColor : getTheme(context).tableBgColor, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.only(top: 40, right: 8, bottom: 8, left: 8), child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, diff --git a/lib/widgets/propEditors/simpleProps/HexPropTextField.dart b/lib/widgets/propEditors/simpleProps/HexPropTextField.dart index dc7046e3..36c6b111 100644 --- a/lib/widgets/propEditors/simpleProps/HexPropTextField.dart +++ b/lib/widgets/propEditors/simpleProps/HexPropTextField.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import 'propTextField.dart'; class HexPropTextField extends ChangeNotifierWidget { diff --git a/lib/widgets/propEditors/simpleProps/NumberPropTextField.dart b/lib/widgets/propEditors/simpleProps/NumberPropTextField.dart index bca28e89..4ce29d31 100644 --- a/lib/widgets/propEditors/simpleProps/NumberPropTextField.dart +++ b/lib/widgets/propEditors/simpleProps/NumberPropTextField.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import '../../../stateManagement/Property.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import 'propTextField.dart'; diff --git a/lib/widgets/propEditors/simpleProps/XmlPropEditorFactory.dart b/lib/widgets/propEditors/simpleProps/XmlPropEditorFactory.dart index bb92c454..3f3eadd2 100644 --- a/lib/widgets/propEditors/simpleProps/XmlPropEditorFactory.dart +++ b/lib/widgets/propEditors/simpleProps/XmlPropEditorFactory.dart @@ -8,7 +8,7 @@ import '../../../main.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/openFileTypes.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/CustomIcons.dart'; import '../../misc/selectionPopup.dart'; import '../customXmlProps/areaEditor.dart'; diff --git a/lib/widgets/propEditors/simpleProps/propTextField.dart b/lib/widgets/propEditors/simpleProps/propTextField.dart index 9ffad977..c13bd4b7 100644 --- a/lib/widgets/propEditors/simpleProps/propTextField.dart +++ b/lib/widgets/propEditors/simpleProps/propTextField.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import 'DoubleClickablePropTextField.dart'; import 'UnderlinePropTextField.dart'; import 'primaryPropTextField.dart'; diff --git a/lib/widgets/propEditors/xmlActions/XmlActionEditor.dart b/lib/widgets/propEditors/xmlActions/XmlActionEditor.dart index 810194ca..d419d632 100644 --- a/lib/widgets/propEditors/xmlActions/XmlActionEditor.dart +++ b/lib/widgets/propEditors/xmlActions/XmlActionEditor.dart @@ -7,7 +7,7 @@ import '../../../widgets/theme/customTheme.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/openFilesManager.dart'; import '../../../stateManagement/xmlProps/xmlActionProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/FlexReorderable.dart'; import '../../misc/Selectable.dart'; import '../../misc/nestedContextMenu.dart'; diff --git a/lib/widgets/propEditors/xmlActions/XmlActionEditorFactory.dart b/lib/widgets/propEditors/xmlActions/XmlActionEditorFactory.dart index 6d4d15c4..4c4c725e 100644 --- a/lib/widgets/propEditors/xmlActions/XmlActionEditorFactory.dart +++ b/lib/widgets/propEditors/xmlActions/XmlActionEditorFactory.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import '../../../stateManagement/xmlProps/xmlActionProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import 'DelayAction.dart'; import 'XmlActionEditor.dart'; diff --git a/lib/widgets/propEditors/xmlActions/XmlActionPresets.dart b/lib/widgets/propEditors/xmlActions/XmlActionPresets.dart index 49737112..647dac67 100644 --- a/lib/widgets/propEditors/xmlActions/XmlActionPresets.dart +++ b/lib/widgets/propEditors/xmlActions/XmlActionPresets.dart @@ -4,7 +4,7 @@ import 'package:xml/xml.dart'; import '../../../main.dart'; import '../../../stateManagement/xmlProps/xmlActionProp.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/selectionPopup.dart'; import '../simpleProps/XmlPropEditorFactory.dart'; import '../simpleProps/propTextField.dart'; diff --git a/lib/widgets/propEditors/xmlActions/xmlArrayEditor.dart b/lib/widgets/propEditors/xmlActions/xmlArrayEditor.dart index e00c00c0..22a218fa 100644 --- a/lib/widgets/propEditors/xmlActions/xmlArrayEditor.dart +++ b/lib/widgets/propEditors/xmlActions/xmlArrayEditor.dart @@ -6,7 +6,7 @@ import '../../../widgets/theme/customTheme.dart'; import '../../../stateManagement/ChangeNotifierWidget.dart'; import '../../../stateManagement/Property.dart'; import '../../../stateManagement/xmlProps/xmlProp.dart'; -import '../../../utils.dart'; +import '../../../utils/utils.dart'; import '../../misc/FlexReorderable.dart'; import '../../misc/nestedContextMenu.dart'; import '../../misc/smallButton.dart'; diff --git a/lib/widgets/theme/nierTheme.dart b/lib/widgets/theme/nierTheme.dart index 63f15707..b778f097 100644 --- a/lib/widgets/theme/nierTheme.dart +++ b/lib/widgets/theme/nierTheme.dart @@ -118,8 +118,8 @@ class NierNierThemeExtension extends NierThemeExtension { ), textSelectionTheme: const TextSelectionThemeData( cursorColor: _ncDark, - selectionColor: _ncBrownDark, - selectionHandleColor: _ncBrownDark, + selectionColor: _ncRed, + selectionHandleColor: _ncRed, ), ); } diff --git a/lib/widgets/titlebar/Titlebar.dart b/lib/widgets/titlebar/Titlebar.dart index 5f0ca0ba..ac73c642 100644 --- a/lib/widgets/titlebar/Titlebar.dart +++ b/lib/widgets/titlebar/Titlebar.dart @@ -6,7 +6,7 @@ import '../../stateManagement/ChangeNotifierWidget.dart'; import '../../stateManagement/miscValues.dart'; import '../../stateManagement/openFilesManager.dart'; import '../../stateManagement/undoable.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; import 'TitlebarButton.dart'; diff --git a/lib/widgets/titlebar/TitlebarButton.dart b/lib/widgets/titlebar/TitlebarButton.dart index e044de1a..69881ff5 100644 --- a/lib/widgets/titlebar/TitlebarButton.dart +++ b/lib/widgets/titlebar/TitlebarButton.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import '../../widgets/theme/customTheme.dart'; -import '../../utils.dart'; +import '../../utils/utils.dart'; class TitleBarButton extends StatefulWidget { final IconData icon;