From 20736b6f4bdfeef3c156e18c8cd0805061022d6e Mon Sep 17 00:00:00 2001 From: EliteAsian Date: Tue, 9 May 2023 21:30:49 -0400 Subject: [PATCH] UPDATE TIME --- .../Prefabs/UI/MusicLibrary/SongView.prefab | 59 ++++++++++++++++++- Assets/Script/Constants.cs | 2 +- Assets/Script/UI/MusicLibrary/SongView.cs | 7 +++ .../UI/MusicLibrary/ViewTypes/SongViewType.cs | 6 ++ .../UI/MusicLibrary/ViewTypes/ViewType.cs | 4 ++ 5 files changed, 76 insertions(+), 2 deletions(-) diff --git a/Assets/Prefabs/UI/MusicLibrary/SongView.prefab b/Assets/Prefabs/UI/MusicLibrary/SongView.prefab index bc30c2ea5..214a4109a 100644 --- a/Assets/Prefabs/UI/MusicLibrary/SongView.prefab +++ b/Assets/Prefabs/UI/MusicLibrary/SongView.prefab @@ -694,6 +694,7 @@ GameObject: - component: {fileID: 4559178976173773975} - component: {fileID: 9038120507072457938} - component: {fileID: 91003172277932724} + - component: {fileID: 937450767208845564} m_Layer: 5 m_Name: Icon m_TagString: Untagged @@ -742,7 +743,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.33333334} + m_Color: {r: 1, g: 1, b: 1, a: 0.8} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 @@ -759,6 +760,62 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &937450767208845564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5383822100959049230} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 0 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 91003172277932724} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 6622513572522471069} + m_TargetAssemblyTypeName: YARG.UI.MusicLibrary.SongView, Assembly-CSharp + m_MethodName: IconClick + m_Mode: 1 + 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 --- !u!1 &6846856528720448001 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Script/Constants.cs b/Assets/Script/Constants.cs index e0a612fdd..7a1bab290 100644 --- a/Assets/Script/Constants.cs +++ b/Assets/Script/Constants.cs @@ -2,7 +2,7 @@ namespace YARG { public static class Constants { - public static readonly YargVersion VERSION_TAG = YargVersion.Parse("v0.10.0"); + public static readonly YargVersion VERSION_TAG = YargVersion.Parse("v0.10.1"); // General public const float HIT_MARGIN = 0.095f; diff --git a/Assets/Script/UI/MusicLibrary/SongView.cs b/Assets/Script/UI/MusicLibrary/SongView.cs index 180bd6bd1..ea8d326ba 100644 --- a/Assets/Script/UI/MusicLibrary/SongView.cs +++ b/Assets/Script/UI/MusicLibrary/SongView.cs @@ -106,5 +106,12 @@ public void SecondaryTextClick() { viewType.SecondaryTextClick(); } + + public void IconClick() { + int realIndex = SongSelection.Instance.SelectedIndex + _relativeSongIndex; + var viewType = SongSelection.Instance.Songs[realIndex]; + + viewType.IconClick(); + } } } \ No newline at end of file diff --git a/Assets/Script/UI/MusicLibrary/ViewTypes/SongViewType.cs b/Assets/Script/UI/MusicLibrary/ViewTypes/SongViewType.cs index 718ca4193..5240b783c 100644 --- a/Assets/Script/UI/MusicLibrary/ViewTypes/SongViewType.cs +++ b/Assets/Script/UI/MusicLibrary/ViewTypes/SongViewType.cs @@ -57,5 +57,11 @@ public override void PrimaryButtonClick() { MainMenu.Instance.chosenSong = SongEntry; MainMenu.Instance.ShowPreSong(); } + + public override void IconClick() { + base.IconClick(); + + SongSelection.Instance.searchField.text = $"source:{SongEntry.Source}"; + } } } \ No newline at end of file diff --git a/Assets/Script/UI/MusicLibrary/ViewTypes/ViewType.cs b/Assets/Script/UI/MusicLibrary/ViewTypes/ViewType.cs index 521d55436..508012e92 100644 --- a/Assets/Script/UI/MusicLibrary/ViewTypes/ViewType.cs +++ b/Assets/Script/UI/MusicLibrary/ViewTypes/ViewType.cs @@ -22,5 +22,9 @@ public virtual void SecondaryTextClick() { public virtual void PrimaryButtonClick() { } + + public virtual void IconClick() { + + } } } \ No newline at end of file