From 9f0314a57bfd797e6c3b2774e5355bbf5be8c327 Mon Sep 17 00:00:00 2001 From: thomeval Date: Thu, 21 Nov 2024 02:49:42 +0000 Subject: [PATCH] Customizable Highway Presets (#905) * WIP Rebuild of Active Players List PR for engine-refactor * Rebuilt ActivePlayerList and ActivePlayerListItem components. Added these to the Status Bar * Update Instrument icon on Active Players List when changing a profile's GameMode, or when choosing an instrument in the Diffisulty Select Menu. * WIP Attempt to add star power glow to Color Presets * Fix one type mismatch * WIP adding color preset option for star power glow colour on note highways * Update YARG.Core * Implemented Star Power colour and Groove colours to ColorProfiles Introduced new "Common" section for ColorProfiles Star Power and Groove colours can now be customized or disabled using the above ColorProfile properties Added "Boring" default color preset which hides Groove and Star Power glow effects. * Update YARG.Core * Added (non-groove) background colours to ColorProfile Force Star Power and Groove on for FakeTrackPlayer * Update YARG.Core * Move highway colours to separate HighwayPreset class, and update usages Update TrackPreviewBuilder to force Star Power and Groove on as needed Added Highway Preset option to ProfileSidebar Moved localization text to subkey * Fixed Highway Preset changes not being applied on Profiles List screen * Removed unused localization key. Update YARG.Core * Remove HighwayPreset from ReplayData * Remove one unused parameter in ReplayData * Removed TrackMaterial.Preset.Layer struct and simplified usage Addressed PR feedback * Update YARG.Core * Update YARG.Core --- .../Menu/ProfileList/ProfileListMenu.prefab | 459 +++++++++++++++++- Assets/Scenes/MenuScene.unity | 5 + Assets/Script/Gameplay/Player/TrackPlayer.cs | 14 +- .../Script/Gameplay/Visuals/TrackMaterial.cs | 96 ++-- .../Script/Menu/ProfileList/ProfileSidebar.cs | 15 +- Assets/Script/Player/YargPlayer.cs | 18 +- .../Customization/CustomContentManager.cs | 7 +- .../Customization/HighwayPresetContainer.cs | 14 + .../HighwayPresetContainer.cs.meta | 11 + .../PreviewBuilders/TrackPreviewBuilder.cs | 8 +- .../Metadata/Tabs/PresetSubTab.Generic.cs | 1 - .../Settings/Metadata/Tabs/PresetsTab.cs | 6 + .../Settings/Preview/FakeTrackPlayer.cs | 8 +- Assets/StreamingAssets/lang/en-US.json | 32 +- YARG.Core | 2 +- 15 files changed, 631 insertions(+), 65 deletions(-) create mode 100644 Assets/Script/Settings/Customization/HighwayPresetContainer.cs create mode 100644 Assets/Script/Settings/Customization/HighwayPresetContainer.cs.meta diff --git a/Assets/Prefabs/Menu/ProfileList/ProfileListMenu.prefab b/Assets/Prefabs/Menu/ProfileList/ProfileListMenu.prefab index fc4084392..b5fd0ab3c 100644 --- a/Assets/Prefabs/Menu/ProfileList/ProfileListMenu.prefab +++ b/Assets/Prefabs/Menu/ProfileList/ProfileListMenu.prefab @@ -388,6 +388,45 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 94} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1198103172099223644 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4152766284090734912} + m_Layer: 5 + m_Name: Highway Preset + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4152766284090734912 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1198103172099223644} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4416709351655628421} + - {fileID: 3977259068854618067} + - {fileID: 2472604815212480413} + m_Father: {fileID: 6874413157356700756} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 94} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1285783844371066432 GameObject: m_ObjectHideFlags: 0 @@ -661,6 +700,7 @@ MonoBehaviour: _profileList: {fileID: 2542308448775651636} _profileViewPrefab: {fileID: 1863348019200065187, guid: 7e9189d6a05c0ba4485c260aab1a1414, type: 3} + _profileListHeaderPrefab: {fileID: 0} --- !u!1 &1731608352109147677 GameObject: m_ObjectHideFlags: 0 @@ -1800,6 +1840,82 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &3120474707007085824 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2472604815212480413} + - component: {fileID: 8828448529382254308} + - component: {fileID: 3346284810481765362} + m_Layer: 5 + m_Name: Border + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2472604815212480413 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120474707007085824} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4152766284090734912} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 50, y: 2} + m_Pivot: {x: 0.5, y: 0} +--- !u!222 &8828448529382254308 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120474707007085824} + m_CullTransparentMesh: 1 +--- !u!114 &3346284810481765362 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3120474707007085824} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.015686275, g: 0.078431375, b: 0.1254902, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &3377590800010664032 GameObject: m_ObjectHideFlags: 0 @@ -2270,6 +2386,7 @@ MonoBehaviour: _themeDropdown: {fileID: 4805044007390359996} _colorProfileDropdown: {fileID: 5317595837428790396} _cameraPresetDropdown: {fileID: 4901702434264564515} + _highwayPresetDropdown: {fileID: 1660771025072783965} _nameContainer: {fileID: 2901502984568389593} _editNameContainer: {fileID: 1767616266085646112} _profileListMenu: {fileID: 0} @@ -2643,6 +2760,142 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 94} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &5360837810789146710 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3977259068854618067} + - component: {fileID: 2083095319665865907} + - component: {fileID: 3919175051988833457} + m_Layer: 5 + m_Name: Option Name + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3977259068854618067 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5360837810789146710} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4152766284090734912} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 100, y: 0} + m_SizeDelta: {x: 200, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2083095319665865907 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5360837810789146710} + m_CullTransparentMesh: 1 +--- !u!114 &3919175051988833457 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5360837810789146710} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: HIGHWAY PRESET + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 69b34e9e884c55947b52d9bbbd4258d7, type: 2} + m_sharedMaterial: {fileID: 4264900350419322127, guid: 69b34e9e884c55947b52d9bbbd4258d7, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4288255885 + m_fontColor: {r: 0.5529412, g: 0.5921569, b: 0.6, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &6466591484018395708 GameObject: m_ObjectHideFlags: 0 @@ -3280,7 +3533,7 @@ RectTransform: - {fileID: 4737082954159568930} - {fileID: 1887563656121079394} m_Father: {fileID: 6874413157356700756} - m_RootOrder: 7 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -4528,6 +4781,11 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 1731608352109147676} m_Modifications: + - target: {fileID: 375337769934742335, guid: 81863a63e0d96cf459c263ee0ea6f98e, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 1931751072317119738, guid: 81863a63e0d96cf459c263ee0ea6f98e, type: 3} propertyPath: m_AnchorMax.x @@ -4538,6 +4796,11 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 1931751072317119738, guid: 81863a63e0d96cf459c263ee0ea6f98e, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2732038155882833699, guid: 81863a63e0d96cf459c263ee0ea6f98e, type: 3} propertyPath: m_Name @@ -4648,6 +4911,16 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6232041351873830570, guid: 81863a63e0d96cf459c263ee0ea6f98e, + type: 3} + propertyPath: m_Size + value: 0.899531 + objectReference: {fileID: 0} + - target: {fileID: 6232041351873830570, guid: 81863a63e0d96cf459c263ee0ea6f98e, + type: 3} + propertyPath: m_Value + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 81863a63e0d96cf459c263ee0ea6f98e, type: 3} --- !u!224 &68518809489572808 stripped @@ -5554,6 +5827,183 @@ RectTransform: type: 3} m_PrefabInstance: {fileID: 5520793928357138795} m_PrefabAsset: {fileID: 0} +--- !u!1001 &6281103917372865750 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4152766284090734912} + m_Modifications: + - target: {fileID: 1988200050303033511, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Name + value: Dropdown + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Interactable + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Colors.m_DisabledColor.a + value: 0.2509804 + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Colors.m_DisabledColor.b + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Colors.m_DisabledColor.g + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Colors.m_DisabledColor.r + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target + value: + objectReference: {fileID: 7898968641357467819} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName + value: ChangeHighwayPreset + objectReference: {fileID: 0} + - target: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: YARG.Menu.Profiles.ProfileSidebar, Assembly-CSharp + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_AnchorMax.x + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_SizeDelta.x + value: -240 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 120 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5f7c905be0699a94b8dc56fc6105c02d, type: 3} +--- !u!114 &1660771025072783965 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 4622602834413321867, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + m_PrefabInstance: {fileID: 6281103917372865750} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7b743370ac3e4ec2a1668f5455a8ef8a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!224 &4416709351655628421 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 7665614177142481491, guid: 5f7c905be0699a94b8dc56fc6105c02d, + type: 3} + m_PrefabInstance: {fileID: 6281103917372865750} + m_PrefabAsset: {fileID: 0} --- !u!1001 &6436711893266689922 PrefabInstance: m_ObjectHideFlags: 0 @@ -5784,6 +6234,11 @@ PrefabInstance: propertyPath: m_SizeDelta.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 375337769934742335, guid: 81863a63e0d96cf459c263ee0ea6f98e, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 1931751072317119738, guid: 81863a63e0d96cf459c263ee0ea6f98e, type: 3} propertyPath: m_AnchorMax.x @@ -5917,7 +6372,7 @@ PrefabInstance: - target: {fileID: 6232041351873830570, guid: 81863a63e0d96cf459c263ee0ea6f98e, type: 3} propertyPath: m_Size - value: 0.7061177 + value: 0.2908742 objectReference: {fileID: 0} - target: {fileID: 6232041351873830570, guid: 81863a63e0d96cf459c263ee0ea6f98e, type: 3} diff --git a/Assets/Scenes/MenuScene.unity b/Assets/Scenes/MenuScene.unity index a4ceafdff..79fe3946e 100644 --- a/Assets/Scenes/MenuScene.unity +++ b/Assets/Scenes/MenuScene.unity @@ -732,6 +732,11 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: -47 objectReference: {fileID: 0} + - target: {fileID: 1660771025072783965, guid: 6814ad1b861f1fa4a93d6c5db38dee86, + type: 3} + propertyPath: m_OnValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName + value: YARG.Menu.ProfileList.ProfileSidebar, Assembly-CSharp + objectReference: {fileID: 0} - target: {fileID: 1731608351740115684, guid: 6814ad1b861f1fa4a93d6c5db38dee86, type: 3} propertyPath: m_Name diff --git a/Assets/Script/Gameplay/Player/TrackPlayer.cs b/Assets/Script/Gameplay/Player/TrackPlayer.cs index 7505bab39..d3b890ae6 100644 --- a/Assets/Script/Gameplay/Player/TrackPlayer.cs +++ b/Assets/Script/Gameplay/Player/TrackPlayer.cs @@ -7,9 +7,11 @@ using YARG.Core.Audio; using YARG.Core.Chart; using YARG.Core.Engine; +using YARG.Core.Game; using YARG.Core.Logging; using YARG.Gameplay.HUD; using YARG.Gameplay.Visuals; +using YARG.Helpers.Extensions; using YARG.Player; using YARG.Settings; using YARG.Themes; @@ -72,7 +74,10 @@ public abstract class TrackPlayer : BasePlayer public virtual void Initialize(int index, YargPlayer player, SongChart chart, TrackView trackView, StemMixer mixer, int? lastHighScore) { - if (IsInitialized) return; + if (IsInitialized) + { + return; + } Initialize(index, player, chart, lastHighScore); @@ -162,7 +167,10 @@ public abstract class TrackPlayer : TrackPlayer public override void Initialize(int index, YargPlayer player, SongChart chart, TrackView trackView, StemMixer mixer, int? currentHighScore) { - if (IsInitialized) return; + if (IsInitialized) + { + return; + } base.Initialize(index, player, chart, trackView, mixer, currentHighScore); @@ -210,7 +218,7 @@ protected virtual void FinishInitialization() { GameManager.BeatEventHandler.Subscribe(StarpowerBar.PulseBar); - TrackMaterial.Initialize(ZeroFadePosition, FadeSize); + TrackMaterial.Initialize(ZeroFadePosition, FadeSize, Player.HighwayPreset); CameraPositioner.Initialize(Player.CameraPreset); } diff --git a/Assets/Script/Gameplay/Visuals/TrackMaterial.cs b/Assets/Script/Gameplay/Visuals/TrackMaterial.cs index 90be55c84..8491e4ada 100644 --- a/Assets/Script/Gameplay/Visuals/TrackMaterial.cs +++ b/Assets/Script/Gameplay/Visuals/TrackMaterial.cs @@ -1,6 +1,7 @@ -using System; +using System; using System.Collections.Generic; using UnityEngine; +using YARG.Core.Game; using YARG.Helpers.Extensions; using YARG.Settings; @@ -21,21 +22,40 @@ public class TrackMaterial : MonoBehaviour private static readonly int _soloStateProperty = Shader.PropertyToID("_Solo_State"); + private static readonly int _starPowerColorProperty = Shader.PropertyToID("_Starpower_Color"); + public struct Preset { - public struct Layer + public Color Layer1; + public Color Layer2; + public Color Layer3; + public Color Layer4; + + public static Preset FromHighwayPreset(HighwayPreset preset, bool groove) { - public Color Color; - } + if (groove) + { + return new Preset + { + Layer1 = preset.BackgroundGrooveBaseColor1.ToUnityColor(), + Layer2 = preset.BackgroundGrooveBaseColor2.ToUnityColor(), + Layer3 = preset.BackgroundGrooveBaseColor3.ToUnityColor(), + Layer4 = preset.BackgroundGroovePatternColor.ToUnityColor() + }; + } - public Layer Layer1; - public Layer Layer2; - public Layer Layer3; - public Layer Layer4; + return new Preset + { + Layer1 = preset.BackgroundBaseColor1.ToUnityColor(), + Layer2 = preset.BackgroundBaseColor2.ToUnityColor(), + Layer3 = preset.BackgroundBaseColor3.ToUnityColor(), + Layer4 = preset.BackgroundPatternColor.ToUnityColor() + }; + } } - private static Preset _normalPreset; - private static Preset _groovePreset; + private Preset _normalPreset; + private Preset _groovePreset; private float _grooveState; private float GrooveState @@ -46,13 +66,13 @@ private float GrooveState _grooveState = value; _material.SetColor(_layer1ColorProperty, - Color.Lerp(_normalPreset.Layer1.Color, _groovePreset.Layer1.Color, value)); + Color.Lerp(_normalPreset.Layer1, _groovePreset.Layer1, value)); _material.SetColor(_layer2ColorProperty, - Color.Lerp(_normalPreset.Layer2.Color, _groovePreset.Layer2.Color, value)); + Color.Lerp(_normalPreset.Layer2, _groovePreset.Layer2, value)); _material.SetColor(_layer3ColorProperty, - Color.Lerp(_normalPreset.Layer3.Color, _groovePreset.Layer3.Color, value)); + Color.Lerp(_normalPreset.Layer3, _groovePreset.Layer3, value)); _material.SetColor(_layer4ColorProperty, - Color.Lerp(_normalPreset.Layer4.Color, _groovePreset.Layer4.Color, value)); + Color.Lerp(_normalPreset.Layer4, _groovePreset.Layer4, value)); _material.SetFloat(_wavinessProperty, value); } @@ -104,49 +124,25 @@ private void Awake() { _trimMaterials.Add(trim.material); } - + _normalPreset = new() { - Layer1 = new() - { - Color = FromHex("0F0F0F", 1f) - }, - Layer2 = new() - { - Color = FromHex("4B4B4B", 0.15f) - }, - Layer3 = new() - { - Color = FromHex("FFFFFF", 0f) - }, - Layer4 = new() - { - Color = FromHex("575757", 1f) - } + Layer1 = FromHex("0F0F0F", 1f), + Layer2 = FromHex("4B4B4B", 0.15f), + Layer3 = FromHex("FFFFFF", 0f), + Layer4 = FromHex("575757", 1f) }; _groovePreset = new() { - Layer1 = new() - { - Color = FromHex("000933", 1f) - }, - Layer2 = new() - { - Color = FromHex("23349C", 0.15f) - }, - Layer3 = new() - { - Color = FromHex("FFFFFF", 0f) - }, - Layer4 = new() - { - Color = FromHex("2C499E", 1f) - } + Layer1 = FromHex("000933", 1f), + Layer2 = FromHex("23349C", 0.15f), + Layer3 = FromHex("FFFFFF", 0f), + Layer4 = FromHex("2C499E", 1f) }; } - public void Initialize(float fadePos, float fadeSize) + public void Initialize(float fadePos, float fadeSize, HighwayPreset highwayPreset) { // Set all fade values _material.SetFade(fadePos, fadeSize); @@ -154,6 +150,10 @@ public void Initialize(float fadePos, float fadeSize) { trimMat.SetFade(fadePos, fadeSize); } + + _material.SetColor(_starPowerColorProperty, highwayPreset.StarPowerColor.ToUnityColor() ); + _normalPreset = Preset.FromHighwayPreset(highwayPreset, false); + _groovePreset = Preset.FromHighwayPreset(highwayPreset, true); } private void Update() diff --git a/Assets/Script/Menu/ProfileList/ProfileSidebar.cs b/Assets/Script/Menu/ProfileList/ProfileSidebar.cs index 4eaf4c579..c1f158a7d 100644 --- a/Assets/Script/Menu/ProfileList/ProfileSidebar.cs +++ b/Assets/Script/Menu/ProfileList/ProfileSidebar.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -63,6 +63,8 @@ public class ProfileSidebar : MonoBehaviour private TMP_Dropdown _colorProfileDropdown; [SerializeField] private TMP_Dropdown _cameraPresetDropdown; + [SerializeField] + private TMP_Dropdown _highwayPresetDropdown; [Space] [SerializeField] @@ -89,6 +91,7 @@ public class ProfileSidebar : MonoBehaviour private List _colorProfilesByIndex; private List _cameraPresetsByIndex; private List _themesByIndex; + private List _highwayPresetsByIndex; private void Awake() { @@ -120,6 +123,9 @@ private void OnEnable() _cameraPresetsByIndex = CustomContentManager.CameraSettings.AddOptionsToDropdown(_cameraPresetDropdown) .Select(i => i.Id).ToList(); + _highwayPresetsByIndex = + CustomContentManager.HighwayPresets.AddOptionsToDropdown(_highwayPresetDropdown) + .Select(i => i.Id).ToList(); } public void UpdateSidebar(YargProfile profile, ProfileView profileView) @@ -152,6 +158,8 @@ public void UpdateSidebar(YargProfile profile, ProfileView profileView) _colorProfilesByIndex.IndexOf(profile.ColorProfile)); _cameraPresetDropdown.SetValueWithoutNotify( _cameraPresetsByIndex.IndexOf(profile.CameraPreset)); + _highwayPresetDropdown.SetValueWithoutNotify( + _highwayPresetsByIndex.IndexOf(profile.HighwayPreset)); // Show the proper name container (hide the editing version) _nameContainer.SetActive(true); @@ -328,5 +336,10 @@ public void ChangeCameraPreset() { _profile.CameraPreset = _cameraPresetsByIndex[_cameraPresetDropdown.value]; } + + public void ChangeHighwayPreset() + { + _profile.HighwayPreset = _highwayPresetsByIndex[_highwayPresetDropdown.value]; + } } } \ No newline at end of file diff --git a/Assets/Script/Player/YargPlayer.cs b/Assets/Script/Player/YargPlayer.cs index b45f75e91..9e07b3b21 100644 --- a/Assets/Script/Player/YargPlayer.cs +++ b/Assets/Script/Player/YargPlayer.cs @@ -24,10 +24,11 @@ public class YargPlayer : IDisposable public bool InputsEnabled { get; private set; } public ProfileBindings Bindings { get; private set; } - public EnginePreset EnginePreset { get; private set; } - public ThemePreset ThemePreset { get; private set; } - public ColorProfile ColorProfile { get; private set; } - public CameraPreset CameraPreset { get; private set; } + public EnginePreset EnginePreset { get; private set; } + public ThemePreset ThemePreset { get; private set; } + public ColorProfile ColorProfile { get; private set; } + public CameraPreset CameraPreset { get; private set; } + public HighwayPreset HighwayPreset { get; private set; } /// /// Overrides the engine parameters in the gameplay player. @@ -57,6 +58,9 @@ public YargPlayer(ReplayFrame frame, ReplayData replay) CameraPreset = replay.GetCameraPreset(Profile.CameraPreset) ?? CustomContentManager.CameraSettings.GetPresetById(Profile.CameraPreset) ?? CameraPreset.Default; + + HighwayPreset = CustomContentManager.HighwayPresets.GetPresetById(Profile.HighwayPreset) + ?? HighwayPreset.Default; } public void SwapToProfile(YargProfile profile, ProfileBindings bindings, bool resolveDevices) @@ -93,12 +97,16 @@ public void RefreshPresets() ?? ColorProfile.Default; CameraPreset = CustomContentManager.CameraSettings.GetPresetById(Profile.CameraPreset) ?? CameraPreset.Default; + HighwayPreset = CustomContentManager.HighwayPresets.GetPresetById(Profile.HighwayPreset) + ?? HighwayPreset.Default; } public void EnableInputs() { if (InputsEnabled || Bindings == null) + { return; + } Bindings.EnableInputs(); Bindings.MenuInputProcessed += OnMenuInput; @@ -110,7 +118,9 @@ public void EnableInputs() public void DisableInputs() { if (!InputsEnabled || Bindings == null) + { return; + } Bindings.DisableInputs(); Bindings.MenuInputProcessed -= OnMenuInput; diff --git a/Assets/Script/Settings/Customization/CustomContentManager.cs b/Assets/Script/Settings/Customization/CustomContentManager.cs index 7ab8f9685..0eef7de88 100644 --- a/Assets/Script/Settings/Customization/CustomContentManager.cs +++ b/Assets/Script/Settings/Customization/CustomContentManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using YARG.Core.Logging; @@ -16,6 +16,7 @@ public static class CustomContentManager public static readonly CameraSettingsContainer CameraSettings; public static readonly ThemePresetContainer ThemePresets; public static readonly EnginePresetContainer EnginePresets; + public static readonly HighwayPresetContainer HighwayPresets; private static readonly List _customContentContainers; public static IReadOnlyList CustomContentContainers => _customContentContainers; @@ -26,13 +27,15 @@ static CustomContentManager() ColorProfiles = new ColorProfileContainer(); ThemePresets = new ThemePresetContainer(); EnginePresets = new EnginePresetContainer(); + HighwayPresets = new HighwayPresetContainer(); _customContentContainers = new() { CameraSettings, ColorProfiles, ThemePresets, - EnginePresets + EnginePresets, + HighwayPresets }; } diff --git a/Assets/Script/Settings/Customization/HighwayPresetContainer.cs b/Assets/Script/Settings/Customization/HighwayPresetContainer.cs new file mode 100644 index 000000000..aebea3ec7 --- /dev/null +++ b/Assets/Script/Settings/Customization/HighwayPresetContainer.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using YARG.Core.Game; + +namespace YARG.Settings.Customization +{ + public class HighwayPresetContainer : CustomContent + { + protected override string ContentDirectory => "highwayPresets"; + + public override string PresetTypeStringName => "HighwayPreset"; + + public override IReadOnlyList DefaultPresets => HighwayPreset.Defaults; + } +} \ No newline at end of file diff --git a/Assets/Script/Settings/Customization/HighwayPresetContainer.cs.meta b/Assets/Script/Settings/Customization/HighwayPresetContainer.cs.meta new file mode 100644 index 000000000..dc5258cab --- /dev/null +++ b/Assets/Script/Settings/Customization/HighwayPresetContainer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e9c64ba39ebabf54c84088e94d0627c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/Settings/Metadata/PreviewBuilders/TrackPreviewBuilder.cs b/Assets/Script/Settings/Metadata/PreviewBuilders/TrackPreviewBuilder.cs index 10c0f7d2c..2a7102d94 100644 --- a/Assets/Script/Settings/Metadata/PreviewBuilders/TrackPreviewBuilder.cs +++ b/Assets/Script/Settings/Metadata/PreviewBuilders/TrackPreviewBuilder.cs @@ -23,10 +23,14 @@ public class TrackPreviewBuilder : IPreviewBuilder public GameMode? StartingGameMode { get; set; } private readonly bool _forceShowHitWindow; + private readonly bool _forceGroove; + private readonly bool _forceStarPower; - public TrackPreviewBuilder(bool forceShowHitWindow = false) + public TrackPreviewBuilder(bool forceShowHitWindow = false, bool forceGroove = false, bool forceStarPower = false) { _forceShowHitWindow = forceShowHitWindow; + _forceGroove = forceGroove; + _forceStarPower = forceStarPower; } public UniTask BuildPreviewWorld(Transform worldContainer) @@ -35,6 +39,8 @@ public UniTask BuildPreviewWorld(Transform worldContainer) var trackPreview = trackObj.GetComponentInChildren(); trackPreview.ForceShowHitWindow = _forceShowHitWindow; + trackPreview.ForceGroove = _forceGroove; + trackPreview.ForceStarPower = _forceStarPower; // If null, just use the default value and skip setting it if (StartingGameMode is not null) diff --git a/Assets/Script/Settings/Metadata/Tabs/PresetSubTab.Generic.cs b/Assets/Script/Settings/Metadata/Tabs/PresetSubTab.Generic.cs index 6e6398166..3beba2a5f 100644 --- a/Assets/Script/Settings/Metadata/Tabs/PresetSubTab.Generic.cs +++ b/Assets/Script/Settings/Metadata/Tabs/PresetSubTab.Generic.cs @@ -14,7 +14,6 @@ using YARG.Settings.Types; using SystemColor = System.Drawing.Color; -using UnityColor = UnityEngine.Color; namespace YARG.Settings.Metadata { diff --git a/Assets/Script/Settings/Metadata/Tabs/PresetsTab.cs b/Assets/Script/Settings/Metadata/Tabs/PresetsTab.cs index 6a1eedbbd..2adf909a4 100644 --- a/Assets/Script/Settings/Metadata/Tabs/PresetsTab.cs +++ b/Assets/Script/Settings/Metadata/Tabs/PresetsTab.cs @@ -47,6 +47,12 @@ public class PresetsTab : Tab CustomContentManager.EnginePresets, new TrackPreviewBuilder(forceShowHitWindow: true), true), + + new PresetSubTab( + CustomContentManager.HighwayPresets, + new TrackPreviewBuilder(false, true, true), + false) + }; private static readonly Dictionary _lastSelectedPresetOfType = new(); diff --git a/Assets/Script/Settings/Preview/FakeTrackPlayer.cs b/Assets/Script/Settings/Preview/FakeTrackPlayer.cs index c74bc0192..3a26a848a 100644 --- a/Assets/Script/Settings/Preview/FakeTrackPlayer.cs +++ b/Assets/Script/Settings/Preview/FakeTrackPlayer.cs @@ -223,6 +223,9 @@ public struct Info private FakeHitWindowDisplay _hitWindow; public bool ForceShowHitWindow { get; set; } + public bool ForceGroove { get; set; } + public bool ForceStarPower { get; set; } + public GameMode SelectedGameMode { get; set; } = GameMode.FiveFretGuitar; public double PreviewTime { get; private set; } @@ -252,6 +255,8 @@ private void Start() // Show hit window if enabled _hitWindow.gameObject.SetActive(SettingsManager.Settings.ShowHitWindow.Value || ForceShowHitWindow); _hitWindow.NoteSpeed = NOTE_SPEED; + _trackMaterial.StarpowerMode = ForceStarPower; + _trackMaterial.GrooveMode = ForceGroove; SettingsMenu.Instance.SettingChanged += OnSettingChanged; @@ -264,9 +269,10 @@ private void OnSettingChanged() var cameraPreset = PresetsTab.GetLastSelectedPreset(CustomContentManager.CameraSettings); var colorProfile = PresetsTab.GetLastSelectedPreset(CustomContentManager.ColorProfiles); var enginePreset = PresetsTab.GetLastSelectedPreset(CustomContentManager.EnginePresets); + var highwayPreset = PresetsTab.GetLastSelectedPreset(CustomContentManager.HighwayPresets); // Update camera presets - _trackMaterial.Initialize(3f, cameraPreset.FadeLength); + _trackMaterial.Initialize(3f, cameraPreset.FadeLength, highwayPreset); _cameraPositioner.Initialize(cameraPreset); // Update color profiles diff --git a/Assets/StreamingAssets/lang/en-US.json b/Assets/StreamingAssets/lang/en-US.json index 652bac76e..107ab5365 100644 --- a/Assets/StreamingAssets/lang/en-US.json +++ b/Assets/StreamingAssets/lang/en-US.json @@ -960,7 +960,8 @@ "PresetType": { "CameraSettingsContainer": "Camera Presets", "ColorProfileContainer": "Color Profiles", - "EnginePresetContainer": "Engine Presets" + "EnginePresetContainer": "Engine Presets", + "HighwayPresetContainer" : "Highway Presets" }, "PresetSetting": { "CameraPreset": { @@ -1326,6 +1327,35 @@ "Name": "Sustain Drop Leniency", "Description": "" } + }, + "HighwayPreset" : { + "BackgroundBaseColor1": { + "Name": "Background Base Color 1" + }, + "BackgroundBaseColor2": { + "Name": "Background Base Color 2" + }, + "BackgroundBaseColor3": { + "Name": "Background UNUSED Color" + }, + "BackgroundPatternColor": { + "Name": "Background Pattern Color" + }, + "BackgroundGrooveBaseColor1": { + "Name": "Groove Base Color 1" + }, + "BackgroundGrooveBaseColor2": { + "Name": "Groove Base Color 2" + }, + "BackgroundGrooveBaseColor3": { + "Name": "Groove UNUSED Color" + }, + "BackgroundGroovePatternColor": { + "Name": "Groove Pattern Color" + }, + "StarPowerColor": { + "Name": "Star Power Color" + } } } } diff --git a/YARG.Core b/YARG.Core index d9ffcbe09..ff512d2d1 160000 --- a/YARG.Core +++ b/YARG.Core @@ -1 +1 @@ -Subproject commit d9ffcbe095d5fd90377811094ffd9aa9ee6b35fc +Subproject commit ff512d2d14adb0f2ac373f1ebdfc172bd235523f