public static SlotItemAlbumDetailTextureInfo[] GenerateSlotItemGraphicsInfo(AlbumSlotModel albumSlotItemModel) { List <SlotItemAlbumDetailTextureInfo> list = new List <SlotItemAlbumDetailTextureInfo>(); list.Add(new SlotItemAlbumDetailTextureInfo(GraphicType.Second, albumSlotItemModel.MstId, Vector3.one, Vector3.zero, 287, 430)); list.Add(new SlotItemAlbumDetailTextureInfo(GraphicType.First, albumSlotItemModel.MstId, Vector3.one, Vector3.zero, 260, 260)); list.Add(new SlotItemAlbumDetailTextureInfo(GraphicType.Third, albumSlotItemModel.MstId, Vector3.one, Vector3.zero, 287, 430)); list.Add(new SlotItemAlbumDetailTextureInfo(GraphicType.Fourth, albumSlotItemModel.MstId, Vector3.one, Vector3.zero, 287, 430)); return(list.ToArray()); }
private void OnSelectedListItemListener(IAlbumModel albumModel) { if (mStateManager.CurrentState == State.SlotItemList && albumModel is AlbumSlotModel) { AlbumSlotModel albumModel2 = (AlbumSlotModel)albumModel; mContext.SetAlbumModel(albumModel2); mUISlotItemAlbumList.SetKeyController(null); mStateManager.PushState(State.SlotItemDetail); } }
private void OnSelectedListItemListener(IAlbumModel albumModel) { bool flag = this.mStateManager.CurrentState == UserInterfaceSlotItemAlbumManager.State.SlotItemList; if (flag && albumModel is AlbumSlotModel) { AlbumSlotModel albumModel2 = (AlbumSlotModel)albumModel; this.mContext.SetAlbumModel(albumModel2); this.mUISlotItemAlbumList.SetKeyController(null); this.mStateManager.PushState(UserInterfaceSlotItemAlbumManager.State.SlotItemDetail); } }
private void InitializeEquipmentShipIcons(AlbumSlotModel albumSlotModel) { List <string> list = new List <string>(); if (albumSlotModel.CanEquip(SType.Destroyter)) { list.Add("ship1"); } if (albumSlotModel.CanEquip(SType.LightCruiser)) { list.Add("ship2"); } if (albumSlotModel.CanEquip(SType.HeavyCruiser)) { list.Add("ship3"); } if (albumSlotModel.CanEquip(SType.BattleShip)) { list.Add("ship6"); } if (albumSlotModel.CanEquip(SType.LightAircraftCarrier)) { list.Add("ship8"); } if (albumSlotModel.CanEquip(SType.AircraftCarrier)) { list.Add("ship9"); } if (albumSlotModel.CanEquip(SType.SeaplaneTender)) { list.Add("ship12"); } if (albumSlotModel.CanEquip(SType.AviationBattleShip)) { list.Add("ship7"); } for (int i = 0; i < mTextures_EquipmentShipIcon.Length; i++) { if (i < list.Count) { mTextures_EquipmentShipIcon[i].mainTexture = RequestTextureShipTypeIcon(list[i]); } else { mTextures_EquipmentShipIcon[i].mainTexture = null; } } }
public void Initialize(AlbumSlotModel albumSlotModel) { this._Stc_R = false; this.mAlbumSlotModel = albumSlotModel; int maxLineInFullWidthChar = 22; int fullWidthCharBuffer = 1; if (this.mSlotItemAlbumDetailTextureInfos != null) { UISlotItemAlbumDetail.SlotItemAlbumDetailTextureInfo[] array = this.mSlotItemAlbumDetailTextureInfos; for (int i = 0; i < array.Length; i++) { UISlotItemAlbumDetail.SlotItemAlbumDetailTextureInfo slotItemAlbumDetailTextureInfo = array[i]; slotItemAlbumDetailTextureInfo.ReleaseTexture(); } } this.mSlotItemAlbumDetailTextureInfos = UISlotItemAlbumDetail.SlotItemAlbumDetailTextureInfo.GenerateSlotItemGraphicsInfo(albumSlotModel); if (this.mTexture_SlotItemTypeBackground.mainTexture != null) { Resources.UnloadAsset(this.mTexture_SlotItemTypeBackground.mainTexture); this.mTexture_SlotItemTypeBackground.mainTexture = null; } this.mTexture_SlotItemTypeBackground.mainTexture = this.RequestTextureShipTypeBackGround(this.mAlbumSlotModel.Type2); this.mLabel_TypeName.text = Utils.GetSlotitemType3Name(this.mAlbumSlotModel.Type3); this.mLabel_No.text = string.Format("{0:000}", this.mAlbumSlotModel.Id); this.mLabel_Name.text = this.mAlbumSlotModel.Name; this.InitializeEquipmentShipIcons(this.mAlbumSlotModel); this.InitializeParameters(this.mAlbumSlotModel); if (this.mTexture_TypeIcon.mainTexture != null) { Resources.UnloadAsset(this.mTexture_TypeIcon.mainTexture); } this.mTexture_TypeIcon.mainTexture = null; this.mTexture_TypeIcon.mainTexture = this.RequestTextureTypeIcon(this.mAlbumSlotModel.Type4); this.mLabel_Description.text = UserInterfaceAlbumManager.Utils.NormalizeDescription(maxLineInFullWidthChar, fullWidthCharBuffer, this.mAlbumSlotModel.Detail); this.mButtons_Focasable = this.GetFocasableButtons(); this.ChangeFocusTexture(this.mSlotItemAlbumDetailTextureInfos[0]); }
private void OnDestroy() { mPanelThis = null; mButtonManager = null; mTransform_OffsetForTexture = null; mTexture_SlotItem = null; mTexture_TypeIcon = null; mTexture_SlotItemTypeBackground = null; mButton_Next = null; mButton_Prev = null; mLabel_No = null; mLabel_Name = null; mLabel_Description = null; mLabel_TypeName = null; mParameters = null; mTextures_EquipmentShipIcon = null; mButtons_Focasable = null; mSlotItemAlbumDetailTextureInfos = null; mCurrentShipAlbumDetailTextureInfo = null; mCurrentFocusButton = null; mKeyController = null; mAlbumSlotModel = null; }
public IEnumerator GenerateInitializeCoroutine(IAlbumModel albumModel) { mAlbumModel = albumModel; mLabel_Number.text = $"{albumModel.Id:000}"; if (mTexture_SlotItemCard.mainTexture != null) { Resources.UnloadAsset(mTexture_SlotItemCard.mainTexture); mTexture_SlotItemCard.mainTexture = null; } if (albumModel is AlbumSlotModel) { AlbumSlotModel albumSlotModel = (AlbumSlotModel)albumModel; Texture slotItemCardTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(albumSlotModel.MstId, 1); mTexture_SlotItemCard.mainTexture = slotItemCardTexture; mTexture_SlotItemCard.alpha = 1f; yield return(null); } else { mTexture_SlotItemCard.alpha = 0f; } }
public void Initialize(AlbumSlotModel albumSlotModel) { _Stc_R = false; mAlbumSlotModel = albumSlotModel; int maxLineInFullWidthChar = 22; int fullWidthCharBuffer = 1; if (mSlotItemAlbumDetailTextureInfos != null) { SlotItemAlbumDetailTextureInfo[] array = mSlotItemAlbumDetailTextureInfos; foreach (SlotItemAlbumDetailTextureInfo slotItemAlbumDetailTextureInfo in array) { slotItemAlbumDetailTextureInfo.ReleaseTexture(); } } mSlotItemAlbumDetailTextureInfos = SlotItemAlbumDetailTextureInfo.GenerateSlotItemGraphicsInfo(albumSlotModel); if (mTexture_SlotItemTypeBackground.mainTexture != null) { Resources.UnloadAsset(mTexture_SlotItemTypeBackground.mainTexture); mTexture_SlotItemTypeBackground.mainTexture = null; } mTexture_SlotItemTypeBackground.mainTexture = RequestTextureShipTypeBackGround(mAlbumSlotModel.Type2); mLabel_TypeName.text = Utils.GetSlotitemType3Name(mAlbumSlotModel.Type3); mLabel_No.text = $"{mAlbumSlotModel.Id:000}"; mLabel_Name.text = mAlbumSlotModel.Name; InitializeEquipmentShipIcons(mAlbumSlotModel); InitializeParameters(mAlbumSlotModel); if (mTexture_TypeIcon.mainTexture != null) { Resources.UnloadAsset(mTexture_TypeIcon.mainTexture); } mTexture_TypeIcon.mainTexture = null; mTexture_TypeIcon.mainTexture = RequestTextureTypeIcon(mAlbumSlotModel.Type4); mLabel_Description.text = UserInterfaceAlbumManager.Utils.NormalizeDescription(maxLineInFullWidthChar, fullWidthCharBuffer, mAlbumSlotModel.Detail); mButtons_Focasable = GetFocasableButtons(); ChangeFocusTexture(mSlotItemAlbumDetailTextureInfos[0]); }
private void InitializeParameters(AlbumSlotModel albumSlotModel) { string[] array = new string[5] { "無", "短", "中", "長", "超長" }; Dictionary <int, string> dictionary = new Dictionary <int, string>(); if (0 < albumSlotModel.Soukou) { dictionary.Add(2, albumSlotModel.Soukou.ToString()); } if (0 < albumSlotModel.Hougeki) { dictionary.Add(7, albumSlotModel.Hougeki.ToString()); } if (0 < albumSlotModel.Raigeki) { dictionary.Add(8, albumSlotModel.Raigeki.ToString()); } if (0 < albumSlotModel.Bakugeki) { dictionary.Add(14, albumSlotModel.Bakugeki.ToString()); } if (0 < albumSlotModel.Taikuu) { dictionary.Add(9, albumSlotModel.Taikuu.ToString()); } if (0 < albumSlotModel.Taisen) { dictionary.Add(10, albumSlotModel.Taisen.ToString()); } if (0 < albumSlotModel.HouMeityu) { dictionary.Add(13, albumSlotModel.HouMeityu.ToString()); } if (0 < albumSlotModel.Kaihi) { dictionary.Add(3, albumSlotModel.Kaihi.ToString()); } if (0 < albumSlotModel.Sakuteki) { dictionary.Add(11, albumSlotModel.Sakuteki.ToString()); } if (0 < albumSlotModel.Syatei) { dictionary.Add(6, array[albumSlotModel.Syatei]); } int[] array2 = dictionary.Keys.ToArray(); for (int i = 0; i < mParameters.Length; i++) { Parameter parameter = mParameters[i]; if (parameter.GetTexture().mainTexture != null) { Resources.UnloadAsset(parameter.GetTexture().mainTexture); parameter.GetTexture().mainTexture = null; } } for (int j = 0; j < mParameters.Length; j++) { Parameter parameter2 = mParameters[j]; if (j < array2.Length) { int num = array2[j]; parameter2.GetTransform().SetActive(isActive: true); parameter2.GetLabel().text = dictionary[num]; parameter2.GetTexture().mainTexture = (Resources.Load($"Textures/Album/status_icon/status_{num}") as Texture); } else { parameter2.GetTransform().SetActive(isActive: false); } } }
private void InitializeParameters(AlbumSlotModel albumSlotModel) { string[] array = new string[] { "無", "短", "中", "長", "超長" }; Dictionary <int, string> dictionary = new Dictionary <int, string>(); if (0 < albumSlotModel.Soukou) { dictionary.Add(2, albumSlotModel.Soukou.ToString()); } if (0 < albumSlotModel.Hougeki) { dictionary.Add(7, albumSlotModel.Hougeki.ToString()); } if (0 < albumSlotModel.Raigeki) { dictionary.Add(8, albumSlotModel.Raigeki.ToString()); } if (0 < albumSlotModel.Bakugeki) { dictionary.Add(14, albumSlotModel.Bakugeki.ToString()); } if (0 < albumSlotModel.Taikuu) { dictionary.Add(9, albumSlotModel.Taikuu.ToString()); } if (0 < albumSlotModel.Taisen) { dictionary.Add(10, albumSlotModel.Taisen.ToString()); } if (0 < albumSlotModel.HouMeityu) { dictionary.Add(13, albumSlotModel.HouMeityu.ToString()); } if (0 < albumSlotModel.Kaihi) { dictionary.Add(3, albumSlotModel.Kaihi.ToString()); } if (0 < albumSlotModel.Sakuteki) { dictionary.Add(11, albumSlotModel.Sakuteki.ToString()); } if (0 < albumSlotModel.Syatei) { dictionary.Add(6, array[albumSlotModel.Syatei]); } int[] array2 = Enumerable.ToArray <int>(dictionary.get_Keys()); for (int i = 0; i < this.mParameters.Length; i++) { UISlotItemAlbumDetail.Parameter parameter = this.mParameters[i]; if (parameter.GetTexture().mainTexture != null) { Resources.UnloadAsset(parameter.GetTexture().mainTexture); parameter.GetTexture().mainTexture = null; } } for (int j = 0; j < this.mParameters.Length; j++) { UISlotItemAlbumDetail.Parameter parameter2 = this.mParameters[j]; if (j < array2.Length) { int num = array2[j]; parameter2.GetTransform().SetActive(true); parameter2.GetLabel().text = dictionary.get_Item(num); parameter2.GetTexture().mainTexture = (Resources.Load(string.Format("Textures/Album/status_icon/status_{0}", num)) as Texture); } else { parameter2.GetTransform().SetActive(false); } } }