|
@@ -1,5 +1,9 @@
|
|
|
|
+using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using ET;
|
|
using ET;
|
|
|
|
+using FairyGUI;
|
|
|
|
+using UnityEngine;
|
|
|
|
+using UnityEngine.Networking;
|
|
|
|
|
|
namespace GFGGame
|
|
namespace GFGGame
|
|
{
|
|
{
|
|
@@ -15,9 +19,9 @@ namespace GFGGame
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
{
|
|
{
|
|
RoleDataManager.slogan = response.Signature;
|
|
RoleDataManager.slogan = response.Signature;
|
|
- RoleDataManager.headId = response.HeadPortraitItemId;
|
|
|
|
- RoleDataManager.headBorderId = response.HeadPortraitBoxItemId;
|
|
|
|
- // RoleInfoManager.Instance.photoDatas=response.OpenAlbumList;
|
|
|
|
|
|
+ RoleDataManager.headId = response.HeadItemId;
|
|
|
|
+ RoleDataManager.headBorderId = response.HeadBorderItemId;
|
|
|
|
+ RoleDataManager.photoDatas = response.PictureIds;
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -35,6 +39,24 @@ namespace GFGGame
|
|
OtherRoleInfoDetailData roleInfoDetail = new OtherRoleInfoDetailData();
|
|
OtherRoleInfoDetailData roleInfoDetail = new OtherRoleInfoDetailData();
|
|
roleInfoDetail.slogan = response.Signature;
|
|
roleInfoDetail.slogan = response.Signature;
|
|
roleInfoDetail.RoleLvl = response.RoleLvl;
|
|
roleInfoDetail.RoleLvl = response.RoleLvl;
|
|
|
|
+ for (int i = 0; i < response.PictureInfoList.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ if (roleInfoDetail.showPhotoList.Count == i)
|
|
|
|
+ {
|
|
|
|
+ roleInfoDetail.showPhotoList.Add(new PoemPhotoData());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (response.PictureInfoList[i].PictureId == 0)
|
|
|
|
+ {
|
|
|
|
+ roleInfoDetail.showPhotoList[i] = null;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ roleInfoDetail.showPhotoList[i].PictureId = response.PictureInfoList[i].PictureId;
|
|
|
|
+ roleInfoDetail.showPhotoList[i].PictureTempUrl = response.PictureInfoList[i].PictureTempUrl;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (response.CustomSuit != null)
|
|
if (response.CustomSuit != null)
|
|
{
|
|
{
|
|
roleInfoDetail.customSuitData = new CustomSuitData(response.CustomSuit.Pos);
|
|
roleInfoDetail.customSuitData = new CustomSuitData(response.CustomSuit.Pos);
|
|
@@ -49,6 +71,31 @@ namespace GFGGame
|
|
}
|
|
}
|
|
return null;
|
|
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)
|
|
public static async ETTask<string> ReqModifySlogan(string slogan)
|
|
{
|
|
{
|
|
@@ -85,13 +132,13 @@ namespace GFGGame
|
|
//修改角色头像
|
|
//修改角色头像
|
|
public static async ETTask<bool> ReqModifyRoleHead(int headId)
|
|
public static async ETTask<bool> ReqModifyRoleHead(int headId)
|
|
{
|
|
{
|
|
- S2C_ModifyRoleName response = null;
|
|
|
|
- response = (S2C_ModifyRoleName)await MessageHelper.SendToServer(new C2S_ModifyRoleName() { });
|
|
|
|
|
|
+ S2C_AuHeadPortrait response = null;
|
|
|
|
+ response = (S2C_AuHeadPortrait)await MessageHelper.SendToServer(new C2S_AuHeadPortrait() { HeadItemId = headId });
|
|
if (response != null)
|
|
if (response != null)
|
|
{
|
|
{
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
{
|
|
{
|
|
- RoleDataManager.roleName = response.Name;
|
|
|
|
|
|
+ RoleDataManager.headId = response.HeadItemId;
|
|
EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
|
|
EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -101,13 +148,13 @@ namespace GFGGame
|
|
//修改角色头像框
|
|
//修改角色头像框
|
|
public static async ETTask<bool> ReqModifyRoleHeadBorder(int HeadBorder)
|
|
public static async ETTask<bool> ReqModifyRoleHeadBorder(int HeadBorder)
|
|
{
|
|
{
|
|
- S2C_ModifyRoleName response = null;
|
|
|
|
- response = (S2C_ModifyRoleName)await MessageHelper.SendToServer(new C2S_ModifyRoleName() { });
|
|
|
|
|
|
+ S2C_AuHeadPortraitBox response = null;
|
|
|
|
+ response = (S2C_AuHeadPortraitBox)await MessageHelper.SendToServer(new C2S_AuHeadPortraitBox() { HeadBorderItemId = HeadBorder });
|
|
if (response != null)
|
|
if (response != null)
|
|
{
|
|
{
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
if (response.Error == ErrorCode.ERR_Success)
|
|
{
|
|
{
|
|
- RoleDataManager.roleName = response.Name;
|
|
|
|
|
|
+ RoleDataManager.headBorderId = response.HeadBorderItemId;
|
|
EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
|
|
EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -115,6 +162,20 @@ namespace GFGGame
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ //修改展示图片
|
|
|
|
+ public static async ETTask<bool> ReqModifyShowPhoto(List<int> photoDatas)
|
|
|
|
+ {
|
|
|
|
+ S2C_AddOpenAlbumInfo response = null;
|
|
|
|
+ response = (S2C_AddOpenAlbumInfo)await MessageHelper.SendToServer(new C2S_AddOpenAlbumInfo() { PictureIds = photoDatas });
|
|
|
|
+ if (response != null)
|
|
|
|
+ {
|
|
|
|
+ if (response.Error == ErrorCode.ERR_Success)
|
|
|
|
+ {
|
|
|
|
+ EventAgent.DispatchEvent(ConstMessage.CHANGE_ROLE_NAME);
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|