zhaoyang il y a 2 ans
Parent
commit
310424bae9

+ 1 - 1
FGUIProject/assets/poem/PoemGalleryUI.xml

@@ -12,7 +12,7 @@
     <component id="n11_r9ri" name="comNormal" src="r9ri114" fileName="componentsGallery/ComNormal.xml" xy="90,83">
     <component id="n11_r9ri" name="comNormal" src="r9ri114" fileName="componentsGallery/ComNormal.xml" xy="90,83">
       <gearDisplay controller="c1" pages="1"/>
       <gearDisplay controller="c1" pages="1"/>
     </component>
     </component>
-    <component id="n23_r9ri" name="ComFavorite" src="r9ri115" fileName="componentsGallery/ComFavorite.xml" xy="129,278">
+    <component id="n23_r9ri" name="comFavorites" src="r9ri115" fileName="componentsGallery/ComFavorites.xml" xy="129,278">
       <gearDisplay controller="c1" pages="2"/>
       <gearDisplay controller="c1" pages="2"/>
     </component>
     </component>
     <component id="n2_r9ri" name="btnRecover" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="96,1716" size="77,76">
     <component id="n2_r9ri" name="btnRecover" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="96,1716" size="77,76">

+ 15 - 0
FGUIProject/assets/poem/componentsGallery/ComHead.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="200,113">
+  <controller name="c1" pages="0,,1,,2," selected="0"/>
+  <displayList>
+    <movieclip id="n30_r9ri" name="n30" src="r9ri119" fileName="componentsGallery/MovieClip1.jta" xy="0,0">
+      <gearDisplay controller="c1" pages="1"/>
+    </movieclip>
+    <image id="n32_r9ri" name="n32" src="ly9g1d" fileName="imagesExport/cj_xhua.png" pkg="eg2y0ldp" xy="51,-9" pivot="0.5,0.5" rotation="90">
+      <gearDisplay controller="c1" pages="0"/>
+    </image>
+    <image id="n33_r9ri" name="n33" src="ly9g1d" fileName="imagesExport/cj_xhua.png" pkg="eg2y0ldp" xy="51,-9" pivot="0.5,0.5" rotation="-90">
+      <gearDisplay controller="c1" pages="2"/>
+    </image>
+  </displayList>
+</component>

+ 5 - 5
FGUIProject/assets/poem/componentsGallery/ComNormal.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<component size="971,1619">
-  <controller name="c1" pages="0,,1,,2," selected="0"/>
+<component size="971,1619" overflow="hidden">
+  <controller name="c1" pages="0,,1,,2," selected="2"/>
   <displayList>
   <displayList>
     <component id="n11_r9ri" name="btnShop" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="893,0" size="77,76">
     <component id="n11_r9ri" name="btnShop" src="r9ri10v" fileName="componentsGallery/Button9.xml" xy="893,0" size="77,76">
       <Button title="商店" icon="ui://iyz778gkuyuxzp"/>
       <Button title="商店" icon="ui://iyz778gkuyuxzp"/>
@@ -15,17 +15,17 @@
     </component>
     </component>
     <image id="n5_r9ri" name="n5" src="uyuxzx" fileName="imagesPhoto/xc_xzdik.png" xy="30,180" size="840,76" group="n8_r9ri"/>
     <image id="n5_r9ri" name="n5" src="uyuxzx" fileName="imagesPhoto/xc_xzdik.png" xy="30,180" size="840,76" group="n8_r9ri"/>
     <component id="n6_r9ri" name="btnTab0" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="30,178" group="n8_r9ri">
     <component id="n6_r9ri" name="btnTab0" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="30,178" group="n8_r9ri">
-      <Button checked="true" title="推荐" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="0"/>
+      <Button title="推荐" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="0"/>
     </component>
     </component>
     <component id="n7_r9ri" name="btnTab1" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="310,178" group="n8_r9ri">
     <component id="n7_r9ri" name="btnTab1" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="310,178" group="n8_r9ri">
       <Button title="好友" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="1"/>
       <Button title="好友" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="1"/>
     </component>
     </component>
     <component id="n9_r9ri" name="btnTab2" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="590,178" group="n8_r9ri">
     <component id="n9_r9ri" name="btnTab2" src="11rzzf" fileName="componentsPhoto/Button6.xml" xy="590,178" group="n8_r9ri">
-      <Button title="排行榜" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="2"/>
+      <Button checked="true" title="排行榜" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="2"/>
     </component>
     </component>
     <group id="n8_r9ri" name="grpTab" xy="30,178" size="840,82"/>
     <group id="n8_r9ri" name="grpTab" xy="30,178" size="840,82"/>
     <text id="n22_r9ri" name="txtTheme" xy="296,298" pivot="0.5,0" size="270,41" fontSize="30" text="本期主题:风花雪月"/>
     <text id="n22_r9ri" name="txtTheme" xy="296,298" pivot="0.5,0" size="270,41" fontSize="30" text="本期主题:风花雪月"/>
-    <list id="n14_r9ri" name="listRecommend" xy="0,397" size="918,1222" layout="flow_hz" overflow="scroll" ptrRes="ui://iyz778gkv4822," colGap="20" defaultItem="ui://iyz778gkr9ri10w">
+    <list id="n14_r9ri" name="listRecommend" xy="0,397" size="918,1222" layout="flow_hz" overflow="scroll" ptrRes="ui://iyz778gkr9ri11a," colGap="20" defaultItem="ui://iyz778gkr9ri10w">
       <item/>
       <item/>
       <item/>
       <item/>
       <item/>
       <item/>

BIN
FGUIProject/assets/poem/componentsGallery/MovieClip1.jta


+ 2 - 0
FGUIProject/assets/poem/package.xml

@@ -61,6 +61,8 @@
     <component id="r9ri116" name="PoemGalleryPreviewUI.xml" path="/" exported="true"/>
     <component id="r9ri116" name="PoemGalleryPreviewUI.xml" path="/" exported="true"/>
     <component id="r9ri117" name="PoemGalleryRewardUI.xml" path="/" exported="true"/>
     <component id="r9ri117" name="PoemGalleryRewardUI.xml" path="/" exported="true"/>
     <component id="r9ri118" name="ListRankRewardItem.xml" path="/componentsGallery/"/>
     <component id="r9ri118" name="ListRankRewardItem.xml" path="/componentsGallery/"/>
+    <movieclip id="r9ri119" name="MovieClip1.jta" path="/componentsGallery/"/>
+    <component id="r9ri11a" name="ComHead.xml" path="/componentsGallery/"/>
   </resources>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Poem" packageCount="2" genCode="true"/>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Poem" packageCount="2" genCode="true"/>
 </packageDescription>
 </packageDescription>

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComHead.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Poem
+{
+    public partial class UI_ComHead
+    {
+        public GComponent target;
+        public Controller m_c1;
+        public const string URL = "ui://iyz778gkr9ri11a";
+        public const string PACKAGE_NAME = "Poem";
+        public const string RES_NAME = "ComHead";
+        private static UI_ComHead _proxy;
+
+        public static UI_ComHead Create(GObject gObject = null)
+        {
+            var ui = new UI_ComHead();
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_ComHead Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_ComHead();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GComponent)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");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComHead.cs.meta

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

+ 4 - 4
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_PoemGalleryUI.cs

@@ -11,7 +11,7 @@ namespace UI.Poem
         public GLoader m_loaBg;
         public GLoader m_loaBg;
         public GButton m_btnback;
         public GButton m_btnback;
         public UI_ComNormal m_comNormal;
         public UI_ComNormal m_comNormal;
-        public UI_ComFavorites m_ComFavorite;
+        public UI_ComFavorites m_comFavorites;
         public GButton m_btnRecover;
         public GButton m_btnRecover;
         public GButton m_btnJoin;
         public GButton m_btnJoin;
         public GButton m_btnFavorites;
         public GButton m_btnFavorites;
@@ -66,7 +66,7 @@ namespace UI.Poem
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_btnback = (GButton)comp.GetChild("btnback");
             m_btnback = (GButton)comp.GetChild("btnback");
             m_comNormal = (UI_ComNormal)UI_ComNormal.Create(comp.GetChild("comNormal"));
             m_comNormal = (UI_ComNormal)UI_ComNormal.Create(comp.GetChild("comNormal"));
-            m_ComFavorite = (UI_ComFavorites)UI_ComFavorites.Create(comp.GetChild("ComFavorite"));
+            m_comFavorites = (UI_ComFavorites)UI_ComFavorites.Create(comp.GetChild("comFavorites"));
             m_btnRecover = (GButton)comp.GetChild("btnRecover");
             m_btnRecover = (GButton)comp.GetChild("btnRecover");
             m_btnJoin = (GButton)comp.GetChild("btnJoin");
             m_btnJoin = (GButton)comp.GetChild("btnJoin");
             m_btnFavorites = (GButton)comp.GetChild("btnFavorites");
             m_btnFavorites = (GButton)comp.GetChild("btnFavorites");
@@ -78,8 +78,8 @@ namespace UI.Poem
             m_btnback = null;
             m_btnback = null;
             m_comNormal.Dispose();
             m_comNormal.Dispose();
             m_comNormal = null;
             m_comNormal = null;
-            m_ComFavorite.Dispose();
-            m_ComFavorite = null;
+            m_comFavorites.Dispose();
+            m_comFavorites = null;
             m_btnRecover = null;
             m_btnRecover = null;
             m_btnJoin = null;
             m_btnJoin = null;
             m_btnFavorites = null;
             m_btnFavorites = null;

+ 7 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/PoemPhotoSProxy.cs

@@ -136,10 +136,14 @@ namespace GFGGame
                     yield return null;
                     yield return null;
                     // }
                     // }
                 }
                 }
+                else
+                {
+
+                    Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
+                    poemPhotoData.Bytes = texture.EncodeToJPG();
+                    poemPhotoData.Ntexture = new NTexture(texture);
+                }
 
 
-                Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
-                poemPhotoData.Bytes = texture.EncodeToJPG();
-                poemPhotoData.Ntexture = new NTexture(texture);
             }
             }
 
 
         }
         }

+ 111 - 4
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryView.cs

@@ -1,3 +1,4 @@
+using System.Collections.Generic;
 using ET;
 using ET;
 using FairyGUI;
 using FairyGUI;
 using UI.Poem;
 using UI.Poem;
@@ -8,6 +9,8 @@ namespace GFGGame
     public class PoemGalleryView : BaseWindow
     public class PoemGalleryView : BaseWindow
     {
     {
         private UI_PoemGalleryUI _ui;
         private UI_PoemGalleryUI _ui;
+        private List<PoemGalleryData> _galleryInfos = new List<PoemGalleryData>();
+        private int _infoType = 0;//0推荐1好友2收藏3我的
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
@@ -36,6 +39,18 @@ namespace GFGGame
             _ui.m_comNormal.m_btnShop.onClick.Add(OnBtnShopClick);
             _ui.m_comNormal.m_btnShop.onClick.Add(OnBtnShopClick);
             _ui.m_comNormal.m_btnRecommend.onClick.Add(OnBtnRecommendClick);
             _ui.m_comNormal.m_btnRecommend.onClick.Add(OnBtnRecommendClick);
             _ui.m_comNormal.m_btnNewest.onClick.Add(OnBtnNewestClick);
             _ui.m_comNormal.m_btnNewest.onClick.Add(OnBtnNewestClick);
+            _ui.m_comNormal.m_c1.onChanged.Add(OnNormalTabChange);
+            _ui.m_comFavorites.m_c1.onChanged.Add(OnFavoritesTabChange);
+
+            _ui.m_comNormal.m_listRecommend.itemRenderer = RenderListItem;
+            _ui.m_comNormal.m_listRecommend.SetVirtual();
+            _ui.m_comNormal.m_listRecommend.scrollPane.onPullDownRelease.Add(onPullDownRelease);
+            _ui.m_comNormal.m_listRecommend.scrollPane.onScroll.Add(onScroll);
+            _ui.m_comNormal.m_listRecommend.scrollPane.onScrollEnd.Add(OnScrollEnd);
+            // SwipeGesture swipeGesture;
+            // swipeGesture = new SwipeGesture(_ui.m_comNormal.m_listRecommend);
+            // swipeGesture.onMove.Add(OnMove);
+
         }
         }
         protected override void AddEventListener()
         protected override void AddEventListener()
         {
         {
@@ -65,22 +80,109 @@ namespace GFGGame
             ViewManager.GoBackFrom(typeof(PoemGalleryView).FullName);
             ViewManager.GoBackFrom(typeof(PoemGalleryView).FullName);
         }
         }
 
 
+        //投稿
+        private void OnBtnJoinClick()
+        {
+
+        }
+
         //首页
         //首页
         private void OnBtnRecoverClick()
         private void OnBtnRecoverClick()
         {
         {
+            _ui.m_comNormal.m_c1.selectedIndex = 0;
+        }
 
 
+        //收藏夹
+        private void OnBtnFavoritesClick()
+        {
+            _ui.m_comFavorites.m_c1.selectedIndex = 0;
         }
         }
 
 
-        //投稿
-        private void OnBtnJoinClick()
+        //切换首页页签
+        private void OnNormalTabChange()
         {
         {
+            if (_ui.m_comNormal.m_c1.selectedIndex == 2)
+            {
 
 
+            }
+            else
+            {
+                if (_ui.m_comNormal.m_c1.selectedIndex == 0)
+                {
+                    _infoType = 0;
+                    _galleryInfos = PoemGalleryDataManager.Instance.RecommendInfos;
+                    _ui.m_comNormal.m_listRecommend.numItems = 5;
+                }
+                else if (_ui.m_comNormal.m_c1.selectedIndex == 1)
+                {
+                    _infoType = 1;
+                    _galleryInfos = PoemGalleryDataManager.Instance.FrinedInfos;
+                }
+            }
+        }
+        //切换收藏页签
+        private void OnFavoritesTabChange()
+        {
+            if (_ui.m_comFavorites.m_c1.selectedIndex == 0)
+            {
+                _infoType = 2;
+                _galleryInfos = PoemGalleryDataManager.Instance.FavoriteInfos;
+            }
+            else if (_ui.m_comFavorites.m_c1.selectedIndex == 1)
+            {
+                _infoType = 3;
+                _galleryInfos = PoemGalleryDataManager.Instance.MySelfInfos;
+            }
         }
         }
+        private void onPullDownRelease()
+        {
+            UI_ComHead header = UI_ComHead.Proxy(_ui.m_comNormal.m_listRecommend.scrollPane.header);
+            // ScrollPaneHeader header = (ScrollPaneHeader)_ui.m_comNormal.m_listRecommend.scrollPane.header;
+            // if (header.ReadyToRefresh)
+            // {
+            // header.SetRefreshStatus(2);
+            header.m_c1.selectedIndex = 1;
+            _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(header.target.sourceHeight);
+
+            //Simulate a async resquest
+            Timers.inst.Add(2, 1, (object param) =>
+            {
+                header.m_c1.selectedIndex = 2;
+                //     _ui.m_comNormal.m_listRecommend.numItems += 5;
+
+                //     //Refresh completed
+                //     header.SetRefreshStatus(3);
+                //     _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(35);
+
+                // Timers.inst.Add(2, 1, (object param2) =>
+                // {
+                //         header.SetRefreshStatus(0);
+                _ui.m_comNormal.m_listRecommend.scrollPane.LockHeader(0);
+                header.m_c1.selectedIndex = 0;
+                // });
+            });
+            // }
 
 
-        //收藏夹
-        private void OnBtnFavoritesClick()
+        }
+        private void OnMove(EventContext context)
+        {
+            SwipeGesture swipeture = (SwipeGesture)context.sender;
+            ScrollPane scrollPane = _ui.m_comNormal.m_listRecommend.scrollPane;
+            ET.Log.Debug("posY:" + scrollPane.header.position.y + "    swipetureY:" + swipeture.position.y + "    " + (-scrollPane.header.height + swipeture.position.y));
+            scrollPane.header.SetXY(scrollPane.header.position.x, -scrollPane.header.height + swipeture.position.y);
+        }
+        private void onScroll()
         {
         {
+            ScrollPane scrollPane = _ui.m_comNormal.m_listRecommend.scrollPane;
+            // scrollPane.
 
 
+            // ET.Log.Debug("posY:" + scrollPane.posY + "    scrollingPosY:" + scrollPane.scrollingPosY);
+        }
+        private void OnScrollEnd()
+        {
+            // ScrollPane scrollPane = _ui.m_comNormal.m_listRecommend.scrollPane;
+            // scrollPane.header.SetXY();
+            // _ui.m_comNormal.m_listRecommend.scrollPane.header.y = -_ui.m_comNormal.m_listRecommend.scrollPane.header.height;
         }
         }
 
 
         //积分商店
         //积分商店
@@ -100,5 +202,10 @@ namespace GFGGame
         {
         {
 
 
         }
         }
+
+        private void RenderListItem(int index, GObject obj)
+        {
+
+        }
     }
     }
 }
 }

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


BIN
GameClient/Assets/ResIn/UI/Poem/Poem_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes