// 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: 0x0600112A RID: 4394 RVA: 0x001E69D4 File Offset: 0x001E4BD4 public void LoadTable() { this.CastleSkinTable = new CExternalTableWithWordKey <CastleSkinTbl>(); this.CastleEnhanceTable = new CExternalTableWithWordKey <CastleEnhanceTbl>(); this.CastleSkinTable.LoadTable("Castleunlock"); byte b = 0; for (int i = 0; i < this.CastleSkinTable.TableCount; i++) { byte b2 = this.CastleSkinTable.GetRecordByIndex(i).Graphic; if (b < b2) { b = b2; } } this.CastleEnhanceIndexTable = new ushort[(int)this.CastleSkinTable.MapCount]; int tableCount = this.CastleSkinTable.TableCount; this.AllAssetID = new int[(int)b]; this.AllSprite = new Sprite[(int)b]; this.AllMaterial = new Material[(int)b]; this.GraphicNameIndex = new ushort[(int)b]; this.DefaultExclamation = new byte[(this.CastleSkinTable.TableCount >> 3) + (((this.CastleSkinTable.TableCount & 7) <= 0) ? 0 : 1)]; this.SortCastleID = new ushort[tableCount]; this.ActiveCastleID = 0; byte b3 = 0; for (int j = 0; j < this.CastleSkinTable.TableCount; j++) { CastleSkinTbl recordByIndex = this.CastleSkinTable.GetRecordByIndex(j); byte b2 = recordByIndex.Graphic; if (b2 == 1 || b2 == 2) { b2 = 0; } int num = 0; if (b2 > 0) { num = (int)(b2 - 2); } if (recordByIndex.DefaultExclamation == 0) { this.SetBitField((byte)recordByIndex.ID, this.DefaultExclamation); } this.GraphicNameIndex[num] = recordByIndex.Name; if (recordByIndex.Priority != 255 && recordByIndex.Priority > b3) { b3 = recordByIndex.Priority; this.ActiveCastleID = recordByIndex.ID; } } this.CastleEnhanceTable.LoadTable("CastleEnhance"); ushort num2 = 255; for (int k = 0; k < this.CastleEnhanceTable.TableCount; k++) { CastleEnhanceTbl recordByIndex2 = this.CastleEnhanceTable.GetRecordByIndex(k); if (num2 != recordByIndex2.CastleID) { num2 = recordByIndex2.CastleID; if ((int)num2 <= this.CastleEnhanceIndexTable.Length) { this.CastleEnhanceIndexTable[(int)(num2 - 1)] = recordByIndex2.ID; } } } }
// 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); } } }