WindowPartsMekureCheckBox.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. string[] category_array = this.category_array;
  72. for (int i = 0; i < category_array.Length; i++)
  73. {
  74. if (maid.IsItemChangeEnabled(category_array[i], this.prop_value_name))
  75. {
  76. result = true;
  77. break;
  78. }
  79. }
  80. return result;
  81. }
  82. private bool IsItemChange(Maid maid)
  83. {
  84. bool result = false;
  85. string[] category_array = this.category_array;
  86. for (int i = 0; i < category_array.Length; i++)
  87. {
  88. if (maid.IsItemChange(category_array[i], this.prop_value_name))
  89. {
  90. result = true;
  91. break;
  92. }
  93. }
  94. return result;
  95. }
  96. private string[] category_array
  97. {
  98. get
  99. {
  100. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureFront)
  101. {
  102. return new string[]
  103. {
  104. "skirt",
  105. "onepiece"
  106. };
  107. }
  108. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureBack)
  109. {
  110. return new string[]
  111. {
  112. "skirt",
  113. "onepiece"
  114. };
  115. }
  116. return new string[]
  117. {
  118. "panz",
  119. "mizugi"
  120. };
  121. }
  122. }
  123. private string prop_value_name
  124. {
  125. get
  126. {
  127. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureFront)
  128. {
  129. return "めくれスカート";
  130. }
  131. if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureBack)
  132. {
  133. return "めくれスカート後ろ";
  134. }
  135. return "パンツずらし";
  136. }
  137. }
  138. public WindowPartsMekureCheckBox.Mode CheckBoxMode;
  139. public PhotoWindowManager mgr;
  140. private Maid maid_;
  141. public enum Mode
  142. {
  143. MekureFront,
  144. MekureBack,
  145. Zurasi
  146. }
  147. }