WindowPartsMekureCheckBox.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. using System;
  2. public class WindowPartsMekureCheckBox : WFCheckBox
  3. {
  4. public override void Awake()
  5. {
  6. base.Awake();
  7. this.onClick.Add(delegate(WFCheckBox check_box)
  8. {
  9. this.Apply();
  10. this.UpdateGui();
  11. });
  12. }
  13. public void SetMaid(Maid maid)
  14. {
  15. this.maid_ = maid;
  16. this.UpdateGui();
  17. }
  18. public void UpdateGui()
  19. {
  20. if (this.maid_ == null)
  21. {
  22. bool flag = false;
  23. base.check = flag;
  24. base.enabled = flag;
  25. }
  26. else if (!this.IsItemChangeEnabled(this.maid_))
  27. {
  28. bool flag = false;
  29. base.check = flag;
  30. base.enabled = flag;
  31. }
  32. else
  33. {
  34. base.enabled = true;
  35. base.check = this.IsItemChange(this.maid_);
  36. }
  37. }
  38. public void Apply()
  39. {
  40. if (this.maid_ == null || !this.IsItemChangeEnabled(this.maid_))
  41. {
  42. return;
  43. }
  44. if (!base.check)
  45. {
  46. string[] category_array = this.category_array;
  47. for (int i = 0; i < category_array.Length; i++)
  48. {
  49. this.maid_.ResetProp(category_array[i], false);
  50. }
  51. }
  52. else if (!Product.isPublic)
  53. {
  54. string[] category_array2 = this.category_array;
  55. for (int j = 0; j < category_array2.Length; j++)
  56. {
  57. this.maid_.ItemChangeTemp(category_array2[j], this.prop_value_name);
  58. }
  59. }
  60. this.maid_.AllProcProp();
  61. GravityControlWindow gravityControlWindow = this.mgr.GetWindow(PhotoWindowManager.WindowType.GravityContro) as GravityControlWindow;
  62. gravityControlWindow.OnChangeMekure();
  63. }
  64. private bool IsItemChangeEnabled(Maid maid)
  65. {
  66. bool result = false;
  67. if (Product.isPublic)
  68. {
  69. return false;
  70. }
  71. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.Hadake && !maid.IsCrcBody)
  72. {
  73. return false;
  74. }
  75. string[] category_array = this.category_array;
  76. for (int i = 0; i < category_array.Length; i++)
  77. {
  78. if (maid.IsItemChangeEnabled(category_array[i], this.prop_value_name))
  79. {
  80. result = true;
  81. break;
  82. }
  83. }
  84. return result;
  85. }
  86. private bool IsItemChange(Maid maid)
  87. {
  88. bool result = false;
  89. string[] category_array = this.category_array;
  90. for (int i = 0; i < category_array.Length; i++)
  91. {
  92. if (maid.IsItemChange(category_array[i], this.prop_value_name))
  93. {
  94. result = true;
  95. break;
  96. }
  97. }
  98. return result;
  99. }
  100. private string[] category_array
  101. {
  102. get
  103. {
  104. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureFront)
  105. {
  106. return new string[]
  107. {
  108. "skirt",
  109. "onepiece"
  110. };
  111. }
  112. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureBack)
  113. {
  114. return new string[]
  115. {
  116. "skirt",
  117. "onepiece"
  118. };
  119. }
  120. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.Zurasi)
  121. {
  122. return new string[]
  123. {
  124. "panz",
  125. "mizugi"
  126. };
  127. }
  128. return new string[]
  129. {
  130. "wear",
  131. "onepiece",
  132. "mizugi_top",
  133. "mizugi",
  134. "bra",
  135. "slip"
  136. };
  137. }
  138. }
  139. private string prop_value_name
  140. {
  141. get
  142. {
  143. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureFront)
  144. {
  145. return "めくれスカート";
  146. }
  147. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureBack)
  148. {
  149. return "めくれスカート後ろ";
  150. }
  151. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.Zurasi)
  152. {
  153. return "パンツずらし";
  154. }
  155. return "はだけ";
  156. }
  157. }
  158. public WindowPartsMekureCheckBox.Mode CheckBoxMode;
  159. public PhotoWindowManager mgr;
  160. private Maid maid_;
  161. public enum Mode
  162. {
  163. MekureFront,
  164. MekureBack,
  165. Zurasi,
  166. Hadake
  167. }
  168. }