From 0506120ede82d6f7d09886cdf35f7f94f65a4c2d Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Fri, 13 Dec 2024 17:06:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=86=85=E6=BB=A4?= =?UTF-8?q?=E9=95=9C=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=BB=A4=E9=95=9C=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/InGameUI/InGameUI_FilterSetting.cs | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs index 563c471..dcfa000 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_FilterSetting.cs @@ -1,6 +1,9 @@ -using AxibugEmuOnline.Client.ClientCore; +锘縰sing AxibugEmuOnline.Client.ClientCore; using System.Collections.Generic; using System.Linq; +using UnityEditor.Presets; +using UnityEngine; +using VirtualNes.Core; using static AxibugEmuOnline.Client.FilterManager; namespace AxibugEmuOnline.Client @@ -9,14 +12,34 @@ namespace AxibugEmuOnline.Client { private InGameUI m_gameUI; - public InGameUI_FilterSetting(InGameUI gameUI) : base("滤镜", null) + public InGameUI_FilterSetting(InGameUI gameUI) : base("婊ら暅", null) { m_gameUI = gameUI; } protected override List GetOptionMenus() { - return App.filter.Filters.Select(f => new FilterMenu(m_gameUI.RomFile, f) as OptionMenu).ToList(); + List menus = new List(); + menus.Add(new FilterNone(m_gameUI.RomFile)); + menus.AddRange(App.filter.Filters.Select(f => new FilterMenu(m_gameUI.RomFile, f) as OptionMenu)); + return menus; + } + + public class FilterNone : ExecuteMenu + { + private RomFile m_rom; + + public FilterNone(RomFile rom) : base("鍙栨秷婊ら暅", null) + { + m_rom = rom; + } + + public override void OnExcute(OptionUI optionUI, ref bool cancelHide) + { + App.filter.ShutDownFilter(); + + App.filter.SetupFilter(m_rom, null, null); + } } public class FilterMenu : ExpandMenu From 7123103fd6f102b273f919b14ba994bb3803e840 Mon Sep 17 00:00:00 2001 From: "ALIENJACK\\alien" Date: Fri, 13 Dec 2024 17:52:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E8=87=AA=E8=A1=8C?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=B8=B8=E6=88=8F=E6=97=B6,=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E8=BF=98=E6=9C=AA=E7=99=BB=E5=BD=95=E6=88=90=E5=8A=9F?= =?UTF-8?q?,=E5=B0=86=E4=BC=9A=E5=9C=A8=E7=99=BB=E5=BD=95=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=90=8E=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA=E6=88=BF?= =?UTF-8?q?=E9=97=B4(=E4=BB=8E=E5=8A=A0=E5=85=A5=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E5=85=A5=E5=8F=A3=E5=88=9B=E5=BB=BA=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E4=BC=9A=E8=A7=A6=E5=8F=91=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E9=80=BB=E8=BE=91)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Script/AppMain/UI/InGameUI/InGameUI.cs | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs index c58f61b..21a28f4 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI.cs @@ -1,5 +1,6 @@ -using AxibugEmuOnline.Client.ClientCore; +锘縰sing AxibugEmuOnline.Client.ClientCore; using AxibugEmuOnline.Client.Event; +using System; using System.Collections.Generic; namespace AxibugEmuOnline.Client @@ -11,7 +12,7 @@ namespace AxibugEmuOnline.Client public RomFile RomFile => m_rom; public override bool Enable => gameObject.activeInHierarchy; - /// 指示该游戏实例是否处于联机模式 + /// 鎸囩ず璇ユ父鎴忓疄渚嬫槸鍚﹀浜庤仈鏈烘ā寮 public bool IsNetPlay { get @@ -53,13 +54,13 @@ namespace AxibugEmuOnline.Client base.OnDestroy(); } - /// 保存快速快照 + /// 淇濆瓨蹇熷揩鐓 public void SaveQuickState(object state) { m_state = state; } /// - /// 读取快速快照 + /// 璇诲彇蹇熷揩鐓 /// /// /// @@ -68,21 +69,31 @@ namespace AxibugEmuOnline.Client return m_state; } + private bool m_delayCreateRoom; public void Show(RomFile currentRom, IEmuCore core) { - m_state = null;//清空游戏快照 + m_delayCreateRoom = false; + m_state = null;//娓呯┖娓告垙蹇収 CommandDispatcher.Instance.RegistController(this); m_rom = currentRom; Core = core; m_stepPerformer.Reset(); - if (App.user.IsLoggedIn && !App.roomMgr.InRoom) - { - App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash); + if (!App.roomMgr.InRoom) + { + if (App.user.IsLoggedIn) + App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash); + else + { + m_delayCreateRoom = true; + OverlayManager.PopTip("绋嶅悗灏嗕細寤虹珛鎴块棿"); + } } + Eventer.Instance.RegisterEvent(EEvent.OnLoginSucceed, OnLoggedIn); Eventer.Instance.RegisterEvent(EEvent.OnRoomWaitStepChange, OnServerStepUpdate); + Eventer.Instance.RegisterEvent(EEvent.OnMineJoinRoom, OnRoomJoin); gameObject.SetActiveEx(true); @@ -95,8 +106,21 @@ namespace AxibugEmuOnline.Client filter.ApplyPreset(preset); App.filter.EnableFilter(filter); } - } - + } + + private void OnRoomJoin() + { + m_delayCreateRoom = false; + } + + private void OnLoggedIn() + { + if (m_delayCreateRoom) + { + App.roomMgr.SendCreateRoom(m_rom.ID, 0, m_rom.Hash); + } + } + private void OnServerStepUpdate(int step) { m_stepPerformer.Perform(step); @@ -114,23 +138,21 @@ namespace AxibugEmuOnline.Client { OverlayManager.PopSideBar(menus, 0, PopMenu_OnHide); - if (!IsNetPlay)//单人模式暂停模拟器 - { + if (!IsNetPlay)//鍗曚汉妯″紡鏆傚仠妯℃嫙鍣 Core.Pause(); - } } - //菜单关闭时候 + //鑿滃崟鍏抽棴鏃跺 private void PopMenu_OnHide() { - if (!IsNetPlay)//单人模式恢复模拟器的暂停 + if (!IsNetPlay)//鍗曚汉妯″紡鎭㈠妯℃嫙鍣ㄧ殑鏆傚仠 Core.Resume(); } - - public void QuitGame() { Eventer.Instance.UnregisterEvent(EEvent.OnRoomWaitStepChange, OnServerStepUpdate); + Eventer.Instance.UnregisterEvent(EEvent.OnLoginSucceed, OnLoggedIn); + Eventer.Instance.UnregisterEvent(EEvent.OnMineJoinRoom, OnRoomJoin); App.roomMgr.SendLeavnRoom(); App.emu.StopGame(); }