Skip to content

Commit 9370416

Browse files
Updated for KSP 1.8
1 parent 9a9c509 commit 9370416

10 files changed

Lines changed: 348 additions & 28 deletions

Changelog.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
ChangeLog
2+
3+
1.0.10
4+
Updated for KSP 1.8
5+
6+
1.0.9.1
7+
Fixed Installchecker string
18

29
1.0.9
310
Adoption by LinuxGuruGamer
411
Added InstallChecker
512
Added AssemblyVersion.tt
613
Added check for multiple SHIPEFFECTS_SETTINGS nodes
714

8-
1.0.9.1
9-
Fixed Installchecker string

ShipEffectsContinued.version

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"VERSION": {
77
"MAJOR": 1,
88
"MINOR": 0,
9-
"PATCH": 9,
10-
"BUILD": 1
9+
"PATCH": 10,
10+
"BUILD": 0
1111
},
1212
"KSP_VERSION_MIN": {
1313
"MAJOR": 1,
14-
"MINOR": 2,
15-
"PATCH": 2
14+
"MINOR": 8,
15+
"PATCH": 0
1616
}
17-
}
17+
}

ShipEffectsContinued.version.orig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"NAME": "Ship Effects Continued",
3+
"URL": "http://ksp-avc.cybutek.net/version.php?id=480",
4+
"DOWNLOAD": "https://github.com/linuxgurugamer/ShipEffectsContinued/releases",
5+
"CHANGE_LOG_URL": "https://raw.githubusercontent.com/linuxgurugamer/ShipEffectsContinued/master/ReadMe.txt",
6+
"VERSION": {
7+
"MAJOR": 1,
8+
"MINOR": 0,
9+
"PATCH": 9,
10+
"BUILD": 1
11+
},
12+
"KSP_VERSION_MIN": {
13+
"MAJOR": 1,
14+
"MINOR": 2,
15+
"PATCH": 2
16+
}
17+
}

Source/InstallChecker.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@
1616

1717
namespace HaystackReContinued
1818
{
19+
[KSPAddon(KSPAddon.Startup.Instantly, true)]
20+
internal class Startup : MonoBehaviour
21+
{
22+
private void Start()
23+
{
24+
string v = "n/a";
25+
AssemblyTitleAttribute attributes = (AssemblyTitleAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(AssemblyTitleAttribute), false);
26+
string title = attributes?.Title;
27+
if (title == null)
28+
{
29+
title = "TitleNotAvailable";
30+
}
31+
v = Assembly.GetExecutingAssembly().FullName;
32+
if (v == null)
33+
{
34+
v = "VersionNotAvailable";
35+
}
36+
Debug.Log("[" + title + "] Version " + v);
37+
}
38+
}
39+
1940
[KSPAddon(KSPAddon.Startup.MainMenu, true)]
2041
internal class InstallChecker : MonoBehaviour
2142
{

Source/InstallChecker.cs.orig

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/**
2+
* Based on the InstallChecker from the Kethane mod for Kerbal Space Program.
3+
* https://github.com/Majiir/Kethane/blob/b93b1171ec42b4be6c44b257ad31c7efd7ea1702/Plugin/InstallChecker.cs
4+
*
5+
* Original is (C) Copyright Majiir.
6+
* CC0 Public Domain (http://creativecommons.org/publicdomain/zero/1.0/)
7+
* http://forum.kerbalspaceprogram.com/threads/65395-CompatibilityChecker-Discussion-Thread?p=899895&viewfull=1#post899895
8+
*
9+
* This file has been modified extensively and is released under the same license.
10+
*/
11+
using System;
12+
using System.IO;
13+
using System.Linq;
14+
using System.Reflection;
15+
using UnityEngine;
16+
17+
namespace HaystackReContinued
18+
{
19+
[KSPAddon(KSPAddon.Startup.MainMenu, true)]
20+
internal class InstallChecker : MonoBehaviour
21+
{
22+
private const string MODNAME = "Ship Effects Continued";
23+
private const string FOLDERNAME = "ShipEffectsContinued";
24+
private const string EXPECTEDPATH = FOLDERNAME + "/Plugins";
25+
26+
protected void Start()
27+
{
28+
// Search for this mod's DLL existing in the wrong location. This will also detect duplicate copies because only one can be in the right place.
29+
var assemblies = AssemblyLoader.loadedAssemblies.Where(a => a.assembly.GetName().Name == Assembly.GetExecutingAssembly().GetName().Name).Where(a => a.url != EXPECTEDPATH);
30+
if (assemblies.Any())
31+
{
32+
var badPaths = assemblies.Select(a => a.path).Select(p => Uri.UnescapeDataString(new Uri(Path.GetFullPath(KSPUtil.ApplicationRootPath)).MakeRelativeUri(new Uri(p)).ToString().Replace('/', Path.DirectorySeparatorChar)));
33+
PopupDialog.SpawnPopupDialog
34+
(
35+
new Vector2(0.5f, 0.5f),
36+
new Vector2(0.5f, 0.5f),
37+
"test",
38+
"Incorrect " + MODNAME + " Installation",
39+
MODNAME + " has been installed incorrectly and will not function properly. All files should be located in KSP/GameData/" + FOLDERNAME + ". Do not move any files from inside that folder.\n\nIncorrect path(s):\n" + String.Join("\n", badPaths.ToArray()),
40+
"OK",
41+
false,
42+
HighLogic.UISkin
43+
);
44+
Debug.Log("Incorrect " + MODNAME + " Installation: " + MODNAME + " has been installed incorrectly and will not function properly. All files should be located in KSP/GameData/" + EXPECTEDPATH + ". Do not move any files from inside that folder.\n\nIncorrect path(s):\n" + String.Join("\n", badPaths.ToArray())
45+
46+
);
47+
48+
}
49+
50+
//// Check for Module Manager
51+
//if (!AssemblyLoader.loadedAssemblies.Any(a => a.assembly.GetName().Name.StartsWith("ModuleManager") && a.url == ""))
52+
//{
53+
// PopupDialog.SpawnPopupDialog("Missing Module Manager",
54+
// modName + " requires the Module Manager mod in order to function properly.\n\nPlease download from http://forum.kerbalspaceprogram.com/threads/55219 and copy to the KSP/GameData/ directory.",
55+
// "OK", false, HighLogic.Skin);
56+
//}
57+
58+
CleanupOldVersions();
59+
}
60+
61+
/*
62+
* Tries to fix the install if it was installed over the top of a previous version
63+
*/
64+
void CleanupOldVersions()
65+
{
66+
try
67+
{
68+
}
69+
catch (Exception ex)
70+
{
71+
Debug.LogError("-ERROR- " + this.GetType().FullName + "[" + this.GetInstanceID().ToString("X") + "][" + Time.time.ToString("0.00") + "]: " +
72+
"Exception caught while cleaning up old files.\n" + ex.Message + "\n" + ex.StackTrace );
73+
74+
}
75+
}
76+
}
77+
}
78+

Source/ShipEffectsContinued.csproj

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<DefineConstants>DEBUG;TRACE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24+
<Prefer32Bit>false</Prefer32Bit>
2425
</PropertyGroup>
2526
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2627
<DebugType>pdbonly</DebugType>
@@ -29,28 +30,16 @@
2930
<DefineConstants>TRACE</DefineConstants>
3031
<ErrorReport>prompt</ErrorReport>
3132
<WarningLevel>4</WarningLevel>
33+
<Prefer32Bit>false</Prefer32Bit>
3234
</PropertyGroup>
3335
<ItemGroup>
34-
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
35-
<SpecificVersion>False</SpecificVersion>
36-
<HintPath>R:\KSP_1.7.2_dev\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
36+
<Reference Include="$(KSPDIR)\KSP_x64_Data\Managed\Assembly*.dll">
37+
<Private>False</Private>
3738
</Reference>
38-
<Reference Include="System" />
39-
<Reference Include="System.Core" />
40-
<Reference Include="System.Xml.Linq" />
41-
<Reference Include="System.Data.DataSetExtensions" />
42-
<Reference Include="Microsoft.CSharp" />
43-
<Reference Include="System.Data" />
44-
<Reference Include="System.Net.Http" />
45-
<Reference Include="System.Xml" />
46-
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47-
<SpecificVersion>False</SpecificVersion>
48-
<HintPath>R:\KSP_1.7.2_dev\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
49-
</Reference>
50-
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
51-
<SpecificVersion>False</SpecificVersion>
52-
<HintPath>R:\KSP_1.7.2_dev\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
39+
<Reference Include="$(KSPDIR)\KSP_x64_Data\Managed\UnityEngine*.dll">
40+
<Private>False</Private>
5341
</Reference>
42+
<Reference Include="System" />
5443
</ItemGroup>
5544
<ItemGroup>
5645
<Compile Include="AssemblyVersion.cs">
@@ -102,4 +91,4 @@ if $(ConfigurationName) == Release (
10291
<Target Name="AfterBuild">
10392
</Target>
10493
-->
105-
</Project>
94+
</Project>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{95F254FB-05EC-4059-B473-D0477510144C}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>ShipEffectsContinued</RootNamespace>
11+
<AssemblyName>ShipEffectsContinued</AssemblyName>
12+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
35+
<SpecificVersion>False</SpecificVersion>
36+
<HintPath>R:\KSP_1.7.3_dev\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
37+
</Reference>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Net.Http" />
45+
<Reference Include="System.Xml" />
46+
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
47+
<SpecificVersion>False</SpecificVersion>
48+
<HintPath>R:\KSP_1.7.3_dev\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
49+
</Reference>
50+
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
51+
<SpecificVersion>False</SpecificVersion>
52+
<HintPath>R:\KSP_1.7.3_dev\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
53+
</Reference>
54+
</ItemGroup>
55+
<ItemGroup>
56+
<Compile Include="AssemblyVersion.cs">
57+
<AutoGen>True</AutoGen>
58+
<DesignTime>True</DesignTime>
59+
<DependentUpon>AssemblyVersion.tt</DependentUpon>
60+
</Compile>
61+
<Compile Include="InstallChecker.cs" />
62+
<Compile Include="ShipEffectsContinued.cs" />
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<Content Include="AssemblyVersion.tt">
67+
<Generator>TextTemplatingFileGenerator</Generator>
68+
<LastGenOutput>AssemblyVersion.cs</LastGenOutput>
69+
</Content>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
73+
</ItemGroup>
74+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
75+
<PropertyGroup>
76+
<PostBuildEvent>start /D D:\Users\jbb\github\ShipEffectsContinued /WAIT deploy.bat $(TargetDir) $(TargetFileName)
77+
78+
79+
80+
if $(ConfigurationName) == Release (
81+
82+
83+
84+
start /D D:\Users\jbb\github\ShipEffectsContinued /WAIT buildRelease.bat $(TargetDir) $(TargetFileName)
85+
86+
87+
88+
)</PostBuildEvent>
89+
</PropertyGroup>
90+
<PropertyGroup>
91+
<PreBuildEvent>set textTemplatingPath="%25ProgramFiles(x86)%25\Microsoft Visual Studio\2017\Community\Common7\IDE\texttransform.exe"
92+
93+
94+
95+
96+
%25textTemplatingPath%25 "$(ProjectDir)AssemblyVersion.tt"</PreBuildEvent>
97+
</PropertyGroup>
98+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
99+
Other similar extension points exist, see Microsoft.Common.targets.
100+
<Target Name="BeforeBuild">
101+
</Target>
102+
<Target Name="AfterBuild">
103+
</Target>
104+
-->
105+
</Project>

0 commit comments

Comments
 (0)