2023-10-01 18:40:41 +02:00
|
|
|
|
namespace TaikoSoundEditor.Commons.Utils
|
2023-08-16 18:40:36 +02:00
|
|
|
|
{
|
|
|
|
|
public static class Config
|
|
|
|
|
{
|
|
|
|
|
private static IniFile CreateIniFile()
|
|
|
|
|
{
|
|
|
|
|
var ini = new IniFile();
|
2024-03-21 17:32:32 +01:00
|
|
|
|
if(!ini.KeyExists("MusicOrderSort")) ini.Write(MusicOrderSortProperty, MusicOrderSortValueGenre);
|
2023-08-16 18:40:36 +02:00
|
|
|
|
return ini;
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-18 17:53:43 +02:00
|
|
|
|
public static readonly DatatableIO DatatableIO = new DatatableIO();
|
|
|
|
|
|
2023-08-16 18:40:36 +02:00
|
|
|
|
public static readonly IniFile IniFile = CreateIniFile();
|
|
|
|
|
|
|
|
|
|
public static void SetMusicOrderSortById() => IniFile.Write(MusicOrderSortProperty, MusicOrderSortValueId);
|
|
|
|
|
public static void SetMusicOrderSortByGenre() => IniFile.Write(MusicOrderSortProperty, MusicOrderSortValueGenre);
|
2024-03-21 17:32:32 +01:00
|
|
|
|
public static void SetMusicOrderSortByTitle() => IniFile.Write(MusicOrderSortProperty, MusicOrderSortValueTitle);
|
|
|
|
|
|
|
|
|
|
public static void SetMusicOrderNoSort() => IniFile.Write(MusicOrderSortProperty, MusicOrderSortValueNoSort);
|
2023-08-16 18:40:36 +02:00
|
|
|
|
|
2023-10-01 18:40:41 +02:00
|
|
|
|
public static string DatatableDefPath
|
|
|
|
|
{
|
|
|
|
|
get => IniFile.Read(DatatableDefPathProperty);
|
|
|
|
|
set => IniFile.Write(DatatableDefPathProperty, value);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-21 12:02:33 +01:00
|
|
|
|
public static string DatatablesPath
|
|
|
|
|
{
|
|
|
|
|
get => IniFile.Read("DatatablePath");
|
|
|
|
|
set => IniFile.Write("DatatablePath", value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string FumenKey
|
|
|
|
|
{
|
|
|
|
|
get => IniFile.Read("FumenKey");
|
|
|
|
|
set => IniFile.Write("FumenKey", value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string DatatableKey
|
|
|
|
|
{
|
|
|
|
|
get => IniFile.Read("DatatableKey");
|
|
|
|
|
set => IniFile.Write("DatatableKey", value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static bool UseEncryption
|
|
|
|
|
{
|
|
|
|
|
get => System.Convert.ToBoolean(IniFile.Read("UseEncryption") == "True" ? true : false);
|
|
|
|
|
set => IniFile.Write("UseEncryption", value.ToString());
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-16 18:40:36 +02:00
|
|
|
|
public static string MusicOrderSort => IniFile.Read(MusicOrderSortProperty);
|
|
|
|
|
|
|
|
|
|
public static string MusicOrderSortProperty = "MusicOrderSort";
|
2023-10-01 18:40:41 +02:00
|
|
|
|
public static string DatatableDefPathProperty = "DatatableDef";
|
2023-08-16 18:40:36 +02:00
|
|
|
|
|
|
|
|
|
public static string MusicOrderSortValueId = "Id";
|
2024-03-21 17:32:32 +01:00
|
|
|
|
public static string MusicOrderSortValueGenre = "Genre";
|
|
|
|
|
public static string MusicOrderSortValueTitle = "Title";
|
|
|
|
|
public static string MusicOrderSortValueNoSort = "None";
|
2023-08-16 18:40:36 +02:00
|
|
|
|
}
|
|
|
|
|
}
|