diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 8d428d3e..278908a7 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -14592,6 +14592,7 @@ MonoBehaviour: EditorThemeBTN: {fileID: 528192061} FullScreenBTN: {fileID: 151246938} TempoFinderBTN: {fileID: 1478799966} + tooltipText: {fileID: 1196204504} discordDuringTesting: 0 canSelect: 1 --- !u!114 &1423699438 diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 1007cce2..437e1c7a 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -50,6 +50,9 @@ namespace RhythmHeavenMania.Editor [SerializeField] private Button FullScreenBTN; [SerializeField] private Button TempoFinderBTN; + [Header("Tooltip")] + public TMP_Text tooltipText; + [Header("Properties")] private bool changedMusic = false; private bool loadedMusic = false; diff --git a/Assets/Scripts/LevelEditor/Tooltip.cs b/Assets/Scripts/LevelEditor/Tooltip.cs index a06805c9..92cf4a65 100644 --- a/Assets/Scripts/LevelEditor/Tooltip.cs +++ b/Assets/Scripts/LevelEditor/Tooltip.cs @@ -50,20 +50,24 @@ namespace RhythmHeavenMania.Editor rectTransform.anchoredPosition = anchoredPosition; } - public static void OnEnter(string tooltipText) + public static void OnEnter(string tooltipText, string altTooltipText) { - instance.OnEnterPrivate(tooltipText); + instance.OnEnterPrivate(tooltipText, altTooltipText); } public static void OnExit() { instance.OnExitPrivate(); + Editor.instance.tooltipText.text = ""; + Editor.instance.tooltipText.ForceMeshUpdate(); } - private void OnEnterPrivate(string tooltipText) + private void OnEnterPrivate(string tooltipText, string altTooltipText) { group.alpha = 1; SetText(tooltipText); + Editor.instance.tooltipText.text = altTooltipText.Replace("\n",""); + Editor.instance.tooltipText.ForceMeshUpdate(); } private void OnExitPrivate() @@ -82,13 +86,16 @@ namespace RhythmHeavenMania.Editor background.sizeDelta = textSize + paddingSize; } - public static void AddTooltip(GameObject g, string tooltipText) + public static void AddTooltip(GameObject g, string tooltipText, string altTooltipText = "") { + if (altTooltipText == "") + altTooltipText = tooltipText; + EventTrigger et = g.AddComponent(); EventTrigger.Entry pointerEnter = new EventTrigger.Entry(); pointerEnter.eventID = EventTriggerType.PointerEnter; - pointerEnter.callback.AddListener((data) => { OnEnter(tooltipText); }); + pointerEnter.callback.AddListener((data) => { OnEnter(tooltipText, altTooltipText); }); EventTrigger.Entry pointerExit = new EventTrigger.Entry(); pointerExit.eventID = EventTriggerType.PointerExit; diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 95b645b6..52674cec 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -72,12 +72,14 @@ namespace RhythmHeavenMania public string propertyName; public object parameter; public string propertyCaption; + public string tooltip; - public Param(string propertyName, object parameter, string propertyCaption) + public Param(string propertyName, object parameter, string propertyCaption, string tooltip = "") { this.propertyName = propertyName; this.parameter = parameter; this.propertyCaption = propertyCaption; + this.tooltip = tooltip; } }