Skip to content

Commit

Permalink
Merge pull request #175 from TheBestAstroNOT/main
Browse files Browse the repository at this point in the history
Finally fixed the music for the events which were not covered by Battle Themes
  • Loading branch information
MadMax1960 authored Jul 27, 2024
2 parents 05dd8a3 + d4e4f4d commit 1706106
Show file tree
Hide file tree
Showing 20 changed files with 7 additions and 83 deletions.
49 changes: 7 additions & 42 deletions code/p3rpc.femc/p3rpc.femc/Template/Configuration/Configurable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,6 @@ namespace p3rpc.femc.Template.Configuration
WriteIndented = true
};

public static class JsonUtils
{
// Use same serialization options as Reloaded.
private static JsonSerializerOptions serializerOptions { get; } = new JsonSerializerOptions()
{
Converters = { new JsonStringEnumConverter() },
WriteIndented = true
};

public static T DeserializeFile<T>(string file, string type = "")
{
var obj = JsonSerializer.Deserialize<T>(File.ReadAllText(file), serializerOptions);
return obj ?? throw new Exception("Json Serialisation Failed.");
}

public static void SerializeFile<T>(T obj, string file)
{
var objText = JsonSerializer.Serialize(obj, serializerOptions);
File.WriteAllText(file, objText);
}
}

/* Events */

/// <summary>
Expand Down Expand Up @@ -156,24 +134,11 @@ private void OnSave()
/* Utility */
private static TParentType ReadFrom(string filePath, string configName)
{
try
{
var result = (File.Exists(filePath)
? JsonSerializer.Deserialize<TParentType>(File.ReadAllBytes(filePath), SerializerOptions)
: new TParentType()) ?? new TParentType();
result.Initialize(filePath, configName);
return result;
}
catch (Exception)
{
var defaultConfig = new Config();
JsonUtils.SerializeFile(defaultConfig, filePath);
var result = (File.Exists(filePath)
? JsonSerializer.Deserialize<TParentType>(File.ReadAllBytes(filePath), SerializerOptions)
: new TParentType()) ?? new TParentType();
result.Initialize(filePath, configName);
return result;
}
}
var result = (File.Exists(filePath)
? JsonSerializer.Deserialize<TParentType>(File.ReadAllBytes(filePath), SerializerOptions)
: new TParentType()) ?? new TParentType();
result.Initialize(filePath, configName);
return result;
}
}
}
}
28 changes: 0 additions & 28 deletions p3rpc.femc/BGME/Documentation.txt

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4000.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4000.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4001.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4001.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4002.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4002.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4003.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4003.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4004.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4004.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4005.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4005.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4006.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4006.yaml

This file was deleted.

Binary file removed p3rpc.femc/BGME/P3R/4007.hca
Binary file not shown.
1 change: 0 additions & 1 deletion p3rpc.femc/BGME/P3R/4007.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions p3rpc.femc/BGME/P3R/config.yaml

This file was deleted.

Binary file added p3rpc.femc/Ryo/P3R/bgm/link_26.hca
Binary file not shown.

0 comments on commit 1706106

Please sign in to comment.