소스 검색

画廊下载

zhaoyang 2 년 전
부모
커밋
95e6529b43

+ 3 - 2
FGUIProject/assets/Common/ModalStatusUI.xml

@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920">
   <displayList>
-    <graph id="n3_ityj" name="n3" xy="0,0" size="1080,1920" alpha="0" type="rect" lineSize="0" fillColor="#ff000000">
+    <graph id="n3_ityj" name="n3" xy="0,0" size="1080,1920" alpha="0.2" type="rect" lineSize="0" fillColor="#ff000000">
       <relation target="" sidePair="width-width,height-height"/>
     </graph>
     <graph id="n1_d4iw" name="n1" xy="390,20" size="300,40" visible="false" alpha="0.5" type="rect" lineSize="0" fillColor="#ff000000">
       <relation target="" sidePair="center-center,middle-middle"/>
     </graph>
-    <text id="n2_d4iw" name="txtMessage" xy="290,976" size="500,42" fontSize="30" color="#876e54" align="center" autoSize="none" autoClearText="true" text="这是一个提示"/>
+    <image id="n5_pac9" name="n5" src="qp4l4q" fileName="imagesExport/zx_jq_rwbszik_normal.png" xy="20,962" color="#e8dbb3"/>
+    <text id="n2_d4iw" name="txtMessage" xy="290,976" size="500,44" fontSize="32" color="#ebe4ce" align="center" autoSize="none" autoClearText="true" text="这是一个提示"/>
     <graph id="n4_t6aj" name="holder" xy="539,959" size="1,1"/>
   </displayList>
 </component>

+ 4 - 4
FGUIProject/assets/DressUp/PhotographUI.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,1920" overflow="hidden" scroll="both">
-  <controller name="c1" pages="0,,1," selected="0"/>
+  <controller name="c1" pages="0,,1," selected="1"/>
   <displayList>
     <loader id="n8_g3xa" name="btnBg" xy="0,0" size="1080,1136">
       <relation target="" sidePair="height-height"/>
@@ -28,9 +28,9 @@
       <relation target="" sidePair="bottom-bottom"/>
       <Button title="确认上传" icon="ui://mk0fwx0xr9ritjd"/>
     </component>
-    <image id="n19_r9ri" name="n19" src="r9riek" fileName="images/hl_ciskuang.png" xy="480,1834" group="n21_r9ri"/>
-    <text id="n20_r9ri" name="txtCount" xy="501,1831" pivot="0.5,0" size="77,41" group="n21_r9ri" fontSize="30" color="#e3d3ae" text="3/10"/>
-    <group id="n21_r9ri" name="n21" xy="480,1831" size="120,42" advanced="true">
+    <image id="n19_r9ri" name="n19" src="r9riek" fileName="images/hl_ciskuang.png" xy="480,1835" group="n21_r9ri"/>
+    <text id="n20_r9ri" name="txtCount" xy="505,1832" pivot="0.5,0" size="70,41" group="n21_r9ri" fontSize="30" color="#f9f1e1" text="3/10"/>
+    <group id="n21_r9ri" name="n21" xy="480,1832" size="120,41" advanced="true">
       <gearDisplay controller="c1" pages="1"/>
       <relation target="" sidePair="bottom-bottom"/>
     </group>

BIN
FGUIProject/assets/DressUp/images/hl_ciskuang.png


+ 2 - 2
FGUIProject/assets/poem/PoemPhotoUI.xml

@@ -18,7 +18,7 @@
       <Button icon="ui://iyz778gkweoktjw" selectedIcon="ui://iyz778gkuyuxzw" controller="c1" page="1"/>
     </component>
     <group id="n14_uyux" name="n14" xy="260,210" size="560,83"/>
-    <list id="n8_v482" name="list" xy="36,338" size="1008,1434" layout="flow_hz" overflow="scroll" lineGap="16" colGap="15" defaultItem="ui://iyz778gkv4828">
+    <list id="n8_v482" name="list" xy="21,338" size="1038,1434" layout="flow_hz" overflow="scroll" lineGap="16" colGap="10" defaultItem="ui://iyz778gkv4828">
       <gearDisplay controller="c1" pages="0"/>
       <relation target="" sidePair="bottomext-bottom"/>
       <item/>
@@ -47,7 +47,7 @@
     <component id="n10_v482" name="btnDelete" src="v4829" fileName="componentsPhoto/Button3.xml" xy="590,1807" group="n17_uyux">
       <gearDisplay controller="c2" pages="0"/>
     </component>
-    <text id="n9_v482" name="txtCount" xy="412,1820" pivot="0.5,0" size="116,61" group="n17_uyux" fontSize="46" color="#b5926a" align="center" text="0/50">
+    <text id="n9_v482" name="txtCount" xy="417,1820" pivot="0.5,0" size="105,61" group="n17_uyux" fontSize="46" color="#b5926a" align="center" text="0/50">
       <gearDisplay controller="c2" pages="0"/>
     </text>
     <group id="n17_uyux" name="n17" xy="0,1775" size="1080,145" advanced="true">

+ 5 - 1
FGUIProject/assets/poem/componentsPhoto/ComIcon.xml

@@ -1,6 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="512,694" mask="n13_uyux">
+<component size="512,694" overflow="hidden" mask="n13_uyux">
   <displayList>
+    <image id="n15_pac9" name="n15" src="pac9tjx" fileName="imagesGallery/hl_cjkuangdiban.png" xy="16,5" size="479,675"/>
+    <loader id="n14_pac9" name="loaBg" xy="50,43" size="411,607" aspect="true" url="ui://iyz778gkpac9tjy" align="center" vAlign="middle" fill="scaleMatchWidth">
+      <relation target="" sidePair="center-center,middle-middle"/>
+    </loader>
     <loader id="n4_v482" name="loaIcon" xy="19,-10" size="474,841" aspect="true" url="ui://iyz778gkr9ri132" align="center" vAlign="middle" fill="scaleMatchWidth">
       <relation target="" sidePair="center-center,middle-middle"/>
     </loader>

+ 8 - 8
FGUIProject/assets/poem/componentsPhoto/ListPhotoItem.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="493,740">
+<component size="512,740">
   <displayList>
-    <component id="n4_v482" name="comIcon" src="uyux101" fileName="components/ComIcon.xml" xy="-9,0"/>
-    <image id="n12_uyux" name="n12" src="uyuxzr" fileName="photImages/xc_kuangdi.png" xy="-9,0"/>
-    <text id="n7_v482" name="txtTime" xy="79,691" pivot="0.5,0" size="335,49" fontSize="36" color="#aa8c61" align="center" text="2022-1-8 17:14:30"/>
-    <image id="n15_uyux" name="imgSelect" src="uyux107" fileName="photImages/xc_xzxd.png" xy="-9,0"/>
-    <component id="n5_v482" name="btnLock" src="v4826" fileName="components/Button1.xml" xy="286,563" group="n16_wono"/>
-    <component id="n6_v482" name="btnUp" src="v4827" fileName="components/Button2.xml" xy="380,563" group="n16_wono"/>
-    <group id="n16_wono" name="n16" xy="286,563" size="171,76"/>
+    <component id="n4_v482" name="comIcon" src="uyux101" fileName="componentsPhoto/ComIcon.xml" xy="0,2" size="512,690"/>
+    <image id="n12_uyux" name="n12" src="uyuxzr" fileName="imagesPhoto/xc_kuangdi.png" xy="0,0"/>
+    <text id="n7_v482" name="txtTime" xy="95,691" pivot="0.5,0" size="321,49" fontSize="36" color="#aa8c61" align="center" text="2022-1-8 17:14:30"/>
+    <image id="n15_uyux" name="imgSelect" src="uyux107" fileName="imagesPhoto/xc_xzxd.png" xy="0,0"/>
+    <component id="n5_v482" name="btnLock" src="v4826" fileName="componentsPhoto/Button1.xml" xy="295,563" group="n16_wono"/>
+    <component id="n6_v482" name="btnUp" src="v4827" fileName="componentsPhoto/Button2.xml" xy="389,563" group="n16_wono"/>
+    <group id="n16_wono" name="n16" xy="295,563" size="171,76"/>
   </displayList>
 </component>

BIN
FGUIProject/assets/poem/images/tz_bolangg.png


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

@@ -141,6 +141,7 @@
     <image id="ysx9tjv" name="xz_wss.png" path="/images/"/>
     <image id="weoktjw" name="xc_xqfs.png" path="/imagesPhoto/"/>
     <image id="pac9tjx" name="hl_cjkuangdiban.png" path="/imagesGallery/" scale="9grid" scale9grid="123,177,246,354"/>
+    <image id="pac9tjy" name="tz_bolangg.png" path="/images/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Poem" packageCount="2" genCode="true"/>
 </packageDescription>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/poem/UI_ComIcon.cs

@@ -7,6 +7,7 @@ namespace UI.Poem
     public partial class UI_ComIcon
     {
         public GComponent target;
+        public GLoader m_loaBg;
         public GLoader m_loaIcon;
         public const string URL = "ui://iyz778gkuyux101";
         public const string PACKAGE_NAME = "Poem";
@@ -55,10 +56,12 @@ namespace UI.Poem
 
         private void Init(GComponent comp)
         {
+            m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_loaBg = null;
             m_loaIcon = null;
             if(disposeTarget && target != null)
             {

+ 54 - 30
GameClient/Assets/Game/HotUpdate/ServerProxy/PictureStorageHelper.cs

@@ -66,26 +66,38 @@ namespace GFGGame
             {
                 PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(list[i]);
                 if (data.Ntexture != null) continue;
-                using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(data.PictureTempUrl))
-                {
-                    yield return request.SendWebRequest();
-                    if (request.result == UnityWebRequest.Result.ProtocolError || request.result == UnityWebRequest.Result.ConnectionError)
-                    {
-                        PromptController.Instance.ShowFloatTextPrompt("下载失败");
-                        yield return null;
-                    }
-                    else
-                    {
-                        Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
-                        data.Ntexture = new NTexture(texture);
-                        EventAgent.DispatchEvent(ConstMessage.DOWNLOAD_FINISH_ONE);
-
-                    }
-                }
+                int count = 0;
+                yield return DownloadPicture(data, count);
             }
             if (callBack != null) callBack();
             ET.Log.Debug("Download  finish!!!");
         }
+        private static IEnumerator DownloadPicture(PoemGalleryData data, int count)
+        {
+            if (count >= 5)
+            {
+                ET.Log.Error("Download  fild!!!");
+                data.Ntexture = null;
+                yield return null;
+            }
+            using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(data.PictureTempUrl))
+            {
+                yield return request.SendWebRequest();
+                if (request.result == UnityWebRequest.Result.ProtocolError || request.result == UnityWebRequest.Result.ConnectionError)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt("下载失败");
+                    ET.Log.Error("Download  fild!!!");
+                    count += 1;
+                    yield return DownloadPicture(data, count);
+                }
+                else
+                {
+                    Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
+                    data.Ntexture = new NTexture(texture);
+                    EventAgent.DispatchEvent(ConstMessage.DOWNLOAD_FINISH_ONE);
+                }
+            }
+        }
 
         public static IEnumerator Download(List<PoemPhotoData> list)
         {
@@ -93,23 +105,35 @@ namespace GFGGame
             {
                 PoemPhotoData data = list[i];
                 if (data == null || data.Ntexture != null) continue;
-                using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(data.PictureTempUrl))
-                {
-                    yield return request.SendWebRequest();
-                    if (request.result == UnityWebRequest.Result.ProtocolError || request.result == UnityWebRequest.Result.ConnectionError)
-                    {
-                        PromptController.Instance.ShowFloatTextPrompt("下载失败");
-                        yield return null;
-                    }
-                    else
-                    {
-                        Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
-                        data.Ntexture = new NTexture(texture);
-                    }
-                }
+                int count = 0;
+                yield return DownloadPicture(data, count);
             }
             ET.Log.Debug("Download  finish!!!");
             EventAgent.DispatchEvent(ConstMessage.DOWNLOAD_FINISH);
         }
+        private static IEnumerator DownloadPicture(PoemPhotoData data, int count)
+        {
+            if (count >= 5)
+            {
+                ET.Log.Error("Download  fild!!!");
+                data.Ntexture = null;
+                yield return null;
+            }
+            using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(data.PictureTempUrl))
+            {
+                yield return request.SendWebRequest();
+                if (request.result == UnityWebRequest.Result.ProtocolError || request.result == UnityWebRequest.Result.ConnectionError)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt("下载失败");
+                    count += 1;
+                    yield return DownloadPicture(data, count);
+                }
+                else
+                {
+                    Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
+                    data.Ntexture = new NTexture(texture);
+                }
+            }
+        }
     }
 }

+ 1 - 69
GameClient/Assets/Game/HotUpdate/ServerProxy/PoemPhotoSProxy.cs

@@ -60,49 +60,6 @@ namespace GFGGame
             return false;
         }
 
-        // //获取图片的临时上传地址协议
-        // public static async ETTask<string[]> ReqTempPictureUrl(int pictureType)
-        // {
-        //     S2C_GetTempPictureUrl response = null;
-        //     response = (S2C_GetTempPictureUrl)await MessageHelper.SendToServer(new C2S_GetTempPictureUrl() { PictureType = pictureType });
-
-        //     if (response != null)
-        //     {
-        //         if (response.Error == ErrorCode.ERR_Success)
-        //         {
-        //             return new string[] { response.TempPictureUrl, response.PictureObjectPath };
-        //         }
-        //     }
-        //     else
-        //     {
-        //         ViewManager.Hide<ModalStatusView>();
-        //         PromptController.Instance.ShowFloatTextPrompt("获取上传地址失败");
-        //     }
-
-        //     return null;
-        // }
-
-        // //将图片上传到华为云
-        // public static async ETTask<bool> PushToHWCloud(string signUrl, byte[] buffer)
-        // {
-
-        //     HttpContent content = new ByteArrayContent(buffer);
-        //     HttpClient httpClient = new HttpClient(new HttpClientHandler() { UseCookies = false });
-        //     HttpResponseMessage response = await httpClient.PutAsync(signUrl, content);
-        //     response.EnsureSuccessStatusCode();
-        //     await response.Content.ReadAsStreamAsync();
-        //     if (response.StatusCode != HttpStatusCode.OK)
-        //     {
-        //         ViewManager.Hide<ModalStatusView>();
-        //         PromptController.Instance.ShowFloatTextPrompt("上传资源失败");
-        //         return false;
-        //     }
-        //     else
-        //     {
-        //         return true;
-        //     }
-
-        // }
         //保存成功后,添加图片至相册
         public static async ETTask<long> ReqAddTophoto(string pictureObjectPath, int sourceType)
         {
@@ -133,32 +90,7 @@ namespace GFGGame
             PromptController.Instance.ShowFloatTextPrompt("存储数据失败");
             return 0;
         }
-        // public static IEnumerator DownloadFile(PoemPhotoData poemPhotoData)
-        // {
-        //     ET.Log.Debug("PictureTempUrl:" + poemPhotoData.PictureTempUrl);
-        //     using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(poemPhotoData.PictureTempUrl))
-        //     {
-        //         yield return request.SendWebRequest();
-        //         if (request.result == UnityWebRequest.Result.ProtocolError || request.result == UnityWebRequest.Result.ConnectionError)
-        //         {
-        //             ET.Log.Debug("Error: " + request.error);
-        //             // while (!request.isDone)
-        //             // {
-        //             DownloadFile(poemPhotoData);
-        //             yield return null;
-        //             // }
-        //         }
-        //         else
-        //         {
-
-        //             Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
-        //             poemPhotoData.Bytes = texture.EncodeToJPG();
-        //             poemPhotoData.Ntexture = new NTexture(texture);
-        //         }
-
-        //     }
-
-        // }
+
         //批量删除玩家相册
         public static async ETTask<bool> ReqRemovedPhoto(List<long> pictureIds, int sourceType)
         {

+ 3 - 4
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

@@ -55,7 +55,7 @@ namespace GFGGame
             base.OnShown();
             _ui.m_c1.selectedIndex = (this.viewData == null) ? (int)PictureSourceType.PersonalAlbum : (int)this.viewData;
             OnBtnTabChange();
-            UpdateView();
+            // UpdateView();
             Timers.inst.AddUpdate(CheckGuide);
         }
 
@@ -102,8 +102,6 @@ namespace GFGGame
         {
             _ui.m_c2.selectedIndex = 0;
             _listDelete.Clear();
-
-            // if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
             UpdateView();
 
         }
@@ -134,9 +132,10 @@ namespace GFGGame
 
             item.m_imgSelect.visible = _ui.m_c2.selectedIndex == 1 && _listDelete.IndexOf(_photoInfos[index].PictureId) >= 0;
             GLoader loaIcon = item.m_comIcon.m_loaIcon;
+            loaIcon.visible = true;
             if (_photoInfos[index].Ntexture == null)
             {
-                _photoInfos[index].Ntexture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+                loaIcon.visible = false;
             }
             loaIcon.texture = _photoInfos[index].Ntexture;
 

BIN
GameClient/Assets/ResIn/UI/Common/Common_fui.bytes


BIN
GameClient/Assets/ResIn/UI/DressUp/DressUp_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/DressUp/DressUp_fui.bytes


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


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


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


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


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


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