diff --git a/Assets/Cryville/Crtr/Config/ConfigScene.cs b/Assets/Cryville/Crtr/Config/ConfigScene.cs index f560007..4507775 100644 --- a/Assets/Cryville/Crtr/Config/ConfigScene.cs +++ b/Assets/Cryville/Crtr/Config/ConfigScene.cs @@ -1,7 +1,7 @@ using Newtonsoft.Json; +using System; using System.IO; using System.Text; -using System; using UnityEngine; using UnityEngine.SceneManagement; @@ -10,6 +10,9 @@ namespace Cryville.Crtr.Config { [SerializeField] Transform m_content; + [SerializeField] + SettingsPanel m_genericConfigPanel; + [SerializeField] InputConfigPanel m_inputConfigPanel; @@ -43,6 +46,9 @@ namespace Cryville.Crtr.Config { }); } } + + m_genericConfigPanel.Target = _rscfg.generic; + var proxy = new InputProxy(ruleset.Root, null); proxy.LoadFrom(_rscfg.inputs); m_inputConfigPanel.proxy = proxy; diff --git a/Assets/Cryville/Crtr/Config/RulesetConfig.cs b/Assets/Cryville/Crtr/Config/RulesetConfig.cs index b650427..707ec7f 100644 --- a/Assets/Cryville/Crtr/Config/RulesetConfig.cs +++ b/Assets/Cryville/Crtr/Config/RulesetConfig.cs @@ -1,12 +1,18 @@ -using System.Collections.Generic; +using Newtonsoft.Json; +using System.Collections.Generic; namespace Cryville.Crtr.Config { public class RulesetConfig { - public Dictionary inputs - = new Dictionary(); - } - public class InputConfigEntry { - public string handler; - public int type; + public Generic generic = new Generic(); + public class Generic { + [JsonProperty("skin")] + public string Skin { get; set; } + } + public Dictionary inputs + = new Dictionary(); + public class InputEntry { + public string handler; + public int type; + } } } diff --git a/Assets/Cryville/Crtr/InputProxy.cs b/Assets/Cryville/Crtr/InputProxy.cs index f2d5644..ace7d56 100644 --- a/Assets/Cryville/Crtr/InputProxy.cs +++ b/Assets/Cryville/Crtr/InputProxy.cs @@ -37,7 +37,7 @@ namespace Cryville.Crtr { readonly Dictionary _use = new Dictionary(); readonly Dictionary> _rev = new Dictionary>(); public event EventHandler ProxyChanged; - public void LoadFrom(Dictionary config) { + public void LoadFrom(Dictionary config) { foreach (var cfg in config) { Set(new InputProxyEntry { Target = cfg.Key, @@ -48,10 +48,10 @@ namespace Cryville.Crtr { }); } } - public void SaveTo(Dictionary config) { + public void SaveTo(Dictionary config) { config.Clear(); foreach (var p in _tproxies) { - config.Add(p.Key, new InputConfigEntry { + config.Add(p.Key, new RulesetConfig.InputEntry { handler = ReflectionHelper.GetNamespaceQualifiedName(p.Value.Source.Value.Handler.GetType()), type = p.Value.Source.Value.Type });