diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab index 232826e5..fc677e08 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab @@ -682,9 +682,9 @@ RectTransform: 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_AnchoredPosition: {x: 25, y: 25} m_SizeDelta: {x: 50, y: 50} - m_Pivot: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7825136160635457043 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1171,9 +1171,9 @@ RectTransform: 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_AnchoredPosition: {x: 25, y: 25} m_SizeDelta: {x: 50, y: 50} - m_Pivot: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6387250980529666459 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1377,10 +1377,10 @@ RectTransform: m_Children: [] m_Father: {fileID: 1100500336380202360} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 170, y: -333} - m_SizeDelta: {x: 300, y: 26} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7910447946506517051 CanvasRenderer: @@ -1477,9 +1477,9 @@ RectTransform: 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_AnchoredPosition: {x: 25, y: 25} m_SizeDelta: {x: 50, y: 50} - m_Pivot: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6018890508858230420 CanvasRenderer: m_ObjectHideFlags: 0 @@ -1667,10 +1667,10 @@ RectTransform: - {fileID: 905458728127029103} m_Father: {fileID: 1100500336380202360} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 170, y: -160} - m_SizeDelta: {x: 300, y: 300} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2558056583130529771 MonoBehaviour: @@ -3058,9 +3058,9 @@ RectTransform: 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_AnchoredPosition: {x: 25, y: 25} m_SizeDelta: {x: 50, y: 50} - m_Pivot: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &6969397185295608833 CanvasRenderer: m_ObjectHideFlags: 0 @@ -3116,7 +3116,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &1100500336380202360 RectTransform: m_ObjectHideFlags: 0 @@ -3134,10 +3134,10 @@ RectTransform: - {fileID: 6878964193873653430} m_Father: {fileID: 4478785627166277610} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 165, y: -443} - m_SizeDelta: {x: 330, y: 356} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &20405450890320071 MonoBehaviour: diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs index 393879d0..ca28ecdc 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/AppSettings/Filter/RLPro/RLPRO_CRT.cs @@ -40,7 +40,8 @@ namespace AxibugEmuOnline.Client.Filters public FloatParameter hardScan = -8.0f; [Range(-3f, 1f)] public FloatParameter hardPix = -3.0f; - public Vector2Parameter warp = new Vector2(0.03125f, 0.04166f); + public FloatParameter warpX = 0.03125f; + public FloatParameter warpY = 0.04166f; [Range(1f, 16f)] public FloatParameter resScale = 4f; [Range(0.5f, 5f)] @@ -131,14 +132,14 @@ namespace AxibugEmuOnline.Client.Filters m_tvEffectMat.EnableKeyword("_CubicDistortion"); break; } - m_tvEffectMat.SetFloat("maskDark", maskDark.GetValue()); - m_tvEffectMat.SetFloat("maskLight", maskLight.GetValue()); - m_tvEffectMat.SetFloat("hardScan", hardScan.GetValue()); - m_tvEffectMat.SetFloat("hardPix", hardPix.GetValue()); - m_tvEffectMat.SetVector("warp", warp.GetValue()); - m_tvEffectMat.SetFloat("resScale", resScale.GetValue()); - m_tvEffectMat.SetFloat("scale", scale.GetValue()); - m_tvEffectMat.SetFloat("fade", fade.GetValue()); + m_tvEffectMat.SetFloat("maskDark", maskDark); + m_tvEffectMat.SetFloat("maskLight", maskLight); + m_tvEffectMat.SetFloat("hardScan", hardScan); + m_tvEffectMat.SetFloat("hardPix", hardPix); + m_tvEffectMat.SetVector("warp", new Vector4(warpX, warpY)); + m_tvEffectMat.SetFloat("resScale", resScale); + m_tvEffectMat.SetFloat("scale", scale); + m_tvEffectMat.SetFloat("fade", fade); Graphics.Blit(src, rt, m_tvEffectMat); diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs index 029ae216..0b242694 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs @@ -1,5 +1,7 @@ using AxibugEmuOnline.Client.ClientCore; using DG.Tweening; +using DG.Tweening.Core; +using DG.Tweening.Plugins.Options; using System; using System.Collections.Generic; using UnityEngine; @@ -84,8 +86,34 @@ namespace AxibugEmuOnline.Client private void UpdateMenuState() { + if (!m_bPoped) return; + if (checkDirty()) - { + { + Canvas.ForceUpdateCanvases(); + + if (m_popTween != null) + { + Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); + m_popTween.ChangeEndValue(end, false); + } + else + { + Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); + var topParent = m_parent; + while (topParent != null && topParent.m_parent != null) + { + topParent = topParent.m_parent; + } + if (topParent != null) + { + topParent.MenuRoot.anchoredPosition = end; + } + else + { + MenuRoot.anchoredPosition = end; + } + } RebuildSelectIndex(); } } @@ -146,8 +174,10 @@ namespace AxibugEmuOnline.Client } return dirty; - } - + } + + private TweenerCore m_popTween; + private TweenerCore m_hideTween; CommandListener.ScheduleType? m_lastCS; private Action m_onClose; @@ -167,8 +197,14 @@ namespace AxibugEmuOnline.Client SelectBorder.Target = optionUI_MenuItem.transform as RectTransform; } + public void Pop(List menus, int defaultIndex = 0, Action onClose = null) where T : InternalOptionMenu - { + { + if (m_hideTween != null) + { + m_hideTween.Kill(true); + } + m_onClose = onClose; ReleaseRuntimeMenus(); foreach (var menu in menus) CreateRuntimeMenuItem(menu); @@ -187,10 +223,11 @@ namespace AxibugEmuOnline.Client if (!m_bPoped) { + m_bPoped = true; Vector2 start = new Vector2(0, MenuRoot.anchoredPosition.y); Vector2 end = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); - DOTween.To( + m_popTween = DOTween.To( () => start, (value) => { @@ -214,6 +251,7 @@ namespace AxibugEmuOnline.Client end, 0.3f ).SetEase(Ease.OutCubic); + m_popTween.onComplete = () => m_popTween = null; m_lastCS = CommandDispatcher.Instance.Mode; CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal; @@ -236,15 +274,17 @@ namespace AxibugEmuOnline.Client Vector2 start = new Vector2(-MenuRoot.rect.width, MenuRoot.anchoredPosition.y); Vector2 end = new Vector2(0, MenuRoot.anchoredPosition.y); - ReleaseRuntimeMenus(); - m_runtimeMenuItems.Clear(); - SelectBorder.gameObject.SetActiveEx(false); CommandDispatcher.Instance.UnRegistController(this); Canvas.ForceUpdateCanvases(); - DOTween.To( + if (m_popTween != null) + { + m_popTween.Kill(true); + } + + m_hideTween = DOTween.To( () => start, (value) => { @@ -268,6 +308,12 @@ namespace AxibugEmuOnline.Client end, 0.3f ).SetEase(Ease.OutCubic); + m_hideTween.onComplete = () => + { + ReleaseRuntimeMenus(); + m_runtimeMenuItems.Clear(); + m_hideTween = null; + }; m_bPoped = false; diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs index 3957b6df..dc150d97 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs @@ -15,7 +15,6 @@ namespace AxibugEmuOnline.Client private RectTransform m_rect => transform as RectTransform; private RectTransform m_target; - private TweenerCore m_trackTween; public RectTransform Target { @@ -37,7 +36,6 @@ namespace AxibugEmuOnline.Client var itemUIRect = m_target.transform as RectTransform; m_rect.pivot = itemUIRect.pivot; - m_rect.sizeDelta = itemUIRect.rect.size; m_rect.SetAsLastSibling(); animator.SetTrigger("reactive"); @@ -47,12 +45,30 @@ namespace AxibugEmuOnline.Client m_trackTween.Kill(); m_trackTween = null; } - m_trackTween = DOTween.To(() => m_rect.position, (_value) => m_rect.position = _value, itemUIRect.position, 0.125f); - m_trackTween.onComplete = () => m_trackTween = null; + + var startSize = m_rect.sizeDelta; + var startPos = m_rect.position; + + m_trackTween = DOTween.To( + () => 0f, + (_value) => + { + var progress = _value; + m_rect.position = Vector3.Lerp(startPos, itemUIRect.position, progress); + m_rect.sizeDelta = Vector2.Lerp(startSize, itemUIRect.rect.size, progress); + }, + 1f, + 0.125f); + m_trackTween.onComplete = () => + { + m_trackTween = null; + }; } } - private bool m_active; + private bool m_active; + private TweenerCore m_trackTween; + public bool Active { get => m_active; @@ -73,12 +89,17 @@ namespace AxibugEmuOnline.Client } } - private void LateUpdate() - { - if (m_trackTween != null && m_trackTween.endValue != Target.position) - { - m_trackTween.ChangeEndValue(Target.position, true); - } + struct TrackTarget + { + Vector3 pos; + Vector2 size; + } + + struct TrackTargetOption : IPlugOptions + { + public void Reset() + { + } } } }