Browse Source

个人信息

zhaoyang 2 years ago
parent
commit
a73a6ac837

+ 41 - 0
FGUIProject/assets/RoleInfo/OtherRoleInfoUI.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="1080,1920">
+  <displayList>
+    <loader id="n27_r9ri" name="loaBg" xy="540,960" pivot="0.5,0.5" anchor="true" size="1080,2400" fill="scaleMatchWidth">
+      <relation target="" sidePair="width-width,height-height,center-center,middle-middle"/>
+    </loader>
+    <component id="n52_r9ri" name="btnBack" src="9xlo8" fileName="components/ButtonBack1.xml" pkg="eg2y0ldp" xy="35,90"/>
+    <component id="n33_r9ri" name="comHead" src="r9ri1h" fileName="components/ComHead.xml" xy="96,147" group="n53_oqa1" scale="1.3,1.3"/>
+    <image id="n29_r9ri" name="n29" src="r9ri24" fileName="images/zjm_dj_1.png" xy="295,317" group="n53_oqa1"/>
+    <text id="n30_r9ri" name="txtLvl" xy="304,324" size="34,34" group="n53_oqa1" fontSize="24" color="#ffffff" align="center" text="99">
+      <relation target="n29_r9ri" sidePair="center-center,middle-middle"/>
+    </text>
+    <image id="n32_r9ri" name="n32" src="r9ri16" fileName="images/grxx_zyshul.png" xy="158,375" group="n53_oqa1"/>
+    <text id="n36_r9ri" name="txtExp" xy="215,373" pivot="0.5,0" size="44,34" group="n53_oqa1" fontSize="24" color="#fbedda" letterSpacing="-2" text="0/1"/>
+    <group id="n53_oqa1" name="n53" xy="96,147" size="249,260" group="n37_r9ri"/>
+    <image id="n50_r9ri" name="n50" src="r9rim" fileName="images/grxx_xtxtx.png" xy="417,297" size="576,6" group="n54_oqa1"/>
+    <text id="n5_d4iw" name="txtRoleName" xy="428,214" size="328,64" group="n54_oqa1" font="ui://eg2y0ldpwonotja" fontSize="48" color="#927346" align="center" letterSpacing="-2" text="玩家名称七个字"/>
+    <text id="n55_v95q" name="txtSlogan" xy="431,318" size="549,89" group="n54_oqa1" fontSize="30" color="#a6967c" autoSize="none" text=""/>
+    <group id="n54_oqa1" name="n54" xy="417,214" size="576,193" group="n37_r9ri"/>
+    <group id="n37_r9ri" name="grpHead" xy="96,147" size="897,260" advanced="true"/>
+    <component id="n38_r9ri" name="btnFieldGuide" src="r9ri1j" fileName="components/Button2.xml" xy="36,476" touchable="false"/>
+    <image id="n41_r9ri" name="n41" src="r9ri12" fileName="images/grxx_zyddt.png" xy="9,573" size="1070,1347" group="n49_r9ri">
+      <relation target="" sidePair="height-height"/>
+    </image>
+    <image id="n43_r9ri" name="n43" src="r9ri18" fileName="images/grxx_grxcxc.png" xy="327,640" group="n49_r9ri"/>
+    <list id="n47_r9ri" name="list" xy="44,791" size="994,974" group="n49_r9ri" layout="flow_hz" overflow="scroll" lineGap="42" colGap="28" defaultItem="ui://374k3dwvr9ri1m" autoClearItems="true">
+      <relation target="" sidePair="bottomext-bottom"/>
+      <item/>
+      <item/>
+      <item/>
+      <item/>
+    </list>
+    <group id="n49_r9ri" name="n49" xy="9,573" size="1070,1347" advanced="true">
+      <relation target="" sidePair="top-top"/>
+    </group>
+    <image id="n42_r9ri" name="n42" src="r9ri13" fileName="images/grxx_zydik.png" xy="0,1780" group="n46_r9ri"/>
+    <group id="n46_r9ri" name="n46" xy="0,1780" size="1080,140" advanced="true">
+      <relation target="" sidePair="bottom-bottom"/>
+    </group>
+  </displayList>
+</component>

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

@@ -79,6 +79,7 @@
     <image id="r9ri23" name="grxx_xtkk_2.png" path="/images/"/>
     <image id="r9ri24" name="zjm_dj_1.png" path="/images/"/>
     <image id="oqa1g1" name="xc_qxxzxd.png" path="/images/"/>
+    <component id="v95qg2" name="OtherRoleInfoUI.xml" path="/" exported="true"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\RoleInfo" packageCount="2" genCode="true"/>
 </packageDescription>

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

@@ -7,8 +7,8 @@ namespace GFGGame
         public long roleId;
         public string roleName;
         public int roleLv;
-        public int roleHead;
-        public int roleHeadBorder;
+        public int roleHead;//头像
+        public int roleHeadBorder;//头像框
         public long offlineTimeSec;//离线时间戳,单位秒,0表示在线
 
 

+ 99 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_OtherRoleInfoUI.cs

@@ -0,0 +1,99 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.RoleInfo
+{
+    public partial class UI_OtherRoleInfoUI
+    {
+        public GComponent target;
+        public GLoader m_loaBg;
+        public GButton m_btnBack;
+        public UI_ComHead m_comHead;
+        public GTextField m_txtLvl;
+        public GTextField m_txtExp;
+        public GTextField m_txtRoleName;
+        public GTextField m_txtSlogan;
+        public GGroup m_grpHead;
+        public GButton m_btnFieldGuide;
+        public GList m_list;
+        public const string URL = "ui://374k3dwvv95qg2";
+        public const string PACKAGE_NAME = "RoleInfo";
+        public const string RES_NAME = "OtherRoleInfoUI";
+        private static UI_OtherRoleInfoUI _proxy;
+
+        public static UI_OtherRoleInfoUI Create(GObject gObject = null)
+        {
+            var ui = new UI_OtherRoleInfoUI();
+            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_OtherRoleInfoUI Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_OtherRoleInfoUI();
+            }
+            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_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_btnBack = (GButton)comp.GetChild("btnBack");
+            m_comHead = (UI_ComHead)UI_ComHead.Create(comp.GetChild("comHead"));
+            m_txtLvl = (GTextField)comp.GetChild("txtLvl");
+            m_txtExp = (GTextField)comp.GetChild("txtExp");
+            m_txtRoleName = (GTextField)comp.GetChild("txtRoleName");
+            m_txtSlogan = (GTextField)comp.GetChild("txtSlogan");
+            m_grpHead = (GGroup)comp.GetChild("grpHead");
+            m_btnFieldGuide = (GButton)comp.GetChild("btnFieldGuide");
+            m_list = (GList)comp.GetChild("list");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_loaBg = null;
+            m_btnBack = null;
+            m_comHead.Dispose();
+            m_comHead = null;
+            m_txtLvl = null;
+            m_txtExp = null;
+            m_txtRoleName = null;
+            m_txtSlogan = null;
+            m_grpHead = null;
+            m_btnFieldGuide = null;
+            m_list = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RoleInfo/UI_OtherRoleInfoUI.cs.meta

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

+ 43 - 13
GameClient/Assets/Game/HotUpdate/ServerProxy/PictureStorageHelper.cs

@@ -5,6 +5,7 @@ using System.IO;
 using System.Net;
 using System.Net.Http;
 using ET;
+using FairyGUI;
 using UnityEngine;
 using UnityEngine.Networking;
 
@@ -57,26 +58,55 @@ namespace GFGGame
             }
 
         }
-        public static IEnumerator DownloadFile(string pictureTempUrl, Action<Texture2D> callback)
+
+        public static IEnumerator Download(List<long> list, int startIndex)
         {
-            using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(pictureTempUrl))
+            for (int i = startIndex; i < list.Count; i++)
             {
-                yield return request.SendWebRequest();
-                if (request.result == UnityWebRequest.Result.ProtocolError || request.result == UnityWebRequest.Result.ConnectionError)
+                PoemGalleryData data = PoemGalleryDataManager.Instance.GetGalleryDataById(list[i]);
+                if (data.Ntexture != null) continue;
+                using (UnityWebRequest request = UnityWebRequestTexture.GetTexture(data.PictureTempUrl))
                 {
-                    DownloadFile(pictureTempUrl, callback);
-                    // PromptController.Instance.ShowFloatTextPrompt("下载失败");
-                    // yield return null;
+                    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);
+                    }
                 }
-                else
-                {
+            }
+            ET.Log.Debug("Download  finish!!!");
+            EventAgent.DispatchEvent(ConstMessage.GALLERY_DATA_CHANGE);
+        }
 
-                    Texture2D texture = (request.downloadHandler as DownloadHandlerTexture).texture;
-                    callback(texture);
+        public static IEnumerator Download(List<PoemPhotoData> list)
+        {
+            for (int i = 0; i < list.Count; i++)
+            {
+                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);
+                    }
                 }
-
             }
-
+            ET.Log.Debug("Download  finish!!!");
+            EventAgent.DispatchEvent(ConstMessage.DOWNLOAD_FINISH);
         }
     }
 }

+ 1 - 24
GameClient/Assets/Game/HotUpdate/ServerProxy/PoemGallerySProxy.cs

@@ -138,30 +138,7 @@ namespace GFGGame
             return false;
         }
 
-        public static IEnumerator Download(List<long> list, int startIndex)
-        {
-            for (int i = startIndex; i < list.Count; i++)
-            {
-                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);
-                    }
-                }
-            }
-            ET.Log.Debug("Download  finish!!!");
-            EventAgent.DispatchEvent(ConstMessage.GALLERY_DATA_CHANGE);
-        }
+
 
 
         //请求投稿画廊作品

+ 6 - 5
GameClient/Assets/Game/HotUpdate/ServerProxy/PoemPhotoSProxy.cs

@@ -30,13 +30,14 @@ namespace GFGGame
                         photoData.LockingStatus = response.PictureInfosA[i].LockingStatus;
                         photoData.SourceType = response.PictureInfosA[i].SourceType;
                         photoData.PictureTempUrl = response.PictureInfosA[i].PictureTempUrl;
-                        Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(photoData.PictureTempUrl, (Texture2D texture) =>
-                        {
-                            photoData.Bytes = texture.EncodeToJPG();
-                            photoData.Ntexture = new NTexture(texture);
-                        }));
+                        // Timers.inst.StartCoroutine(PictureStorageHelper.DownloadFile(photoData.PictureTempUrl, (Texture2D texture) =>
+                        // {
+                        //     photoData.Bytes = texture.EncodeToJPG();
+                        //     photoData.Ntexture = new NTexture(texture);
+                        // }));
                         PoemPhotoDataManager.Instance.Add(photoData, (int)PictureSourceType.PersonalAlbum);
                     }
+                    Timers.inst.StartCoroutine(PictureStorageHelper.Download(PoemPhotoDataManager.Instance.PersonalPhotoInfos));
                     for (int i = 0; i < response.PictureInfosB.Count; i++)
                     {
                         PoemPhotoData photoData = new PoemPhotoData();

+ 4 - 28
GameClient/Assets/Game/HotUpdate/ServerProxy/RoleInfoSProxy.cs

@@ -71,30 +71,7 @@ namespace GFGGame
             }
             return null;
         }
-        public static IEnumerator Download(List<PoemPhotoData> list)
-        {
-            for (int i = 0; i < list.Count; i++)
-            {
-                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);
-                    }
-                }
-            }
-            ET.Log.Debug("Download  finish!!!");
-            EventAgent.DispatchEvent(ConstMessage.DOWNLOAD_FINISH);
-        }
+
 
         //修改个人签名
         public static async ETTask<string> ReqModifySlogan(string slogan)
@@ -139,7 +116,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     RoleDataManager.headId = response.HeadItemId;
-                    EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
+                    EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_HEAD);
                     return true;
                 }
             }
@@ -155,7 +132,7 @@ namespace GFGGame
                 if (response.Error == ErrorCode.ERR_Success)
                 {
                     RoleDataManager.headBorderId = response.HeadBorderItemId;
-                    EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
+                    EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_HEAD);
                     return true;
                 }
             }
@@ -163,7 +140,7 @@ namespace GFGGame
         }
 
         //修改展示图片
-        public static async ETTask<bool> ReqModifyShowPhoto(List<int> photoDatas)
+        public static async ETTask<bool> ReqModifyShowPhoto(List<long> photoDatas)
         {
             S2C_AddOpenAlbumInfo response = null;
             response = (S2C_AddOpenAlbumInfo)await MessageHelper.SendToServer(new C2S_AddOpenAlbumInfo() { PictureIds = photoDatas });
@@ -171,7 +148,6 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
                     return true;
                 }
             }

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

@@ -350,7 +350,7 @@ namespace GFGGame
             bool result = await PoemGallerySProxy.ReqGalleryList(_sortType, startIndex, _pageCount);
             if (result)
             {
-                Timers.inst.StartCoroutine(PoemGallerySProxy.Download(_galleryDatas, startIndex));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, startIndex));
             }
         }
         private void UpdateGalleryList()
@@ -595,7 +595,7 @@ namespace GFGGame
             // OnPullDownTimeComplete();
             if (result)
             {
-                Timers.inst.StartCoroutine(PoemGallerySProxy.Download(_galleryDatas, 0));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, 0));
             }
 
         }
@@ -621,7 +621,7 @@ namespace GFGGame
             // OnPullUpTimeComplete();
             if (result)
             {
-                Timers.inst.StartCoroutine(PoemGallerySProxy.Download(_galleryDatas, _galleryDatas.Count));
+                Timers.inst.StartCoroutine(PictureStorageHelper.Download(_galleryDatas, _galleryDatas.Count));
             }
         }
 

+ 99 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/OtherRoleInfoView.cs

@@ -0,0 +1,99 @@
+using ET;
+using FairyGUI;
+using UI.RoleInfo;
+
+namespace GFGGame
+{
+    public class OtherRoleInfoView : BaseWindow
+    {
+        private UI_OtherRoleInfoUI _ui;
+        private OtherRoleInfoData _roleInfo;
+        private OtherRoleInfoDetailData _roleDetailInfo;
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+            }
+            _ui = null;
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_OtherRoleInfoUI.PACKAGE_NAME;
+            _ui = UI_OtherRoleInfoUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+
+            _ui.m_btnBack.onClick.Add(OnBtnBackClick);
+
+            _ui.m_list.itemRenderer = RenderListItem;
+
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("xc_bjbj");
+        }
+
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _roleInfo = (this.viewData as object[])[0] as OtherRoleInfoData;
+            _roleDetailInfo = (this.viewData as object[])[1] as OtherRoleInfoDetailData;
+
+            _ui.m_txtRoleName.text = _roleInfo.roleName;
+            _ui.m_txtLvl.text = _roleInfo.roleLv.ToString();
+            RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(_roleInfo.roleLv);
+            if (roleLevelCfg.exp > 0)
+            {
+                _ui.m_txtExp.text = string.Format("{0}/{1}", GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp), roleLevelCfg.exp);
+            }
+            else
+            {
+                _ui.m_txtExp.text = "已满级";
+            }
+
+            _ui.m_txtSlogan.text = _roleDetailInfo.slogan;
+            _ui.m_btnFieldGuide.title = string.Format("收集度:{0}%", RoleInfoManager.Instance.GetGuideProgress());
+            _ui.m_list.numItems = _roleDetailInfo.showPhotoList.Count;
+            UpdateHead();
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+        }
+        private void OnBtnBackClick()
+        {
+            ViewManager.GoBackFrom(typeof(RoleInfoView).FullName);
+        }
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+        }
+
+        private void UpdateHead()
+        {
+            ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(_roleInfo.roleHead);
+            _ui.m_comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
+
+            ItemCfg headBorderCfg = ItemCfgArray.Instance.GetCfg(_roleInfo.roleHeadBorder);
+            _ui.m_comHead.m_loaBorder.url = ResPathUtil.GetHeadBorderPath(headBorderCfg.res);
+        }
+        private void RenderListItem(int index, GObject obj)
+        {
+            PoemPhotoData poemPhotoData = _roleDetailInfo.showPhotoList[index];
+            UI_ListPhotoItem item = UI_ListPhotoItem.Proxy(obj);
+
+            item.m_comPhoto.m_loaPhoto.texture = poemPhotoData == null ? null : poemPhotoData.Ntexture;
+            item.target.data = index;
+            UI_ListPhotoItem.ProxyEnd();
+        }
+
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/OtherRoleInfoView.cs.meta

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

+ 6 - 3
GameClient/Assets/Game/HotUpdate/Views/RoleInfo/PersonalPhotoView.cs

@@ -63,7 +63,7 @@ namespace GFGGame
             UI_ListPhotoItem1.ProxyEnd();
 
         }
-        private void OnListItemClick(EventContext context)
+        private async void OnListItemClick(EventContext context)
         {
             GObject obj = context.data as GObject;
             long selectPictureId = (long)obj.data;
@@ -92,8 +92,11 @@ namespace GFGGame
                     }
                 }
             }
-
-            ViewManager.GoBackFrom(typeof(PersonalPhotoView).FullName);
+            bool result = await RoleInfoSProxy.ReqModifyShowPhoto(RoleDataManager.photoDatas);
+            if (result)
+            {
+                ViewManager.GoBackFrom(typeof(PersonalPhotoView).FullName);
+            }
         }
     }
 }

BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_atlas0.png


BIN
GameClient/Assets/ResIn/UI/RoleInfo/RoleInfo_fui.bytes