From cb653cf75b17b9bdca0b5b9e6b88edf1ca72e90c Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 17 十月 2025 09:54:11 +0800
Subject: [PATCH] 0312 删除旧的日常代码3
---
Main/System/GMCommand/GMCmdPanel.cs | 149 +++++++++++++++++++++++--------------------------
1 files changed, 70 insertions(+), 79 deletions(-)
diff --git a/Main/System/GMCommand/GMCmdPanel.cs b/Main/System/GMCommand/GMCmdPanel.cs
index c51d371..0df2d85 100644
--- a/Main/System/GMCommand/GMCmdPanel.cs
+++ b/Main/System/GMCommand/GMCmdPanel.cs
@@ -5,92 +5,83 @@
using UnityEngine.Events;
-namespace vnxbqy.UI
+public class GMCmdPanel : UIBase
{
- public class GMCmdPanel : UIBase
+
+ [SerializeField]
+ private ScrollerController _cmdCtrl;
+
+ [SerializeField]
+ private Button _closeBtn;
+
+ GMCmdManager _cmdModel;
+ GMCmdManager cmdModel{ get { return GMCmdManager.Instance; } }
+
+ protected override void InitComponent()
+ {
+ _closeBtn.AddListener(OnClickCloseBtn);
+ }
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ _cmdCtrl.OnRefreshCell += RefreshCmdCell;
+
+
+ CreateCmdCell();
+ }
+
+ protected override void OnOpen()
+ {
+ base.OnOpen();
+ this.transform.SetAsLastSibling();
+ }
+
+
+ private void CreateCmdCell()
+ {
+ _cmdCtrl.Refresh();
+ var allKeys = GmCmdConfig.dic.Keys;
+ foreach (var key in allKeys)
+ {
+ _cmdCtrl.AddCell(ScrollerDataType.Header, key);
+ }
+ _cmdCtrl.Restart();
+ }
+
+ private void RefreshCmdCell(ScrollerDataType type, CellView cell)
+ {
+ Button cellBtn = cell.GetComponent<Button>();
+ Text cmdText = cell.transform.Find("Text").GetComponent<Text>();
+ GmCmdConfig gmCmdModel = GmCmdConfig.Get(cell.index);
+ if (gmCmdModel == null)
+ return;
+
+ cmdText.text = gmCmdModel.Cmd + "=" + gmCmdModel.ParamSet;
+ cellBtn.onClick.RemoveAllListeners();
+ cellBtn.onClick.AddListener(() => { OnClickCmdCell(gmCmdModel.ParamSet); });
+ }
+
+ private void OnClickCmdCell(string paramSet)
+ {
+ SplitLongGMCmd(paramSet);
+ }
+
+ public void SplitLongGMCmd(string value)
{
- [SerializeField]
- private ScrollerController _cmdCtrl;
-
- [SerializeField]
- private Button _closeBtn;
-
- GMCmdModel _cmdModel;
- GMCmdModel cmdModel{ get { return GMCmdModel.Instance; } }
-
- protected override void OnPreOpen()
+ string[] longCmdArray = value.Split('|');
+ for (int i = 0; i < longCmdArray.Length; i++)
{
- base.OnPreOpen();
- _cmdCtrl.OnRefreshCell += RefreshCmdCell;
-
- _closeBtn.onClick.AddListener(OnClickCloseBtn);
-
- CreateCmdCell();
+ cmdModel.OnSendGMQuest(longCmdArray[i].Trim());
}
- protected override void OnOpen()
- {
- base.OnOpen();
- this.transform.SetAsLastSibling();
- }
-
-
- private void CreateCmdCell()
- {
- _cmdCtrl.Refresh();
- var allKeys = GmCmdConfig.dic.Keys;
- foreach (var key in allKeys)
- {
- _cmdCtrl.AddCell(ScrollerDataType.Header, key);
- }
- _cmdCtrl.Restart();
- }
-
- private void RefreshCmdCell(ScrollerDataType type, CellView cell)
- {
- Button cellBtn = cell.GetComponent<Button>();
- Text cmdText = cell.transform.Find("Text").GetComponent<Text>();
- GmCmdConfig gmCmdModel = GmCmdConfig.Get(cell.index);
- if (gmCmdModel == null)
- return;
-
- cmdText.text = gmCmdModel.Cmd + "=" + gmCmdModel.ParamSet;
- cellBtn.onClick.RemoveAllListeners();
- cellBtn.onClick.AddListener(() => { OnClickCmdCell(gmCmdModel.ParamSet); });
- }
-
- private void OnClickCmdCell(string paramSet)
- {
- SplitLongGMCmd(paramSet);
- }
-
- public void SplitLongGMCmd(string value)
- {
- if (value == "RoleDead" && CrossServerUtility.IsCrossServer())
- {
- string[] longCmdArray = value.Split('|');
- for (int i = 0; i < longCmdArray.Length; i++)
- {
- cmdModel.SendCrossServerGMQuest(longCmdArray[i].Trim());
- }
- }
- else
- {
- string[] longCmdArray = value.Split('|');
- for (int i = 0; i < longCmdArray.Length; i++)
- {
- cmdModel.OnSendGMQuest(longCmdArray[i].Trim());
- }
- }
-
- }
-
- public void OnClickCloseBtn()
- {
- CloseWindow();
- }
}
+
+ public void OnClickCloseBtn()
+ {
+ CloseWindow();
+ }
+
}
--
Gitblit v1.8.0