FaceWindowPane.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using UnityEngine;
  2. namespace COM3D2.MeidoPhotoStudio.Plugin
  3. {
  4. public class FaceWindowPane : BaseMainWindowPane
  5. {
  6. private readonly MeidoManager meidoManager;
  7. private readonly MaidFaceSliderPane maidFaceSliderPane;
  8. private readonly MaidFaceBlendPane maidFaceBlendPane;
  9. private readonly MaidSwitcherPane maidSwitcherPane;
  10. private readonly SaveFacePane saveFacePane;
  11. private readonly Toggle saveFaceToggle;
  12. private bool saveFaceMode;
  13. public FaceWindowPane(MeidoManager meidoManager, MaidSwitcherPane maidSwitcherPane)
  14. {
  15. this.meidoManager = meidoManager;
  16. this.maidSwitcherPane = maidSwitcherPane;
  17. maidFaceSliderPane = AddPane(new MaidFaceSliderPane(this.meidoManager));
  18. maidFaceBlendPane = AddPane(new MaidFaceBlendPane(this.meidoManager));
  19. saveFacePane = AddPane(new SaveFacePane(this.meidoManager));
  20. saveFaceToggle = new Toggle(Translation.Get("maidFaceWindow", "savePaneToggle"));
  21. saveFaceToggle.ControlEvent += (s, a) => saveFaceMode = !saveFaceMode;
  22. }
  23. protected override void ReloadTranslation()
  24. {
  25. saveFaceToggle.Label = Translation.Get("maidFaceWindow", "savePaneToggle");
  26. }
  27. public override void Draw()
  28. {
  29. tabsPane.Draw();
  30. maidSwitcherPane.Draw();
  31. maidFaceBlendPane.Draw();
  32. scrollPos = GUILayout.BeginScrollView(scrollPos);
  33. maidFaceSliderPane.Draw();
  34. GUI.enabled = meidoManager.HasActiveMeido;
  35. saveFaceToggle.Draw();
  36. GUI.enabled = true;
  37. if (saveFaceMode) saveFacePane.Draw();
  38. GUILayout.EndScrollView();
  39. }
  40. public override void UpdatePanes()
  41. {
  42. if (!meidoManager.HasActiveMeido) return;
  43. if (ActiveWindow)
  44. {
  45. meidoManager.ActiveMeido.StopBlink();
  46. base.UpdatePanes();
  47. }
  48. }
  49. }
  50. }