-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathConfigMigration_V2_3_V2_4.cs
More file actions
73 lines (60 loc) · 2.48 KB
/
ConfigMigration_V2_3_V2_4.cs
File metadata and controls
73 lines (60 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using AquaMai.Config.Interfaces;
using Tomlet.Models;
namespace AquaMai.Config.Migration;
public class ConfigMigration_V2_3_V2_4 : IConfigMigration
{
public string FromVersion => "2.3";
public string ToVersion => "2.4";
public ConfigView Migrate(ConfigView src)
{
var dst = (ConfigView)src.Clone();
dst.SetValue("Version", ToVersion);
if (src.TryGetValue<bool>("GameSystem.KeyMap.DisableIO4", out var disableIO4))
{
dst.SetValue("GameSystem.KeyMap.DisableIO4_1P", disableIO4);
dst.SetValue("GameSystem.KeyMap.DisableIO4_2P", disableIO4);
dst.SetValue("GameSystem.KeyMap.DisableIO4System", disableIO4);
dst.Remove("GameSystem.KeyMap.DisableIO4");
}
if (src.IsSectionEnabled("GameSystem.SkipBoardNoCheck"))
{
dst.EnsureDictionary("GameSystem.OldCabLightBoardSupport");
dst.Remove("GameSystem.SkipBoardNoCheck");
}
if (src.TryGetValue<bool>("GameSystem.MaimollerIO.P1", out var mml1p))
{
dst.SetValue("GameSystem.MaimollerIO.Touch1p", mml1p);
dst.SetValue("GameSystem.MaimollerIO.Button1p", mml1p);
dst.SetValue("GameSystem.MaimollerIO.Led1p", mml1p);
dst.Remove("GameSystem.MaimollerIO.P1");
}
if (src.TryGetValue<bool>("GameSystem.MaimollerIO.P2", out var mml2p))
{
dst.SetValue("GameSystem.MaimollerIO.Touch2p", mml2p);
dst.SetValue("GameSystem.MaimollerIO.Button2p", mml2p);
dst.SetValue("GameSystem.MaimollerIO.Led2p", mml2p);
dst.Remove("GameSystem.MaimollerIO.P2");
}
if (src.TryGetValue<bool>("GameSystem.AdxHidInput.Io4Compact", out var adxDisableButtons))
{
dst.SetValue("GameSystem.AdxHidInput.DisableButtons", adxDisableButtons);
dst.Remove("GameSystem.AdxHidInput.Io4Compact");
}
if (src.IsSectionEnabled("GameSystem.UnstableRate"))
{
dst.EnsureDictionary("Utils.UnstableRate");
dst.Remove("GameSystem.UnstableRate");
}
if (src.IsSectionEnabled("Fancy.CustomSkinsPlusStatic"))
{
dst.EnsureDictionary("Fancy.ResourcesOverride");
dst.Remove("Fancy.CustomSkinsPlusStatic");
}
if (src.IsSectionEnabled("Fancy.RsOverride"))
{
dst.EnsureDictionary("Fancy.ResourcesOverride");
dst.Remove("Fancy.RsOverride");
}
return dst;
}
}