Browse Source

Fix camera zooming when scrolling over UI (fr this time)

I'm certain capturing input in the Update method is guaranteed.
habeebweeb 4 years ago
parent
commit
7dba011ac4

+ 4 - 56
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs

@@ -1,4 +1,4 @@
-using ExIni;
+using ExIni;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -109,15 +109,6 @@ namespace CM3D2.MultipleMaids.Plugin
                 GameMain.Instance.MainCamera.SetControl(true);
                 if (!sceneFlg && !faceFlg && !poseFlg && !kankyoFlg && !kankyo2Flg && !isF6 && okFlg)
                 {
-                    if (Input.mouseScrollDelta.y != 0f)
-                    {
-                        if (rectWin.Contains(Event.current.mousePosition))
-                        {
-                            GameMain.Instance.MainCamera.SetControl(false);
-                            Input.ResetInputAxes();
-                        }
-                    }
-
                     rectWin = GUI.Window(129, rectWin, MaidCallWindow, "", style);
                 }
                 else if (sceneFlg)
@@ -214,19 +205,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
                 else if (kankyoFlg)
                 {
-                    if (bgmCombo.isClickedComboButton || bgCombo.isClickedComboButton || doguCombo.isClickedComboButton
-                        || parCombo.isClickedComboButton)
-                    {
-                        if (Input.mouseScrollDelta.y != 0f)
-                        {
-                            if (rectWin.Contains(Event.current.mousePosition))
-                            {
-                                GameMain.Instance.MainCamera.SetControl(false);
-                                Input.ResetInputAxes();
-                            }
-                        }
-                    }
-                    else if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
+                    if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
                              && rectWin.Contains(Event.current.mousePosition)
                              && Input.GetMouseButtonDown(0))
                     {
@@ -237,15 +216,6 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
                 else if (kankyo2Flg)
                 {
-                    if (Input.mouseScrollDelta.y != 0f)
-                    {
-                        if (rectWin.Contains(Event.current.mousePosition))
-                        {
-                            GameMain.Instance.MainCamera.SetControl(false);
-                            Input.ResetInputAxes();
-                        }
-                    }
-
                     if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
                         && rectWin.Contains(Event.current.mousePosition)
                         && Input.GetMouseButtonDown(0))
@@ -257,18 +227,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
                 else if (poseFlg)
                 {
-                    if (poseGroupCombo.isClickedComboButton || poseCombo.isClickedComboButton || itemCombo.isClickedComboButton)
-                    {
-                        if (Input.mouseScrollDelta.y != 0f)
-                        {
-                            if (rectWin.Contains(Event.current.mousePosition))
-                            {
-                                GameMain.Instance.MainCamera.SetControl(false);
-                                Input.ResetInputAxes();
-                            }
-                        }
-                    }
-                    else if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
+                    if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
                              && rectWin.Contains(Event.current.mousePosition)
                              && Input.GetMouseButtonDown(0))
                     {
@@ -279,18 +238,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
                 else
                 {
-                    if (faceCombo.isClickedComboButton)
-                    {
-                        if (Input.mouseScrollDelta.y != 0f)
-                        {
-                            if (rectWin.Contains(Event.current.mousePosition))
-                            {
-                                GameMain.Instance.MainCamera.SetControl(false);
-                                Input.ResetInputAxes();
-                            }
-                        }
-                    }
-                    else if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
+                    if (!yotogiFlg && sceneLevel != 3 && sceneLevel != 5
                              && rectWin.Contains(Event.current.mousePosition)
                              && Input.GetMouseButtonDown(0))
                     {

+ 14 - 1
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Update.cs

@@ -1,4 +1,4 @@
-using ExIni;
+using ExIni;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -20,6 +20,19 @@ namespace CM3D2.MultipleMaids.Plugin
                 return;
             }
 
+            if (bGui)
+            {
+                if (Input.mouseScrollDelta.y != 0f)
+                {
+                    if (rectWin.Contains(Event.current.mousePosition))
+                    {
+                        GameMain.Instance.MainCamera.SetControl(false);
+                        Input.ResetInputAxes();
+                    }
+                }
+
+            }
+
             if (allowUpdate)
             {
                 MaidUpdate();