mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
fix nasty bugs with saving / loading
- duplicate property names no longer soft crash loading (thanks, tap trial) - fix remix saving nothing music
This commit is contained in:
parent
aa4f9440cd
commit
45bbcc8fba
4 changed files with 77 additions and 39 deletions
|
@ -12254,7 +12254,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 0, y: -40}
|
m_AnchoredPosition: {x: 0, y: -25}
|
||||||
m_SizeDelta: {x: 134, y: 40}
|
m_SizeDelta: {x: 134, y: 40}
|
||||||
m_Pivot: {x: 0, y: 0.5}
|
m_Pivot: {x: 0, y: 0.5}
|
||||||
--- !u!114 &506932090
|
--- !u!114 &506932090
|
||||||
|
@ -23924,7 +23924,7 @@ RectTransform:
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: -31.000061, y: -91.21527}
|
m_AnchoredPosition: {x: -31.000061, y: -91.21527}
|
||||||
m_SizeDelta: {x: 1000, y: 80}
|
m_SizeDelta: {x: 1000, y: 50}
|
||||||
m_Pivot: {x: 0.5, y: 0.5}
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
--- !u!114 &937032844
|
--- !u!114 &937032844
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -29713,7 +29713,7 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0.5}
|
m_AnchorMin: {x: 0, y: 0.5}
|
||||||
m_AnchorMax: {x: 1, y: 0.5}
|
m_AnchorMax: {x: 1, y: 0.5}
|
||||||
m_AnchoredPosition: {x: 0, y: 129.9111}
|
m_AnchoredPosition: {x: 0, y: 129.91107}
|
||||||
m_SizeDelta: {x: 0, y: 0}
|
m_SizeDelta: {x: 0, y: 0}
|
||||||
m_Pivot: {x: 0.5, y: 1}
|
m_Pivot: {x: 0.5, y: 1}
|
||||||
--- !u!114 &1154875944
|
--- !u!114 &1154875944
|
||||||
|
@ -46272,8 +46272,8 @@ MonoBehaviour:
|
||||||
m_faceColor:
|
m_faceColor:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
rgba: 4294967295
|
rgba: 4294967295
|
||||||
m_fontSize: 14
|
m_fontSize: 16
|
||||||
m_fontSizeBase: 14
|
m_fontSizeBase: 16
|
||||||
m_fontWeight: 400
|
m_fontWeight: 400
|
||||||
m_enableAutoSizing: 0
|
m_enableAutoSizing: 0
|
||||||
m_fontSizeMin: 18
|
m_fontSizeMin: 18
|
||||||
|
@ -51696,8 +51696,8 @@ RectTransform:
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 0, y: 1}
|
m_AnchorMax: {x: 0, y: 1}
|
||||||
m_AnchoredPosition: {x: 137, y: -40}
|
m_AnchoredPosition: {x: 137, y: -25}
|
||||||
m_SizeDelta: {x: 1000, y: 80}
|
m_SizeDelta: {x: 1000, y: 50}
|
||||||
m_Pivot: {x: 0, y: 0.5}
|
m_Pivot: {x: 0, y: 0.5}
|
||||||
--- !u!114 &2094676610
|
--- !u!114 &2094676610
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
@ -51756,7 +51756,7 @@ MonoBehaviour:
|
||||||
m_HideSoftKeyboard: 0
|
m_HideSoftKeyboard: 0
|
||||||
m_CharacterValidation: 0
|
m_CharacterValidation: 0
|
||||||
m_RegexValue:
|
m_RegexValue:
|
||||||
m_GlobalPointSize: 14
|
m_GlobalPointSize: 16
|
||||||
m_CharacterLimit: 0
|
m_CharacterLimit: 0
|
||||||
m_OnEndEdit:
|
m_OnEndEdit:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
|
|
|
@ -234,6 +234,8 @@ namespace HeavenStudio
|
||||||
game = EventCaller.instance.GetMinigame(e.datamodel.Split(0));
|
game = EventCaller.instance.GetMinigame(e.datamodel.Split(0));
|
||||||
action = EventCaller.instance.GetGameAction(game, e.datamodel.Split(1));
|
action = EventCaller.instance.GetGameAction(game, e.datamodel.Split(1));
|
||||||
|
|
||||||
|
// Debug.Log($"{game.name} {action.displayName} @ beat {e.beat}");
|
||||||
|
|
||||||
Dictionary<string, dynamic> dynamicData = new Dictionary<string, dynamic>();
|
Dictionary<string, dynamic> dynamicData = new Dictionary<string, dynamic>();
|
||||||
//check each param of the action
|
//check each param of the action
|
||||||
if (action.parameters != null)
|
if (action.parameters != null)
|
||||||
|
@ -242,6 +244,9 @@ namespace HeavenStudio
|
||||||
{
|
{
|
||||||
type = param.parameter.GetType();
|
type = param.parameter.GetType();
|
||||||
pType = e[param.propertyName].GetType();
|
pType = e[param.propertyName].GetType();
|
||||||
|
// Debug.Log($"adding parameter {param.propertyName} of type {type}");
|
||||||
|
if (!dynamicData.ContainsKey(param.propertyName))
|
||||||
|
{
|
||||||
if (pType == type)
|
if (pType == type)
|
||||||
{
|
{
|
||||||
dynamicData.Add(param.propertyName, e[param.propertyName]);
|
dynamicData.Add(param.propertyName, e[param.propertyName]);
|
||||||
|
@ -260,7 +265,13 @@ namespace HeavenStudio
|
||||||
dynamicData.Add(param.propertyName, Convert.ChangeType(e[param.propertyName], type));
|
dynamicData.Add(param.propertyName, Convert.ChangeType(e[param.propertyName], type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"Property {param.propertyName} already exists in the entity's dynamic data! Skipping...");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dynamicBeatmap.entities.Add(new DynamicEntity()
|
dynamicBeatmap.entities.Add(new DynamicEntity()
|
||||||
{
|
{
|
||||||
beat = e.beat,
|
beat = e.beat,
|
||||||
|
@ -332,6 +343,8 @@ namespace HeavenStudio
|
||||||
if (action.parameters != null)
|
if (action.parameters != null)
|
||||||
{
|
{
|
||||||
foreach (var param in action.parameters)
|
foreach (var param in action.parameters)
|
||||||
|
{
|
||||||
|
if (!dynamicData.ContainsKey(param.propertyName))
|
||||||
{
|
{
|
||||||
type = param.parameter.GetType();
|
type = param.parameter.GetType();
|
||||||
pType = e[param.propertyName].GetType();
|
pType = e[param.propertyName].GetType();
|
||||||
|
@ -342,19 +355,24 @@ namespace HeavenStudio
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (type == typeof(EntityTypes.Integer))
|
if (type == typeof(EntityTypes.Integer))
|
||||||
dynamicData.Add(param.propertyName, (int) e[param.propertyName]);
|
dynamicData.Add(param.propertyName, (int)e[param.propertyName]);
|
||||||
else if (type == typeof(EntityTypes.Float))
|
else if (type == typeof(EntityTypes.Float))
|
||||||
dynamicData.Add(param.propertyName, (float) e[param.propertyName]);
|
dynamicData.Add(param.propertyName, (float)e[param.propertyName]);
|
||||||
else if (type == typeof(EasingFunction.Ease) && pType == typeof(string))
|
else if (type == typeof(EasingFunction.Ease) && pType == typeof(string))
|
||||||
dynamicData.Add(param.propertyName, Enum.Parse(typeof(EasingFunction.Ease), (string) e[param.propertyName]));
|
dynamicData.Add(param.propertyName, Enum.Parse(typeof(EasingFunction.Ease), (string)e[param.propertyName]));
|
||||||
else if (type.IsEnum)
|
else if (type.IsEnum)
|
||||||
dynamicData.Add(param.propertyName, (int) e[param.propertyName]);
|
dynamicData.Add(param.propertyName, (int)e[param.propertyName]);
|
||||||
else if (pType == typeof(Newtonsoft.Json.Linq.JObject))
|
else if (pType == typeof(Newtonsoft.Json.Linq.JObject))
|
||||||
dynamicData.Add(param.propertyName, e[param.propertyName].ToObject(type));
|
dynamicData.Add(param.propertyName, e[param.propertyName].ToObject(type));
|
||||||
else
|
else
|
||||||
dynamicData.Add(param.propertyName, Convert.ChangeType(e[param.propertyName], type));
|
dynamicData.Add(param.propertyName, Convert.ChangeType(e[param.propertyName], type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"Property {param.propertyName} already exists in the entity's dynamic data! Skipping...");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
e.DynamicData = dynamicData;
|
e.DynamicData = dynamicData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,18 +307,31 @@ namespace HeavenStudio.Editor
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (clip != null)
|
if (clip != null)
|
||||||
MusicBytes = OggVorbis.VorbisPlugin.GetOggVorbis(Conductor.instance.musicSource.clip, 1);
|
MusicBytes = OggVorbis.VorbisPlugin.GetOggVorbis(clip, 1);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MusicBytes = null;
|
MusicBytes = null;
|
||||||
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
|
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (System.Exception)
|
catch (System.ArgumentNullException)
|
||||||
{
|
{
|
||||||
|
clip = null;
|
||||||
MusicBytes = null;
|
MusicBytes = null;
|
||||||
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
|
Debug.LogWarning("Failed to load music file! The stream is currently empty.");
|
||||||
}
|
}
|
||||||
|
catch (System.ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
clip = null;
|
||||||
|
MusicBytes = null;
|
||||||
|
Debug.LogWarning("Failed to load music file! The stream is malformed.");
|
||||||
|
}
|
||||||
|
catch (System.ArgumentException)
|
||||||
|
{
|
||||||
|
clip = null;
|
||||||
|
MusicBytes = null;
|
||||||
|
Debug.LogWarning("Failed to load music file! Only 1 or 2 channels are supported!.");
|
||||||
|
}
|
||||||
|
|
||||||
return clip;
|
return clip;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,6 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
if (chart.properties.ContainsKey(property.tag))
|
if (chart.properties.ContainsKey(property.tag))
|
||||||
{
|
{
|
||||||
Debug.Log($"Found property: {property.tag} with label {property.label}");
|
|
||||||
infoContainer.AddParam(this, property.tag, chart.properties[property.tag], property.label, property.isReadOnly);
|
infoContainer.AddParam(this, property.tag, chart.properties[property.tag], property.label, property.isReadOnly);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -67,6 +66,14 @@ namespace HeavenStudio.Editor
|
||||||
{
|
{
|
||||||
infoContainer.AddDivider(this);
|
infoContainer.AddDivider(this);
|
||||||
}
|
}
|
||||||
|
else if (property.tag == "heading")
|
||||||
|
{
|
||||||
|
infoContainer.AddDivider(this);
|
||||||
|
}
|
||||||
|
else if (property.tag == "subheading")
|
||||||
|
{
|
||||||
|
infoContainer.AddDivider(this);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.LogWarning("Property Menu generation Warning: Property " + property.tag + " not found, skipping...");
|
Debug.LogWarning("Property Menu generation Warning: Property " + property.tag + " not found, skipping...");
|
||||||
|
|
Loading…
Reference in a new issue