Skip to content

Commit

Permalink
Updated plugin to support ksp 0.2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinZeidler committed Dec 27, 2023
1 parent 33e268c commit 5258a9e
Show file tree
Hide file tree
Showing 20 changed files with 448 additions and 576 deletions.
406 changes: 46 additions & 360 deletions .gitignore

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup Label="Framework and language configuration">
<TargetFramework>netstandard2.1</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<PropertyGroup Label="Game folder configuration">
<!-- Set this to the path to your KSP 2 folder if you don't have the KSP2DIR environmental variable set -->
<KSP2DIR Condition="'$(KSP2DIR)' == ''">C:/Program Files (x86)/Steam/steamapps/common/Kerbal Space Program 2</KSP2DIR>
</PropertyGroup>

<PropertyGroup Label="Build and namespace configuration">
<SolutionDir Condition="'$(SolutionDir)'==''">$(MSBuildThisFileDirectory)</SolutionDir>
<PluginBinPath>$(SolutionDir)build/bin/plugin/$(Configuration)</PluginBinPath>
<PluginObjPath>$(SolutionDir)build/obj/plugin/$(Configuration)</PluginObjPath>
<BaseOutputPath>$(PluginBinPath)/$(MSBuildProjectName)</BaseOutputPath>
<BaseIntermediateOutputPath>$(PluginObjPath)/$(MSBuildProjectName)</BaseIntermediateOutputPath>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<Configurations>Debug;Release;Deploy;DeployAndRun</Configurations>
<Platforms>AnyCPU</Platforms>
<NoWarn>$(NoWarn);CS0436</NoWarn>
</PropertyGroup>

<PropertyGroup Label="Package source configuration">
<RestoreAdditionalProjectSources>
https://nuget.spacewarp.org/v3/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>

<ItemGroup Label="Dependencies for build targets">
<PackageReference Include="JsonPeek" Version="1.2.0" PrivateAssets="all"/>
</ItemGroup>

<!-- Define the main target -->
<Target Label="Reading properties from swinfo.json" Name="ReadPropertiesFromJson" BeforeTargets="PreBuildEvent;AddGeneratedFile">
<JsonPeek ContentPath="$(SolutionDir)/plugin_template/swinfo.json" Query="$">
<Output TaskParameter="Result" ItemName="Swinfo"/>
</JsonPeek>

<!-- Extract properties from the JSON -->
<PropertyGroup>
<ModId>@(Swinfo -> '%(mod_id)')</ModId>
<Version>@(Swinfo -> '%(version)')</Version>
<Version Condition="$(Version.Contains('-'))">$(Version.Substring(0, $(Version.IndexOf('-'))))</Version>
<Product>@(Swinfo -> '%(name)')</Product>
<Authors>@(Swinfo -> '%(author)')</Authors>
<Description>@(Swinfo -> '%(description)')</Description>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>@(Swinfo -> '%(source)')</RepositoryUrl>
<SpaceWarpPluginGuid>$(ModId)</SpaceWarpPluginGuid>
<SpaceWarpPluginName>$(Product)</SpaceWarpPluginName>
<SpaceWarpPluginVersion>$(Version)</SpaceWarpPluginVersion>
</PropertyGroup>
</Target>
</Project>
19 changes: 12 additions & 7 deletions HideOrbits.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33424.131
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HideOrbits", "HideOrbitsProject\HideOrbits.csproj", "{D734C8FD-21D3-4C99-8722-3324D9A63F34}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HideOrbits", "src\HideOrbits\HideOrbits.csproj", "{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Deploy|Any CPU = Deploy|Any CPU
DeployAndRun|Any CPU = DeployAndRun|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D734C8FD-21D3-4C99-8722-3324D9A63F34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D734C8FD-21D3-4C99-8722-3324D9A63F34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D734C8FD-21D3-4C99-8722-3324D9A63F34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D734C8FD-21D3-4C99-8722-3324D9A63F34}.Release|Any CPU.Build.0 = Release|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.Deploy|Any CPU.Build.0 = Deploy|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{747F4A4F-2AE2-4C45-AB24-E56E7BF3673C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
42 changes: 0 additions & 42 deletions HideOrbitsProject/HideOrbits.csproj

This file was deleted.

118 changes: 0 additions & 118 deletions HideOrbitsProject/OrbitHiderPatch.cs

This file was deleted.

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ Automatically hide distant orbits while zoomed in
## Installing
Extract and copy into your KSP2 install directory

Requires SpaceWarp 0.4.0: https://github.com/SpaceWarpDev/SpaceWarp
Requires SpaceWarp 1.7.0: https://github.com/SpaceWarpDev/SpaceWarp
Requires UITKForKSP2

## Issues
- Distant orbits are always hidden (can be displayed using the toggle in the mods UI menu)

Please report any issues at https://github.com/ColinZeidler/KSP2-HideDistantOrbits/issues

## Changelog
### v0.5.0
- Support for ksp 0.2.0

### v0.3.0
- Local moons should now always show their orbits
2 changes: 0 additions & 2 deletions build-debug.bat

This file was deleted.

2 changes: 0 additions & 2 deletions build-release.bat

This file was deleted.

Binary file removed hide_orbits/assets/images/icon.png
Binary file not shown.
21 changes: 0 additions & 21 deletions hide_orbits/swinfo.json

This file was deleted.

Binary file added plugin_template/assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions plugin_template/swinfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"spec": "2.0",
"mod_id": "HideOrbits",
"author": "Strykker2",
"name": "HideOrbits",
"description": "UI to toggle distant orbits if they get in the way",
"source": "https://github.com/ColinZeidler/KSP2-HideDistantOrbits",
"version": "0.5.0",
"version_check": "",
"ksp2_version": {
"min": "0.2.0",
"max": "*"
},
"dependencies": [
{
"id": "com.github.x606.spacewarp",
"version": {
"min": "1.7.0",
"max": "*"
}
},
]
}
2 changes: 2 additions & 0 deletions scripts/build-debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
dotnet build "../HideOrbits.sln" -c Debug
2 changes: 2 additions & 0 deletions scripts/build-deploy.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
dotnet build "../HideOrbits.sln" -c Deploy
2 changes: 2 additions & 0 deletions scripts/build-release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
dotnet build "../HideOrbits.sln" -c Release
2 changes: 2 additions & 0 deletions scripts/build-run.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
dotnet build "../HideOrbits.sln" -c DeployAndRun
Loading

0 comments on commit 5258a9e

Please sign in to comment.