From f522a1a398f62f143a13f3994f97f68f1e7ad9f7 Mon Sep 17 00:00:00 2001 From: ThatZeoMan <67521686+ThatZeoMan@users.noreply.github.com> Date: Thu, 18 Aug 2022 22:36:47 -0500 Subject: [PATCH] it just keeps getting worse old plan abandoned, now properties are hardcoded --- Assets/Scenes/Editor.unity | 46 +++++++++++++++---- Assets/Scripts/LevelEditor/Editor.cs | 8 +++- .../LevelEditor/Properties/PropController.cs | 7 ++- .../LevelEditor/Properties/PropList.meta | 8 ++++ .../Properties/PropList/RemixName.cs | 17 +++++++ .../Properties/PropList/RemixName.cs.meta | 11 +++++ .../LevelEditor/Properties/PropertyDefn.cs | 2 +- .../Properties/RemixParameterManager.cs | 35 +++++++++++++- 8 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 Assets/Scripts/LevelEditor/Properties/PropList.meta create mode 100644 Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs create mode 100644 Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs.meta diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index ff7947d7a..bd0e53536 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -1337,7 +1337,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: "AWWWWWWW BWWWWWWW\u200B" + m_text: "\u200B" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} m_sharedMaterial: {fileID: 8580487687356851718, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} @@ -18737,7 +18737,7 @@ MonoBehaviour: m_ChildControlWidth: 0 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 - m_ChildScaleHeight: 0 + m_ChildScaleHeight: 1 m_ReverseArrangement: 0 --- !u!114 &830452354 MonoBehaviour: @@ -24292,7 +24292,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -408.98007, y: -17} + m_AnchoredPosition: {x: -408.98013, y: -17} m_SizeDelta: {x: -817.96, y: -46.29} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1118147045 @@ -25730,7 +25730,6 @@ RectTransform: m_Children: - {fileID: 1344658867} - {fileID: 2009181867} - - {fileID: 1252591648} m_Father: {fileID: 1745456516} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -27527,6 +27526,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1252591648} + - component: {fileID: 1252591649} m_Layer: 5 m_Name: String m_TagString: Untagged @@ -27543,18 +27543,31 @@ RectTransform: m_GameObject: {fileID: 1252591647} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1.0000796, y: 1.0000796, z: 1.0000796} + m_LocalScale: {x: 1.0000798, y: 1.0000798, z: 1.0000798} m_Children: - {fileID: 1980463954} - {fileID: 1425536043} - m_Father: {fileID: 1167667137} - m_RootOrder: 2 + m_Father: {fileID: 1344658867} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: -240.99994, y: 263.99997} m_SizeDelta: {x: 537.35, y: 50} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1252591649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1252591647} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dfd9c4dee49957d4da897e02634ce6db, type: 3} + m_Name: + m_EditorClassIdentifier: + content: {fileID: 0} --- !u!1 &1254178913 GameObject: m_ObjectHideFlags: 0 @@ -30604,7 +30617,8 @@ RectTransform: m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] + m_Children: + - {fileID: 1252591648} m_Father: {fileID: 1167667137} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -31554,14 +31568,26 @@ MonoBehaviour: m_Calls: [] m_OnValueChanged: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 1252591649} + m_TargetAssemblyTypeName: HeavenStudio.Properties.RemixName, Assembly-CSharp + m_MethodName: Refresh + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_OnTouchScreenKeyboardStatusChanged: m_PersistentCalls: m_Calls: [] m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_CustomCaretColor: 0 m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} - m_Text: AWWWWWWW BWWWWWWW + m_Text: m_CaretBlinkRate: 0.85 m_CaretWidth: 1 m_ReadOnly: 0 diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 24333ec38..3a7f23632 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -507,8 +507,12 @@ namespace HeavenStudio.Editor return json; } - public string GetPropertiesJson() => - JsonConvert.SerializeObject(Properties.PropController.instance.properties); + public string GetPropertiesJson() + { + string json = string.Empty; + json = JsonConvert.SerializeObject(Properties.PropController.instance.properties); + return json; + } public void SetGameEventTitle(string txt) { diff --git a/Assets/Scripts/LevelEditor/Properties/PropController.cs b/Assets/Scripts/LevelEditor/Properties/PropController.cs index 0e10964ba..ff2fe8860 100644 --- a/Assets/Scripts/LevelEditor/Properties/PropController.cs +++ b/Assets/Scripts/LevelEditor/Properties/PropController.cs @@ -55,11 +55,15 @@ namespace HeavenStudio.Properties [Serializable] public class Properties { + public static Properties instance { get; private set; } = new Properties(); + //this is just copied from the beatmap lol - public string levelName = "test"; + public string levelName = "asdf"; public string levelCreator = "testCreator"; public int Number; + public string datamodel; + public object this[string propertyName] { get @@ -78,7 +82,6 @@ namespace HeavenStudio.Properties } } } - } public class PropController diff --git a/Assets/Scripts/LevelEditor/Properties/PropList.meta b/Assets/Scripts/LevelEditor/Properties/PropList.meta new file mode 100644 index 000000000..ee0d72713 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Properties/PropList.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 80e5db7602a2b044ba965c556335a757 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs b/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs new file mode 100644 index 000000000..05a69fccc --- /dev/null +++ b/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs @@ -0,0 +1,17 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace HeavenStudio.Properties +{ + public class RemixName : MonoBehaviour + { + [SerializeField] private GameObject content; + + public void Refresh(string content) + { + Properties.instance.levelName = content; + Debug.Log(Properties.instance.levelName); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs.meta b/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs.meta new file mode 100644 index 000000000..b1c1c5c04 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Properties/PropList/RemixName.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dfd9c4dee49957d4da897e02634ce6db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Properties/PropertyDefn.cs b/Assets/Scripts/LevelEditor/Properties/PropertyDefn.cs index 6005dea5b..dd068bf93 100644 --- a/Assets/Scripts/LevelEditor/Properties/PropertyDefn.cs +++ b/Assets/Scripts/LevelEditor/Properties/PropertyDefn.cs @@ -15,7 +15,7 @@ namespace HeavenStudio.Properties { public TMP_Text caption; - [SerializeField] private PropManager parameterManager; + [SerializeField] private RemixParameterManager parameterManager; [Header("Integer and Float")] [Space(10)] diff --git a/Assets/Scripts/LevelEditor/Properties/RemixParameterManager.cs b/Assets/Scripts/LevelEditor/Properties/RemixParameterManager.cs index 4b38e5560..1781e4ac0 100644 --- a/Assets/Scripts/LevelEditor/Properties/RemixParameterManager.cs +++ b/Assets/Scripts/LevelEditor/Properties/RemixParameterManager.cs @@ -6,8 +6,11 @@ using HeavenStudio.Editor.Track; namespace HeavenStudio.Properties { - public class EventParameterManager : MonoBehaviour + public class RemixParameterManager : MonoBehaviour { + [Header("General References")] + [SerializeField] private GameObject eventSelector; + [Header("Property Prefabs")] [SerializeField] private GameObject IntegerP; [SerializeField] private GameObject FloatP; @@ -16,6 +19,36 @@ namespace HeavenStudio.Properties [SerializeField] private GameObject ColorP; [SerializeField] private GameObject StringP; + public bool active; + + public void StartParams(Beatmap.Entity entity) + { + active = true; + AddParams(entity); + } + + private void AddParams(Beatmap.Entity entity) + { + var minigame = EventCaller.instance.GetMinigame(Properties.instance.datamodel.Split(0)); + int actionIndex = minigame.actions.IndexOf(minigame.actions.Find(c => c.actionName == Properties.instance.datamodel.Split(1))); + Minigames.GameAction action = minigame.actions[actionIndex]; + + if (action.parameters != null) + { + + for (int i = 0; i < action.parameters.Count; i++) + { + object param = action.parameters[i].parameter; + string caption = action.parameters[i].propertyCaption; + string propertyName = action.parameters[i].propertyName; + string tooltip = action.parameters[i].tooltip; + + AddParam(propertyName, param, caption); + } + + active = true; + } + } private void AddParam(string propertyName, object type, string caption) {