OnaholeNodeMenuManager.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. using System;
  2. using UnityEngine;
  3. public class OnaholeNodeMenuManager : OnaholeBaseNodeMenuManager
  4. {
  5. public bool isOpen
  6. {
  7. get
  8. {
  9. return base.gameObject.activeSelf;
  10. }
  11. }
  12. private void Awake()
  13. {
  14. GameObject gameObject = this.menuButtonGrid.gameObject;
  15. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "ステージ選択", OnaholeNodeMenuChildSecondRow.Mode.StageSelect.ToString(), true, true), new Action(this.CallSubMenu)));
  16. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "夜伽スキル", OnaholeNodeMenuChildSecondRow.Mode.SkillCategorySelect.ToString(), true, true), new Action(this.CallSubMenu)));
  17. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "コスチューム", OnaholeNodeMenuChildSecondRow.Mode.Costume.ToString(), true, true), new Action(this.CallSubMenu)));
  18. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "Chu-B Lip S2設定", OnaholeNodeMenuChildSecondRow.Mode.DeviceSetting.ToString(), true, true), new Action(this.CallSubMenu)));
  19. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "メイド感度", OnaholeNodeMenuChildSecondRow.Mode.MaidSensitivity.ToString(), true, true), new Action(this.CallSubMenu)));
  20. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "ピストン設定", OnaholeNodeMenuChildSecondRow.Mode.PistonSetting.ToString(), true, true), new Action(this.CallSubMenu)));
  21. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "男の透明度", OnaholeNodeMenuChildSecondRow.Mode.ManAlpha.ToString(), true, true), new Action(this.CallSubMenu)));
  22. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "オートモード", OnaholeNodeMenuChildSecondRow.Mode.AutoMode.ToString(), true, true), new Action(this.CallSubMenu)));
  23. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "オートフィニッシュ", OnaholeNodeMenuChildSecondRow.Mode.AutoFinish.ToString(), true, true), new Action(this.CallSubMenu)));
  24. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "オートリアクション", OnaholeNodeMenuChildSecondRow.Mode.AutoReaction.ToString(), true, true), new Action(this.CallSubMenu)));
  25. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "リアクションLevelUp", "reactionlevelup", true, false), new Action(this.ClickEmulate)));
  26. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "エディット", "edit", true, false), new Action(this.ClickEmulate)));
  27. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "液体を拭く", "releaseseieki", true, false), new Action(this.ClickEmulate)));
  28. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "カメラリセット", "camerareset", true, false), new Action(this.ClickEmulate)));
  29. this.menuButtons.Add(new NodeButtonData(OnaholeBaseNodeMenuManager.CreateBasicNodeButton(gameObject, "夜伽終了", OnaholeNodeMenuChildSecondRow.Mode.YotogiEnd.ToString(), true, true), new Action(this.CallSubMenu)));
  30. this.reactionLevelUpButtonData = base.GetNodeButtonData("reactionlevelup");
  31. this.menuButtonGrid.Reposition();
  32. base.SetFocusButton(this.menuButtons[0]);
  33. this.isInputEnabled = false;
  34. this.changeInput = -1;
  35. }
  36. public void Open()
  37. {
  38. this.Close();
  39. this.changeInput = 1;
  40. if (!this.editButton.isEnabled)
  41. {
  42. base.GetNodeButtonData("edit").selectType = OnaholeNodeButton.SelectType.Disable;
  43. }
  44. base.SetFocusButton(this.menuButtons[0]);
  45. base.gameObject.SetActive(true);
  46. GameMain.Instance.SoundMgr.PlaySystem(SoundMgr.SeType.Click);
  47. }
  48. public void Close()
  49. {
  50. this.isInputEnabled = false;
  51. this.changeInput = -1;
  52. this.secondRow.Clear();
  53. this.thirdRow.Clear();
  54. base.gameObject.SetActive(false);
  55. }
  56. private void CallSubMenu()
  57. {
  58. if (base.selectedNodeButton == null)
  59. {
  60. return;
  61. }
  62. base.SetSelectedButton(base.selectedNodeButton);
  63. this.secondRow.CallMenu((OnaholeNodeMenuChildSecondRow.Mode)Enum.Parse(typeof(OnaholeNodeMenuChildSecondRow.Mode), base.selectedNodeButton.button.uniqueName));
  64. this.isInputEnabled = false;
  65. }
  66. private void ClickEmulate()
  67. {
  68. if (base.selectedNodeButton == null)
  69. {
  70. return;
  71. }
  72. UIButton uibutton = null;
  73. if (base.selectedNodeButton.button.uniqueName == "edit")
  74. {
  75. uibutton = this.editButton;
  76. }
  77. else if (base.selectedNodeButton.button.uniqueName == "releaseseieki")
  78. {
  79. uibutton = this.releaseSeiekiButton;
  80. }
  81. else if (base.selectedNodeButton.button.uniqueName == "camerareset")
  82. {
  83. uibutton = this.cameraResetButton;
  84. }
  85. else if (base.selectedNodeButton.button.uniqueName == "reactionlevelup")
  86. {
  87. uibutton = this.reactionLevelUpButton;
  88. }
  89. if (uibutton != null)
  90. {
  91. EventDelegate.Execute(uibutton.onClick);
  92. }
  93. }
  94. public void ReturnMenu()
  95. {
  96. if (base.selectedNodeButton != null)
  97. {
  98. base.selectedNodeButton.button.selectType = OnaholeNodeButton.SelectType.Focus;
  99. }
  100. this.changeInput = 1;
  101. }
  102. public void EndYotogi()
  103. {
  104. EventDelegate.Execute(this.yotogiEndButton.onClick);
  105. }
  106. protected override void OnEnterMenu()
  107. {
  108. base.OnEnterMenu();
  109. if (base.selectedNodeButton != null)
  110. {
  111. base.selectedNodeButton.enterEvent();
  112. }
  113. }
  114. protected override void OnCancelMenu()
  115. {
  116. }
  117. private void UpdateUIText()
  118. {
  119. NodeButtonData nodeButtonData = base.GetNodeButtonData(OnaholeNodeMenuChildSecondRow.Mode.AutoMode.ToString());
  120. OnaholeNodeButton onaholeNodeButton = nodeButtonData.button as OnaholeNodeButton;
  121. onaholeNodeButton.text = "オートモード:" + ((!this.autoPistonEnabled) ? "OFF" : "ON");
  122. nodeButtonData = base.GetNodeButtonData(OnaholeNodeMenuChildSecondRow.Mode.AutoFinish.ToString());
  123. onaholeNodeButton = (nodeButtonData.button as OnaholeNodeButton);
  124. onaholeNodeButton.text = "オートフィニッシュ:" + ((!this.autoFinishEnabled) ? "OFF" : "ON");
  125. nodeButtonData = base.GetNodeButtonData(OnaholeNodeMenuChildSecondRow.Mode.AutoReaction.ToString());
  126. onaholeNodeButton = (nodeButtonData.button as OnaholeNodeButton);
  127. onaholeNodeButton.text = "オートリアクション:" + ((!this.autoReaction) ? "OFF" : "ON");
  128. bool flag = false;
  129. if ((this.autoReaction && this.reactionLevelUpButtonData.button.selectType != OnaholeNodeButton.SelectType.Disable) || (this.reactionLevel == 2 && this.reactionLevelUpButtonData.button.selectType != OnaholeNodeButton.SelectType.Disable))
  130. {
  131. flag = true;
  132. }
  133. if (flag)
  134. {
  135. if (base.selectedNodeButton.button.uniqueName == this.reactionLevelUpButtonData.button.uniqueName)
  136. {
  137. for (int i = 0; i < this.menuButtons.Count; i++)
  138. {
  139. if (this.menuButtons[i].button.uniqueName == base.selectedNodeButton.button.uniqueName)
  140. {
  141. int num = i + 1;
  142. if (this.menuButtons.Count <= num)
  143. {
  144. num = 0;
  145. }
  146. base.SetFocusButton(this.menuButtons[num]);
  147. break;
  148. }
  149. }
  150. }
  151. this.reactionLevelUpButtonData.button.selectType = OnaholeNodeButton.SelectType.Disable;
  152. }
  153. else if (!this.autoReaction && this.reactionLevel != 2 && this.reactionLevelUpButtonData.button.selectType == OnaholeNodeButton.SelectType.Disable)
  154. {
  155. this.reactionLevelUpButtonData.button.selectType = OnaholeNodeButton.SelectType.None;
  156. }
  157. }
  158. protected override void Update()
  159. {
  160. if (base.inputDownKey)
  161. {
  162. base.NextItem();
  163. }
  164. else if (base.inputUpKey)
  165. {
  166. base.PrevItem();
  167. }
  168. else if (base.inputEnterKey || base.inputRightKye)
  169. {
  170. this.OnEnterMenu();
  171. }
  172. else if (base.inputCancelKey || base.inputLeftKey)
  173. {
  174. this.OnCancelMenu();
  175. }
  176. if (this.changeInput != -1)
  177. {
  178. this.isInputEnabled = (this.changeInput == 1);
  179. }
  180. this.changeInput = -1;
  181. this.UpdateUIText();
  182. }
  183. [SerializeField]
  184. private OnaholeNodeMenuChildSecondRow secondRow;
  185. [SerializeField]
  186. private OnaholeNodeMenuChildThirdRow thirdRow;
  187. [SerializeField]
  188. [Header("夜伽から貰ってくるコンポーネント群")]
  189. public YotogiPlayManagerWithChubLip playManager;
  190. [SerializeField]
  191. public YotogiAppearanceWithChubLip appearanceData;
  192. [SerializeField]
  193. public UndressingManager undressingManager;
  194. [SerializeField]
  195. private UIButton reactionLevelUpButton;
  196. [SerializeField]
  197. private UIButton editButton;
  198. [SerializeField]
  199. private UIButton releaseSeiekiButton;
  200. [SerializeField]
  201. private UIButton cameraResetButton;
  202. [SerializeField]
  203. private UIButton yotogiEndButton;
  204. private int changeInput;
  205. private NodeButtonData reactionLevelUpButtonData;
  206. public bool autoPistonEnabled;
  207. public bool autoFinishEnabled;
  208. public bool autoReaction;
  209. public int reactionLevel;
  210. }