Skip to content

Commit

Permalink
1.1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zer0Kerbal committed Sep 19, 2019
1 parent bdcf184 commit 1120d42
Show file tree
Hide file tree
Showing 16 changed files with 387 additions and 35 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ Release/
*.log
TestResult.xml
*.VisualState.xml

# internal tools
buildRelease.bat
deploy.bat
*.sqlite
*.json
21 changes: 11 additions & 10 deletions FieldTrainingFacility.version
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"NAME":"FieldTrainingFacility",
"URL":"https://raw.githubusercontent.com/zer0Kerbal/FieldTrainingFacility/FieldTrainingFacility.version",
"DOWNLOAD":"https://github.com/zer0Kerbal/FieldTrainingFacility/releases", "CHANGE_LOG_URL": "https://raw.githubusercontent.com/zer0Kerbal/FieldTrainingFacility/dev/changelog.md",
"GITHUB":
{
"USERNAME":"zer0Kerbal",
"REPOSITORY":"FieldTrainingFacility",
"ALLOW_PRE_RELEASE":false,
},
"DOWNLOAD":"https://github.com/zer0Kerbal/FieldTrainingFacility/releases",
"CHANGE_LOG_URL":"https://raw.githubusercontent.com/zer0Kerbal/FieldTrainingFacility/KerbalChangelog.cfg",
"GITHUB":
{
"USERNAME":"zer0Kerbal",
"REPOSITORY":"FieldTrainingFacility",
"ALLOW_PRE_RELEASE":false
},
"VERSION":
{
"MAJOR":1,
"MINOR":0,
"PATCH":3,
"BUILD":4
"MINOR":1,
"PATCH":0,
"BUILD":3
},
"KSP_VERSION":
{
Expand Down
37 changes: 37 additions & 0 deletions GameData/FieldTrainingFacility/FieldTrainingFacility.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"NAME":"FieldTrainingFacility",
"URL":"https://raw.githubusercontent.com/zer0Kerbal/FieldTrainingFacility/FieldTrainingFacility.version",
"DOWNLOAD":"https://github.com/zer0Kerbal/FieldTrainingFacility/releases",
"CHANGE_LOG_URL":"https://raw.githubusercontent.com/zer0Kerbal/FieldTrainingFacility/KerbalChangelog.cfg",
"GITHUB":
{
"USERNAME":"zer0Kerbal",
"REPOSITORY":"FieldTrainingFacility",
"ALLOW_PRE_RELEASE":false
},
"VERSION":
{
"MAJOR":1,
"MINOR":1,
"PATCH":0,
"BUILD":3
},
"KSP_VERSION":
{
"MAJOR":1,
"MINOR":7,
"PATCH":3
},
"KSP_VERSION_MIN":
{
"MAJOR":1,
"MINOR":7,
"PATCH":1
},
"KSP_VERSION_MAX":
{
"MAJOR":1,
"MINOR":7,
"PATCH":9999
}
}
Empty file.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@PART[Large_Crewed_Lab]
@PART[KKAOSS_Science_g]:NEEDS[PlanetaryBaseInc]:FOR[FieldTrainingFacility]
{
MODULE
{
name = FieldTrainingFacilityModule

// TimeFactor = time to level 0 kerbal becoming level 5 kerbal (sec) (default = 1 year)
// ECFactor = Electric Charge consuming (per kerbal)
// SpaceFactor = multiplyer of time efficiency at space
// LandedFactor = multiplyer of time efficiency at landed on other planet
// SpaceFactor = multiplier of time efficiency at space
// LandedFactor = multiplier of time efficiency at landed on other planet
// ex : training on orbit, level 0 kerbal -> level 5 kerbal after 1/4 year.

TimeFactor = 9201600
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
@PART[KKAOSS_Science_g]:NEEDS[PlanetaryBaseInc]
@PART[Large_Crewed_Lab]:FOR[FieldTrainingFacility]
{
MODULE
{
name = FieldTrainingFacilityModule

// TimeFactor = time to level 0 kerbal becoming level 5 kerbal (sec) (default = 1 year)
// ECFactor = Electric Charge consuming (per kerbal)
// SpaceFactor = multiplyer of time efficiency at space
// LandedFactor = multiplyer of time efficiency at landed on other planet
// SpaceFactor = multiplier of time efficiency at space
// LandedFactor = multiplier of time efficiency at landed on other planet
// ex : training on orbit, level 0 kerbal -> level 5 kerbal after 1/4 year.

TimeFactor = 9201600
Expand Down
2 changes: 2 additions & 0 deletions GameData/FieldTrainingFacility/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# FieldTrainingFacility
This mod adds training center at laboratory. Paying science point, Gets kerbal experiences
Empty file added KerbalChangelog.cfg
Empty file.
8 changes: 8 additions & 0 deletions Source/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.1.0.3")]
96 changes: 96 additions & 0 deletions Source/AssemblyVersion.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>

<#

// 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;

//
// Update the following with the complete path to the .version file
//
string versionfile = @"C:\KSP_DEV\Workspace\FieldTrainingFacility\FieldTrainingFacility.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 #>")]
38 changes: 31 additions & 7 deletions Source/FieldTrainingFacility.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -31,7 +31,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\Games\Career\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>$(DevDir)\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
Expand All @@ -41,20 +41,44 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\Games\Career\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<HintPath>$(DevDir)\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyVersion.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>AssemblyVersion.tt</DependentUpon>
</Compile>
<Compile Include="FieldTrainingFacilityModule.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="InstallChecker.cs" />
</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="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
-->
<PropertyGroup>
<PostBuildEvent>start /D $(ProjectDir)..\ /WAIT deploy.bat $(TargetDir) $(TargetFileName)

if $(ConfigurationName) == Release start /D C:\KSP_DEV\Workspace\FieldTrainingFacility /WAIT buildRelease.bat $(TargetDir) $(TargetFileName)</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>set textTemplatingPath="$(DevEnvDir)texttransform.exe"
%25textTemplatingPath%25 "$(ProjectDir)AssemblyVersion.tt"</PreBuildEvent>
</PropertyGroup>
<!--<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Target>-->
</Project>
7 changes: 7 additions & 0 deletions Source/FieldTrainingFacility.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ VisualStudioVersion = 16.0.29230.47
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FieldTrainingFacility", "FieldTrainingFacility.csproj", "{F1E7665D-05FE-4267-85E8-FDA6D510628E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{51AF6BFB-F283-4724-872A-697C6B8F28D5}"
ProjectSection(SolutionItems) = preProject
..\buildRelease.bat = ..\buildRelease.bat
..\deploy.bat = ..\deploy.bat
..\FieldTrainingFacility.version = ..\FieldTrainingFacility.version
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
20 changes: 10 additions & 10 deletions Source/FieldTrainingFacilityModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public class FieldTrainingFacilityModule : PartModule
[KSPField]
public float LandedFactor = 6f;

[KSPField(isPersistant = true, guiActive = true, guiName = "Training Status")]
[KSPField(isPersistant = true, guiActive = true, guiName = "Training Status", groupName = "Training")]
public bool TrainingStatus = false;

[KSPField(isPersistant = true)]
public double LastTimeSigniture = -1;

[KSPEvent(guiActive = true, guiName = "Start Training")]
[KSPEvent(guiActive = true, guiName = "Start Training", groupName = "Training")]
public void ToggleTraining()
{
if(TrainingStatus == false)
Expand All @@ -64,21 +64,21 @@ public void ToggleTraining()
}
}

[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training", groupDisplayName = "Training", groupStartCollapsed = true)]
public string BoardKerbal0;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal1;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal2;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal3;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal4;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal5;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal6;
[KSPField(guiActive = false)]
[KSPField(guiActive = false, groupName = "Training")]
public string BoardKerbal7;

public override void OnLoad(ConfigNode node)
Expand Down
Loading

0 comments on commit 1120d42

Please sign in to comment.