Beispiel #1
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);

            if (HighLogic.LoadedSceneIsEditor)
            {
                if (part.parent != null)
                {
                    _firstUpdateWithParent = false;
                }
                Setup();

                if (_prefabPart.CrewCapacity > 0)
                {
                    GameEvents.onEditorShipModified.Add(OnEditorShipModified);
                }

                _chainingEnabled = HotkeyManager.Instance.AddHotkey("Scale chaining", new[] { KeyCode.LeftShift },
                                                                    new[] { KeyCode.LeftControl, KeyCode.K }, false);
            }

            // scale IVA overlay
            if (HighLogic.LoadedSceneIsFlight && enabled && (part.internalModel != null))
            {
                _savedIvaScale = part.internalModel.transform.localScale * ScalingFactor.absolute.linear;
                part.internalModel.transform.localScale = _savedIvaScale;
                part.internalModel.transform.hasChanged = true;
            }
        }
Beispiel #2
0
 public Hotkeyable AddHotkey(string hotkeyName, ICollection <KeyCode> tempDisableDefault, ICollection <KeyCode> toggleDefault, bool state)
 {
     if (_hotkeys.ContainsKey(hotkeyName))
     {
         return(_hotkeys[hotkeyName]);
     }
     return(_hotkeys[hotkeyName] = new Hotkeyable(_osd, hotkeyName, tempDisableDefault, toggleDefault, state));
 }
Beispiel #3
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            if (part.parent != null)
            {
                _firstUpdateWithParent = false;
            }
            Setup();

            if (HighLogic.LoadedSceneIsEditor)
            {
                _autoscaleEnabled = HotkeyManager.Instance.AddHotkey("Autoscale", new[] { KeyCode.LeftShift },
                                                                     new[] { KeyCode.LeftControl, KeyCode.L }, true);
                _chainingEnabled = HotkeyManager.Instance.AddHotkey("Scale chaining", new[] { KeyCode.LeftShift },
                                                                    new[] { KeyCode.LeftControl, KeyCode.K }, true);
            }
        }
 public void RemoveHotkey(Hotkeyable hotKey) => this.RemoveHotkey(hotKey.Name);
Beispiel #5
0
        public override void OnStart(StartState state)
        {
            base.OnStart(state);
            if (part.parent != null)
            {
                _firstUpdateWithParent = false;
            }
            Setup();

            if (HighLogic.LoadedSceneIsEditor)
            {
                _autoscaleEnabled = HotkeyManager.Instance.AddHotkey("Autoscale", new[] {KeyCode.LeftShift},
                    new[] {KeyCode.LeftControl, KeyCode.L}, true);
                _chainingEnabled = HotkeyManager.Instance.AddHotkey("Scale chaining", new[] {KeyCode.LeftShift},
                    new[] {KeyCode.LeftControl, KeyCode.K}, true);
            }
        }