Эх сурвалжийг харах

雅集界面聊天加入时间间隔

hexiaojie 1 жил өмнө
parent
commit
735ecf7348

+ 3 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_LeagueChatUI.cs

@@ -10,7 +10,7 @@ namespace UI.League
         public GLoader m_loaBg;
         public GList m_list;
         public GTextInput m_txtChat;
-        public GButton m_btnSend;
+        public UI_Button22 m_btnSend;
         public const string URL = "ui://tw70qm9dofwu8d";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "LeagueChatUI";
@@ -61,13 +61,14 @@ namespace UI.League
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_list = (GList)comp.GetChild("list");
             m_txtChat = (GTextInput)comp.GetChild("txtChat");
-            m_btnSend = (GButton)comp.GetChild("btnSend");
+            m_btnSend = (UI_Button22)UI_Button22.Create(comp.GetChild("btnSend"));
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_loaBg = null;
             m_list = null;
             m_txtChat = null;
+            m_btnSend.Dispose();
             m_btnSend = null;
             if(disposeTarget && target != null)
             {

+ 20 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueChatView.cs

@@ -34,7 +34,7 @@ namespace GFGGame
             _ui.m_list.itemProvider = GetListChatItemResource;
             _ui.m_list.SetVirtual();
 
-            _ui.m_btnSend.onClick.Add(OnBtnSendClick);
+            _ui.m_btnSend.target.onClick.Add(OnBtnSendClick);
         }
         protected override void AddEventListener()
         {
@@ -90,6 +90,12 @@ namespace GFGGame
         }
         private async void OnBtnSendClick()
         {
+            if (_ui.m_btnSend.m_c1.selectedIndex == 1)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("消息发送频繁");
+                return;
+            }
+            
             if (string.IsNullOrEmpty(_ui.m_txtChat.text))
             {
                 PromptController.Instance.ShowFloatTextPrompt("还没有输入想发送的内容哦");
@@ -100,6 +106,19 @@ namespace GFGGame
             {
                 _ui.m_txtChat.text = "";
                 UpdateChatList();
+                
+                int num = GlobalCfgArray.globalCfg.chatTime;
+                _ui.m_btnSend.m_timeStr.text = num.ToString();
+                _ui.m_btnSend.m_c1.selectedIndex = 1;
+                Timers.inst.Add(1, 10, (param) =>
+                {
+                    num--;
+                    _ui.m_btnSend.m_timeStr.text = num.ToString();
+                    if (num == 0)
+                    {
+                        _ui.m_btnSend.m_c1.selectedIndex = 0;
+                    }
+                });
             }
         }
     }

BIN
GameClient/Assets/ResIn/UI/League/League_fui.bytes