diff --git a/DS_Map/Resources/CharMaps/CharMapManager.cs b/DS_Map/Resources/CharMaps/CharMapManager.cs index 46c1781..042c6fa 100644 --- a/DS_Map/Resources/CharMaps/CharMapManager.cs +++ b/DS_Map/Resources/CharMaps/CharMapManager.cs @@ -179,45 +179,25 @@ namespace DSPRE.CharMaps public static bool IsCustomMapOutdated() { // Check if custom charmap file exists - if (!File.Exists(customCharmapFilePath)) + if (File.Exists(customCharmapFilePath)) { - AppLogger.Warn($"No custom charmap found at: {customCharmapFilePath}"); - + // Both files exist, compare versions try { - // Ensure directory exists - if (!Directory.Exists(Program.DspreDataPath)) - { - Directory.CreateDirectory(Program.DspreDataPath); - } + var defaultVersion = GetCharMapVersion(charmapFilePath); + var customVersion = GetCharMapVersion(customCharmapFilePath); - // Copy default charmap to custom path - File.Copy(charmapFilePath, customCharmapFilePath, false); - AppLogger.Info($"Created custom charmap from default at: {customCharmapFilePath}"); - - // Since we just created it, it's not outdated - return false; + return customVersion < defaultVersion; } catch (Exception ex) { - AppLogger.Error($"Failed to create custom charmap: {ex.Message}"); - return false; // Don't treat as outdated if creation failed + AppLogger.Error($"Error comparing charmap versions: {ex.Message}"); + return false; // Don't treat as outdated if comparison failed } } - // Both files exist, compare versions - try - { - var defaultVersion = GetCharMapVersion(charmapFilePath); - var customVersion = GetCharMapVersion(customCharmapFilePath); + return false; // Custom charmap does not exist, so not outdated - return customVersion < defaultVersion; - } - catch (Exception ex) - { - AppLogger.Error($"Error comparing charmap versions: {ex.Message}"); - return false; // Don't treat as outdated if comparison failed - } } ///