612 lines
15 KiB
C#
612 lines
15 KiB
C#
using System;
|
|
using DB;
|
|
using MAI2.Util;
|
|
using Manager;
|
|
using Manager.MaiStudio;
|
|
using Manager.UserDatas;
|
|
using Process;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
// Token: 0x02000083 RID: 131
|
|
public class UserInformationController : MonoBehaviour
|
|
{
|
|
// Token: 0x17000097 RID: 151
|
|
// (get) Token: 0x0600048E RID: 1166 RVA: 0x00010AAC File Offset: 0x0000FCAC
|
|
public RectTransform RectTransform
|
|
{
|
|
get
|
|
{
|
|
RectTransform rectTransform;
|
|
if ((rectTransform = this._rectTransform) == null)
|
|
{
|
|
rectTransform = (this._rectTransform = base.GetComponent<RectTransform>());
|
|
}
|
|
return rectTransform;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600048F RID: 1167 RVA: 0x00010AD4 File Offset: 0x0000FCD4
|
|
public void SetUserData(MessageUserInformationData data)
|
|
{
|
|
this._isKiraFrame = false;
|
|
this.SetUserIcon(data.Icon);
|
|
this.userNameText.text = data.Name;
|
|
this.SetUserRating(data.Rateing);
|
|
this.SetTitle(data.Title, data.TitleBg);
|
|
this.SetNamePlate(data.Plate);
|
|
this.SetFrame(data.Frame, data.IsKiraFrame, data.KiraFrame, data.KiraFrameMask, data.KiraFramePattern);
|
|
this.SetUdemae(data.ClassID);
|
|
this.SetRank(data.DaniID);
|
|
this.SetFriendBonusEffect(data.SeasonRankingRank, data.SeasonRankingNo);
|
|
if (data.IsSubMonitor)
|
|
{
|
|
this.SetPass(data.Pass, data.BaseColor, data.PassMaterial);
|
|
}
|
|
this.SetDispRate(data.DispRate);
|
|
if (null != this.namePlateMask)
|
|
{
|
|
this.namePlateMask.enabled = !data.IsSubMonitor;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000490 RID: 1168 RVA: 0x00010BCC File Offset: 0x0000FDCC
|
|
public void SetUserDataParts(int playerIndex, AssetManager manager, UserDetail data, UserOption option)
|
|
{
|
|
Texture2D iconTexture2D = manager.GetIconTexture2D(playerIndex, data.ViewIconID);
|
|
Texture2D plateTexture2D = manager.GetPlateTexture2D(data.ViewPlateID);
|
|
Texture2D frameTexture2D = manager.GetFrameTexture2D(data.ViewFrameID);
|
|
FrameData frame = Singleton<DataManager>.Instance.GetFrame(data.ViewFrameID);
|
|
bool flag;
|
|
Texture2D texture2D;
|
|
Texture2D texture2D2;
|
|
Texture2D texture2D3;
|
|
if (frame != null && frame.isEffect)
|
|
{
|
|
flag = true;
|
|
texture2D = manager.GetFrameTexture2D(data.ViewFrameID);
|
|
texture2D2 = manager.GetFrameMaskTexture2D(data.ViewFrameID);
|
|
texture2D3 = manager.GetFramePatternTexture2D(data.ViewFrameID);
|
|
}
|
|
else
|
|
{
|
|
flag = false;
|
|
texture2D = null;
|
|
texture2D2 = null;
|
|
texture2D3 = null;
|
|
}
|
|
TitleData title = Singleton<DataManager>.Instance.GetTitle(data.ViewTitleID);
|
|
string text = "";
|
|
TrophyRareType trophyRareType = TrophyRareType.Normal;
|
|
if (title != null)
|
|
{
|
|
text = title.name.str;
|
|
trophyRareType = title.rareType;
|
|
}
|
|
Sprite sprite = Resources.Load<Sprite>("Process/Common/Sprites/UpperMonitor/UI_CMN_Shougou_" + trophyRareType.ToString());
|
|
Sprite sprite2 = Resources.Load<Sprite>("Process/Common/Sprites/UpperMonitor/UI_CMN_DXPass_Platinum");
|
|
UdemaeID classRank = (UdemaeID)data.ClassRank;
|
|
uint courseRank = data.CourseRank;
|
|
this.SetUserData(iconTexture2D, plateTexture2D, data.UserName, data.Rating, text, classRank, courseRank, sprite, sprite2, option.DispRate, frameTexture2D, flag, texture2D, texture2D2, texture2D3);
|
|
}
|
|
|
|
// Token: 0x06000491 RID: 1169 RVA: 0x00010D04 File Offset: 0x0000FF04
|
|
private void SetUserData(Texture2D userIcon, Texture2D plate, string userName, uint rateing, string title, UdemaeID classID, uint daniID, Sprite titleBg, Sprite pass, OptionDisprateID dispRate, Texture2D frame, bool isKira, Texture2D kira_source_tex, Texture2D kira_mask_tex, Texture2D kira_pattern_tex)
|
|
{
|
|
this.SetUserIcon(userIcon);
|
|
this.userNameText.text = userName;
|
|
this.SetUserRating(rateing);
|
|
this.SetTitle(title, titleBg);
|
|
this.SetNamePlate(plate);
|
|
this.SetFrame(frame, isKira, kira_source_tex, kira_mask_tex, kira_pattern_tex);
|
|
this.SetDispRate(dispRate);
|
|
this.SetPass(pass);
|
|
this.SetUdemae(classID);
|
|
this.SetRank(daniID);
|
|
}
|
|
|
|
// Token: 0x06000492 RID: 1170 RVA: 0x00010D6D File Offset: 0x0000FF6D
|
|
public void ResetInformation()
|
|
{
|
|
this.SetUserIcon(null);
|
|
this.userNameText.text = "";
|
|
this.SetUserRating(0U);
|
|
this.titleText.SetData("");
|
|
}
|
|
|
|
// Token: 0x06000493 RID: 1171 RVA: 0x00010DA0 File Offset: 0x0000FFA0
|
|
public void SetDispRate(OptionDisprateID dispRate)
|
|
{
|
|
switch (dispRate)
|
|
{
|
|
case OptionDisprateID.AllDisp:
|
|
{
|
|
Image image = this.rateingBase;
|
|
if (image != null)
|
|
{
|
|
image.gameObject.SetActive(true);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(true);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(true);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.DispRateDan:
|
|
{
|
|
Image image2 = this.rateingBase;
|
|
if (image2 != null)
|
|
{
|
|
image2.gameObject.SetActive(true);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(true);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(false);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.DispRateClass:
|
|
{
|
|
Image image3 = this.rateingBase;
|
|
if (image3 != null)
|
|
{
|
|
image3.gameObject.SetActive(true);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(false);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(true);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.DispDanClass:
|
|
{
|
|
Image image4 = this.rateingBase;
|
|
if (image4 != null)
|
|
{
|
|
image4.gameObject.SetActive(false);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(true);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(true);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.DispRate:
|
|
{
|
|
Image image5 = this.rateingBase;
|
|
if (image5 != null)
|
|
{
|
|
image5.gameObject.SetActive(true);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(false);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(false);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.DispDan:
|
|
{
|
|
Image image6 = this.rateingBase;
|
|
if (image6 != null)
|
|
{
|
|
image6.gameObject.SetActive(false);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(true);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(false);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.DispClass:
|
|
{
|
|
Image image7 = this.rateingBase;
|
|
if (image7 != null)
|
|
{
|
|
image7.gameObject.SetActive(false);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(false);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(true);
|
|
return;
|
|
}
|
|
break;
|
|
}
|
|
case OptionDisprateID.Hide:
|
|
{
|
|
Image image8 = this.rateingBase;
|
|
if (image8 != null)
|
|
{
|
|
image8.gameObject.SetActive(false);
|
|
}
|
|
if (null != this.udemaeBadgeObj)
|
|
{
|
|
this.udemaeBadgeObj.SetActive(false);
|
|
}
|
|
if (null != this.rankBadgeObj)
|
|
{
|
|
this.rankBadgeObj.SetActive(false);
|
|
}
|
|
break;
|
|
}
|
|
default:
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000494 RID: 1172 RVA: 0x00011045 File Offset: 0x00010245
|
|
public void SetClassicMode(bool isActive)
|
|
{
|
|
this.rateingText.gameObject.SetActive(!isActive);
|
|
}
|
|
|
|
// Token: 0x06000495 RID: 1173 RVA: 0x0001105B File Offset: 0x0001025B
|
|
public void SetUserIcon(Texture2D texture)
|
|
{
|
|
if (this.userIconImage != null)
|
|
{
|
|
this.userIconImage.texture = texture;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000496 RID: 1174 RVA: 0x00011077 File Offset: 0x00010277
|
|
public void SetNamePlate(Texture2D texture)
|
|
{
|
|
if (this.namePlate != null)
|
|
{
|
|
this.namePlate.texture = texture;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000497 RID: 1175 RVA: 0x00011094 File Offset: 0x00010294
|
|
public void SetFrame(Texture2D texture, bool isKira, Texture2D kira_source_tex, Texture2D kira_mask_tex, Texture2D kira_pattern_tex)
|
|
{
|
|
bool flag = false;
|
|
this._isKiraFrame = isKira;
|
|
if (this._isKiraFrame)
|
|
{
|
|
if (this._kiraFrameImage != null)
|
|
{
|
|
if (kira_source_tex == null || kira_mask_tex == null)
|
|
{
|
|
this._kiraFrameImage.gameObject.SetActive(false);
|
|
flag = true;
|
|
}
|
|
else
|
|
{
|
|
Material material = Resources.Load<Material>("Common/Materials/UI_Frame/FX_Frame");
|
|
if (material != null)
|
|
{
|
|
if (this._material != null)
|
|
{
|
|
Object.DestroyImmediate(this._material);
|
|
this._material = null;
|
|
}
|
|
this._material = new Material(material);
|
|
if (this._material != null)
|
|
{
|
|
this._kiraFrameImage.gameObject.GetComponent<Image>().material = this._material;
|
|
}
|
|
this._kiraFrameImage.gameObject.SetActive(true);
|
|
this._kiraFrameImage.SetSourceImage(kira_source_tex);
|
|
this._kiraFrameImage.SetSubTexImage(kira_mask_tex);
|
|
this._kiraFrameImage.SetPatternTexImage(kira_pattern_tex);
|
|
}
|
|
}
|
|
}
|
|
if (this.frameImage != null)
|
|
{
|
|
this.frameImage.gameObject.SetActive(false);
|
|
if (flag)
|
|
{
|
|
if (texture == null)
|
|
{
|
|
this.frameImage.gameObject.SetActive(false);
|
|
return;
|
|
}
|
|
this.frameImage.gameObject.SetActive(true);
|
|
this.frameImage.texture = texture;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this._kiraFrameImage != null)
|
|
{
|
|
this._kiraFrameImage.gameObject.SetActive(false);
|
|
}
|
|
if (this.frameImage != null)
|
|
{
|
|
if (texture == null)
|
|
{
|
|
this.frameImage.gameObject.SetActive(false);
|
|
return;
|
|
}
|
|
this.frameImage.gameObject.SetActive(true);
|
|
this.frameImage.texture = texture;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000498 RID: 1176 RVA: 0x00003598 File Offset: 0x00002798
|
|
public void SetKiraFrame(Texture2D mainTex, Texture2D subTex)
|
|
{
|
|
}
|
|
|
|
// Token: 0x06000499 RID: 1177 RVA: 0x0001125A File Offset: 0x0001045A
|
|
public void SetVisibleKiraFrame(bool isVisisble)
|
|
{
|
|
KiraFrameImage kiraFrameImage = this._kiraFrameImage;
|
|
if (kiraFrameImage == null)
|
|
{
|
|
return;
|
|
}
|
|
kiraFrameImage.gameObject.SetActive(isVisisble);
|
|
}
|
|
|
|
// Token: 0x0600049A RID: 1178 RVA: 0x00011274 File Offset: 0x00010474
|
|
public void SetTitle(string title, Sprite titleBg)
|
|
{
|
|
if (this.titleText != null)
|
|
{
|
|
this.titleText.SetData(title);
|
|
this.titleText.ResetPosition();
|
|
}
|
|
if (this.titleBaseImage != null)
|
|
{
|
|
this.titleBaseImage.sprite = titleBg;
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600049B RID: 1179 RVA: 0x000112C0 File Offset: 0x000104C0
|
|
public void SetUserRating(uint rate)
|
|
{
|
|
if (this.rateingText != null)
|
|
{
|
|
this.rateingText.ChangeText(rate.ToString().PadLeft(5));
|
|
this.rateingBase.sprite = Resources.Load<Sprite>("Common/Sprites/DXRating/UI_CMN_DXRating_S_" + ResultProcess.GetRatePlate(rate));
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600049C RID: 1180 RVA: 0x00011313 File Offset: 0x00010513
|
|
public void SetUdemae(UdemaeID classID)
|
|
{
|
|
if (this.rankImage != null)
|
|
{
|
|
this.rankImage.sprite = Resources.Load<Sprite>(string.Format("Common/Sprites/Class/UI_CMN_Class_S_{0:00}", classID.GetEnumValue()));
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600049D RID: 1181 RVA: 0x00011348 File Offset: 0x00010548
|
|
public void SetRank(uint danibaseId)
|
|
{
|
|
if (this._udemaeImage != null)
|
|
{
|
|
this._udemaeImage.sprite = Resources.Load<Sprite>("Process/Course/Sprites/DaniPlate/UI_DNM_DaniPlate_" + danibaseId.ToString("00"));
|
|
}
|
|
}
|
|
|
|
// Token: 0x0600049E RID: 1182 RVA: 0x00003598 File Offset: 0x00002798
|
|
public void SetPass(Sprite sp)
|
|
{
|
|
}
|
|
|
|
// Token: 0x0600049F RID: 1183 RVA: 0x0001137E File Offset: 0x0001057E
|
|
public void SetPass(Sprite pass, Color baseColor, Material material)
|
|
{
|
|
pass == null;
|
|
}
|
|
|
|
// Token: 0x060004A0 RID: 1184 RVA: 0x00011388 File Offset: 0x00010588
|
|
public void SetActiveFriendBonusEffect(bool isActive)
|
|
{
|
|
for (int i = 0; i < this.FriendBattleFrame.Length; i++)
|
|
{
|
|
this.FriendBattleFrame[i].gameObject.SetActive(isActive);
|
|
this.FriendBattleBase[i].gameObject.SetActive(isActive);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060004A1 RID: 1185 RVA: 0x000113D0 File Offset: 0x000105D0
|
|
public void SetFriendBonusEffect(int rank, int seasonNo)
|
|
{
|
|
int[] array = new int[] { 1, 10, 100 };
|
|
if (rank > 0 && seasonNo > 0)
|
|
{
|
|
int num = 0;
|
|
for (int i = 0; i < array.Length; i++)
|
|
{
|
|
if (rank > array[i])
|
|
{
|
|
num++;
|
|
}
|
|
}
|
|
for (int j = 0; j < this.FriendBattleFrame.Length; j++)
|
|
{
|
|
if (j == num)
|
|
{
|
|
this.FriendBattleFrame[j].gameObject.SetActive(true);
|
|
this.FriendBattleBase[j].gameObject.SetActive(true);
|
|
this.FriendBattleFrame[j].Play("In");
|
|
if (seasonNo < 10)
|
|
{
|
|
this.FriendBattleNum1[j].gameObject.SetActive(true);
|
|
this.FriendBattleNum1[j].text = seasonNo.ToString();
|
|
this.FriendBattleNum2[j].gameObject.SetActive(false);
|
|
}
|
|
else if (seasonNo < 100)
|
|
{
|
|
this.FriendBattleNum2[j].gameObject.SetActive(true);
|
|
this.FriendBattleNum2[j].text = seasonNo.ToString();
|
|
this.FriendBattleNum1[j].gameObject.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
this.FriendBattleNum1[j].gameObject.SetActive(false);
|
|
this.FriendBattleNum2[j].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.FriendBattleFrame[j].gameObject.SetActive(false);
|
|
this.FriendBattleBase[j].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
for (int k = 0; k < this.FriendBattleFrame.Length; k++)
|
|
{
|
|
this.FriendBattleFrame[k].gameObject.SetActive(false);
|
|
this.FriendBattleBase[k].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060004A2 RID: 1186 RVA: 0x00011582 File Offset: 0x00010782
|
|
public void UpdateTextScroll()
|
|
{
|
|
if (this.titleText != null)
|
|
{
|
|
this.titleText.ViewUpdate();
|
|
}
|
|
}
|
|
|
|
// Token: 0x04000316 RID: 790
|
|
[SerializeField]
|
|
protected RawImage userIconImage;
|
|
|
|
// Token: 0x04000317 RID: 791
|
|
[SerializeField]
|
|
protected RawImage namePlate;
|
|
|
|
// Token: 0x04000318 RID: 792
|
|
[SerializeField]
|
|
protected Mask namePlateMask;
|
|
|
|
// Token: 0x04000319 RID: 793
|
|
[SerializeField]
|
|
protected RawImage frameImage;
|
|
|
|
// Token: 0x0400031A RID: 794
|
|
[SerializeField]
|
|
protected bool _isKiraFrame;
|
|
|
|
// Token: 0x0400031B RID: 795
|
|
[SerializeField]
|
|
[Header("キラフレーム")]
|
|
protected KiraFrameImage _kiraFrameImage;
|
|
|
|
// Token: 0x0400031C RID: 796
|
|
[SerializeField]
|
|
protected TextMeshProUGUI userNameText;
|
|
|
|
// Token: 0x0400031D RID: 797
|
|
[SerializeField]
|
|
[Header("レーティング表示土台")]
|
|
protected Image rateingBase;
|
|
|
|
// Token: 0x0400031E RID: 798
|
|
[SerializeField]
|
|
protected SpriteCounter rateingText;
|
|
|
|
// Token: 0x0400031F RID: 799
|
|
[SerializeField]
|
|
protected Image titleBaseImage;
|
|
|
|
// Token: 0x04000320 RID: 800
|
|
[SerializeField]
|
|
protected CustomTextScroll titleText;
|
|
|
|
// Token: 0x04000321 RID: 801
|
|
[SerializeField]
|
|
[Header("パス")]
|
|
protected Image _passBase;
|
|
|
|
// Token: 0x04000322 RID: 802
|
|
[SerializeField]
|
|
protected Image passImage;
|
|
|
|
// Token: 0x04000323 RID: 803
|
|
[SerializeField]
|
|
[Header("段位バッチ")]
|
|
protected GameObject udemaeBadgeObj;
|
|
|
|
// Token: 0x04000324 RID: 804
|
|
[SerializeField]
|
|
protected Image _udemaeImage;
|
|
|
|
// Token: 0x04000325 RID: 805
|
|
[SerializeField]
|
|
[Header("ランクバッチ")]
|
|
protected GameObject rankBadgeObj;
|
|
|
|
// Token: 0x04000326 RID: 806
|
|
[SerializeField]
|
|
protected Image rankImage;
|
|
|
|
// Token: 0x04000327 RID: 807
|
|
[SerializeField]
|
|
protected Image readerIcon;
|
|
|
|
// Token: 0x04000328 RID: 808
|
|
[SerializeField]
|
|
protected Image contributionImage;
|
|
|
|
// Token: 0x04000329 RID: 809
|
|
[SerializeField]
|
|
[Header("シーズンランキング関連")]
|
|
protected Animator[] FriendBattleFrame;
|
|
|
|
// Token: 0x0400032A RID: 810
|
|
[SerializeField]
|
|
protected GameObject[] FriendBattleBase;
|
|
|
|
// Token: 0x0400032B RID: 811
|
|
[SerializeField]
|
|
protected TextMeshProUGUI[] FriendBattleNum1;
|
|
|
|
// Token: 0x0400032C RID: 812
|
|
[SerializeField]
|
|
protected TextMeshProUGUI[] FriendBattleNum2;
|
|
|
|
// Token: 0x0400032D RID: 813
|
|
private RectTransform _rectTransform;
|
|
|
|
// Token: 0x0400032E RID: 814
|
|
private Material _material;
|
|
}
|