zhaoyang 2 jaren geleden
bovenliggende
commit
5c18ce9a91

+ 1 - 1
FGUIProject/assets/poem/components/ComIcon.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="465,655" mask="n13_uyux">
   <displayList>
-    <loader id="n4_v482" name="loaIcon" xy="0,-85" pivot="0.5,0.5" size="465,826" aspect="true" url="ui://iyz778gkuyux102" fill="scaleMatchWidth"/>
+    <loader id="n4_v482" name="loaIcon" xy="0,-50" pivot="0.5,0.5" size="465,826" aspect="true" url="ui://iyz778gkuyux102" fill="scaleMatchWidth"/>
     <image id="n13_uyux" name="n13" src="uyux107" fileName="photImages/xc_xzxd.png" xy="0,0"/>
   </displayList>
 </component>

+ 3 - 3
FGUIProject/assets/poem/components/ListPhotoPreviewItem.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1000,1605">
   <displayList>
-    <component id="n5_v482" name="comPhoto" src="uyux105" fileName="components/ComPhoto.xml" xy="3,2" size="994,1605">
+    <component id="n5_v482" name="comPhoto" src="uyux105" fileName="components/ComPhoto.xml" xy="3,1" size="994,1602">
       <relation target="" sidePair="width-width,height-height"/>
     </component>
-    <image id="n8_uyux" name="n8" src="uyux100" fileName="photImages/xc_dakuang.png" xy="0,0" size="1000,1605">
-      <relation target="" sidePair="width-width,height-height"/>
+    <image id="n9_mdd9" name="imgBorder" src="uyux100" fileName="photImages/xc_dakuang.png" xy="0,0" size="1000,1605">
+      <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
     </image>
   </displayList>
 </component>

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Data/VO/PoemPhotoData.cs

@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using FairyGUI;
 
 namespace GFGGame
 {
@@ -47,6 +48,6 @@ namespace GFGGame
 
         public byte[] Bytes;
 
-
+        public NTexture Ntexture;
     }
 }

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

@@ -8,6 +8,7 @@ namespace UI.Poem
     {
         public GComponent target;
         public UI_ComPhoto m_comPhoto;
+        public GImage m_imgBorder;
         public const string URL = "ui://iyz778gkv482b";
         public const string PACKAGE_NAME = "Poem";
         public const string RES_NAME = "ListPhotoPreviewItem";
@@ -56,11 +57,13 @@ namespace UI.Poem
         private void Init(GComponent comp)
         {
             m_comPhoto = (UI_ComPhoto)UI_ComPhoto.Create(comp.GetChild("comPhoto"));
+            m_imgBorder = (GImage)comp.GetChild("imgBorder");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_comPhoto.Dispose();
             m_comPhoto = null;
+            m_imgBorder = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 2 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/PoemPhotoSProxy.cs

@@ -30,6 +30,7 @@ namespace GFGGame
                         photoData.PictureTempUrl = response.PictureInfosA[i].PictureTempUrl;
                         byte[] bytes = DownloadFile(response.PictureInfosA[i].PictureTempUrl);
                         photoData.Bytes = bytes;
+                        // photoData.Ntexture = PoemPhotoDataManager.Instance.BytesToTexture2D(bytes); ;
 
                         PoemPhotoDataManager.Instance.Add(photoData, (int)PictureSourceType.PersonalAlbum);
                     }
@@ -45,6 +46,7 @@ namespace GFGGame
                         photoData.PictureTempUrl = response.PictureInfosB[i].PictureTempUrl;
                         byte[] bytes = DownloadFile(response.PictureInfosB[i].PictureTempUrl);
                         photoData.Bytes = bytes;
+                        // photoData.Ntexture = PoemPhotoDataManager.Instance.BytesToTexture2D(bytes); ;
 
                         PoemPhotoDataManager.Instance.Add(photoData, (int)PictureSourceType.WanShuiQianShan);
                     }

+ 6 - 4
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographSaveView.cs

@@ -11,6 +11,7 @@ namespace GFGGame
     public class PhotographSaveView : BaseView
     {
         private UI_PhotographSaveUI _ui;
+        private byte[] bytes;
 
         protected override void OnInit()
         {
@@ -29,6 +30,7 @@ namespace GFGGame
         {
             base.OnShown();
             Texture2D tex = this.viewData as Texture2D;
+            byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
             _ui.m_imgRes.texture = new NTexture(tex);
             float width = _ui.m_imgBorder.width;
             float height = width * tex.height / tex.width;
@@ -54,8 +56,8 @@ namespace GFGGame
 
         private void OnClickBtnSave()
         {
-            Texture2D tex = this.viewData as Texture2D;
-            byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
+            // Texture2D tex = this.viewData as Texture2D;
+            // byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
             string fileName = "wsj" + TimeHelper.ServerNowSecs + ".jpg";
 
             PhotographDataManager.Instance.SavePicturoToLocal(bytes, fileName);
@@ -69,8 +71,8 @@ namespace GFGGame
                 return;
             }
 
-            Texture2D tex = this.viewData as Texture2D;
-            byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
+            // Texture2D tex = this.viewData as Texture2D;
+            // byte[] bytes = tex.EncodeToJPG();//将纹理数据,转化成一个jpg图片
 
             string[] rsp = await PoemPhotoSProxy.ReqTempPictureUrl((int)PictureType.jpg);
             if (rsp == null) return;

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographView.cs

@@ -544,12 +544,12 @@ namespace GFGGame
 
         private void OnClickBtnPhotograph()
         {
-            _ui.target.visible = false;
+            GRoot.inst.visible = false;
             Timers.inst.StartCoroutine(ScreenShotTex());// ();
         }
         private IEnumerator ScreenShotTex()
         {
-            _ui.target.visible = false;
+            GRoot.inst.visible = false;
             yield return new WaitForEndOfFrame();
 
             Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
@@ -558,7 +558,7 @@ namespace GFGGame
             tex.Apply();//保存像素信息
 
             ViewManager.Show<PhotographSaveView>(tex);
-            _ui.target.visible = true;
+            GRoot.inst.visible = true;
             LogServerHelper.SendNodeLog((int)PlayParticipationEnum.PAI_ZHAO, 2);
 
         }

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoPreView.cs

@@ -104,10 +104,11 @@ namespace GFGGame
         {
             UI_ListPhotoPreviewItem item = UI_ListPhotoPreviewItem.Proxy(obj);
             GLoader loaIcon = item.m_comPhoto.m_loaPhoto;
-            item.m_comPhoto.m_loaPhoto.texture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+            item.m_comPhoto.m_loaPhoto.texture = _photoInfos[index].Ntexture;// PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
             item.target.SetSize(item.target.width, item.target.initHeight * _ui.target.height / _ui.target.initHeight);
             loaIcon.SetSize(loaIcon.width, loaIcon.texture.height * loaIcon.width / loaIcon.texture.width);
             loaIcon.y = item.target.height / 2;
+            item.m_imgBorder.SetSize(item.target.width, item.target.height);
             UI_ListPhotoPreviewItem.ProxyEnd();
         }
 

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoShareView.cs

@@ -50,7 +50,7 @@ namespace GFGGame
 
             _curPhotoData = this.viewData as PoemPhotoData;
 
-            _ui.m_loaBg.texture = PoemPhotoDataManager.Instance.BytesToTexture2D(_curPhotoData.Bytes);
+            _ui.m_loaBg.texture = _curPhotoData.Ntexture;// PoemPhotoDataManager.Instance.BytesToTexture2D(_curPhotoData.Bytes);
             _ui.m_loaBg.SetSize(_ui.m_loaBg.width, _ui.m_loaBg.texture.height * _ui.m_loaBg.width / _ui.m_loaBg.texture.width);
 
         }

+ 5 - 1
GameClient/Assets/Game/HotUpdate/Views/Poem/PoemPhotoView.cs

@@ -124,7 +124,11 @@ 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.texture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+            if (_photoInfos[index].Ntexture == null)
+            {
+                _photoInfos[index].Ntexture = PoemPhotoDataManager.Instance.BytesToTexture2D(_photoInfos[index].Bytes);
+            }
+            loaIcon.texture = _photoInfos[index].Ntexture;
             loaIcon.SetSize(loaIcon.width, loaIcon.texture.height * loaIcon.width / loaIcon.texture.width);
 
             item.m_txtTime.text = TimeUtil.FormattingTime1(_photoInfos[index].CreationTime);

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