Ejemplo n.º 1
0
        private static void loadPresets()
        {
            ConfigNode[]      presetNodes = GameDatabase.Instance.GetConfigNodes("ROE_THRUSTCURVE");
            ThrustCurvePreset preset;
            int len = presetNodes.Length;

            presets = new ThrustCurvePreset[len];
            for (int i = 0; i < len; i++)
            {
                preset     = new ThrustCurvePreset(presetNodes[i]);
                presets[i] = preset;
            }
        }
        private void loadPresetCurve(string presetName)
        {
            ConfigNode[]      presetNodes = GameDatabase.Instance.GetConfigNodes("ROE_THRUSTCURVE");
            ThrustCurvePreset preset;
            int len = presetNodes.Length;

            for (int i = 0; i < len; i++)
            {
                if (presetNodes[i].GetStringValue("name") == presetName)
                {
                    ROELog.debug("Updating engine thrust curve data.  Use preset: " + usePresetCurve);
                    preset          = new ThrustCurvePreset(presetNodes[i]);
                    currentCurve    = preset.curve;
                    thrustCurveName = preset.name;
                    savedCurve      = currentCurve.ToStringSingleLine();
                    updateEngineCurve();
                    break;
                }
            }
        }
Ejemplo n.º 3
0
        /*
         * private static void updatePresetWindow(int id)
         * {
         *  GUILayout.BeginVertical();
         *  int len = presets.Length;
         *  for (int i = 0; i < len; i++)
         *  {
         *      if (GUILayout.Button(presets[i].name))
         *      {
         *          loadPresetCurve(presets[i]);
         *      }
         *  }
         *  GUILayout.FlexibleSpace();
         *  if (GUILayout.Button("Close"))
         *  {
         *      presetWindowOpen = false;
         *  }
         *  GUILayout.EndVertical();
         *  GUI.DragWindow();
         * }
         */

        private static void loadPresetCurve(ThrustCurvePreset preset)
        {
            setupCurveData(preset.curve);
            updateGraphTexture();
            presetName = preset.name;
        }