diff --git a/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs b/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs
index 762559db4..c16c75c98 100644
--- a/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs
+++ b/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs
@@ -97,7 +97,14 @@ namespace HeavenStudio.Editor
eventSelector.SetActive(false);
this.entity = entity;
- string col = EditorTheme.theme.properties.LayerColors[(int)entity["track"]];
+ string col = (int)entity["track"] switch
+ {
+ 1 => EditorTheme.theme.properties.Layer2Col,
+ 2 => EditorTheme.theme.properties.Layer3Col,
+ 3 => EditorTheme.theme.properties.Layer4Col,
+ 4 => EditorTheme.theme.properties.Layer5Col,
+ _ => EditorTheme.theme.properties.Layer1Col
+ };
Editor.instance.SetGameEventTitle($"Properties for {action.displayName} on Beat {entity.beat.ToString("F2")} on Track {(int)entity["track"] + 1}");
DestroyParams();
@@ -138,7 +145,6 @@ namespace HeavenStudio.Editor
Debug.LogError("Can't make property interface of type: " + typeType);
return null;
}
- print(propertyPrefab.name);
GameObject input = Instantiate(propertyPrefab, transform);
input.SetActive(true);
diff --git a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs
index a9c4213dc..f703011fe 100644
--- a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs
+++ b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs
@@ -892,7 +892,7 @@ namespace HeavenStudio.Editor.Track
EntityTypes.Integer intVal => intVal.val,
EntityTypes.Float floatVal => floatVal.val,
EntityTypes.Button buttonVal => buttonVal.defaultLabel,
- EntityTypes.Dropdown ddVal => new EntityTypes.DropdownObj(ddVal.defaultValue, ddVal.values),
+ EntityTypes.Dropdown ddVal => new EntityTypes.DropdownObj(ddVal),
_ => ep[i].parameter,
};
diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs
index 15c60e545..cc749c4a6 100644
--- a/Assets/Scripts/Minigames.cs
+++ b/Assets/Scripts/Minigames.cs
@@ -17,6 +17,7 @@ using System;
using System.IO;
using System.Linq;
using UnityEngine.Assertions.Must;
+using Newtonsoft.Json.Linq;
namespace HeavenStudio
{
@@ -266,6 +267,13 @@ namespace HeavenStudio
e.dynamicData[param.propertyName] = (int)e[param.propertyName];
else if (type == typeof(EntityTypes.Float))
e.dynamicData[param.propertyName] = (float)e[param.propertyName];
+ else if (type == typeof(EntityTypes.Button))
+ e.dynamicData[param.propertyName] = (string)e[param.propertyName];
+ else if (type == typeof(EntityTypes.Dropdown)) {
+ JValue value = e[param.propertyName]["value"];
+ JArray values = e[param.propertyName]["Values"];
+ e.dynamicData[param.propertyName] = new EntityTypes.DropdownObj((int)value, values.Select(x => (string)x).ToList());
+ }
else if (type == typeof(EntityTypes.Resource))
e.dynamicData[param.propertyName] = (EntityTypes.Resource)e[param.propertyName];
else if (type.IsEnum)
diff --git a/Assets/Scripts/Util/EntityTypes.cs b/Assets/Scripts/Util/EntityTypes.cs
index 4f954d9e9..be539739a 100644
--- a/Assets/Scripts/Util/EntityTypes.cs
+++ b/Assets/Scripts/Util/EntityTypes.cs
@@ -105,6 +105,14 @@ namespace HeavenStudio
onValueChanged = null;
}
+
+ public DropdownObj(Dropdown dd)
+ {
+ value = dd.defaultValue;
+ Values = dd.values ?? new();
+
+ onValueChanged = null;
+ }
}
public struct Resource