// Token: 0x06001A09 RID: 6665 RVA: 0x002C27DC File Offset: 0x002C09DC public void SetData(byte CastleID) { this.CastleID = CastleID; CastleSkin castleSkin = GUIManager.Instance.BuildingData.castleSkin; CastleSkinTbl recordByKey = castleSkin.CastleSkinTable.GetRecordByKey((ushort)CastleID); byte level = GUIManager.Instance.BuildingData.GetBuildData(8, 0).Level; this.MainImg.sprite = castleSkin.GetUISprite(recordByKey.Graphic, level); this.MainImg.material = castleSkin.GetUIMaterial(recordByKey.Graphic, level); this.MainImg.SetNativeSize(); float num = (float)recordByKey.UnlockPercentage * 0.01f * 0.3f; this.MainImg.rectTransform.localScale = new Vector3(num, num, num); this.SetStar(castleSkin.GetCastleEnhance(CastleID)); if (GUIManager.Instance.BuildingData.CastleID == CastleID) { this.AddImg.sprite = this.StarArray.GetSprite(3); this.AddImg.enabled = true; } else if (!castleSkin.CheckUnlock(CastleID)) { this.AddImg.sprite = this.StarArray.GetSprite(2); this.AddImg.enabled = true; } else { this.AddImg.enabled = false; } this.NoticeObj.SetActive(!castleSkin.CheckSelect(CastleID)); this.SelectImg.color = new Color(1f, 1f, 1f, 0f); }
// Token: 0x0600114E RID: 4430 RVA: 0x001E7FA8 File Offset: 0x001E61A8 private int CompareOwn(ushort x, ushort y) { CastleSkin castleSkin = GUIManager.Instance.BuildingData.castleSkin; CastleSkinTbl recordByKey = castleSkin.CastleSkinTable.GetRecordByKey(x); CastleSkinTbl recordByKey2 = castleSkin.CastleSkinTable.GetRecordByKey(y); if (recordByKey.Priority > recordByKey2.Priority) { return(-1); } if (recordByKey.Priority < recordByKey2.Priority) { return(1); } return(0); }
// Token: 0x06001BFB RID: 7163 RVA: 0x003193A0 File Offset: 0x003175A0 string SimpleHintKind.SetContent(CString Content, int Parm1, int Parm2) { Content.ClearString(); CastleSkin castleSkin = GUIManager.Instance.BuildingData.castleSkin; DataManager instance = DataManager.Instance; CastleEnhanceTbl castleEnhanceData = castleSkin.GetCastleEnhanceData((byte)Parm1, 0); CastleSkinTbl recordByKey = castleSkin.CastleSkinTable.GetRecordByKey((ushort)((byte)Parm1)); bool flag = false; for (int i = 0; i < 2; i++) { Effect recordByKey2 = instance.EffectData.GetRecordByKey(recordByKey.Effect[i]); if (recordByKey2.ValueID == 4378) { flag = true; } this.EffectStr[i].ClearString(); this.EffectStr[i].StringToFormat(instance.mStringTable.GetStringByID((uint)recordByKey2.String_infoID)); if (flag) { this.EffectStr[i].DoubleToFormat((double)castleEnhanceData.Value[i] / 100.0, 2, false); this.EffectStr[i].AppendFormat("{0}{1}%"); } else { this.EffectStr[i].IntToFormat((long)castleEnhanceData.Value[i], 1, false); this.EffectStr[i].AppendFormat("{0}{1}"); } } if (castleSkin.CheckUnlock((byte)Parm1)) { Content.StringToFormat(instance.mStringTable.GetStringByID(9688u)); } else { Content.StringToFormat(instance.mStringTable.GetStringByID(9687u)); } Content.StringToFormat(this.EffectStr[0]); Content.StringToFormat(this.EffectStr[1]); Content.StringToFormat(instance.mStringTable.GetStringByID(9689u)); Content.AppendFormat("{0}\n{1}\n{2}\n{3}"); return(Content.ToString()); }
// Token: 0x0600114D RID: 4429 RVA: 0x001E7EE0 File Offset: 0x001E60E0 private int CompareAll(ushort x, ushort y) { CastleSkin castleSkin = GUIManager.Instance.BuildingData.castleSkin; CastleSkinTbl recordByKey = castleSkin.CastleSkinTable.GetRecordByKey(x); CastleSkinTbl recordByKey2 = castleSkin.CastleSkinTable.GetRecordByKey(y); bool flag = castleSkin.CheckUnlock((byte)x); bool flag2 = castleSkin.CheckUnlock((byte)y); bool flag3 = castleSkin.CheckSelect((byte)x); bool flag4 = castleSkin.CheckSelect((byte)y); if (flag && !flag2) { return(-1); } if (!flag && flag2) { return(1); } if (flag3 && !flag4) { return(1); } if (!flag3 && flag4) { return(-1); } if (recordByKey.Priority > recordByKey2.Priority) { return(-1); } if (recordByKey.Priority < recordByKey2.Priority) { return(1); } return(0); }
// Token: 0x06001A03 RID: 6659 RVA: 0x002C2074 File Offset: 0x002C0274 public void Show(ushort CastleID) { this.ThisTransObj.SetActive(true); if (this.CastleID == CastleID) { return; } CastleSkin castleSkin = GUIManager.Instance.BuildingData.castleSkin; DataManager instance = DataManager.Instance; this.CastleID = CastleID; CastleSkinTbl recordByKey = castleSkin.CastleSkinTable.GetRecordByKey(CastleID); byte level = GUIManager.Instance.BuildingData.GetBuildData(8, 0).Level; this.CastleImg.sprite = castleSkin.GetUISprite(recordByKey.Graphic, level); this.CastleImg.material = castleSkin.GetUIMaterial(recordByKey.Graphic, level); this.CastleImg.SetNativeSize(); float num = (float)recordByKey.PreViewPercentage * 0.002f; this.CastleImg.rectTransform.localScale = new Vector3(num, num, num); this.NameText.text = instance.mStringTable.GetStringByID((uint)recordByKey.Name); this.TitleText.text = instance.mStringTable.GetStringByID(14562u); byte castleEnhance = castleSkin.GetCastleEnhance((byte)CastleID); CastleEnhanceTbl castleEnhanceData = castleSkin.GetCastleEnhanceData((byte)CastleID, castleEnhance); bool flag = false; for (int i = 0; i < 2; i++) { Effect recordByKey2 = instance.EffectData.GetRecordByKey(recordByKey.Effect[i]); if (recordByKey2.ValueID == 4378) { flag = true; } this.EffectStr[i].ClearString(); this.EffectStr[i].StringToFormat(instance.mStringTable.GetStringByID((uint)recordByKey2.String_infoID)); if (flag) { this.EffectStr[i].DoubleToFormat((double)castleEnhanceData.Value[i] / 100.0, 2, false); this.EffectStr[i].AppendFormat("{0}{1}%"); } else { this.EffectStr[i].IntToFormat((long)castleEnhanceData.Value[i], 1, false); this.EffectStr[i].AppendFormat("{0}{1}"); } this.AttribText[i].text = this.EffectStr[i].ToString(); this.AttribText[i].SetAllDirty(); this.AttribText[i].cachedTextGenerator.Invalidate(); } for (byte b = 0; b < 5; b += 1) { castleEnhanceData = castleSkin.GetCastleEnhanceData((byte)CastleID, b + 1); this.EnhanceStr[0][(int)b].ClearString(); if (flag) { this.EnhanceStr[0][(int)b].FloatToFormat((float)castleEnhanceData.Value[0] / 100f, 2, false); if (GUIManager.Instance.IsArabic) { this.EnhanceStr[0][(int)b].AppendFormat("%{0}"); } else { this.EnhanceStr[0][(int)b].AppendFormat("{0}%"); } } else { this.EnhanceStr[0][(int)b].IntToFormat((long)castleEnhanceData.Value[0], 1, false); this.EnhanceStr[0][(int)b].AppendFormat("{0}"); } this.EnhanceText[0][(int)b].text = this.EnhanceStr[0][(int)b].ToString(); this.EnhanceText[0][(int)b].SetAllDirty(); this.EnhanceText[0][(int)b].cachedTextGenerator.Invalidate(); this.EnhanceStr[1][(int)b].ClearString(); if (flag) { this.EnhanceStr[1][(int)b].FloatToFormat((float)castleEnhanceData.Value[1] / 100f, 2, false); if (GUIManager.Instance.IsArabic) { this.EnhanceStr[1][(int)b].AppendFormat("%{0}"); } else { this.EnhanceStr[1][(int)b].AppendFormat("{0}%"); } } else { this.EnhanceStr[1][(int)b].IntToFormat((long)castleEnhanceData.Value[1], 1, false); this.EnhanceStr[1][(int)b].AppendFormat("{0}"); } this.EnhanceText[1][(int)b].text = this.EnhanceStr[1][(int)b].ToString(); this.EnhanceText[1][(int)b].SetAllDirty(); this.EnhanceText[1][(int)b].cachedTextGenerator.Invalidate(); if (b < castleEnhance) { this.EnhanceImg[0][(int)b].sprite = this.StarArray.GetSprite(1); this.EnhanceImg[1][(int)b].sprite = this.StarArray.GetSprite(1); this.EnhanceText[0][(int)b].color = Color.white; this.EnhanceText[1][(int)b].color = Color.white; } else { this.EnhanceImg[0][(int)b].sprite = this.StarArray.GetSprite(0); this.EnhanceImg[1][(int)b].sprite = this.StarArray.GetSprite(0); this.EnhanceText[0][(int)b].color = new Color(0.6275f, 0.6275f, 0.6275f); this.EnhanceText[1][(int)b].color = new Color(0.6275f, 0.6275f, 0.6275f); } } }