BGWindowPane.cs 2.1 KB

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