Skip to content

Commit

Permalink
Version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Real-Gecko committed Oct 12, 2016
1 parent 0e66a18 commit ea44c2b
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 46 deletions.
Binary file modified GameData/KeepItStraight/KeepItStraight.dll
Binary file not shown.
70 changes: 35 additions & 35 deletions GameData/KeepItStraight/KeepItStraight.version
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{
"NAME" : "Camera Mode Persistence",
"URL" : "https://github.com/Real-Gecko/KSP-KeepItStraight/raw/master/GameData/KeepItStraight/KeepItStraight.version",
"DOWNLOAD" : "http://spacedock.info/mod/824/Keep%20It%20Straight",
"GITHUB" :
{
"USERNAME" : "Real-Gecko",
"REPOSITORY" : "KSP-KeepItStraight"
},
"VERSION" :
{
"MAJOR" : 1,
"MINOR" : 0,
"PATCH" : 0,
"BUILD" : 0
},
"KSP_VERSION" :
{
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 3
},
"KSP_VERSION_MIN" :
{
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 3
},
"KSP_VERSION_MAX" :
{
"MAJOR" : 1,
"MINOR" : 1,
"PATCH" : 3
}
}
{
"NAME" : "Camera Mode Persistence",
"URL" : "https://github.com/Real-Gecko/KSP-KeepItStraight/raw/master/GameData/KeepItStraight/KeepItStraight.version",
"DOWNLOAD" : "http://spacedock.info/mod/824/Keep%20It%20Straight",
"GITHUB" :
{
"USERNAME" : "Real-Gecko",
"REPOSITORY" : "KSP-KeepItStraight"
},
"VERSION" :
{
"MAJOR" : 1,
"MINOR" : 0,
"PATCH" : 1,
"BUILD" : 0
},
"KSP_VERSION" :
{
"MAJOR" : 1,
"MINOR" : 2,
"PATCH" : 0
},
"KSP_VERSION_MIN" :
{
"MAJOR" : 1,
"MINOR" : 2,
"PATCH" : 0
},
"KSP_VERSION_MAX" :
{
"MAJOR" : 1,
"MINOR" : 2,
"PATCH" : 0
}
}
14 changes: 14 additions & 0 deletions KeepItStraight/KeepItStraight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,29 @@ namespace KeepItStraight
[KSPAddon(KSPAddon.Startup.Flight, false)]
public class KeepItStraight: MonoBehaviour
{
public static KeepItStraight instance;
private PluginConfiguration config;
FlightCamera camera;

void Awake() {
if (instance != null) {
Destroy (this);
return;
}

if (config == null) {
config = PluginConfiguration.CreateForType<KeepItStraight> ();
}
config.load ();
camera = FlightCamera.fetch;
GameEvents.onFlightReady.Add (FlightReady);
GameEvents.onPartCouple.Add (onPartCouple);
}

void OnDestroy()
{
GameEvents.onFlightReady.Remove (FlightReady);
GameEvents.onPartCouple.Remove (onPartCouple);
config.SetValue ("CameraMode", FlightCamera.CamMode);
config.save ();
}
Expand All @@ -29,5 +38,10 @@ void FlightReady() {
int CamMode = config.GetValue<int>("CameraMode");
camera.setModeImmediate((FlightCamera.Modes)CamMode);
}

void onPartCouple(GameEvents.FromToAction<Part,Part> action) {
int CamMode = config.GetValue<int>("CameraMode");
camera.setModeImmediate((FlightCamera.Modes)CamMode);
}
}
}
17 changes: 7 additions & 10 deletions KeepItStraight/KeepItStraight.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,22 @@
<ConsolePause>false</ConsolePause>
<CustomCommands>
<CustomCommands>
<Command type="AfterBuild" command="cp ${TargetFile} /home/realgecko/dev/KSP/GameData/KeepItStraight" />
<Command type="AfterBuild" command="cp ${TargetFile} /home/realgecko/Development/KSP/GameData/KeepItStraight" />
<Command type="AfterBuild" command="cp ${TargetFile} ${SolutionDir}/GameData/KeepItStraight" />
<Command type="Execute" command="/usr/bin/wine /home/realgecko/dev/KSP/KSP_x64.exe" workingdir="/home/realgecko/dev/KSP/" />
<Command type="Execute" command="/usr/bin/wine /home/realgecko/Development/KSP/KSP_x64.exe" workingdir="/home/realgecko/Development/KSP/" />
</CustomCommands>
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\Games\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\..\Games\steamapps\common\Kerbal Space Program\KSP_Data\Managed\KSPUtil.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\Games\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>..\..\KSP\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\Games\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
<HintPath>..\..\KSP\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\KSP\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion KeepItStraight/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("1.0.0")]
[assembly: AssemblyVersion ("1.0.1")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# KSP-KeepItStraight

Remembers camera mode between scene switches so you will not end up with AUTO every time.

# Changelog
## Version 1.0.1
- Camera mode is not reset to AUTO after docking is complete

0 comments on commit ea44c2b

Please sign in to comment.