zhaoyang 3 年之前
父節點
當前提交
49cfabda25

+ 14 - 14
FGUIProject/assets/Friend/FriendAddUI.xml

@@ -1,17 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1062,1300">
-  <controller name="c1" pages="0,,1," selected="1"/>
+  <controller name="c1" pages="0,,1," selected="0"/>
   <displayList>
     <image id="n0_pdeo" name="n0" src="pdeoa" fileName="images/gg_gg_dtpian.png" xy="0,-72"/>
     <image id="n26_z73e" name="n26" src="kztethr" fileName="imagesExport/hyhy_btbt_1.png" pkg="eg2y0ldp" xy="293,45" group="n28_z73e"/>
     <text id="n27_z73e" name="txtName" xy="417,45" pivot="0.5,0" size="228,74" group="n28_z73e" fontSize="56" color="#8f6e30" text="添加好友"/>
     <group id="n28_z73e" name="n28" xy="293,45" size="475,85"/>
     <component id="n1_pdeo" name="btnTabSearch" src="pdeob" fileName="components/BtnTab.xml" xy="154,1192">
-      <Button icon="ui://wez2ujnnz73e18" selectedIcon="ui://wez2ujnnz73e10" controller="c1" page="0"/>
+      <Button checked="true" icon="ui://wez2ujnnz73e18" selectedIcon="ui://wez2ujnnz73e10" controller="c1" page="0"/>
     </component>
     <component id="n2_pdeo" name="btnTabApply" src="pdeob" fileName="components/BtnTab.xml" xy="548,1192">
-      <Button checked="true" icon="ui://wez2ujnnz73e11" selectedIcon="ui://wez2ujnnz73e19" controller="c1" page="1"/>
+      <Button icon="ui://wez2ujnnz73e11" selectedIcon="ui://wez2ujnnz73e19" controller="c1" page="1"/>
     </component>
+    <image id="n29_z73e" name="n29" src="z73ey" fileName="images/hy_tjhy_ssk.png" xy="101,176" group="n34_z73e"/>
+    <text id="n5_pdeo" name="txtSearch" xy="126,182" size="478,65" group="n34_z73e" fontSize="44" color="#948364" ubb="true" autoSize="none" autoClearText="true" text="" input="true" prompt="[color=#BCB196]输入玩家名称[/color]"/>
+    <component id="n31_z73e" name="btnClear" src="z73e1a" fileName="components/BtnClear.xml" xy="606,182" group="n34_z73e"/>
+    <component id="n6_pdeo" name="btnSearch" src="pdeog" fileName="components/BtnSearch.xml" xy="697,170" group="n34_z73e">
+      <Button icon="ui://wez2ujnnz73e13"/>
+    </component>
+    <group id="n34_z73e" name="n34" xy="101,170" size="873,90" group="n17_pdeo"/>
     <text id="n32_z73e" name="txtTips" xy="102,289" size="196,64" group="n33_z73e" fontSize="48" color="#998262" text="搜索结果"/>
     <image id="n30_z73e" name="n30" src="z73ev" fileName="images/line.png" xy="318,324" group="n33_z73e"/>
     <component id="n7_pdeo" name="btnRefresh" src="pdeoh" fileName="components/BtnRefresh.xml" xy="859,280" group="n33_z73e">
@@ -25,17 +32,10 @@
       <item/>
       <item/>
     </list>
-    <image id="n29_z73e" name="n29" src="z73ey" fileName="images/hy_tjhy_ssk.png" xy="101,176" group="n34_z73e"/>
-    <text id="n5_pdeo" name="txtSearch" xy="126,182" size="478,65" group="n34_z73e" fontSize="44" color="#948364" ubb="true" autoSize="none" autoClearText="true" text="" input="true" prompt="[color=#BCB196]输入玩家名称[/color]"/>
-    <component id="n31_z73e" name="btnClear" src="z73e1a" fileName="components/BtnClear.xml" xy="606,182" group="n34_z73e"/>
-    <component id="n6_pdeo" name="btnSearch" src="pdeog" fileName="components/BtnSearch.xml" xy="697,170" group="n34_z73e">
-      <Button icon="ui://wez2ujnnz73e13"/>
-    </component>
-    <group id="n34_z73e" name="n34" xy="101,170" size="873,90" group="n17_pdeo"/>
     <group id="n17_pdeo" name="grpSearch" xy="78,170" size="905,921" advanced="true">
       <gearDisplay controller="c1" pages="0"/>
     </group>
-    <list id="n22_pdeo" name="listApply" xy="76,183" size="910,762" group="n25_pdeo" overflow="scroll" lineGap="24" defaultItem="ui://wez2ujnnpdeoj">
+    <list id="n22_pdeo" name="listApply" xy="76,177" size="910,790" group="n25_pdeo" overflow="scroll" lineGap="24" defaultItem="ui://wez2ujnnpdeoj">
       <gearDisplay controller="c1" pages="1"/>
       <item/>
       <item/>
@@ -44,13 +44,13 @@
       <item/>
       <item/>
     </list>
-    <component id="n23_pdeo" name="btnDeleteAll" src="ih7595" fileName="components/Button11.xml" pkg="mk0fwx0x" xy="116,1030" group="n25_pdeo">
+    <component id="n23_pdeo" name="btnRefuseAll" src="ih7595" fileName="components/Button11.xml" pkg="mk0fwx0x" xy="116,1017" size="380,113" group="n25_pdeo">
       <Button title="一键拒绝"/>
     </component>
-    <component id="n24_pdeo" name="btnAddAll" src="ih7594" fileName="components/Button10.xml" pkg="mk0fwx0x" xy="558,1030" group="n25_pdeo">
+    <component id="n24_pdeo" name="btnAgreeAll" src="ih7594" fileName="components/Button10.xml" pkg="mk0fwx0x" xy="558,1017" size="380,113" group="n25_pdeo">
       <Button title="一键接受"/>
     </component>
-    <group id="n25_pdeo" name="grpApply" xy="76,183" size="910,952" advanced="true">
+    <group id="n25_pdeo" name="grpApply" xy="76,177" size="910,953" advanced="true">
       <gearDisplay controller="c1" pages="1"/>
     </group>
   </displayList>

+ 18 - 11
FGUIProject/assets/Friend/FriendUI.xml

@@ -7,7 +7,24 @@
     <group id="n9_z73e" name="grpCount" xy="705,100" size="317,51"/>
     <image id="n17_z73e" name="n17" src="q08xs" fileName="imagesExport/hz_xzkuang.png" pkg="eg2y0ldp" xy="200,93" group="n13_z73e"/>
     <text id="n12_z73e" name="txtName" xy="370,98" pivot="0.5,0" size="71,46" group="n13_z73e" fontSize="34" color="#fff0db" text="套装"/>
-    <group id="n13_z73e" name="grpname" xy="200,93" size="412,62"/>
+    <group id="n13_z73e" name="grpName" xy="200,93" size="412,62"/>
+    <image id="n18_z73e" name="n18" src="z73e1c" fileName="images/dz_hz_rwdh_1.png" xy="89,1265" group="n20_z73e">
+      <relation target="" sidePair="bottom-bottom"/>
+    </image>
+    <text id="n19_z73e" name="txtSlogan" xy="105,1267" size="364,96" group="n20_z73e" fontSize="30" color="#997350" vAlign="middle" ubb="true" autoSize="none" autoClearText="true" text="采菊东篱下,悠然见南山。山气日夕佳,飞鸟相与还。此中有真意,欲辨已忘言。">
+      <relation target="" sidePair="bottom-bottom"/>
+    </text>
+    <group id="n20_z73e" name="grpSlogan" xy="89,1265" size="394,131" advanced="true"/>
+    <component id="n15_z73e" name="btnSolgan" src="jdju1" fileName="components/BtnModel1.xml" xy="40,1393" group="n16_z73e">
+      <Button icon="ui://wez2ujnnz73et"/>
+    </component>
+    <component id="n14_z73e" name="btnDelete" src="jdju1" fileName="components/BtnModel1.xml" xy="40,1530" group="n16_z73e">
+      <Button icon="ui://wez2ujnnz73es"/>
+    </component>
+    <component id="n1_jdju" name="btnAdd" src="jdju1" fileName="components/BtnModel1.xml" xy="40,1667" group="n16_z73e"/>
+    <group id="n16_z73e" name="n16" xy="40,1393" size="112,394" advanced="true" layout="vt" lineGap="17" excludeInvisibles="true">
+      <relation target="" sidePair="left-left,bottom-bottom"/>
+    </group>
     <list id="n7_pdeo" name="list" xy="652,220" size="428,1460" overflow="scroll" lineGap="25" defaultItem="ui://wez2ujnnpdeo9">
       <relation target="" sidePair="right-right,top-top,bottomext-bottom"/>
       <item/>
@@ -22,15 +39,5 @@
       <relation target="" sidePair="right-right,bottom-bottom"/>
       <Button title="一键领取"/>
     </component>
-    <component id="n15_z73e" name="btnSolgan" src="jdju1" fileName="components/BtnModel1.xml" xy="40,1393" group="n16_z73e">
-      <Button icon="ui://wez2ujnnz73et"/>
-    </component>
-    <component id="n14_z73e" name="btnDelete" src="jdju1" fileName="components/BtnModel1.xml" xy="40,1530" group="n16_z73e">
-      <Button icon="ui://wez2ujnnz73es"/>
-    </component>
-    <component id="n1_jdju" name="btnAdd" src="jdju1" fileName="components/BtnModel1.xml" xy="40,1667" group="n16_z73e"/>
-    <group id="n16_z73e" name="n16" xy="40,1393" size="112,394" advanced="true" layout="vt" lineGap="17" excludeInvisibles="true">
-      <relation target="" sidePair="left-left,bottom-bottom"/>
-    </group>
   </displayList>
 </component>

+ 1 - 0
FGUIProject/assets/Friend/package.xml

@@ -45,6 +45,7 @@
     <image id="z73e19" name="hyhy_anniu_3.png" path="/images/"/>
     <component id="z73e1a" name="BtnClear.xml" path="/components/"/>
     <image id="z73e1b" name="hyhy_tjtja.png" path="/images/"/>
+    <image id="z73e1c" name="dz_hz_rwdh_1.png" path="/images/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Friend" packageCount="2" genCode="true"/>
 </packageDescription>

+ 15 - 15
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Friend/UI_FriendAddUI.cs

@@ -11,16 +11,16 @@ namespace UI.Friend
         public GTextField m_txtName;
         public GButton m_btnTabSearch;
         public GButton m_btnTabApply;
-        public GTextField m_txtTips;
-        public GButton m_btnRefresh;
-        public GList m_listSearch;
         public GTextInput m_txtSearch;
         public GButton m_btnClear;
         public GButton m_btnSearch;
+        public GTextField m_txtTips;
+        public GButton m_btnRefresh;
+        public GList m_listSearch;
         public GGroup m_grpSearch;
         public GList m_listApply;
-        public GButton m_btnDeleteAll;
-        public GButton m_btnAddAll;
+        public GButton m_btnRefuseAll;
+        public GButton m_btnAgreeAll;
         public GGroup m_grpApply;
         public const string URL = "ui://wez2ujnnjdju2";
         public const string PACKAGE_NAME = "Friend";
@@ -73,16 +73,16 @@ namespace UI.Friend
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_btnTabSearch = (GButton)comp.GetChild("btnTabSearch");
             m_btnTabApply = (GButton)comp.GetChild("btnTabApply");
-            m_txtTips = (GTextField)comp.GetChild("txtTips");
-            m_btnRefresh = (GButton)comp.GetChild("btnRefresh");
-            m_listSearch = (GList)comp.GetChild("listSearch");
             m_txtSearch = (GTextInput)comp.GetChild("txtSearch");
             m_btnClear = (GButton)comp.GetChild("btnClear");
             m_btnSearch = (GButton)comp.GetChild("btnSearch");
+            m_txtTips = (GTextField)comp.GetChild("txtTips");
+            m_btnRefresh = (GButton)comp.GetChild("btnRefresh");
+            m_listSearch = (GList)comp.GetChild("listSearch");
             m_grpSearch = (GGroup)comp.GetChild("grpSearch");
             m_listApply = (GList)comp.GetChild("listApply");
-            m_btnDeleteAll = (GButton)comp.GetChild("btnDeleteAll");
-            m_btnAddAll = (GButton)comp.GetChild("btnAddAll");
+            m_btnRefuseAll = (GButton)comp.GetChild("btnRefuseAll");
+            m_btnAgreeAll = (GButton)comp.GetChild("btnAgreeAll");
             m_grpApply = (GGroup)comp.GetChild("grpApply");
         }
         public void Dispose(bool disposeTarget = false)
@@ -91,16 +91,16 @@ namespace UI.Friend
             m_txtName = null;
             m_btnTabSearch = null;
             m_btnTabApply = null;
-            m_txtTips = null;
-            m_btnRefresh = null;
-            m_listSearch = null;
             m_txtSearch = null;
             m_btnClear = null;
             m_btnSearch = null;
+            m_txtTips = null;
+            m_btnRefresh = null;
+            m_listSearch = null;
             m_grpSearch = null;
             m_listApply = null;
-            m_btnDeleteAll = null;
-            m_btnAddAll = null;
+            m_btnRefuseAll = null;
+            m_btnAgreeAll = null;
             m_grpApply = null;
             if(disposeTarget && target != null)
             {

+ 12 - 6
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Friend/UI_FriendUI.cs

@@ -10,11 +10,13 @@ namespace UI.Friend
         public GButton m_btnBack;
         public GTextField m_txtCount;
         public GTextField m_txtName;
-        public GList m_list;
-        public GButton m_btnSendAll;
+        public GTextField m_txtSlogan;
+        public GGroup m_grpSlogan;
         public GButton m_btnSolgan;
         public GButton m_btnDelete;
         public GButton m_btnAdd;
+        public GList m_list;
+        public GButton m_btnSendAll;
         public const string URL = "ui://wez2ujnnjdju0";
         public const string PACKAGE_NAME = "Friend";
         public const string RES_NAME = "FriendUI";
@@ -65,22 +67,26 @@ namespace UI.Friend
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_txtCount = (GTextField)comp.GetChild("txtCount");
             m_txtName = (GTextField)comp.GetChild("txtName");
-            m_list = (GList)comp.GetChild("list");
-            m_btnSendAll = (GButton)comp.GetChild("btnSendAll");
+            m_txtSlogan = (GTextField)comp.GetChild("txtSlogan");
+            m_grpSlogan = (GGroup)comp.GetChild("grpSlogan");
             m_btnSolgan = (GButton)comp.GetChild("btnSolgan");
             m_btnDelete = (GButton)comp.GetChild("btnDelete");
             m_btnAdd = (GButton)comp.GetChild("btnAdd");
+            m_list = (GList)comp.GetChild("list");
+            m_btnSendAll = (GButton)comp.GetChild("btnSendAll");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_btnBack = null;
             m_txtCount = null;
             m_txtName = null;
-            m_list = null;
-            m_btnSendAll = null;
+            m_txtSlogan = null;
+            m_grpSlogan = null;
             m_btnSolgan = null;
             m_btnDelete = null;
             m_btnAdd = null;
+            m_list = null;
+            m_btnSendAll = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 68 - 39
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendAddView.cs

@@ -1,6 +1,7 @@
 using UnityEngine;
 using FairyGUI;
 using UI.Friend;
+using System.Collections.Generic;
 
 namespace GFGGame
 {
@@ -8,7 +9,7 @@ namespace GFGGame
     {
         private UI_FriendAddUI _ui;
 
-
+        private List<int> _searchDatas = new List<int>();
         public override void Dispose()
         {
             if (_ui != null)
@@ -30,17 +31,20 @@ namespace GFGGame
             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
             _ui.m_listSearch.itemRenderer = RenderListSearchItem;
-            _ui.m_listApply.itemRenderer = RenderListApplyItem;
             _ui.m_btnSearch.onClick.Add(OnBtnSearchClick);
+            _ui.m_btnClear.onClick.Add(OnBtnClearClick);
             _ui.m_btnRefresh.onClick.Add(OnBtnRefreshClick);
 
+            _ui.m_listApply.itemRenderer = RenderListApplyItem;
+            _ui.m_btnAgreeAll.onClick.Add(OnBtnAgreeAllClick);
+            _ui.m_btnRefuseAll.onClick.Add(OnBtnRefuseAllClick);
         }
 
         protected override void OnInit()
         {
             base.OnInit();
 
-            _ui.m_c1.onChanged.Add(OnCtrlChange);
+            // _ui.m_c1.onChanged.Add(OnCtrlChange);
 
         }
         protected override void AddEventListener()
@@ -51,9 +55,11 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _ui.m_c1.selectedIndex = 1;
-
-            OnCtrlChange();
+            _ui.m_c1.selectedIndex = 0;
+            _ui.m_txtSearch.text = "";
+            _ui.m_btnClear.visible = false;
+            // OnCtrlChange();
+            OnBtnRefreshClick();
         }
 
         protected override void OnHide()
@@ -66,41 +72,67 @@ namespace GFGGame
 
         }
 
-        private void OnCtrlChange()
+        /**************************************************好友搜索***********************************************/
+
+        private void RenderListSearchItem(int index, GObject obj)
+        {
+            UI_ListSearchItem item = UI_ListSearchItem.Proxy(obj);
+            if (item.m_btnAdd.data == null)
+            {
+                item.m_btnAdd.onClick.Add(OnBtnAddClick);
+            }
+            UI_ListSearchItem.ProxyEnd();
+        }
+
+        //添加好友
+        private void OnBtnAddClick(EventContext context)
         {
-            // if (_ui.m_c1.selectedIndex == 0)
-            // {
-            //     UpdateListSearch();
-            // }
-            // else if (_ui.m_c1.selectedIndex == 1)
-            // {
-            //     _ui.m_listApply.numItems = 0;
-            // }
+            GObject obj = context.data as GObject;
         }
 
-        private void UpdateListSearch()
+        //搜索好友
+        private void OnBtnSearchClick()
         {
-            if (string.IsNullOrEmpty(_ui.m_txtSearch.text))
+            if (_ui.m_txtSearch.text.Length < 2)
             {
-                _ui.m_listSearch.numItems = 0;
+                PromptController.Instance.ShowFloatTextPrompt("请输入至少两个字符");
+                return;
             }
-            else
+            bool result = true;
+            if (result)
             {
-
+                _ui.m_txtTips.text = "搜索结果";
+                _ui.m_btnClear.visible = true;
+                _searchDatas = null;
+                _ui.m_listSearch.numItems = 0;
             }
         }
 
-        private void RenderListSearchItem(int index, GObject obj)
+        //清空搜索
+        private void OnBtnClearClick()
         {
-            UI_ListSearchItem item = UI_ListSearchItem.Proxy(obj);
-            if (item.m_btnAdd.data == null)
+            _ui.m_txtSearch.text = "";
+            _ui.m_btnClear.visible = false;
+            OnBtnRefreshClick();
+        }
+
+        //刷新好友列表
+        private void OnBtnRefreshClick()
+        {
+            _ui.m_txtTips.text = "推荐好友";
+            bool result = true;
+            if (result)
             {
-                item.m_btnAdd.onClick.Add(OnBtnAddClick);
+                _searchDatas = null;
+                _ui.m_listSearch.numItems = 0;
             }
-            UI_ListSearchItem.ProxyEnd();
         }
+
+        /**************************************************好友申请***********************************************/
+
         private void RenderListApplyItem(int index, GObject obj)
         {
+            int data = _searchDatas[index];
             UI_ListApplyItem item = UI_ListApplyItem.Proxy();
             if (item.m_btnAgree.data == null)
             {
@@ -112,35 +144,32 @@ namespace GFGGame
             }
             UI_ListApplyItem.ProxyEnd();
         }
-
-        //添加好友
-        private void OnBtnAddClick()
-        {
-
-        }
-
         //通过好友申请
-        private void OnBtnAgreeClick()
+        private void OnBtnAgreeClick(EventContext context)
         {
-
+            GObject obj = context.data as GObject;
         }
 
         //拒绝好友申请
-        private void OnBtnRefuseClick()
+        private void OnBtnRefuseClick(EventContext context)
         {
+            GObject obj = context.data as GObject;
 
         }
 
-        //搜过好友
-        private void OnBtnSearchClick()
+        //一键通过好友申请
+        private void OnBtnAgreeAllClick()
         {
 
         }
 
-        //刷新好友列表
-        private void OnBtnRefreshClick()
+        //一键拒绝好友申请
+        private void OnBtnRefuseAllClick()
         {
+            AlertUI.Show("是否拒绝所有好友申请?").SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
+            {
 
+            });
         }
 
     }

+ 24 - 1
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -39,6 +39,10 @@ namespace GFGGame
             _ui.m_list.SetVirtual();
             _ui.m_list.itemRenderer = RenderListItem;
             _ui.m_list.onClickItem.Add(OnListItemClick);
+
+            _ui.m_btnSolgan.onClick.Add(OnBtnSloganClick);
+            _ui.m_btnDelete.onClick.Add(OnBtnDeleteClick);
+            _ui.m_btnAdd.onClick.Add(OnBtnAddClick);
         }
 
         protected override void OnInit()
@@ -53,8 +57,9 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            UpdateList();
+            _ui.m_grpSlogan.visible = false;
 
+            UpdateList();
             CustomSuitData suitSavedData = CustomSuitDataManager.GetCurrentSuitList();
             // if (_ui.m_list.numItems > 0)
             // {
@@ -104,5 +109,23 @@ namespace GFGGame
             }
             EquipDataCache.cacher.PutOnSuitMemory(suitSavedData);
         }
+
+        private void OnBtnSloganClick()
+        {
+            _ui.m_grpSlogan.visible = !_ui.m_grpSlogan.visible;
+        }
+
+        private void OnBtnDeleteClick()
+        {
+            AlertUI.Show("是否删除好友?").SetLeftButton(true).SetRightButton(true, "确定", (object data) =>
+            {
+
+            });
+        }
+
+        private void OnBtnAddClick()
+        {
+            ViewManager.Show<FriendAddView>();
+        }
     }
 }

二進制
GameClient/Assets/ResIn/UI/Friend/Friend_atlas0.png


二進制
GameClient/Assets/ResIn/UI/Friend/Friend_fui.bytes