DescScheduleYotogi.cs 6.3 KB

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