DescScheduleYotogi.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Schedule;
  5. using UnityEngine;
  6. using wf;
  7. public class DescScheduleYotogi : DescScheduleBase
  8. {
  9. public override void Init(ScheduleTaskCtrl taskCtrl)
  10. {
  11. base.Init(taskCtrl);
  12. this.m_lReception = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "Reception", true);
  13. this.m_lCare = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "Care", true);
  14. this.m_lTeachRate = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "TeachRate", true);
  15. this.m_lInyoku = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "Inyoku", true);
  16. this.m_lMvalue = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "Mvalue", true);
  17. this.m_lHentai = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "Hentai", true);
  18. this.m_lHousi = new DescScheduleBase.ParamSet(this.m_goMaidParameterParent, "Housi", true);
  19. this.m_listMaidItem.Add(this.m_lReception.GetVariableItem());
  20. this.m_listMaidItem.Add(this.m_lCare.GetVariableItem());
  21. this.m_listMaidItem.Add(this.m_lTeachRate.GetVariableItem());
  22. this.m_listMaidItem.Add(this.m_lInyoku.GetVariableItem());
  23. this.m_listMaidItem.Add(this.m_lMvalue.GetVariableItem());
  24. this.m_listMaidItem.Add(this.m_lHentai.GetVariableItem());
  25. this.m_listMaidItem.Add(this.m_lHousi.GetVariableItem());
  26. this.explanation_label_ = UTY.GetChildObject(base.gameObject, "Description/Message", false).GetComponent<UILabel>();
  27. this.condition_parent = UTY.GetChildObject(base.gameObject, "Condition/ConditionParent", false);
  28. for (int i = 0; i < 9; i++)
  29. {
  30. GameObject gameObject = Utility.CreatePrefab(this.condition_parent, "SceneDaily/Schedule/Prefab/ConditionUnit", true);
  31. gameObject.transform.localPosition = new Vector3(0f, (float)(i * 10), 0f);
  32. UTY.GetChildObject(gameObject, "No", false).GetComponent<UILabel>().text = (i + 1).ToString();
  33. KeyValuePair<GameObject, UILabel> item = new KeyValuePair<GameObject, UILabel>(gameObject, UTY.GetChildObject(gameObject, "Message", false).GetComponent<UILabel>());
  34. this.condition_unit_label_.Add(item);
  35. }
  36. DescScheduleBase.Reposition(this.condition_parent);
  37. }
  38. protected override void UpdateCurentValue()
  39. {
  40. Slot slot = this.taskCtrl.ScheduleMgr.GetScheduleApi().slot[this.taskCtrl.CurrentActiveSlotNo];
  41. Maid maid = slot.maid;
  42. if (maid == null)
  43. {
  44. return;
  45. }
  46. this.m_lReception.CurrentValueText = maid.status.reception.ToString();
  47. this.m_lCare.CurrentValueText = maid.status.care.ToString();
  48. this.m_lTeachRate.CurrentValueText = (maid.status.teachRate / 10).ToString();
  49. this.m_lInyoku.CurrentValueText = maid.status.inyoku.ToString();
  50. this.m_lMvalue.CurrentValueText = maid.status.mvalue.ToString();
  51. this.m_lHentai.CurrentValueText = maid.status.hentai.ToString();
  52. this.m_lHousi.CurrentValueText = maid.status.housi.ToString();
  53. }
  54. private void UpdateAddValue(ScheduleCSVData.Yotogi data)
  55. {
  56. this.m_lReception.AddValueText = base.Sign(data.easyYotogi.reception, null);
  57. this.m_lCare.AddValueText = base.Sign(data.easyYotogi.care, null);
  58. this.m_lTeachRate.AddValueText = base.Sign(data.easyYotogi.teach_rate, null);
  59. this.m_lInyoku.AddValueText = base.Sign(data.easyYotogi.inyoku, null);
  60. this.m_lMvalue.AddValueText = base.Sign(data.easyYotogi.msei, null);
  61. this.m_lHentai.AddValueText = base.Sign(data.easyYotogi.hentai, null);
  62. this.m_lHousi.AddValueText = base.Sign(data.easyYotogi.housi, null);
  63. }
  64. protected override void UpdateView(ScheduleCSVData.ScheduleBase work_data)
  65. {
  66. ScheduleCSVData.Yotogi yotogi = (ScheduleCSVData.Yotogi)work_data;
  67. base.Active(true);
  68. this.explanation_label_.text = yotogi.information;
  69. int num = 0;
  70. for (int i = 0; i < this.condition_unit_label_.Count; i++)
  71. {
  72. if (i < yotogi.condInfo.Count)
  73. {
  74. this.condition_unit_label_[i].Key.SetActive(true);
  75. this.condition_unit_label_[i].Value.text = yotogi.condInfo[i];
  76. num++;
  77. }
  78. else
  79. {
  80. this.condition_unit_label_[i].Key.SetActive(false);
  81. }
  82. }
  83. float num2 = 260f;
  84. float num3 = 10f;
  85. float num4 = 25f;
  86. float num5 = 4f;
  87. float num6 = 0f;
  88. GameObject childObject = UTY.GetChildObject(base.gameObject, "Condition/Title", false);
  89. if (0 < num)
  90. {
  91. childObject.SetActive(true);
  92. num6 += (float)(childObject.GetComponent<UISprite>().height / 2) + num3;
  93. float y = UTY.GetChildObject(base.gameObject, "Condition/ConditionParent", false).GetComponent<UITable>().padding.y;
  94. Transform parent = this.condition_unit_label_[0].Key.transform.parent;
  95. IEnumerator enumerator = parent.transform.GetEnumerator();
  96. try
  97. {
  98. while (enumerator.MoveNext())
  99. {
  100. object obj = enumerator.Current;
  101. Transform transform = (Transform)obj;
  102. if (transform.gameObject.activeSelf)
  103. {
  104. UILabel component = transform.Find("Message").GetComponent<UILabel>();
  105. num6 += (float)component.height + y * 2f + num5;
  106. }
  107. }
  108. }
  109. finally
  110. {
  111. IDisposable disposable;
  112. if ((disposable = (enumerator as IDisposable)) != null)
  113. {
  114. disposable.Dispose();
  115. }
  116. }
  117. num6 += num4;
  118. }
  119. else
  120. {
  121. childObject.SetActive(false);
  122. }
  123. DescScheduleBase.Reposition(this.condition_parent);
  124. UTY.GetChildObject(base.gameObject, "BG", false).GetComponent<UISprite>().height = (int)(num2 + num6);
  125. if (yotogi.easyYotogi != null)
  126. {
  127. this.m_goMaidParameter.SetActive(true);
  128. this.UpdateCurentValue();
  129. this.UpdateAddValue(yotogi);
  130. base.ExamineDisplayItem();
  131. }
  132. else
  133. {
  134. this.m_goMaidParameter.SetActive(false);
  135. }
  136. }
  137. private UILabel explanation_label_;
  138. private List<KeyValuePair<GameObject, UILabel>> condition_unit_label_ = new List<KeyValuePair<GameObject, UILabel>>();
  139. private GameObject condition_parent;
  140. protected DescScheduleBase.ParamSet m_lCare;
  141. protected DescScheduleBase.ParamSet m_lReception;
  142. protected DescScheduleBase.ParamSet m_lTeachRate;
  143. protected DescScheduleBase.ParamSet m_lInyoku;
  144. protected DescScheduleBase.ParamSet m_lMvalue;
  145. protected DescScheduleBase.ParamSet m_lHentai;
  146. protected DescScheduleBase.ParamSet m_lHousi;
  147. protected DescScheduleBase.ParamSet m_lYotogiCnt;
  148. }