123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- 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<string, UILabel> func = (string find_name) => UTY.GetChildObject(find_target, find_name, false).GetComponent<UILabel>();
- 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<UISprite>();
- 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<YotogiParameterViewer.LabelType, string, string> action = delegate(YotogiParameterViewer.LabelType labelType, string rawText, string termText)
- {
- this.label_dictionary_[labelType].text = rawText;
- Localize component = this.label_dictionary_[labelType].GetComponent<Localize>();
- 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.lastName + "\n" + status.firstName;
- 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.SPP)
- {
- 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<UIButton>();
- }
- }
- public Dictionary<YotogiParameterViewer.LabelType, UILabel> label_dictionary
- {
- get
- {
- return this.label_dictionary_;
- }
- }
- public bool CostumeButtonVisible = true;
- public AttributeViewer attributeViewer;
- public bool CurrentValueDraw;
- private Dictionary<YotogiParameterViewer.LabelType, UILabel> label_dictionary_ = new Dictionary<YotogiParameterViewer.LabelType, UILabel>();
- 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
- }
- }
|