瀏覽代碼

画廊头像

zhaoyang 2 年之前
父節點
當前提交
710970dbfc

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

@@ -39,7 +39,7 @@
       <gearDisplay controller="c1" pages="0,1"/>
       <relation target="" sidePair="height-height"/>
     </component>
-    <list id="n23_r9ri" name="listRank" xy="24,483" size="1032,1136" overflow="scroll" lineGap="20" defaultItem="ui://iyz778gkr9ri10y" align="center" autoClearItems="true">
+    <list id="n23_r9ri" name="listRank" xy="43,483" size="997,1136" overflow="scroll" lineGap="20" defaultItem="ui://iyz778gkr9ri10y" align="center" autoClearItems="true">
       <gearDisplay controller="c1" pages="2"/>
       <relation target="" sidePair="top-top,bottomext-bottom"/>
       <item/>
@@ -49,7 +49,7 @@
     <text id="n29_r9ri" name="txtRank" xy="830,427" pivot="1,0" size="169,41" fontSize="30" color="#c58383" text="我的排名:20">
       <gearDisplay controller="c1" pages="2"/>
     </text>
-    <image id="n30_r9ri" name="n30" src="r9ri12o" fileName="imagesGallery/hl_ddandik.png" xy="391,660" group="n32_r9ri" pkg="eg2y0ldp"/>
+    <image id="n30_r9ri" name="n30" src="r9ri12o" fileName="images/hl_ddandik.png" pkg="eg2y0ldp" xy="391,660" group="n32_r9ri"/>
     <text id="n31_r9ri" name="n31" xy="231,783" size="617,51" group="n32_r9ri" fontSize="38" color="#ac9b7f" text="排行榜数据正在结算中,请稍后再来!"/>
     <group id="n32_r9ri" name="grpResult" xy="231,660" size="617,298" advanced="true">
       <relation target="" sidePair="center-center,middle-middle"/>

+ 2 - 2
FGUIProject/assets/poem/componentsGallery/ListRankItem.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="996,1004" overflow="hidden">
-  <controller name="c1" pages="0,,1,,2,,3," selected="3"/>
+  <controller name="c1" pages="0,,1,,2,,3," selected="0"/>
   <displayList>
     <loader id="n3_r9ri" name="loaIcon" xy="1,0" pivot="0.5,0" size="994,909" url="ui://iyz778gkr9ri132" align="center" vAlign="middle" fill="scaleMatchWidth"/>
     <image id="n11_r9ri" name="n11" src="r9ri120" fileName="imagesGallery/hl_phb_b_1.png" xy="34,4">
@@ -30,7 +30,7 @@
     <image id="n15_r9ri" name="n15" src="r9ri13f" fileName="imagesGallery/hl_phb_4.png" xy="0,-2" size="996,1009">
       <gearDisplay controller="c1" pages="3"/>
     </image>
-    <text id="n7_r9ri" name="txtRank" xy="78,47" pivot="0.5,0" size="36,72" font="ui://eg2y0ldpwonotj9" fontSize="54" color="#fdf4e6" strokeColor="#d4b06b" strokeSize="2" text="2">
+    <text id="n7_r9ri" name="txtRank" xy="78,47" pivot="0.5,0" size="36,71" font="ui://eg2y0ldpwonotj9" fontSize="54" color="#fdf4e6" strokeColor="#d4b06b" strokeSize="2" text="2">
       <gearDisplay controller="c1" pages="3"/>
     </text>
     <text id="n4_r9ri" name="txtName" xy="37,928" size="211,41" group="n14_r9ri" fontSize="30" color="#ac806f" text="名字名字名字啊"/>

+ 3 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/PictureStorageHelper.cs

@@ -59,7 +59,7 @@ namespace GFGGame
 
         }
 
-        public static IEnumerator Download(List<long> list, int startIndex)
+        public static IEnumerator Download(List<long> list, int startIndex, Action callBack = null)
         {
             for (int i = startIndex; i < list.Count; i++)
             {
@@ -80,8 +80,9 @@ namespace GFGGame
                     }
                 }
             }
+            if (callBack != null) callBack();
             ET.Log.Debug("Download  finish!!!");
-            EventAgent.DispatchEvent(ConstMessage.GALLERY_DATA_CHANGE);
+            EventAgent.DispatchEvent(ConstMessage.DOWNLOAD_FINISH);
         }
 
         public static IEnumerator Download(List<PoemPhotoData> list)

+ 18 - 34
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemGalleryView.cs

@@ -120,8 +120,8 @@ namespace GFGGame
         {
             base.AddEventListener();
 
-            EventAgent.AddEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
-            EventAgent.AddEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
+            // EventAgent.AddEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
+            // EventAgent.AddEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
         }
         protected override async void OnShown()
         {
@@ -194,8 +194,8 @@ namespace GFGGame
         protected override void RemoveEventListener()
         {
             base.RemoveEventListener();
-            EventAgent.RemoveEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
-            EventAgent.RemoveEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
+            // EventAgent.RemoveEventListener(ConstMessage.GALLERY_DATA_CHANGE, UpdateGalleryList);
+            // EventAgent.RemoveEventListener(ConstMessage.GALLERY_RANK_DATA_CHANGE, UpdateGalleryRankList);
         }
 
         private void OnBtnBackClick()
@@ -291,9 +291,11 @@ namespace GFGGame
             else
             {
                 UpdateList();
+
                 if (_list.numItems > 0) _list.ScrollToView(0);
                 if (_list1.numItems > 0) _list.ScrollToView(0);
-
+                _list.numItems = 0;
+                _list1.numItems = 0;
                 ReqGalleryList(0);
             }
 
@@ -362,7 +364,7 @@ namespace GFGGame
             bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, startIndex, _pageCount);
             if (result)
             {
-                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex, UpdateGalleryList));
             }
         }
         private void UpdateGalleryList()
@@ -392,9 +394,13 @@ namespace GFGGame
         }
 
         //请求排行榜刷新
-        private void ReqGalleryRankList()
+        private async void ReqGalleryRankList()
         {
-            PoemGallerySProxy.ReqRankList().Coroutine();
+            bool result = await PoemGallerySProxy.ReqRankList();
+            if (result)
+            {
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0, UpdateGalleryRankList));
+            }
         }
         private void UpdateGalleryRankList()
         {
@@ -408,7 +414,7 @@ namespace GFGGame
         {
             GalleryThemeCfg themeCfg = GalleryThemeCfgArray.Instance.GetCfg((int)PoemGalleryDataManager.Instance.ThemeId);
             _ui.m_comNormal.m_txtTheme.text = string.Format("本期主题:{0}", themeCfg.theme);
-            _ui.m_comNormal.m_txtRank.text = string.Format("我的排名:{0}", PoemGalleryDataManager.Instance.MyRank);
+            _ui.m_comNormal.m_txtRank.text = string.Format("我的排名: {0}", PoemGalleryDataManager.Instance.MyRank > 0 ? PoemGalleryDataManager.Instance.MyRank.ToString() : "- -");
             _ui.m_comNormal.m_txtRewardCount.text = string.Format("奖励次数:{0}/{1}", GameGlobal.myNumericComponent.GetAsInt(NumericType.LikeGalleryWorksCountDaily), GalleryRewardCfgArray.Instance.dataArray.Length);
             _ui.m_comNormal.m_txtTime.text = string.Format("截止日期:{0}", PoemGalleryDataManager.Instance.GetThemeTime());
             _ui.m_comNormal.m_grpResult.visible = PoemGalleryDataManager.Instance.IsResulting();
@@ -432,18 +438,7 @@ namespace GFGGame
             PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
             UI_ListItem item = UI_ListItem.Proxy(obj);
 
-            // if (data.Ntexture == null)
-            // {
-            //     Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(data.PictureTempUrl, (Texture2D texture) =>
-            //     {
-            //         data.Ntexture = new NTexture(texture);
-            //         item.m_loaIcon.texture = data.Ntexture;
-            //     }));
-            // }
-            // else
-            // {
             item.m_loaIcon.texture = data.Ntexture;
-            // }
             item.m_loaIcon.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
             item.m_txtName.text = data.AuthorName;
             item.m_btnCollect.title = data.CollectCount.ToString();
@@ -474,20 +469,9 @@ namespace GFGGame
             long workId = _galleryDatas[index];
             PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(workId);
             UI_ListRankItem item = UI_ListRankItem.Proxy(obj);
-            // if (data.Ntexture == null)
-            // {
-            //     Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(data.PictureTempUrl, (Texture2D texture) =>
-            //     {
-            //         data.Ntexture = new NTexture(texture);
-            //         item.m_loaIcon.texture = data.Ntexture;
-            //     }));
-            // }
-            // else
-            // {
+
             item.m_loaIcon.texture = data.Ntexture;
-            // }
             item.m_loaIcon.height = item.m_loaIcon.width * item.m_loaIcon.texture.height / item.m_loaIcon.texture.width;
-
             item.m_txtName.text = data.AuthorName;
             item.m_btnCollect.title = data.CollectCount.ToString();
             item.m_btnCollect.selected = data.CollectOrNot;
@@ -607,7 +591,7 @@ namespace GFGGame
             // OnPullDownTimeComplete();
             if (result)
             {
-                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0, UpdateGalleryList));
             }
 
         }
@@ -633,7 +617,7 @@ namespace GFGGame
             // OnPullUpTimeComplete();
             if (result)
             {
-                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count, UpdateGalleryList));
             }
         }
 

二進制
GameClient/Assets/ResIn/UI/Poem/Poem_fui.bytes