Browse Source

Add "Backgrounds" button to BG2

Opens scene manager with the kankyo toggle set to true
habeebweeb 4 years ago
parent
commit
fa337f1449

+ 21 - 74
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs

@@ -110,7 +110,6 @@ namespace CM3D2.MultipleMaids.Plugin
                 bgmCombo.height = rectWin.height;
                 itemCombo2.height = rectWin.height;
                 bgCombo2.height = rectWin.height;
-                kankyoCombo.height = rectWin.height;
                 bgCombo.height = rectWin.height;
                 slotCombo.height = rectWin.height;
                 doguCombo.height = rectWin.height;
@@ -256,26 +255,13 @@ namespace CM3D2.MultipleMaids.Plugin
                 itemCombo2List = itemBArray.Select(s => itemComboUiName.TryGetValue(s, out string name) ? name : s)
                                            .Select(s => new GUIContent(s)).ToArray();
 
-                kankyoCombo.selectedItemIndex = 0;
-                kankyoComboList = new GUIContent[kankyoMax];
-                for (int index = 0; index < kankyoMax; ++index)
-                {
-                    IniKey iniKey = Preferences["kankyo"]["kankyo" + (index + 1)];
-                    kankyoComboList[index] = new GUIContent(iniKey.Value);
-                }
-
                 kankyo2InitFlg = true;
             }
 
             listStyle3.padding.top = GetPix(1);
             listStyle3.padding.bottom = GetPix(0);
             listStyle3.fontSize = GetPix(13);
-            if (poseCombo.isClickedComboButton)
-            {
-                GUI.enabled = false;
-            }
-
-            if (poseGroupCombo.isClickedComboButton)
+            if (poseCombo.isClickedComboButton || poseGroupCombo.isClickedComboButton)
             {
                 GUI.enabled = false;
             }
@@ -383,8 +369,8 @@ namespace CM3D2.MultipleMaids.Plugin
                 isDanceStop = false;
             }
 
-            if (kankyoCombo.isClickedComboButton || slotCombo.isClickedComboButton
-                                                 || itemCombo2.isClickedComboButton || bgCombo2.isClickedComboButton)
+            if (slotCombo.isClickedComboButton || itemCombo2.isClickedComboButton
+                || bgCombo2.isClickedComboButton)
             {
                 GUI.enabled = false;
             }
@@ -482,11 +468,26 @@ namespace CM3D2.MultipleMaids.Plugin
             GUI.Label(new Rect(GetPix(3), GetPix(86), GetPix(100), GetPix(24)),
                       "背景(小)",
                       style1);
-            if (kankyoCombo.isClickedComboButton || itemCombo2.isClickedComboButton || bgCombo2.isClickedComboButton)
+            if (itemCombo2.isClickedComboButton || bgCombo2.isClickedComboButton)
             {
                 GUI.enabled = false;
             }
 
+            if (GUI.Button(
+                new Rect(GetPix(4), GetPix(27), GetPix(85), GetPix(23)),
+                "Backgrounds", style2))
+            {
+                kankyoToggle = true;
+                sceneFlg = !sceneFlg;
+                faceFlg = false;
+                poseFlg = false;
+                kankyoFlg = false;
+                kankyo2Flg = true;
+                bGui = true;
+
+                if (!sceneManagerInitialize) InitializeSceneManager();
+            }
+
             int num1 =
                     slotCombo.List(new Rect(GetPix(51),
                                              GetPix(111),
@@ -498,7 +499,7 @@ namespace CM3D2.MultipleMaids.Plugin
                                     "box",
                                    listStyle3);
             GUI.enabled = true;
-            if (kankyoCombo.isClickedComboButton || itemCombo2.isClickedComboButton)
+            if (itemCombo2.isClickedComboButton)
             {
                 GUI.enabled = false;
             }
@@ -549,10 +550,6 @@ namespace CM3D2.MultipleMaids.Plugin
             }
 
             GUI.enabled = true;
-            if (kankyoCombo.isClickedComboButton)
-            {
-                GUI.enabled = false;
-            }
 
             itemIndexB =
                     itemCombo2.List(new Rect(GetPix(51),
@@ -699,57 +696,6 @@ namespace CM3D2.MultipleMaids.Plugin
             }
 
             GUI.enabled = true;
-            if (nameFlg)
-            {
-                inName2 = GUI.TextField(new Rect(GetPix(5),
-                                                  GetPix(27),
-                                                  GetPix(100),
-                                                  GetPix(20)),
-                                        inName2);
-                if (GUI.Button(new Rect(GetPix(110),
-                                         GetPix(27),
-                                         GetPix(35),
-                                         GetPix(20)),
-                               "更新",
-                               style2))
-                {
-                    nameFlg = false;
-                    GameMain.Instance.SoundMgr.PlaySe("se002.ogg", false);
-                    Preferences["kankyo"]["kankyo" + (kankyoCombo.selectedItemIndex + 1)].Value = inName2;
-                    SaveConfig();
-                    kankyoComboList = new GUIContent[kankyoMax];
-                    for (int index = 0; index < kankyoMax; ++index)
-                    {
-                        IniKey iniKey = Preferences["kankyo"]["kankyo" + (index + 1)];
-                        kankyoComboList[index] = new GUIContent(iniKey.Value);
-                    }
-                }
-            }
-            // else
-            // {
-            //     style2.alignment = TextAnchor.MiddleCenter;
-            //     if (GUI.Button(new Rect(
-            //         GetPix(4),
-            //         GetPix(27),
-            //         GetPix(120),
-            //         GetPix(20)
-            //     ), "Scene Manager", style2))
-            //     {
-            //         sceneFlg = false;
-            //         poseFlg = false;
-            //         faceFlg = false;
-            //         sceneFlg = false;
-            //         kankyoFlg = false;
-            //         kankyoModeFlag = true;
-            //         kankyo2Flg = true;
-
-            //         RefreshSceneManager();
-
-            //         if (!sceneManagerInitialize) InitializeSceneManager();
-            //     }
-            // }
-
-            GUI.enabled = true;
 
             GUI.DragWindow();
 
@@ -1106,6 +1052,7 @@ namespace CM3D2.MultipleMaids.Plugin
                                guistyle3))
                 {
                     sceneFlg = !sceneFlg;
+                    kankyoToggle = false;
                     faceFlg = false;
                     poseFlg = false;
                     kankyoFlg = true;

+ 2 - 4
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Init.cs

@@ -114,7 +114,6 @@ namespace CM3D2.MultipleMaids.Plugin
             wearIndex = 0;
             bGuiMessage = false;
             inName = "";
-            inName2 = "";
             inName3 = "";
             inText = "";
             fontSize = 25;
@@ -441,7 +440,7 @@ namespace CM3D2.MultipleMaids.Plugin
             lightCombo.selectedItemIndex = 0;
             selectLightIndex = 0;
             // bgCombo.selectedItemIndex = 0;
-            kankyoCombo.selectedItemIndex = 0;
+            // kankyoCombo.selectedItemIndex = 0;
             // bgCombo2.selectedItemIndex = 0;
             itemCombo2.selectedItemIndex = 0;
             slotCombo.selectedItemIndex = 0;
@@ -631,7 +630,6 @@ namespace CM3D2.MultipleMaids.Plugin
             kankyo2Flg = false;
             unLockFlg = false;
             inName = "";
-            inName2 = "";
             inName3 = "";
             inText = "";
             fontSize = 25;
@@ -966,7 +964,7 @@ namespace CM3D2.MultipleMaids.Plugin
             lightCombo.selectedItemIndex = 0;
             selectLightIndex = 0;
             // bgCombo.selectedItemIndex = 0;
-            kankyoCombo.selectedItemIndex = 0;
+            // kankyoCombo.selectedItemIndex = 0;
             // bgCombo2.selectedItemIndex = 0;
             itemCombo2.selectedItemIndex = 0;
             slotCombo.selectedItemIndex = 0;

+ 1 - 0
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.MaidUpdate.cs

@@ -7127,6 +7127,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 else if (!isVR && Input.GetKeyDown(KeyCode.F8))
                 {
                     sceneFlg = true;
+                    kankyoToggle = false;
                     bGui = true;
 
                     if (!sceneManagerInitialize) InitializeSceneManager();

+ 0 - 4
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.cs

@@ -4055,7 +4055,6 @@ namespace CM3D2.MultipleMaids.Plugin
         private readonly Transform[] IKMuneR = new Transform[maxMaidCnt];
         private readonly Transform[] IKMuneRSub = new Transform[maxMaidCnt];
         private string inName = "";
-        private string inName2 = "";
         private string inName3 = "";
         private string inName4 = "";
         private string inText = "";
@@ -4345,8 +4344,6 @@ namespace CM3D2.MultipleMaids.Plugin
         private float kamiyure4;
         private bool kankyo2Flg;
         private bool kankyo2InitFlg;
-        private readonly ComboBox2 kankyoCombo = new ComboBox2();
-        private GUIContent[] kankyoComboList;
         private bool kankyoFlg;
         private bool kankyoInitFlg;
         private bool kankyoLoadFlg;
@@ -4452,7 +4449,6 @@ namespace CM3D2.MultipleMaids.Plugin
         private readonly bool[] muneIKL = new bool[maxMaidCnt];
         private readonly bool[] muneIKR = new bool[maxMaidCnt];
         private string nameA = "";
-        private bool nameFlg;
         private string nameK = "";
         private string nameS = "";
         private readonly Transform[] Neck = new Transform[maxMaidCnt];