BGWindowPane.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using UnityEngine;
  2. namespace COM3D2.MeidoPhotoStudio.Plugin
  3. {
  4. internal class BGWindowPane : BaseWindowPane
  5. {
  6. private BackgroundSelectorPane backgroundSelectorPane;
  7. private LightsPane lightsPane;
  8. private EffectsPane effectsPane;
  9. private DragPointPane dragPointPane;
  10. private Button sceneManagerButton;
  11. public BGWindowPane(
  12. EnvironmentManager environmentManager, LightManager lightManager, EffectManager effectManager,
  13. SceneWindow sceneWindow
  14. )
  15. {
  16. this.sceneManagerButton = new Button(Translation.Get("backgroundWindow", "manageScenesButton"));
  17. this.sceneManagerButton.ControlEvent += (s, a) => sceneWindow.Visible = !sceneWindow.Visible;
  18. this.backgroundSelectorPane = AddPane(new BackgroundSelectorPane(environmentManager));
  19. this.dragPointPane = AddPane(new DragPointPane());
  20. this.lightsPane = AddPane(new LightsPane(lightManager));
  21. this.effectsPane = AddPane(new EffectsPane()
  22. {
  23. ["bloom"] = new BloomPane(effectManager),
  24. ["dof"] = new DepthOfFieldPane(effectManager),
  25. ["vignette"] = new VignettePane(effectManager),
  26. ["fog"] = new FogPane(effectManager)
  27. });
  28. }
  29. protected override void ReloadTranslation()
  30. {
  31. this.sceneManagerButton.Label = Translation.Get("backgroundWindow", "manageScenesButton");
  32. }
  33. public override void Draw()
  34. {
  35. this.sceneManagerButton.Draw();
  36. this.backgroundSelectorPane.Draw();
  37. this.dragPointPane.Draw();
  38. this.scrollPos = GUILayout.BeginScrollView(this.scrollPos);
  39. this.lightsPane.Draw();
  40. this.effectsPane.Draw();
  41. GUILayout.EndScrollView();
  42. }
  43. public override void UpdatePanes()
  44. {
  45. if (ActiveWindow)
  46. {
  47. base.UpdatePanes();
  48. }
  49. }
  50. }
  51. }