From 45539f3b924c95b018c5a638535bd8cc09ea93b9 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Mon, 11 Nov 2024 17:11:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=BA=8C=E7=BA=A7UI=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=A6=E6=96=B9=E5=90=91=E9=94=AE=E8=BF=94=E5=9B=9E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD,=E4=BF=AE=E5=A4=8DRoom=E5=88=97=E8=A1=A8=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E6=97=B6=E7=9A=84=E4=BD=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIPrefabs/SubMenuItemTemplates/Room_Template.prefab | 2 +- .../Assets/Script/UI/CommandDispatcher/CommandExcuter.cs | 8 ++++++++ .../Assets/Script/UI/MenuItemController.cs | 6 +++++- .../Assets/Script/UI/RomListMenuItem.cs | 2 +- .../Assets/Script/UI/SubMenuItemGroup.cs | 6 ++++++ AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs | 3 ++- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab index d57d294..c590aab 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/SubMenuItemTemplates/Room_Template.prefab @@ -826,7 +826,7 @@ GameObject: - component: {fileID: 6055880809428073973} - component: {fileID: 1286529697012677180} m_Layer: 5 - m_Name: RomGroup + m_Name: RoomGroup m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs index 07eff9b..7a324a2 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/CommandDispatcher/CommandExcuter.cs @@ -36,6 +36,14 @@ namespace AxibugEmuOnline.Client m_pulsInvoker_Down.Update(Time.deltaTime); } + public void ResetPulsInvoker() + { + m_pulsInvoker_Left.DisActive(); + m_pulsInvoker_Right.DisActive(); + m_pulsInvoker_Up.DisActive(); + m_pulsInvoker_Down.DisActive(); + } + public void ExecuteCommand(EnumCommand cmd, bool cancel) { if (!cancel) diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs index 909afcf..7a67fca 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/MenuItemController.cs @@ -9,7 +9,6 @@ namespace AxibugEmuOnline.Client [SerializeField] protected Transform m_menuItemRoot; protected List m_runtimeMenuUI = new List(); - public override bool Enable => enabled; protected MenuItem m_enteredItem = null; @@ -78,6 +77,8 @@ namespace AxibugEmuOnline.Client public abstract class MenuItemController : MenuItemController { + public override bool Enable => enabled && ListenControlAction; + private bool m_listenControlAction; public bool ListenControlAction { @@ -90,6 +91,9 @@ namespace AxibugEmuOnline.Client CommandDispatcher.Instance.RegistController(this); else CommandDispatcher.Instance.UnRegistController(this); + + if(!value) + ResetPulsInvoker(); } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/RomListMenuItem.cs b/AxibugEmuOnline.Client/Assets/Script/UI/RomListMenuItem.cs index edf3556..c337bd5 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/RomListMenuItem.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/RomListMenuItem.cs @@ -28,6 +28,6 @@ namespace AxibugEmuOnline.Client protected override void GetVirtualListDatas(Action datas) { RomLib.FetchRomCount((roms) => datas.Invoke(roms)); - } + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs b/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs index b92d2b1..415e568 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/SubMenuItemGroup.cs @@ -119,6 +119,12 @@ namespace AxibugEmuOnline.Client ListenControlAction = m_selected; } + protected override void OnCmdSelectItemLeft() + { + base.OnCmdSelectItemLeft(); + + OnCmdBack(); + } protected override void OnSelectMenuChanged() { diff --git a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs b/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs index 5b7a3fb..9206cc7 100644 --- a/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs +++ b/AxibugEmuOnline.Client/Assets/Script/UI/ThirdMenuRoot.cs @@ -12,7 +12,7 @@ namespace AxibugEmuOnline.Client private RectTransform m_parent; [SerializeField] - private RectTransform m_selectArrow; + private RectTransform m_selectArrow; [SerializeField] float ArrowOffset = 50; [SerializeField] @@ -87,6 +87,7 @@ namespace AxibugEmuOnline.Client void RollToIndex(int index, bool useAnim = false) { + SyncRectToLaunchUI(); Vector2 itemPos = itemGroup.GetItemAnchorePos(index); Vector2 targetPos = itemGroup.transform.InverseTransformPoint(m_selectArrow.position);