protected override void OnUpdateItem(GameObject go, int index) { StatusListItem component = (StatusListItem)go.GetComponent <StatusListItem>(); if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null)) { return; } string type = this.mStatusValues[index].type; int oldValue = this.mStatusValues[index].old_value; int newValue = this.mStatusValues[index].new_value; ((Component)component).get_gameObject().SetActive(true); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component.Label, (UnityEngine.Object)null)) { component.Label.set_text(LocalizedText.Get("sys." + type)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component.Value, (UnityEngine.Object)null)) { component.Value.set_text(oldValue.ToString()); } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component.Bonus, (UnityEngine.Object)null)) { return; } if (newValue != 0) { component.Bonus.set_text(newValue.ToString()); ((Component)component.Bonus).get_gameObject().SetActive(true); } else { ((Component)component.Bonus).get_gameObject().SetActive(false); } }
private void AddValue(int index, string type, int value, int bonus, bool multiply, bool isSecret = false, bool use_bonus_color = false) { if (this.mItems.Count <= index) { StatusListItem statusListItem = (StatusListItem)UnityEngine.Object.Instantiate <StatusListItem>((M0)this.ListItem); ((Component)statusListItem).get_transform().SetParent(((Component)this).get_transform(), false); this.mItems.Add(statusListItem); } StatusListItem mItem = this.mItems[index]; ((Component)mItem).get_gameObject().SetActive(true); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Value, (UnityEngine.Object)null)) { ((Component)mItem.Value).get_gameObject().SetActive(false); ((Graphic)mItem.Value).set_color(!use_bonus_color || bonus == 0 ? this.mDefaultValueColor : this.mDefaultBonusColor); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Bonus, (UnityEngine.Object)null)) { ((Component)mItem.Bonus).get_gameObject().SetActive(false); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Label, (UnityEngine.Object)null)) { mItem.Label.set_text(LocalizedText.Get("sys." + type)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Value, (UnityEngine.Object)null)) { string str = !isSecret?value.ToString() : "???"; if (this.ShowSign && value > 0) { str = "+" + str; } if (multiply) { str += "%"; } mItem.Value.set_text(str); ((Component)mItem.Value).get_gameObject().SetActive(true); } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Bonus, (UnityEngine.Object)null) || bonus == 0 || use_bonus_color) { return; } string str1 = bonus.ToString(); if (this.ShowSign && bonus > 0) { str1 = "+" + str1; } if (multiply) { str1 += "%"; } mItem.Bonus.set_text(str1); ((Component)mItem.Bonus).get_gameObject().SetActive(true); }
private void AddValue_TotalAndBonus(int index, string type, int main_value, int bonus_value, bool is_def_main, bool is_def_bonus, bool multiply) { Color color1 = !is_def_main ? this.mDefaultValueColor : this.mDefaultBonusColor; Color color2 = !is_def_main ? this.mDefaultBonusColor : this.mDefaultBonusColor; if (this.mItems.Count <= index) { StatusListItem statusListItem = (StatusListItem)UnityEngine.Object.Instantiate <StatusListItem>((M0)this.ListItem); ((Component)statusListItem).get_transform().SetParent(((Component)this).get_transform(), false); this.mItems.Add(statusListItem); } StatusListItem mItem = this.mItems[index]; ((Component)mItem).get_gameObject().SetActive(true); Text text = mItem.Value; Text bonus = mItem.Bonus; ((Component)text).get_gameObject().SetActive(false); ((Component)bonus).get_gameObject().SetActive(false); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Label, (UnityEngine.Object)null)) { mItem.Label.set_text(LocalizedText.Get("sys." + type)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)text, (UnityEngine.Object)null)) { string str = main_value.ToString(); if (this.ShowSign && main_value > 0) { str = "+" + str; } if (multiply) { str += "%"; } text.set_text(str); ((Graphic)text).set_color(color1); ((Component)text).get_gameObject().SetActive(true); } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)bonus, (UnityEngine.Object)null) || bonus_value == 0) { return; } string str1 = bonus_value.ToString(); if (this.ShowSign && bonus_value > 0) { str1 = "+" + str1; } if (multiply) { str1 += "%"; } bonus.set_text(string.Format(LocalizedText.Get("sys.STATUS_FORMAT_PARAM_BONUS"), (object)str1)); ((Graphic)bonus).set_color(color2); ((Component)bonus).get_gameObject().SetActive(true); }
private void AddValue(int index, string type, int value, int bonus, bool multiply) { if (this.mItems.Count <= index) { StatusListItem statusListItem = (StatusListItem)UnityEngine.Object.Instantiate <StatusListItem>((M0)this.ListItem); ((Component)statusListItem).get_transform().SetParent(((Component)this).get_transform(), false); this.mItems.Add(statusListItem); } StatusListItem mItem = this.mItems[index]; ((Component)mItem).get_gameObject().SetActive(true); if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Label, (UnityEngine.Object)null)) { mItem.Label.set_text(LocalizedText.Get("sys." + type)); } if (UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Value, (UnityEngine.Object)null)) { string str = value.ToString(); if (this.ShowSign && value > 0) { str = "+" + str; } if (multiply) { str += "%"; } mItem.Value.set_text(str); } if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)mItem.Bonus, (UnityEngine.Object)null)) { return; } if (bonus != 0) { string str = bonus.ToString(); if (this.ShowSign && bonus > 0) { str = "+" + str; } if (multiply) { str += "%"; } mItem.Bonus.set_text(str); ((Component)mItem.Bonus).get_gameObject().SetActive(true); } else { ((Component)mItem.Bonus).get_gameObject().SetActive(false); } }