From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/GMCommand/GMInputWin.cs | 325 +++++++++++++++++++++++++----------------------------
1 files changed, 152 insertions(+), 173 deletions(-)
diff --git a/Main/System/GMCommand/GMInputWin.cs b/Main/System/GMCommand/GMInputWin.cs
index ce2499f..ac90a1e 100644
--- a/Main/System/GMCommand/GMInputWin.cs
+++ b/Main/System/GMCommand/GMInputWin.cs
@@ -3,189 +3,168 @@
using UnityEngine;
using UnityEngine.UI;
-namespace vnxbqy.UI
+public class GMInputWin : UIBase
{
- public class GMInputWin : UIBase
+ [SerializeField]
+ private ScrollerController _cmdCtrl;
+
+ [SerializeField]
+ private InputField _inputCmd;
+
+ [SerializeField]
+ private Button _closeBtn;
+
+ [SerializeField]
+ private Button _lookBtn;
+
+ [SerializeField]
+ private Button _sendBtn;
+
+
+ [SerializeField]
+ private Button _gmInfoBtn;
+
+ [SerializeField]
+ private Button _clearBtn;
+
+ [SerializeField]
+ private Button achieveJumpTestBtn;
+
+ [SerializeField]
+ private GameObject _cmdContent;
+
+ private List<string> recordCmdlist;
+
+ GMCmdManager cmdModel { get { return GMCmdManager.Instance; } }
+
+ protected override void InitComponent()
{
- [SerializeField]
- private ScrollerController _cmdCtrl;
+ _closeBtn.onClick.AddListener(OnClickCloseBtn);
+ _lookBtn.onClick.AddListener(OnClickLookBtn);
+ _sendBtn.onClick.AddListener(() => { OnClickSendBtn(); });
+ _gmInfoBtn.onClick.AddListener(OnClickGMInfoBtn);
+ _clearBtn.onClick.AddListener(OnClickClearBtn);
+ achieveJumpTestBtn.AddListener(ClickAchieveJumpBtn);
+ }
- [SerializeField]
- private InputField _inputCmd;
- [SerializeField]
- private Button _closeBtn;
+ protected override void OnPreOpen()
+ {
+ base.OnPreOpen();
+ _cmdCtrl.OnRefreshCell += RefreshCmdCell;
- [SerializeField]
- private Button _lookBtn;
+ _cmdContent.SetActive(false);
+ }
- [SerializeField]
- private Button _sendBtn;
-
- [SerializeField]
- private Button m_CrossServerSend;
-
- [SerializeField]
- private Button _gmInfoBtn;
-
- [SerializeField]
- private Button _clearBtn;
-
- [SerializeField]
- private Button achieveJumpTestBtn;
-
- [SerializeField]
- private GameObject _cmdContent;
-
- private List<string> recordCmdlist;
-
- GMCmdModel cmdModel { get { return GMCmdModel.Instance; } }
-
-
- protected override void OnPreOpen()
+ protected override void OnOpen()
+ {
+ this.transform.SetAsLastSibling();
+ }
+ protected void LateUpdate()
+ {
+ if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
{
- base.OnPreOpen();
- _cmdCtrl.OnRefreshCell += RefreshCmdCell;
- _closeBtn.onClick.AddListener(OnClickCloseBtn);
- _lookBtn.onClick.AddListener(OnClickLookBtn);
- _sendBtn.onClick.AddListener(() => { OnClickSendBtn(); });
- _gmInfoBtn.onClick.AddListener(OnClickGMInfoBtn);
- _clearBtn.onClick.AddListener(OnClickClearBtn);
- achieveJumpTestBtn.AddListener(ClickAchieveJumpBtn);
- m_CrossServerSend.SetListener(SendCrossServerGM);
+ OnClickSendBtn();
+ }
+ }
+
+ private void CreateCmdCell()
+ {
+ _cmdCtrl.Refresh();
+ int i = 0;
+ for (i = recordCmdlist.Count - 1; i > -1; i--)
+ {
+ _cmdCtrl.AddCell(ScrollerDataType.Header, i);
+ }
+ _cmdCtrl.Restart();
+ }
+
+ private void RefreshCmdCell(ScrollerDataType type, CellView cell)
+ {
+ Button cellBtn = cell.GetComponent<Button>();
+ Text cmdText = cell.transform.Find("Text").GetComponent<Text>();
+ string cmdStr = recordCmdlist[cell.index];
+ cmdText.text = cmdStr;
+ cellBtn.onClick.RemoveAllListeners();
+ cellBtn.onClick.AddListener(() =>
+ {
+ OnClickCmdCell(cmdStr);
+ });
+ }
+
+ private void OnClickCmdCell(string paramSet)
+ {
+ _inputCmd.text = paramSet;
+ }
+
+ private void OnClickGMInfoBtn()
+ {
+ ServerTipDetails.OpenGMPanel();
+ }
+
+ private void OnClickLookBtn()
+ {
+ if (_cmdContent.gameObject.activeInHierarchy)
+ {
_cmdContent.SetActive(false);
}
-
- protected override void OnOpen()
+ else
{
- base.HandleOpen();
- this.transform.SetAsLastSibling();
+ _cmdContent.SetActive(true);
+ recordCmdlist = cmdModel.GetRecordCmdlist();
+ CreateCmdCell();
}
- protected void LateUpdate()
- {
- if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
- {
- OnClickSendBtn();
- }
- }
-
- private void CreateCmdCell()
- {
- _cmdCtrl.Refresh();
- int i = 0;
- for (i = recordCmdlist.Count - 1; i > -1; i--)
- {
- _cmdCtrl.AddCell(ScrollerDataType.Header, i);
- }
- _cmdCtrl.Restart();
- }
-
- private void RefreshCmdCell(ScrollerDataType type, CellView cell)
- {
- Button cellBtn = cell.GetComponent<Button>();
- Text cmdText = cell.transform.Find("Text").GetComponent<Text>();
- string cmdStr = recordCmdlist[cell.index];
- cmdText.text = cmdStr;
- cellBtn.onClick.RemoveAllListeners();
- cellBtn.onClick.AddListener(() =>
- {
- OnClickCmdCell(cmdStr);
- });
- }
-
- private void OnClickCmdCell(string paramSet)
- {
- _inputCmd.text = paramSet;
- }
-
- private void OnClickGMInfoBtn()
- {
- ServerTipDetails.OpenGMPanel();
- }
-
- private void OnClickLookBtn()
- {
- if (_cmdContent.gameObject.activeInHierarchy)
- {
- _cmdContent.SetActive(false);
- }
- else
- {
- _cmdContent.SetActive(true);
- recordCmdlist = cmdModel.GetRecordCmdlist();
- CreateCmdCell();
- }
- }
-
- private void OnClickSendBtn()
- {
- if (_inputCmd.text == null || _inputCmd.text == "" || _inputCmd.text == string.Empty)
- return;
-
- // if (_inputCmd.text == "HappyXB")
- // {
- // WindowCenter.Instance.Open<HappyXBWin>();
- // return;
- // }
- // else if (_inputCmd.text == "TreasureFindHost")
- // {
- // WindowCenter.Instance.Open<TreasureFindHostWin>();
- // return;
- // }
- // if (_inputCmd.text.Equals("EnterFB 31250"))
- // {
- // cmdModel.OnSendGMQuest("SetFBStar 31250");
- // ClientGuardDungeon.RequestEnter();
- // return;
- // }
-
- cmdModel.OnSendGMQuest(_inputCmd.text.Trim());
- cmdModel.SetRecordCmdlist(_inputCmd.text);
- }
-
- private void SendCrossServerGM()
- {
- if (_inputCmd.text == null || _inputCmd.text == "" || _inputCmd.text == string.Empty)
- return;
-
- // if (_inputCmd.text == "HappyXB")
- // {
- // WindowCenter.Instance.Open<HappyXBWin>();
- // return;
- // }
- // else if (_inputCmd.text == "TreasureFindHost")
- // {
- // WindowCenter.Instance.Open<TreasureFindHostWin>();
- // return;
- // }
-
- cmdModel.SendCrossServerGMQuest(_inputCmd.text.Trim());
- cmdModel.SetRecordCmdlist(_inputCmd.text);
- }
-
-
- private void OnClickClearBtn()
- {
- cmdModel.ClearRecordCmdlist();
- OnClickLookBtn();
- }
-
- private void OnClickCloseBtn()
- {
- CloseWindow();
- }
-
- private void ClickAchieveJumpBtn()
- {
- // try
- // {
- // int achieveId = int.Parse(_inputCmd.text);
- // ModelCenter.Instance.GetModel<AchievementModel>().GotoCompleteAchievement(achieveId);
- // }
- // catch (Exception ex)
- // {
- // }
- }
-
}
+
+ private void OnClickSendBtn()
+ {
+ if (_inputCmd.text == null || _inputCmd.text == "" || _inputCmd.text == string.Empty)
+ return;
+
+ if (_inputCmd.text.StartsWith("GuildID"))
+ {
+ var id = GuildManager.Instance.DecryptGuildID(_inputCmd.text.Substring(8));
+ ServerTipDetails.ReceivePackage("鍏細ID锛�" + id);
+ return;
+ }
+ // else if (_inputCmd.text == "TreasureFindHost")
+ // {
+ // WindowCenter.Instance.Open<TreasureFindHostWin>();
+ // return;
+ // }
+ // if (_inputCmd.text.Equals("EnterFB 31250"))
+ // {
+ // cmdModel.OnSendGMQuest("SetFBStar 31250");
+ // ClientGuardDungeon.RequestEnter();
+ // return;
+ // }
+
+ cmdModel.OnSendGMQuest(_inputCmd.text.Trim());
+ cmdModel.SetRecordCmdlist(_inputCmd.text);
+ }
+
+
+ private void OnClickClearBtn()
+ {
+ cmdModel.ClearRecordCmdlist();
+ OnClickLookBtn();
+ }
+
+ private void OnClickCloseBtn()
+ {
+ CloseWindow();
+ }
+
+ private void ClickAchieveJumpBtn()
+ {
+ // try
+ // {
+ // int achieveId = int.Parse(_inputCmd.text);
+ // ModelCenter.Instance.GetModel<AchievementModel>().GotoCompleteAchievement(achieveId);
+ // }
+ // catch (Exception ex)
+ // {
+ // }
+ }
+
}
--
Gitblit v1.8.0