Fix chart importing.
This commit is contained in:
@@ -218,18 +218,24 @@ namespace Cryville.Crtr {
|
|||||||
|
|
||||||
public class Motion : ChartEvent {
|
public class Motion : ChartEvent {
|
||||||
#pragma warning disable IDE1006
|
#pragma warning disable IDE1006
|
||||||
|
string m_motion;
|
||||||
[JsonRequired]
|
[JsonRequired]
|
||||||
public string motion {
|
public string motion {
|
||||||
get { return ToString(); }
|
get { return m_motion == null ? ToString() : m_motion; }
|
||||||
set { LoadFromString(value); }
|
set { LoadFromString(value); }
|
||||||
}
|
}
|
||||||
#pragma warning restore IDE1006
|
#pragma warning restore IDE1006
|
||||||
private void LoadFromString(string s) {
|
private void LoadFromString(string s) {
|
||||||
if (Node != null)
|
if (Node != null)
|
||||||
throw new InvalidOperationException("The motion property can only be set at initialization");
|
throw new InvalidOperationException("The motion property can only be set at initialization");
|
||||||
|
if (ChartPlayer.motionRegistry == null) {
|
||||||
|
m_motion = s;
|
||||||
|
}
|
||||||
|
else {
|
||||||
ChartCompatibilityHandler.MotionStringParser.Parse(s, out name, out Node);
|
ChartCompatibilityHandler.MotionStringParser.Parse(s, out name, out Node);
|
||||||
SubmitPropSrc("value", new VectorSrc(() => Node.Value));
|
SubmitPropSrc("value", new VectorSrc(() => Node.Value));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
string result = Name.ToString();
|
string result = Name.ToString();
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ namespace Cryville.Crtr {
|
|||||||
static float startOffset = 0;
|
static float startOffset = 0;
|
||||||
public static float sv = 16f;
|
public static float sv = 16f;
|
||||||
|
|
||||||
public static Dictionary<Identifier, MotionRegistry> motionRegistry = new Dictionary<Identifier, MotionRegistry>();
|
public static Dictionary<Identifier, MotionRegistry> motionRegistry;
|
||||||
|
|
||||||
public static PdtEvaluator etor;
|
public static PdtEvaluator etor;
|
||||||
#endregion
|
#endregion
|
||||||
@@ -533,6 +533,7 @@ namespace Cryville.Crtr {
|
|||||||
effectManager.Dispose();
|
effectManager.Dispose();
|
||||||
effectManager = null;
|
effectManager = null;
|
||||||
etor = null;
|
etor = null;
|
||||||
|
motionRegistry = null;
|
||||||
Logger.Log("main", 1, "Game", "Stopped");
|
Logger.Log("main", 1, "Game", "Stopped");
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
|
|||||||
Reference in New Issue
Block a user