Skip to content

Commit

Permalink
Merge pull request #1 from jbengtson/master
Browse files Browse the repository at this point in the history
Update for 1.1
  • Loading branch information
NathanKell committed Apr 23, 2016
2 parents 65f3896 + add36a0 commit 0420ad3
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 1,036 deletions.
Binary file added KSCSwitcher.1.1.zip
Binary file not shown.
10 changes: 5 additions & 5 deletions KSCSwitcher.userprefs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.Workbench ActiveDocument="KSCSwitcher/CameraFixer.cs">
<Files>
<File FileName="KSCSwitcher/CameraFixer.cs" Line="38" Column="13" />
<File FileName="KSCSwitcher/KSCLoader.cs" Line="1" Column="1" />
<File FileName="KSCSwitcher/KSCSwitcher.cs" Line="1" Column="1" />
<File FileName="KSCSwitcher/LastKSC.cs" Line="1" Column="1" />
<File FileName="KSCSwitcher/LaunchSite.cs" Line="16" Column="58" />
<File FileName="KSCSwitcher/CameraFixer.cs" Line="5" Column="27" />
<File FileName="KSCSwitcher/KSCLoader.cs" Line="7" Column="27" />
<File FileName="KSCSwitcher/KSCSwitcher.cs" Line="10" Column="27" />
<File FileName="KSCSwitcher/LastKSC.cs" Line="7" Column="27" />
<File FileName="KSCSwitcher/LaunchSite.cs" Line="5" Column="27" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.DebuggingService.Breakpoints>
Expand Down
2 changes: 1 addition & 1 deletion KSCSwitcher/CameraFixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEngine;

/******************************************************************************
* Copyright (c) 2014~2015, Justin Bengtson
* Copyright (c) 2014~2016, Justin Bengtson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion KSCSwitcher/KSCLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using KSP;

/******************************************************************************
* Copyright (c) 2014~2015, Justin Bengtson
* Copyright (c) 2014~2016, Justin Bengtson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
13 changes: 6 additions & 7 deletions KSCSwitcher/KSCSwitcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using KSP.IO;

/******************************************************************************
* Copyright (c) 2014~2015, Justin Bengtson
* Copyright (c) 2014~2016, Justin Bengtson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -72,20 +72,19 @@ public void Start() {
print("KSCSwitcher could not set the active site");
}
loadTextures();
RenderingManager.AddToPostDrawQueue(2, this.onDraw);
RenderingManager.AddToPostDrawQueue(3, this.onDrawGUI);
print("KSCSwitcher initialized");
}

public void OnDestroy() {
RenderingManager.RemoveFromPostDrawQueue(2, this.onDraw);
RenderingManager.RemoveFromPostDrawQueue(3, this.onDrawGUI);
print("KSCSwitcher destroyed");
}

public void onDrawGUI() {
public void OnGUI() {
if(siteLocations.Count < 1) { return; }

if(Event.current.type == EventType.Repaint || Event.current.isMouse) {
onDraw();
}
GUI.skin = HighLogic.Skin;
if(bStyle == null) {
bStyle = new GUIStyle(GUI.skin.button);
Expand Down Expand Up @@ -155,7 +154,7 @@ public void onDraw() {
CelestialBody Kerbin = KSCBody;
bool isActiveSite = false;
foreach(KeyValuePair<string, LaunchSite> kvp in siteLocations) {
Camera camera = MapView.MapCamera.camera;
Camera camera = PlanetariumCamera.Camera;
Vector3d point = Kerbin.GetWorldSurfacePosition(kvp.Value.geographicLocation.x, kvp.Value.geographicLocation.y, 0);
if(!IsOccluded(point, Kerbin)) {
isActiveSite = kvp.Value.name.Equals(activeSite);
Expand Down
19 changes: 14 additions & 5 deletions KSCSwitcher/KSCSwitcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,25 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
<HintPath>..\..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System.Core">
<HintPath>..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\System.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
<HintPath>..\..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="KSPCore">
<HintPath>..\..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\KSPCore.dll</HintPath>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\KSPUtil.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\.local\share\Steam\SteamApps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion KSCSwitcher/LastKSC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;

/******************************************************************************
* Copyright (c) 2014~2015, Justin Bengtson
* Copyright (c) 2014~2016, Justin Bengtson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion KSCSwitcher/LaunchSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEngine;

/******************************************************************************
* Copyright (c) 2014~2015, Justin Bengtson
* Copyright (c) 2014~2016, Justin Bengtson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down
Binary file modified Switcher/GameData/KSCSwitcher/Plugins/KSCSwitcher.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Switcher/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015, Justin Bengtson
Copyright (c) 2015~2016, Justin Bengtson
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
20 changes: 0 additions & 20 deletions Switcher/src/KSCSwitcher.sln

This file was deleted.

16 changes: 0 additions & 16 deletions Switcher/src/KSCSwitcher.userprefs

This file was deleted.

91 changes: 0 additions & 91 deletions Switcher/src/KSCSwitcher/CameraFixer.cs

This file was deleted.

122 changes: 0 additions & 122 deletions Switcher/src/KSCSwitcher/KSCLoader.cs

This file was deleted.

Loading

0 comments on commit 0420ad3

Please sign in to comment.