private bool CheckEquipItemEnhance() { if (this.mEnhanceEquipData == null || this.mEnhanceEquipData.equip == null) { return(false); } EquipData equip = this.mEnhanceEquipData.equip; int current = equip.Exp + this.mEnhanceEquipData.gainexp; return(equip.CalcRankFromExp(current) < equip.GetRankCap()); }
private void RefreshData() { JobData jobData = this.mUnit.GetJobData(this.mJobIndex); DataSource.Bind <UnitData>(this.Unit, this.mUnit); for (int index = 0; index < this.Equipments.Count; ++index) { EquipData equip = jobData.Equips[index]; DataSource.Bind <EquipData>(((Component)this.Equipments[index]).get_gameObject(), equip); bool flag = equip != null && (equip.IsValid() && equip.IsEquiped()); ((Selectable)this.Equipments[index]).set_interactable(flag); ((Component)this.EquipmentRawImages[index]).get_gameObject().SetActive(flag); this.EquipmentCursors[index].SetActive(Object.op_Equality((Object)this.mSelectedEquipItem, (Object)((Component)this.Equipments[index]).get_gameObject())); } this.mEnhanceEquipData.equip = (EquipData)null; this.mEnhanceEquipData.gainexp = 0; this.mEnhanceEquipData.is_enhanced = false; for (int index = 0; index < this.mEnhanceParameters.Count; ++index) { this.mEnhanceParameters[index].SetActive(false); } ((Selectable)this.BtnEnhance).set_interactable(false); EquipData equipData = !Object.op_Inequality((Object)this.mSelectedEquipItem, (Object)null) ? (EquipData)null : DataSource.FindDataOfClass <EquipData>(this.mSelectedEquipItem, (EquipData)null); int num1 = 0; int num2 = 0; for (int index = 0; index < this.mMaterialItems.Count; ++index) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type EnhanceEquipDetailWindow.\u003CRefreshData\u003Ec__AnonStorey242 dataCAnonStorey242 = new EnhanceEquipDetailWindow.\u003CRefreshData\u003Ec__AnonStorey242(); // ISSUE: reference to a compiler-generated field dataCAnonStorey242.item = this.mMaterialItems[index]; // ISSUE: reference to a compiler-generated method EnhanceMaterial enhanceMaterial1 = this.mEnhanceMaterials.Find(new Predicate <EnhanceMaterial>(dataCAnonStorey242.\u003C\u003Em__26F)); if (enhanceMaterial1 == null) { EnhanceMaterial enhanceMaterial2 = new EnhanceMaterial(); // ISSUE: reference to a compiler-generated field enhanceMaterial2.item = dataCAnonStorey242.item; enhanceMaterial2.num = 0; this.mEnhanceMaterials.Add(enhanceMaterial2); enhanceMaterial1 = enhanceMaterial2; } if (equipData != null) { // ISSUE: reference to a compiler-generated field num1 += (int)dataCAnonStorey242.item.Param.enhace_cost * equipData.GetEnhanceCostScale() / 100 * enhanceMaterial1.num; // ISSUE: reference to a compiler-generated field num2 += (int)dataCAnonStorey242.item.Param.enhace_point * enhanceMaterial1.num; } } bool flag1 = false; if (Object.op_Inequality((Object)this.EquipSelectParent, (Object)null)) { DataSource.Bind <EnhanceEquipData>(this.EquipSelectParent, (EnhanceEquipData)null); this.EquipSelectParent.get_gameObject().SetActive(false); } if (Object.op_Inequality((Object)this.TxtComment, (Object)null)) { ((Component)this.TxtComment).get_gameObject().SetActive(false); } if (Object.op_Inequality((Object)this.mSelectedEquipItem, (Object)null)) { this.mEnhanceEquipData.equip = equipData; this.mEnhanceEquipData.gainexp = num2; if (equipData != null) { BuffEffect buffEffect = equipData.Skill.GetBuffEffect(SkillEffectTargets.Target); if (buffEffect != null && buffEffect.targets != null) { for (int index = 0; index < buffEffect.targets.Count; ++index) { if (index >= this.mEnhanceParameters.Count) { this.ParamUpTemplate.SetActive(true); GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ParamUpTemplate); gameObject.get_transform().SetParent(this.ParamUpLayoutParent, false); this.mEnhanceParameters.Add(gameObject); this.ParamUpTemplate.SetActive(false); } GameObject enhanceParameter = this.mEnhanceParameters[index]; EquipItemParameter data = DataSource.FindDataOfClass <EquipItemParameter>(enhanceParameter, (EquipItemParameter)null) ?? new EquipItemParameter(); data.equip = equipData; data.param_index = index; DataSource.Bind <EquipItemParameter>(enhanceParameter, data); enhanceParameter.SetActive(true); } } flag1 = true; if (equipData.Rank == equipData.GetRankCap()) { if (Object.op_Inequality((Object)this.TxtComment, (Object)null)) { this.TxtComment.set_text(LocalizedText.Get("sys.DIABLE_ENHANCE_RANKCAP_MESSAGE")); ((Component)this.TxtComment).get_gameObject().SetActive(true); } flag1 = false; } } if (Object.op_Inequality((Object)this.EquipSelectParent, (Object)null)) { DataSource.Bind <EnhanceEquipData>(this.EquipSelectParent, this.mEnhanceEquipData); this.EquipSelectParent.get_gameObject().SetActive(true); } } else if (Object.op_Inequality((Object)this.TxtComment, (Object)null)) { this.TxtComment.set_text(LocalizedText.Get("sys.ENHANCE_EQUIPMENT_MESSAGE")); ((Component)this.TxtComment).get_gameObject().SetActive(true); } this.mEnhanceEquipData.is_enhanced = flag1; if (Object.op_Inequality((Object)this.SelectedParent, (Object)null)) { DataSource.Bind <EnhanceEquipData>(this.SelectedParent, this.mEnhanceEquipData); this.SelectedParent.get_gameObject().SetActive(flag1); } if (Object.op_Inequality((Object)this.TxtDisableEnhanceOnGauge, (Object)null)) { ((Component)this.TxtDisableEnhanceOnGauge).get_gameObject().SetActive(!flag1); } if (Object.op_Inequality((Object)this.TxtCost, (Object)null)) { this.TxtCost.set_text(num1.ToString()); } if (Object.op_Inequality((Object)this.TxtJob, (Object)null)) { this.TxtJob.set_text(jobData.Name); } if (flag1) { int num3 = equipData.CalcRankFromExp(equipData.Exp + num2); ((Selectable)this.BtnEnhance).set_interactable(equipData != null && equipData.Rank < num3); } if (Object.op_Inequality((Object)this.BtnAdd, (Object)null)) { ((Selectable)this.BtnAdd).set_interactable(flag1 && Object.op_Inequality((Object)this.mSelectedMaterialItem, (Object)null)); } if (Object.op_Inequality((Object)this.BtnSub, (Object)null)) { ((Selectable)this.BtnSub).set_interactable(flag1 && Object.op_Inequality((Object)this.mSelectedMaterialItem, (Object)null)); } this.mEnableEnhanceMaterials.Clear(); for (int index = 0; index < this.mEnhanceMaterials.Count; ++index) { if (this.mEnhanceMaterials[index].item != null && this.mEnhanceMaterials[index].item.Num != 0) { this.mEnableEnhanceMaterials.Add(this.mEnhanceMaterials[index]); } } this.SetData((object[])this.mEnableEnhanceMaterials.ToArray(), typeof(EnhanceMaterial)); GameParameter.UpdateAll(((Component)this).get_gameObject()); }