Prechádzať zdrojové kódy

Pass tabs pane to main window panes

habeebweeb 4 rokov pred
rodič
commit
9a656987e8

+ 2 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BG2WindowPane.cs

@@ -1,6 +1,6 @@
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    internal class BG2WindowPane : BaseWindowPane
+    internal class BG2WindowPane : BaseMainWindowPane
     {
         private MeidoManager meidoManager;
         private PropManager propManager;
@@ -40,6 +40,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
+            this.tabsPane.Draw();
             this.propTabs.Draw();
             MiscGUI.WhiteLine();
             this.currentPropsPane.Draw();

+ 2 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BGWindowPane.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    internal class BGWindowPane : BaseWindowPane
+    internal class BGWindowPane : BaseMainWindowPane
     {
         private BackgroundSelectorPane backgroundSelectorPane;
         private LightsPane lightsPane;
@@ -38,6 +38,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
+            this.tabsPane.Draw();
             this.sceneManagerButton.Draw();
             this.backgroundSelectorPane.Draw();
             this.dragPointPane.Draw();

+ 8 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BaseMainWindowPane.cs

@@ -0,0 +1,8 @@
+namespace COM3D2.MeidoPhotoStudio.Plugin
+{
+    internal abstract class BaseMainWindowPane : BaseWindowPane
+    {
+        protected TabsPane tabsPane;
+        public void SetTabsPane(TabsPane tabsPane) => this.tabsPane = tabsPane;
+    }
+}

+ 2 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/CallWindowPane.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    internal class CallWindowPane : BaseWindowPane
+    internal class CallWindowPane : BaseMainWindowPane
     {
         private MeidoManager meidoManager;
         private MaidSelectorPane maidSelectorPane;
@@ -42,6 +42,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
+            this.tabsPane.Draw();
             GUILayout.BeginHorizontal();
             placementDropdown.Draw(GUILayout.Width(150));
             placementOKButton.Draw();

+ 2 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/FaceWindowPane.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    internal class FaceWindowPane : BaseWindowPane
+    internal class FaceWindowPane : BaseMainWindowPane
     {
         private MeidoManager meidoManager;
         private MaidFaceSliderPane maidFaceSliderPane;
@@ -21,6 +21,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
+            this.tabsPane.Draw();
             this.maidSwitcherPane.Draw();
 
             this.scrollPos = GUILayout.BeginScrollView(this.scrollPos);

+ 2 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/PoseWindowPane.cs

@@ -1,12 +1,8 @@
-using System;
-using System.IO;
-using System.Collections.Generic;
-using System.Linq;
 using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    internal class PoseWindowPane : BaseWindowPane
+    internal class PoseWindowPane : BaseMainWindowPane
     {
         private MeidoManager meidoManager;
         private MaidPoseSelectorPane maidPosePane;
@@ -80,6 +76,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
+            this.tabsPane.Draw();
             this.maidSwitcherPane.Draw();
             maidPosePane.Draw();
 

+ 6 - 7
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/MainWindow.cs

@@ -8,10 +8,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private MeidoManager meidoManager;
         private PropManager propManager;
         private LightManager lightManager;
-        private Dictionary<Constants.Window, BaseWindowPane> windowPanes;
+        private Dictionary<Constants.Window, BaseMainWindowPane> windowPanes;
         private TabsPane tabsPane;
         private Button ReloadTranslationButton;
-        private BaseWindowPane currentWindowPane;
+        private BaseMainWindowPane currentWindowPane;
         public override Rect WindowRect
         {
             set
@@ -25,7 +25,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
         private Constants.Window selectedWindow = Constants.Window.Call;
 
-        public BaseWindowPane this[Constants.Window id]
+        public BaseMainWindowPane this[Constants.Window id]
         {
             get => windowPanes[id];
             set => AddWindow(id, value);
@@ -43,7 +43,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             this.lightManager = lightManager;
             this.lightManager.Select += (s, a) => ChangeWindow(Constants.Window.BG);
 
-            windowPanes = new Dictionary<Constants.Window, BaseWindowPane>();
+            windowPanes = new Dictionary<Constants.Window, BaseMainWindowPane>();
             WindowRect = new Rect(Screen.width, Screen.height * 0.08f, 240f, Screen.height * 0.9f);
 
             tabsPane = new TabsPane();
@@ -64,13 +64,14 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             this.Visible = true;
         }
 
-        public void AddWindow(Constants.Window id, BaseWindowPane window)
+        public void AddWindow(Constants.Window id, BaseMainWindowPane window)
         {
             if (windowPanes.ContainsKey(id))
             {
                 Panes.Remove(windowPanes[id]);
             }
             windowPanes[id] = window;
+            windowPanes[id].SetTabsPane(tabsPane);
             Panes.Add(windowPanes[id]);
         }
 
@@ -99,8 +100,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
-            tabsPane.Draw();
-
             currentWindowPane?.Draw();
 
             GUI.enabled = true;