Skip to content

Commit

Permalink
ignore control surfaces that contain Blade and Propeller strings in name
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris-Barboris committed Jul 15, 2019
1 parent 160856e commit 8679a63
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions AtmosphereAutopilot/AtmosphereAutopilot.version
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"VERSION" : {
"MAJOR" : 1,
"MINOR" : 5,
"PATCH" : 14,
"PATCH" : 15,
"BUILD" : 0
},
"KSP_VERSION" : {
"MAJOR" : 1,
"MINOR" : 7,
"PATCH" : 2
"PATCH" : 3
},
"KSP_VERSION_MIN" : {
"MAJOR" : 1,
Expand Down
10 changes: 8 additions & 2 deletions AtmosphereAutopilot/GimbalRearranger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using UnityEngine;

namespace AtmosphereAutopilot
Expand Down Expand Up @@ -128,14 +129,19 @@ public override bool IsReady()
public override void StartLoad()
{
// replace ModuleControlSurface modules with SyncModuleControlSurface
string propellerRegex = @"Propeller|Blade";
var part_configs = GameDatabase.Instance.GetConfigNodes("PART");
foreach (var part in part_configs)
{
ConfigNode csurf_node;
if ((csurf_node = part.nodes.GetNode("MODULE", "name", "ModuleControlSurface")) != null)
{
Debug.Log("[AtmosphereAutopilot]: part '" + part.GetValue("name") + "' config node contains ModuleControlSurface, replacing it");
csurf_node.SetValue("name", "SyncModuleControlSurface", false);
Match m = Regex.Match(part.GetValue("name"), propellerRegex, RegexOptions.IgnoreCase);
if (!m.Success)
{
Debug.Log("[AtmosphereAutopilot]: part '" + part.GetValue("name") + "' config node contains ModuleControlSurface, replacing it");
csurf_node.SetValue("name", "SyncModuleControlSurface", false);
}
}
}
ready = true;
Expand Down
4 changes: 2 additions & 2 deletions AtmosphereAutopilot/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.14.0")]
[assembly: AssemblyFileVersion("1.5.14.0")]
[assembly: AssemblyVersion("1.5.15.0")]
[assembly: AssemblyFileVersion("1.5.15.0")]
7 changes: 0 additions & 7 deletions AtmosphereAutopilot/csurf_sync.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
@PART[*]:HAS[@MODULE[ModuleControlSurface]]:FOR[AtmosphereAutopilot]:NEEDS[!FerramAerospaceResearch]
{
@MODULE[ModuleControlSurface]
{
@name = SyncModuleControlSurface
}
}
@PART[*]:HAS[@MODULE[ModuleGimbal]]:FOR[AtmosphereAutopilot]
{
@MODULE[ModuleGimbal]
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Contributors:

License: GNU GPL version 3

# Dependencies

ModuleManager.

# For developers

## How to build:
Expand All @@ -27,7 +31,7 @@ Atmosphere autopilot is a modular atmospheric flight control system library. It'

Autopilots are modular entities. They can use basic, provided by main library components (like controllers and models), or they can define their own components and share them with other Autopilots. Those components will be called "Autopilot modules", or simply - "Modules". Every sealed child of AutopilotModule wich is not a StateController is treated by the library like a Module. Sealed StateController children are treated as Autopilots.

Stock and FAR aerodynamics are supported. Plugin is dependent on ModuleManager by sarbian, and is shipped with Mini-AVC plugin by cybutek.
Stock and FAR aerodynamics are supported.

# GUI concept
AA icon is placed in Application Launcher toolbar during flight. It's contents will visualize a list of all Autopilots and Modules, created for active vessel. For every vessel "Autopilot Module Manager" will be created regardless. Turning on a "MASTER SWITCH" on it's window will create required context of Autopilots and Modules for this vessel. Under the master switch all Autopilots will be listed, for the user to choose one of them as an active one. Hotkey for Master switch is letter P, autoPilot. Can be changed in Global_settings.cfg file, Autopilot_module_manager section.
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ mkdir AtmosphereAutopilot
cp ../../../UnityAssets/Result/atmosphereautopilotprefabs ./
cp * AtmosphereAutopilot/ || true
cp ../../../LICENSE LICENSE_AtmosphereAutopilot
zip AtmosphereAutopilot.zip LICENSE_AtmosphereAutopilot AtmosphereAutopilot/*
wget https://ksp.sarbian.com/jenkins/job/ModuleManager/149/artifact/ModuleManager.4.0.2.dll
zip AtmosphereAutopilot.zip LICENSE_AtmosphereAutopilot ModuleManager.4.0.2.dll AtmosphereAutopilot/*

0 comments on commit 8679a63

Please sign in to comment.