@@ -43,6 +43,9 @@ public class MicroEngineerMod : BaseSpaceWarpPlugin
4343 // Index of the stage for which user wants to select a different CelestialBody for different TWR calculations. -1 -> no stage is selected
4444 private int _celestialBodySelectionStageIndex = - 1 ;
4545
46+ // If game input is enabled or disabled (used for locking controls when user is editing a text field
47+ private bool _gameInputState = true ;
48+
4649 public override void OnInitialized ( )
4750 {
4851 MicroStyles . InitializeStyles ( ) ;
@@ -192,6 +195,8 @@ private void OnGUI()
192195 #region Flight scene UI and logic
193196 private void OnGUI_Flight ( )
194197 {
198+ _gameInputState = MicroUtility . ToggleGameInputOnControlInFocus ( _gameInputState , _showGuiFlight ) ;
199+
195200 if ( ! _showGuiFlight || MicroUtility . ActiveVessel == null ) return ;
196201
197202 MicroWindow mainGui = MicroWindows . Find ( window => window . MainWindow == MainWindow . MainGui ) ;
@@ -559,8 +564,10 @@ private void DrawEditWindow(int windowIndex)
559564 {
560565 selectedWindowId = selectedWindowId > 0 ? selectedWindowId - 1 : editableWindows . Count - 1 ;
561566 }
567+ GUI . SetNextControlName ( MicroUtility . InputDisableWindowAbbreviation ) ;
562568 editableWindows [ selectedWindowId ] . Abbreviation = GUILayout . TextField ( editableWindows [ selectedWindowId ] . Abbreviation , MicroStyles . WindowSelectionAbbrevitionTextFieldStyle ) ;
563569 editableWindows [ selectedWindowId ] . Abbreviation = MicroUtility . ValidateAbbreviation ( editableWindows [ selectedWindowId ] . Abbreviation ) ;
570+ GUI . SetNextControlName ( MicroUtility . InputDisableWindowName ) ;
564571 editableWindows [ selectedWindowId ] . Name = GUILayout . TextField ( editableWindows [ selectedWindowId ] . Name , MicroStyles . WindowSelectionTextFieldStyle ) ;
565572 if ( GUILayout . Button ( ">" , MicroStyles . OneCharacterBtnStyle ) )
566573 {
0 commit comments