Ejemplo n.º 1
0
        public AxisBinding(BindingSet bs, ConfigNode node)
        {
            int ind;

            if (int.TryParse(node.GetValue("index"), out ind))
            {
                index = ind;
            }

            binding = AI_FlightControl.GetAxisBinding(node);

            bool b;

            if (bool.TryParse(node.GetValue("invert"), out b))
            {
                invert = b;
            }

            float c;

            if (float.TryParse(node.GetValue("curve"), out c))
            {
                curve = c;
            }

            bindingSet = bs;

            prevValue = bindingSet.AxisValue(index, invert);
        }
Ejemplo n.º 2
0
 void OnDestroy()
 {
     instance = null;
     GameEvents.onVesselChange.Remove(OnVesselChange);
     GameEvents.onInputLocksModified.Remove(OnInputLocksModified);
     InputLib.Close();
     InputLib.DeviceAdded              -= DeviceAdded;
     InputLib.DeviceRemoved            -= DeviceRemoved;
     FlightInputHandler.OnRawAxisInput -= ControlUpdate;
 }
Ejemplo n.º 3
0
        public ButtonBinding(BindingSet bs, ConfigNode node)
        {
            int ind;

            if (int.TryParse(node.GetValue("index"), out ind))
            {
                index = ind;
            }

            binding = AI_FlightControl.GetButtonBinding(node);

            bindingSet = bs;

            prevState = bindingSet.ButtonState(index);
        }
Ejemplo n.º 4
0
 void Awake()
 {
     if (axisBindings == null)
     {
         DiscoverAxisBindings();
         DiscoverButtonBindings();
     }
     instance       = this;
     onVesselChange = new EventData <Vessel>("onVesselChange");
     GameEvents.onVesselChange.Add(OnVesselChange);
     GameEvents.onInputLocksModified.Add(OnInputLocksModified);
     ctrlState        = new FlightCtrlState();
     kerbalState      = new KerbalCtrlState();
     devices          = new List <Device> ();
     prevMainThrottle = -2;
     prevMainThrottle = -2;
 }