using System; using System.Collections.Generic; using I2.Loc; using MaidStatus; using UnityEngine; public class YotogiParameterViewer : MonoBehaviour { private void Awake() { GameObject childObject = UTY.GetChildObject(base.gameObject, string.Empty, false); GameObject find_target = null; Func func = (string find_name) => UTY.GetChildObject(find_target, find_name, false).GetComponent(); find_target = childObject; this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Contract, func("ContractType/Name")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Name, func("MaidName/Name")); find_target = UTY.GetChildObject(childObject, "YotogiClass", false); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.YotogiClass, func("Name")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.YotogiClassLv, func("Level/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.YotogiClassCurExp, func("Exp/Exp")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.YotogiClassNextExp, func("Exp/RequiredExp")); find_target = UTY.GetChildObject(childObject, "NumberGroup", false); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Seikeiken, func("Seikeiken/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Relation, func("Grid1/Relation/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.ConditionText, func("Grid1/conditionText/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Likability, func("Grid1/Likability/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.StudyRate, func("Grid1/StudyRate/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Hp, func("Grid2/Hp/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Mind, func("Grid2/Mind/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Inyoku, func("Grid2/Inyoku/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.MValue, func("Grid2/MValue/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Hentai, func("Grid2/Hentai/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.Housi, func("Grid2/Housi/Value")); this.label_dictionary_.Add(YotogiParameterViewer.LabelType.YotogiPlayCount, func("YotogiPlayCount/Value")); this.bg_sprite_ = UTY.GetChildObject(base.gameObject, "BG", false).GetComponent(); this.costume_button_obj_ = UTY.GetChildObject(base.gameObject, "ChangeCostume", false); this.SetCostumeButtonVisible(this.CostumeButtonVisible); } public void SetMaid(Maid maid) { this.maid_ = maid; this.attributeViewer.targetMaid = maid; this.attributeViewer.UpdateStatusInfo(); } public void UpdateTextCommon() { if (this.maid_ == null) { return; } Status status = this.maid_.status; Action action = delegate(YotogiParameterViewer.LabelType labelType, string rawText, string termText) { this.label_dictionary_[labelType].text = rawText; Localize component = this.label_dictionary_[labelType].GetComponent(); if (component != null) { component.SetTerm(termText); } }; action(YotogiParameterViewer.LabelType.Contract, EnumConvert.GetString(status.contract), EnumConvert.GetTerm(status.contract)); this.label_dictionary_[YotogiParameterViewer.LabelType.Name].text = status.charaName.GetFullName("\n"); this.label_dictionary_[YotogiParameterViewer.LabelType.YotogiPlayCount].text = status.playCountYotogi.ToString(); action(YotogiParameterViewer.LabelType.Seikeiken, EnumConvert.GetString(status.seikeiken), EnumConvert.GetTerm(status.seikeiken)); action(YotogiParameterViewer.LabelType.Relation, EnumConvert.GetString(status.relation, status.additionalRelation), EnumConvert.GetTerm(status.relation, status.additionalRelation)); action(YotogiParameterViewer.LabelType.ConditionText, status.conditionText, status.conditionTermText); } public void UpdateTextParam() { if (this.maid_ == null) { return; } Status status = this.maid_.status; this.label_dictionary_[YotogiParameterViewer.LabelType.Likability].text = status.likability.ToString(); this.label_dictionary_[YotogiParameterViewer.LabelType.Hp].text = ((!this.CurrentValueDraw) ? status.maxHp.ToString() : status.currentHp.ToString()); this.label_dictionary_[YotogiParameterViewer.LabelType.Mind].text = ((!this.CurrentValueDraw) ? status.maxMind.ToString() : status.currentMind.ToString()); if (YotogiManager.instans != null && YotogiManager.instans.is_new_yotogi_mode) { this.label_dictionary_[YotogiParameterViewer.LabelType.Mind].text = status.maxMind.ToString(); } this.label_dictionary_[YotogiParameterViewer.LabelType.Inyoku].text = status.inyoku.ToString(); this.label_dictionary_[YotogiParameterViewer.LabelType.MValue].text = status.mvalue.ToString(); this.label_dictionary_[YotogiParameterViewer.LabelType.Hentai].text = status.hentai.ToString(); this.label_dictionary_[YotogiParameterViewer.LabelType.Housi].text = status.housi.ToString(); this.label_dictionary_[YotogiParameterViewer.LabelType.StudyRate].text = (status.studyRate / 10).ToString(); } public void SetCostumeButtonVisible(bool set_visible) { if (set_visible) { this.bg_sprite_.SetDimensions(this.bg_sprite_.width, 770); this.costume_button_obj_.SetActive(true); } else { this.bg_sprite_.SetDimensions(this.bg_sprite_.width, 710); this.costume_button_obj_.SetActive(false); } } public void SetAttributeViewer(AttributeViewer obj) { this.attributeViewer = obj; this.attributeViewer.gameObject.SetActive(false); if (Product.supportMultiLanguage) { this.attributeViewer.transform.localPosition = new Vector3(184f, 0f, 0f); } } public void OnHoverOver() { this.attributeViewer.gameObject.SetActive(true); } public void OnHoverOut() { this.attributeViewer.gameObject.SetActive(false); } public UIButton costume_button { get { return this.costume_button_obj_.GetComponent(); } } public Dictionary label_dictionary { get { return this.label_dictionary_; } } public bool CostumeButtonVisible = true; public AttributeViewer attributeViewer; public bool CurrentValueDraw; private Dictionary label_dictionary_ = new Dictionary(); private Maid maid_; private UISprite bg_sprite_; private GameObject costume_button_obj_; public enum LabelType { Contract, Name, YotogiClass, YotogiClassLv, YotogiClassCurExp, YotogiClassNextExp, YotogiPlayCount, Seikeiken, Relation, ConditionText, Likability, Hp, Mind, Inyoku, MValue, Hentai, Housi, StudyRate } }