JSL-Related Improvements (#679)

* *don't* cause a stack overflow when polling split controller

* update JSL (DualSense Edge support)

add ability to update controller bindings

* (temporarily) get rid of everything joy-con pair related

* prepare the new controller

update JSL

* implementation of joycon pair

* properly do the material

* finish implementation
This commit is contained in:
minenice55
2024-02-04 01:54:32 -05:00
committed by minenice55
parent a9017bf06c
commit a874b18ccb
20 changed files with 959 additions and 699 deletions

View File

@ -32,27 +32,44 @@ namespace HeavenStudio.Editor
if (File.Exists(Application.persistentDataPath + "/editorTheme.json"))
{
string json = File.ReadAllText(Application.persistentDataPath + "/editorTheme.json");
theme = JsonConvert.DeserializeObject<Theme>(json);
// Naive way of doing it? Possibly, but we should have a theme editor in the future.
if (defaultTheme.properties.LayerColors != null)
if (json == "")
{
theme.properties.LayerColors = new string[]
PersistentDataManager.SaveTheme(ThemeTXT.text);
theme = defaultTheme;
theme.SetLayersGradient();
return;
}
try
{
theme = JsonConvert.DeserializeObject<Theme>(json);
// Naive way of doing it? Possibly, but we should have a theme editor in the future.
if (defaultTheme.properties.LayerColors != null)
{
theme.properties.Layer1Col,
theme.properties.Layer2Col,
theme.properties.Layer3Col,
theme.properties.Layer4Col,
theme.properties.Layer5Col
};
// Create a function for this in the future.
var savedTheme = JsonConvert.SerializeObject(theme, Formatting.Indented, new JsonSerializerSettings()
{
TypeNameHandling = TypeNameHandling.None,
NullValueHandling = NullValueHandling.Include,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
});
PersistentDataManager.SaveTheme(savedTheme);
theme.properties.LayerColors = new string[]
{
theme.properties.Layer1Col,
theme.properties.Layer2Col,
theme.properties.Layer3Col,
theme.properties.Layer4Col,
theme.properties.Layer5Col
};
// Create a function for this in the future.
var savedTheme = JsonConvert.SerializeObject(theme, Formatting.Indented, new JsonSerializerSettings()
{
TypeNameHandling = TypeNameHandling.None,
NullValueHandling = NullValueHandling.Include,
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
});
PersistentDataManager.SaveTheme(savedTheme);
}
}
catch
{
PersistentDataManager.SaveTheme(ThemeTXT.text);
theme = defaultTheme;
theme.SetLayersGradient();
return;
}
}
else