mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-12 06:54:33 -05:00
allow for no custom charmap to be present
This commit is contained in:
parent
78194677c2
commit
474f04869c
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user