YotogiOldParameterViewer.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using UnityEngine;
  5. public class YotogiOldParameterViewer : MonoBehaviour
  6. {
  7. private void Awake()
  8. {
  9. GameObject childObject = UTY.GetChildObject(base.gameObject, string.Empty, false);
  10. GameObject find_target = null;
  11. Func<string, UILabel> func = (string find_name) => UTY.GetChildObject(find_target, find_name, false).GetComponent<UILabel>();
  12. find_target = childObject;
  13. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Contract, func("ContractType/Name"));
  14. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Name, func("MaidName/Name"));
  15. find_target = UTY.GetChildObject(childObject, "YotogiClass", false);
  16. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.YotogiClass, func("Name"));
  17. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.YotogiClassLv, func("Level/Value"));
  18. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.YotogiClassCurExp, func("Exp/Exp"));
  19. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.YotogiClassNextExp, func("Exp/RequiredExp"));
  20. find_target = UTY.GetChildObject(childObject, "NumberGroup/firstGroup", false);
  21. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.YotogiPlayCount, func("YotogiPlayCount/Value"));
  22. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.OthersPlayCount, func("OthersPlayCount/Value"));
  23. find_target = UTY.GetChildObject(childObject, "NumberGroup/secondGroup", false);
  24. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Hp, func("Hp/Value"));
  25. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Likability, func("Likability/Value"));
  26. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Reason, func("Reason/Value"));
  27. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Mind, func("Mind/Value"));
  28. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Lovely, func("Lovely/Value"));
  29. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Elegance, func("Elegance/Value"));
  30. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Charm, func("Charm/Value"));
  31. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Housi, func("Housi/Value"));
  32. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Inyoku, func("Inyoku/Value"));
  33. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.MValue, func("MValue/Value"));
  34. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.Hentai, func("Hentai/Value"));
  35. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.StudyRate, func("StudyRate/Value"));
  36. this.label_dictionary_.Add(YotogiOldParameterViewer.LabelType.TeachRate, func("TeachRate/Value"));
  37. this.bg_sprite_ = UTY.GetChildObject(base.gameObject, "BG", false).GetComponent<UISprite>();
  38. this.costume_button_obj_ = UTY.GetChildObject(base.gameObject, "ChangeCostume", false);
  39. this.SetCostumeButtonVisible(this.CostumeButtonVisible);
  40. }
  41. public void SetMaid(Maid maid)
  42. {
  43. this.maid_ = maid;
  44. if (this.AttributeViewer != null)
  45. {
  46. AttributeViewerOld component = this.AttributeViewer.GetComponent<AttributeViewerOld>();
  47. component.SetMaid(this.maid_);
  48. }
  49. }
  50. public void UpdateTextCommon()
  51. {
  52. if (this.maid_ == null)
  53. {
  54. return;
  55. }
  56. Status status = this.maid_.status;
  57. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Contract].text = EnumConvert.GetString(status.contract);
  58. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Name].text = status.lastName + "\n" + status.firstName;
  59. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiPlayCount].text = status.playCountYotogi.ToString();
  60. this.label_dictionary_[YotogiOldParameterViewer.LabelType.OthersPlayCount].text = status.playCountNightWork.ToString();
  61. if (status.selectedYotogiClass != null)
  62. {
  63. ClassData<YotogiClass.Data> selectedYotogiClass = status.selectedYotogiClass;
  64. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClass].text = selectedYotogiClass.data.drawName;
  65. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClassLv].text = selectedYotogiClass.level.ToString();
  66. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClassCurExp].text = selectedYotogiClass.cur_exp.ToString();
  67. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClassNextExp].text = selectedYotogiClass.next_exp.ToString();
  68. }
  69. else
  70. {
  71. UILabel uilabel = this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClass];
  72. string text = string.Empty;
  73. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClassNextExp].text = text;
  74. text = text;
  75. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClassCurExp].text = text;
  76. text = text;
  77. this.label_dictionary_[YotogiOldParameterViewer.LabelType.YotogiClassLv].text = text;
  78. uilabel.text = text;
  79. }
  80. }
  81. public void UpdateTextParam()
  82. {
  83. if (this.maid_ == null)
  84. {
  85. return;
  86. }
  87. Status status = this.maid_.status;
  88. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Hp].text = ((!this.CurrentValueDraw) ? status.maxHp.ToString() : status.currentHp.ToString());
  89. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Likability].text = status.likability.ToString();
  90. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Reason].text = ((!this.CurrentValueDraw) ? status.maxReason.ToString() : status.currentReason.ToString());
  91. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Mind].text = ((!this.CurrentValueDraw) ? status.maxMind.ToString() : status.currentMind.ToString());
  92. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Lovely].text = status.lovely.ToString();
  93. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Elegance].text = status.elegance.ToString();
  94. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Charm].text = status.charm.ToString();
  95. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Housi].text = status.housi.ToString();
  96. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Inyoku].text = status.inyoku.ToString();
  97. this.label_dictionary_[YotogiOldParameterViewer.LabelType.MValue].text = status.mvalue.ToString();
  98. this.label_dictionary_[YotogiOldParameterViewer.LabelType.Hentai].text = status.hentai.ToString();
  99. this.label_dictionary_[YotogiOldParameterViewer.LabelType.StudyRate].text = (status.studyRate / 10).ToString();
  100. this.label_dictionary_[YotogiOldParameterViewer.LabelType.TeachRate].text = (status.teachRate / 10).ToString();
  101. }
  102. public void SetCostumeButtonVisible(bool set_visible)
  103. {
  104. if (set_visible)
  105. {
  106. this.bg_sprite_.SetDimensions(this.bg_sprite_.width, 900);
  107. this.costume_button_obj_.SetActive(true);
  108. }
  109. else
  110. {
  111. this.bg_sprite_.SetDimensions(this.bg_sprite_.width, 850);
  112. this.costume_button_obj_.SetActive(false);
  113. }
  114. }
  115. public void SetAttributeViewer(GameObject obj)
  116. {
  117. this.AttributeViewer = obj;
  118. AttributeViewerOld component = this.AttributeViewer.GetComponent<AttributeViewerOld>();
  119. component.SetMaid(this.maid_);
  120. this.AttributeViewer.SetActive(false);
  121. }
  122. public void OnHoverOver()
  123. {
  124. this.AttributeViewer.SetActive(true);
  125. }
  126. public void OnHoverOut()
  127. {
  128. this.AttributeViewer.SetActive(false);
  129. }
  130. public UIButton costume_button
  131. {
  132. get
  133. {
  134. return this.costume_button_obj_.GetComponent<UIButton>();
  135. }
  136. }
  137. public Dictionary<YotogiOldParameterViewer.LabelType, UILabel> label_dictionary
  138. {
  139. get
  140. {
  141. return this.label_dictionary_;
  142. }
  143. }
  144. public bool CostumeButtonVisible = true;
  145. public GameObject AttributeViewer;
  146. public bool CurrentValueDraw;
  147. private Dictionary<YotogiOldParameterViewer.LabelType, UILabel> label_dictionary_ = new Dictionary<YotogiOldParameterViewer.LabelType, UILabel>();
  148. private Maid maid_;
  149. private UISprite bg_sprite_;
  150. private GameObject costume_button_obj_;
  151. public enum LabelType
  152. {
  153. Contract,
  154. Name,
  155. YotogiClass,
  156. YotogiClassLv,
  157. YotogiClassCurExp,
  158. YotogiClassNextExp,
  159. YotogiPlayCount,
  160. OthersPlayCount,
  161. Hp,
  162. Likability,
  163. Reason,
  164. Mind,
  165. Lovely,
  166. Elegance,
  167. Charm,
  168. Housi,
  169. Inyoku,
  170. MValue,
  171. Hentai,
  172. StudyRate,
  173. TeachRate
  174. }
  175. }