From cf2850ccb108ed647b2ed5dee7e58f6c668cd0ae Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sat, 20 Aug 2022 23:54:09 -0400 Subject: [PATCH] display action real name in aproppriate places - make text on entities larger - fix bug with enum properties - show beat of editing entity when viewing properties --- Assets/Scenes/Editor.unity | 10 +++++----- .../LevelEditor/EventSelector/EventParameterManager.cs | 2 +- .../LevelEditor/EventSelector/EventPropertyPrefab.cs | 4 +++- .../LevelEditor/EventSelector/GridGameSelector.cs | 4 ++-- Assets/Scripts/LevelEditor/Timeline/Timeline.cs | 9 +++++---- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 4fd53783..b971faf6 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -6340,8 +6340,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: -0.047210693, y: 0.000017166138} - m_SizeDelta: {x: 36.806, y: 44.84} + m_AnchoredPosition: {x: -0.039999, y: 0.000017166138} + m_SizeDelta: {x: 36.813, y: 44.84} m_Pivot: {x: 1, y: 0.5} --- !u!114 &258006093 MonoBehaviour: @@ -6402,7 +6402,7 @@ MonoBehaviour: m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 - m_lineSpacing: 0 + m_lineSpacing: -100 m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 @@ -19238,7 +19238,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1589389272} m_HandleRect: {fileID: 1589389271} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -24820,7 +24820,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, 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_Pivot: {x: 0.5, y: 1} --- !u!114 &1154875944 diff --git a/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs b/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs index c0e1c16d..8dcbb582 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/EventParameterManager.cs @@ -78,7 +78,7 @@ namespace HeavenStudio.Editor eventSelector.SetActive(false); this.entity = entity; - Editor.instance.SetGameEventTitle($"Properties for {entity.datamodel}"); + Editor.instance.SetGameEventTitle($"Properties for {entity.datamodel} at beat {entity.beat}"); DestroyParams(); diff --git a/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs index 593b7f2c..e45cc825 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/EventPropertyPrefab.cs @@ -172,7 +172,9 @@ namespace HeavenStudio.Editor dropdown.value = selected; dropdown.onValueChanged.AddListener(_ => - parameterManager.entity[propertyName] = Enum.ToObject(enumType, dropdown.value) + { + parameterManager.entity[propertyName] = (int) enumVals.GetValue(dropdown.value); + } ); break; diff --git a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs index 234067f5..b5147b65 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs @@ -140,7 +140,7 @@ namespace HeavenStudio.Editor if (!EventCaller.FXOnlyGames().Contains(EventCaller.instance.GetMinigame(mg.name))) { GameObject sg = Instantiate(EventRef, eventsParent); - sg.GetComponent().text = "switchGame"; + sg.GetComponent().text = "Switch Game"; sg.SetActive(true); sg.GetComponent().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB(); } @@ -149,7 +149,7 @@ namespace HeavenStudio.Editor { if (mg.actions[i].actionName == "switchGame" || mg.actions[i].hidden) continue; GameObject g = Instantiate(EventRef, eventsParent); - g.GetComponent().text = mg.actions[i].actionName; + g.GetComponent().text = mg.actions[i].displayName; g.SetActive(true); } } diff --git a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs index 71f35d14..162eacb8 100644 --- a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs +++ b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs @@ -505,9 +505,11 @@ namespace HeavenStudio.Editor.Track public TimelineEventObj AddEventObject(string eventName, bool dragNDrop = false, Vector3 pos = new Vector3(), Beatmap.Entity entity = null, bool addEvent = false, string eventId = "") { + var game = EventCaller.instance.GetMinigame(eventName.Split(0)); + var action = EventCaller.instance.GetGameAction(game, eventName.Split(1)); GameObject g = Instantiate(TimelineEventObjRef.gameObject, TimelineEventObjRef.parent); g.transform.localPosition = pos; - g.transform.GetChild(3).GetComponent().text = eventName.Split('/')[1]; + g.transform.GetChild(3).GetComponent().text = action.displayName; TimelineEventObj eventObj = g.GetComponent(); @@ -572,9 +574,8 @@ namespace HeavenStudio.Editor.Track tempEntity = en; - // default param value - var game = EventCaller.instance.GetMinigame(eventName.Split(0)); - var ep = EventCaller.instance.GetGameAction(game, eventName.Split(1)).parameters; + // default param values + var ep = action.parameters; if (ep != null) {