From 31ca1b9571025505f34e81fb15078c4eb90c8a1a Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 20 Aug 2025 10:49:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BE=A7=E8=BE=B9?= =?UTF-8?q?=E6=A0=8FUI=E7=9A=84=E5=B8=83=E5=B1=80=E8=AE=A1=E7=AE=97bug(?= =?UTF-8?q?=E5=BD=93=E6=9C=89=E5=AD=90=E8=8F=9C=E5=8D=95=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=97=B6,=E4=BB=BB=E6=84=8F=E8=8F=9C=E5=8D=95=E9=A1=B9?= =?UTF-8?q?=E5=8F=91=E7=94=9Fvisible=E5=8F=98=E5=8C=96=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E7=9A=84=E4=BD=8D=E7=BD=AE=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Script/AppMain/UI/OptionUI/OptionUI.cs | 60 ++++++++++--------- .../Script/AppMain/UI/Tools/Selector.cs | 2 - 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs index 0b242694..16d7bdac 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/OptionUI/OptionUI.cs @@ -92,27 +92,18 @@ namespace AxibugEmuOnline.Client { Canvas.ForceUpdateCanvases(); + var topParent = FindTopOptionUI(); + var totalWidth = GetTotalWidth(topParent); + + Vector2 end = new Vector2(-totalWidth, MenuRoot.anchoredPosition.y); + 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; - } + topParent.MenuRoot.anchoredPosition = end; } RebuildSelectIndex(); } @@ -223,7 +214,6 @@ 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); @@ -234,19 +224,8 @@ namespace AxibugEmuOnline.Client var moveDelta = value - start; start = value; - var topParent = m_parent; - while (topParent != null && topParent.m_parent != null) - { - topParent = topParent.m_parent; - } - if (topParent != null) - { - topParent.MenuRoot.anchoredPosition += moveDelta; - } - else - { - MenuRoot.anchoredPosition += moveDelta; - } + var topParent = FindTopOptionUI(); + topParent.MenuRoot.anchoredPosition += moveDelta; }, end, 0.3f @@ -256,7 +235,30 @@ namespace AxibugEmuOnline.Client m_lastCS = CommandDispatcher.Instance.Mode; CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal; } + } + OptionUI FindTopOptionUI() + { + if (m_parent == null) return this; + + var topParent = m_parent; + while (topParent != null && topParent.m_parent != null) + { + topParent = topParent.m_parent; + } + + return topParent; + } + + static float GetTotalWidth(OptionUI root) + { + float totalWidth = root.MenuRoot.rect.width; + if (root.m_child != null) + { + totalWidth += GetTotalWidth(root.m_child); + } + + return totalWidth; } /// diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs index 2cf827fd..b4f5c840 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/Tools/Selector.cs @@ -21,8 +21,6 @@ namespace AxibugEmuOnline.Client get => m_target; set { - if (m_target == value) return; - m_target = value; if (m_target == null) { From ab4496ebef8d426c2ab1efd1a7ed85887c253365 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 20 Aug 2025 14:39:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=91=E5=AD=98?= =?UTF-8?q?=E6=A1=A3=E7=9B=B8=E5=85=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/UIPrefabs/OptionUI.prefab | 2 +- .../Manager/SaveSlotManager/SaveFile.cs | 2 -- .../SaveFileSyncStates/DownloadingState.cs | 25 +++++++++++++------ .../UI/InGameUI/InGameUI_SaveStateMenu.cs | 10 +++----- 4 files changed, 22 insertions(+), 17 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab index e20dea9c..7ebba81d 100644 --- a/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab +++ b/AxibugEmuOnline.Client/Assets/Resources/UIPrefabs/OptionUI.prefab @@ -585,7 +585,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_Sprite: {fileID: 21300000, guid: 961aba7b7a39e4d4c832e94350f44d4c, type: 3} + m_Sprite: {fileID: 21300000, guid: 0ab2653139d474e40a1ce8213f36274e, type: 3} m_Type: 0 m_PreserveAspect: 0 m_FillCenter: 1 diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFile.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFile.cs index fa08afc3..91cbc4d5 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFile.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFile.cs @@ -172,8 +172,6 @@ namespace AxibugEmuOnline.Client public unsafe void Save(uint sequence, byte[] savData, byte[] screenShotData) { - if (IsBusy) return; - var filePath = FilePath; var header = new Header diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFileSyncStates/DownloadingState.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFileSyncStates/DownloadingState.cs index 951d4c9d..23949a35 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFileSyncStates/DownloadingState.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/SaveSlotManager/SaveFileSyncStates/DownloadingState.cs @@ -26,8 +26,8 @@ namespace AxibugEmuOnline.Client } m_sequece = (uint)netData.Sequence; - m_downloadTask = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavUrl}"); - m_downloadTaskImg = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavImgUrl}"); + m_downloadTask = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavUrl}?v={m_sequece}"); + m_downloadTaskImg = AxiHttpProxy.GetDownLoad($"{App.httpAPI.WebHost}/{netData.SavImgUrl}?v={m_sequece}"); Host.SetSavingFlag(); } @@ -52,14 +52,25 @@ namespace AxibugEmuOnline.Client if (m_downloadTaskImg.downloadHandler.bHadErr) //下载失败 { - FSM.ChangeState(); + FSM.GetState().Error = m_downloadTaskImg.downloadHandler.ErrInfo; + FSM.ChangeState(); return; } - var savData = Host.CloudAPI.UnGzipData(m_downloadTask.downloadHandler.data); - var imgData = Host.CloudAPI.UnGzipData(m_downloadTaskImg.downloadHandler.data); - Host.Save(m_sequece, savData, imgData); - FSM.ChangeState(); + try + { + var savData = Host.CloudAPI.UnGzipData(m_downloadTask.downloadHandler.data); + var imgData = m_downloadTaskImg.downloadHandler.data; //图片数据已被服务器解压 + + Host.Save(m_sequece, savData, imgData); + FSM.ChangeState(); + } + catch + { + FSM.GetState().Error = "云存档解压失败"; + FSM.ChangeState(); + return; + } } } diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveStateMenu.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveStateMenu.cs index eff8c86a..b98ed527 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveStateMenu.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveStateMenu.cs @@ -92,18 +92,16 @@ namespace AxibugEmuOnline.Client public override void OnExcute(OptionUI optionUI, ref bool cancelHide) { - if (m_savFile.IsBusy) + if (m_savFile.IsBusy) //取消同步进程 { - OverlayManager.PopTip("存档正在同步中"); - cancelHide = true; - return; + m_savFile.FSM.ChangeState(); } var stateData = m_ingameUI.Core.GetStateBytes(); var tex = m_ingameUI.Core.OutputPixel; var screenData = tex.ToJPG(m_ingameUI.Core.DrawCanvas.transform.localScale); - m_savFile.Save(m_savFile.Sequecen, stateData, screenData); + m_savFile.Save(m_savFile.Sequecen + 1, stateData, screenData); } } @@ -167,7 +165,6 @@ namespace AxibugEmuOnline.Client public override void OnExcute(OptionUI optionUI, ref bool cancelHide) { if (m_savFile.GetCurrentState() is not SaveFile.ConflictState) return; - cancelHide = true; m_savFile.FSM.ChangeState(); } } @@ -187,7 +184,6 @@ namespace AxibugEmuOnline.Client public override void OnExcute(OptionUI optionUI, ref bool cancelHide) { if (m_savFile.GetCurrentState() is not SaveFile.ConflictState) return; - cancelHide = true; m_savFile.FSM.ChangeState(); } } From b07972f66d4049d79e6aa2fb41005c26378499f2 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Wed, 20 Aug 2025 15:25:25 +0800 Subject: [PATCH 3/3] inputsystem debug --- .../Manager/InputDevicesManager/InputDevicesManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputDevicesManager.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputDevicesManager.cs index c887489a..3c540c77 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputDevicesManager.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/InputDevicesManager/InputDevicesManager.cs @@ -79,6 +79,13 @@ namespace AxibugEmuOnline.Client.InputDevices { foreach (var device in m_devices.Values) device.Update(); + DebugInputSystem(); + } + + private static void DebugInputSystem() + { + return; +#if ENABLE_INPUT_SYSTEM foreach (var device in InputSystem.devices) { if (device is Mouse) @@ -91,7 +98,7 @@ namespace AxibugEmuOnline.Client.InputDevices } } } - +#endif } } } \ No newline at end of file