Skip to content

Commit

Permalink
Removed toolbar button when leaving flight scene
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxgurugamer committed Sep 29, 2017
1 parent 6d50370 commit 029f6b5
Show file tree
Hide file tree
Showing 20 changed files with 673 additions and 198 deletions.
408 changes: 220 additions & 188 deletions .gitignore

Large diffs are not rendered by default.

Binary file added .vs/ProbeControlRoom/v15/sqlite3/storage.ide
Binary file not shown.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1.2.2.7
Removed toolbar button when leaving flight scene
Binary file removed GameData/ProbeControlRoom/ProbeControlRoom.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion GameData/ProbeControlRoom/ProbeControlRoom.version
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"MAJOR" : 1,
"MINOR" : 2,
"PATCH" : 2,
"BUILD" : 6
"BUILD" : 7
},
"KSP_VERSION":
{
Expand Down
Binary file not shown.
67 changes: 67 additions & 0 deletions GameData/ProbeControlRoom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
ProbeControlRoom
=========

Features
--------
Adds IVA to UNMANNED Vessels/CommandModules that have no Crew/Internal.
AutoUpdates all "ModuleCommand"-Parts that have no "INTERNAL"
RasterPropMonitor gets enabled automatically if the .dll is loaded


Requires
----------
- [ModuleManager](http://forum.kerbalspaceprogram.com/threads/55219) >= v2.7.3
- (optional) [Toolbar](http://forum.kerbalspaceprogram.com/threads/60863) >= v1.7.13

For RasterPropMonitor
----------
- [RasterPropMonitor](http://forum.kerbalspaceprogram.com/threads/117471) >= v0.28
- (optional) [SCANsat](http://forum.kerbalspaceprogram.com/threads/80369) >= v1.1.6.11


How to use
----------
1. Remove any previous versions of "ProbeControlRoom" in your KerbalSpaceProgram/GameData directory
2. Merge the downloaded "GameData" into your KerbalSpaceProgram directory
3. Start the game and build a vessel with a ProbeCore
4. Start the ControlRoom by:
a. MannedVessel: Bottom right, above the KerbalAvatars is a IVA button
b. UnmannedVessel: Use the CameraMode button (C) to access/leave IVA
c. Righclick the ProbeCore and click "IVA from here"
d. click the IVA button in the toolbar (if installed)

Extended
----------
On the first start a config file is created at GameData/ProbeControlRoom/Settings.cfg
ForcePCROnly (default: False)
forces the use of PCR
- UI/Toolbar buttons to overwrite
- Traps mapView and "Camera"-Key
DisableWobble (default: True)
disables the cameraShake when inside a PCR
DisableSounds (default: False) [ALPHA - CurrentMethod (GameSettings-Volume) not stable]
disables the Ship_Audio when inside a PCR
- Seems to ignore Engines, Staging, Parachutes and similar, while explosions get muted.
- With ForcePCROnly=True muting works, but always for every rocket with a PCR...


Thanks
-------
- G'th for the idea&kick to actually do it
- all the KSP modders putting tons of sourcecode out there to read & learn
- the folks in the #kspmodders irc that linked me there ;-)
- "Albert VDS" for the excelent work hes done on the 3D Model/Textures/Pages
- "Dexter9313" and "Z-Key Aerospace" for the pull-requests regarding Wobble&Audio removal
- "MeCripp", "jlcarneiro" and again "Z-Key Aerospace" & "Dexter9313" for providing updates while i could not


Authors
-------
Contributions by: Virindi, Tabakhase, Icedown, Albert_VDS, MeCripp, Nils277, JPLRepo, Dexter9313, Z-Key Aerospace, JlCarneiro


License
-------
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
17 changes: 15 additions & 2 deletions ProbeControlRoom.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26730.8
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProbeControlRoom", "ProbeControlRoom\ProbeControlRoom.csproj", "{6BB6BF04-C58F-47EE-A4BB-3CADA7850606}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProbeControlRoomToolbar", "ProbeControlRoomToolbar\ProbeControlRoomToolbar.csproj", "{F85B9451-74D5-4C48-8647-76A779ADD3FF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{5634DF77-97E5-459F-B03A-6A9791A75B34}"
ProjectSection(SolutionItems) = preProject
buildRelease.bat = buildRelease.bat
ChangeLog.txt = ChangeLog.txt
deploy.bat = deploy.bat
LICENSE.txt = LICENSE.txt
ProbeControlRoom.version = ProbeControlRoom.version
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,6 +35,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {64059492-3E12-45A1-B722-3ABA71B45823}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = ProbeControlRoom\ProbeControlRoom.csproj
EndGlobalSection
Expand Down
30 changes: 30 additions & 0 deletions ProbeControlRoom.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"NAME" : "ProbeControlRoom",
"URL" : "https://raw.githubusercontent.com/Virindi-AC/KSP-ProbeControlRoom/master/GameData/ProbeControlRoom/ProbeControlRoom.version",
"DOWNLOAD" : "https://github.com/Virindi-AC/KSP-ProbeControlRoom/releases",
"GITHUB" :
{
"USERNAME" : "Virindi-AC",
"REPOSITORY": "KSP-ProbeControlRoom",
"ALLOW_PRE_RELEASE": false
},
"VERSION" :
{
"MAJOR" : 1,
"MINOR" : 2,
"PATCH" : 2,
"BUILD" : 7
},
"KSP_VERSION":
{
"MAJOR": 1,
"MINOR": 2,
"PATCH": 2
},
"KSP_VERSION_MIN":
{
"MAJOR": 1,
"MINOR": 2,
"PATCH": 2
}
}
8 changes: 8 additions & 0 deletions ProbeControlRoom/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyVersion("1.2.2.7")]
93 changes: 93 additions & 0 deletions ProbeControlRoom/AssemblyVersion.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>

<#@ assembly name="EnvDTE" #><# /* This assembly provides access to Visual Studio project properties. */ #>
<#

// Instructions
// 1. Add a new Text Template to the project
// 2. Copy this file into the new template
// 3. Update the string: versionfile with the complete path to the .version file
// 4. Remove the following line from the file AssemblyInfo.cs (usually located in the "Property" folder inside your C# project):
// [assembly: AssemblyVersion("1.0.0.0")]
// 5. Add the following to the PreBuild steps:
// set textTemplatingPath="%CommonProgramFiles(x86)%\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe"
//
// if %textTemplatingPath%=="\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe" set textTemplatingPath="%CommonProgramFiles%\Microsoft Shared\TextTemplating\$(VisualStudioVersion)\texttransform.exe"
//
// %textTemplatingPath% "$(ProjectDir)AssemblyFileVersion.tt"

int major = 0;
int minor = 0;
int build = 0;
int patch = 0;
bool versionSection = false;

int i = 0;
int i2 = 0;
string s;

string versionfile = @"D:\Users\jbb\github\KSP-ProbeControlRoom\ProbeControlRoom.version";
if (!File.Exists(versionfile))
{
Write("File: " + versionfile + " missing\n");
}

try
{
foreach (var line in File.ReadAllLines(versionfile))
{
if (line != null)
{
if (!versionSection)
{
if (line.Contains("\"VERSION\""))
versionSection = true;
}
else
{
if (line.Contains("}"))
versionSection = false;
i = line.IndexOf(":");
i2 = line.IndexOf(",");
if (i2 == -1)
i2 = line.Length;
if (i >= 0 && i2 >= 0)
{
s = line.Substring(i + 1, i2 - i - 1);

if (line.Contains("MAJOR"))
Int32.TryParse(s, out major);

if (line.Contains("MINOR"))
Int32.TryParse(s, out minor);

if (line.Contains("PATCH"))
Int32.TryParse(s, out patch);

if (line.Contains("BUILD"))
Int32.TryParse(s, out build);
}
}
}
}

}
catch
{
major = 1;
minor = 0;
patch = 0;
build = 0;
}
//Write("File done");

#>
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyVersion("<#= major #>.<#= minor #>.<#= patch #>.<#= build #>")]
14 changes: 12 additions & 2 deletions ProbeControlRoom/ProbeControlRoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public void Start()
GameEvents.onVesselChange.Add(OnVesselChange);
GameEvents.onVesselWasModified.Add(OnVesselModified);
GameEvents.onGUIApplicationLauncherReady.Add(onGUIApplicationLauncherReady);
GameEvents.OnMapExited.Add(onMapExited);
GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGUIAppLauncherDestroyed);
GameEvents.OnMapExited.Add(onMapExited);
GameEvents.OnCameraChange.Add(onCameraChange);
GameEvents.onGameSceneSwitchRequested.Add(OnGameSceneSwitchRequested);

Expand All @@ -142,8 +143,16 @@ void OnGameSceneSwitchRequested(GameEvents.FromToAction<GameScenes, GameScenes>
{
if (isActive)
stopIVA ();

}

void OnGUIAppLauncherDestroyed()
{
if (appLauncherButton != null)
{
ApplicationLauncher.Instance.RemoveModApplication(appLauncherButton);
}
}
/// <summary>
/// Setup app launcher button when the GUI is ready
/// </summary>
Expand Down Expand Up @@ -300,7 +309,8 @@ public void OnDestroy()
GameEvents.onVesselChange.Remove(OnVesselChange);
GameEvents.onVesselWasModified.Remove(OnVesselModified);
GameEvents.onGUIApplicationLauncherReady.Remove(onGUIApplicationLauncherReady);
GameEvents.OnMapExited.Remove(onMapExited);
GameEvents.onGUIApplicationLauncherDestroyed.Rempve(OnGUIAppLauncherDestroyed);
GameEvents.OnMapExited.Remove(onMapExited);
GameEvents.OnCameraChange.Remove(onCameraChange);
GameEvents.onGameSceneSwitchRequested.Remove(OnGameSceneSwitchRequested);

Expand Down
28 changes: 27 additions & 1 deletion ProbeControlRoom/ProbeControlRoom.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
</CustomCommands>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyVersion.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>AssemblyVersion.tt</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProbeControlRoom.cs" />
<Compile Include="ProbeControlRoomPart.cs" />
Expand All @@ -61,8 +66,29 @@
<HintPath>R:\KSP_1.3.0_dev\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="AssemblyVersion.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AssemblyVersion.cs</LastGenOutput>
</Content>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /Y "$(TargetDir)$(TargetFileName)" "$(SolutionDir)GameData\ProbeControlRoom\$(TargetFileName)"</PostBuildEvent>
<PostBuildEvent>
start /D D:\Users\jbb\github\KSP-ProbeControlRoom/WAIT deploy.bat $(TargetDir) $(TargetFileName)

if $(ConfigurationName) == Release (
start /D D:\Users\jbb\github\KSP-ProbeControlRoom/WAIT buildRelease.bat $(TargetDir) $(TargetFileName)
)
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>
set textTemplatingPath="%25ProgramFiles(x86)%25\Microsoft Visual Studio\2017\Community\Common7\IDE \texttransform.exe"

%25textTemplatingPath%25 "$(ProjectDir)AssemblyVersion.tt"</PreBuildEvent>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion ProbeControlRoom/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.2.2.6")]
//[assembly: AssemblyVersion ("1.2.2.6")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
Expand Down
8 changes: 8 additions & 0 deletions ProbeControlRoomToolbar/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyVersion("1.2.2.7")]
Loading

0 comments on commit 029f6b5

Please sign in to comment.