123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- using System;
- public class WindowPartsMekureCheckBox : WFCheckBox
- {
- public override void Awake()
- {
- base.Awake();
- this.onClick.Add(delegate(WFCheckBox check_box)
- {
- this.Apply();
- this.UpdateGui();
- });
- }
- public void SetMaid(Maid maid)
- {
- this.maid_ = maid;
- this.UpdateGui();
- }
- public void UpdateGui()
- {
- if (this.maid_ == null)
- {
- bool flag = false;
- base.check = flag;
- base.enabled = flag;
- }
- else if (!this.IsItemChangeEnabled(this.maid_))
- {
- bool flag = false;
- base.check = flag;
- base.enabled = flag;
- }
- else
- {
- base.enabled = true;
- base.check = this.IsItemChange(this.maid_);
- }
- }
- public void Apply()
- {
- if (this.maid_ == null || !this.IsItemChangeEnabled(this.maid_))
- {
- return;
- }
- if (!base.check)
- {
- string[] category_array = this.category_array;
- for (int i = 0; i < category_array.Length; i++)
- {
- this.maid_.ResetProp(category_array[i], false);
- }
- }
- else if (!Product.isPublic)
- {
- string[] category_array2 = this.category_array;
- for (int j = 0; j < category_array2.Length; j++)
- {
- this.maid_.ItemChangeTemp(category_array2[j], this.prop_value_name);
- }
- }
- this.maid_.AllProcProp();
- GravityControlWindow gravityControlWindow = this.mgr.GetWindow(PhotoWindowManager.WindowType.GravityContro) as GravityControlWindow;
- gravityControlWindow.OnChangeMekure();
- }
- private bool IsItemChangeEnabled(Maid maid)
- {
- bool result = false;
- if (Product.isPublic)
- {
- return false;
- }
- string[] category_array = this.category_array;
- for (int i = 0; i < category_array.Length; i++)
- {
- if (maid.IsItemChangeEnabled(category_array[i], this.prop_value_name))
- {
- result = true;
- break;
- }
- }
- return result;
- }
- private bool IsItemChange(Maid maid)
- {
- bool result = false;
- string[] category_array = this.category_array;
- for (int i = 0; i < category_array.Length; i++)
- {
- if (maid.IsItemChange(category_array[i], this.prop_value_name))
- {
- result = true;
- break;
- }
- }
- return result;
- }
- private string[] category_array
- {
- get
- {
- if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureFront)
- {
- return new string[]
- {
- "skirt",
- "onepiece"
- };
- }
- if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureBack)
- {
- return new string[]
- {
- "skirt",
- "onepiece"
- };
- }
- return new string[]
- {
- "panz",
- "mizugi"
- };
- }
- }
- private string prop_value_name
- {
- get
- {
- if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureFront)
- {
- return "めくれスカート";
- }
- if (this.CheckBoxMode == WindowPartsMekureCheckBox.Mode.MekureBack)
- {
- return "めくれスカート後ろ";
- }
- return "パンツずらし";
- }
- }
- public WindowPartsMekureCheckBox.Mode CheckBoxMode;
- public PhotoWindowManager mgr;
- private Maid maid_;
- public enum Mode
- {
- MekureFront,
- MekureBack,
- Zurasi
- }
- }
|