浏览代码

雅集答题聊天间隔

hexiaojie 1 年之前
父节点
当前提交
e9aaff7cc3

+ 83 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_Button22.cs

@@ -0,0 +1,83 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.League
+{
+    public partial class UI_Button22
+    {
+        public GButton target;
+        public Controller m_c1;
+        public GImage m_an_grey;
+        public GImage m_an_yellow;
+        public GTextField m_send;
+        public GTextField m_timeStr;
+        public const string URL = "ui://tw70qm9dndv9tpi";
+        public const string PACKAGE_NAME = "League";
+        public const string RES_NAME = "Button22";
+        private static UI_Button22 _proxy;
+
+        public static UI_Button22 Create(GObject gObject = null)
+        {
+            var ui = new UI_Button22();
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_Button22 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_Button22();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static void ProxyEnd()
+        {
+            if (_proxy != null)
+            {
+                _proxy.Dispose();
+            }
+        }
+
+        public static void ClearProxy()
+        {
+            ProxyEnd();
+            _proxy = null;
+        }
+
+        private void Init(GComponent comp)
+        {
+            m_c1 = comp.GetController("c1");
+            m_an_grey = (GImage)comp.GetChild("an_grey");
+            m_an_yellow = (GImage)comp.GetChild("an_yellow");
+            m_send = (GTextField)comp.GetChild("send");
+            m_timeStr = (GTextField)comp.GetChild("timeStr");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            m_an_grey = null;
+            m_an_yellow = null;
+            m_send = null;
+            m_timeStr = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/League/UI_Button22.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 421894bd88cce334389d764acc0736c7
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

@@ -34,7 +34,7 @@ namespace UI.League
         public GList m_listJoin;
         public GList m_listChat;
         public GTextInput m_txtChat;
-        public GButton m_btnSend;
+        public UI_Button22 m_btnSend;
         public const string URL = "ui://tw70qm9dpvb453";
         public const string PACKAGE_NAME = "League";
         public const string RES_NAME = "LeagueAnsweringUI";
@@ -109,7 +109,7 @@ namespace UI.League
             m_listJoin = (GList)comp.GetChild("listJoin");
             m_listChat = (GList)comp.GetChild("listChat");
             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)
         {
@@ -141,6 +141,7 @@ namespace UI.League
             m_listJoin = null;
             m_listChat = null;
             m_txtChat = null;
+            m_btnSend.Dispose();
             m_btnSend = null;
             if(disposeTarget && target != null)
             {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/GameConfig.cs

@@ -21,7 +21,7 @@ namespace GFGGame
             var result = JsonMapper.ToObject<Result>(json);
             LoginAddress = result.loginApiUrl;
             // LoginAddress = "http://login.gfg.com:10005";
-            //LoginAddress = "127.0.0.1:10005";//测试地址
+            LoginAddress = "127.0.0.1:10005";//测试地址
             PlatformName = result.platformName;
             showGM = int.Parse(result.showGM);
             if(!string.IsNullOrEmpty(result.openTime))

+ 21 - 1
GameClient/Assets/Game/HotUpdate/Views/League/LeagueAnsweringView.cs

@@ -42,7 +42,7 @@ namespace GFGGame
 
             _ui.m_btnBack.onClick.Add(OnBtnBackClick);
             _ui.m_btnRule.onClick.Add(OnBtnRuleClick);
-            _ui.m_btnSend.onClick.Add(OnBtnSendClick);
+            _ui.m_btnSend.target.onClick.Add(OnBtnSendClick);
 
             _ui.m_listResult.itemRenderer = RenderListResultItem;
             _ui.m_listJoin.itemRenderer = RenderListJoinItem;
@@ -125,16 +125,36 @@ 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("还没有输入想发送的内容哦");
                 return;
             }
+            
             bool result = await ChatSProxy.ReqSendChatMsg(ChatType.LeagueQuestion, _ui.m_txtChat.text);
             if (result)
             {
                 _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;
+                    }
+                });
             }
         }
         private void UpdateActiveTime(object param)

二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0!a.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_1!a.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_1.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_2!a.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_2.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_3!a.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_3.png


二进制
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


二进制
GameClient/Assets/ResIn/UI/League/League_fui.bytes