Fix issues with KSP 1.11 part repairing

master v1.1.2
Andrew Cassidy 3 years ago
parent e6eff42ff4
commit 61ace23609

1
.gitignore vendored

@ -328,3 +328,4 @@ ASALocalRun/
# MFractors (Xamarin productivity tool) working folder
.mfractor/
DepthMask/dlls

@ -1,8 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.136
MinimumVisualStudioVersion = 10.0.40219.1
# Visual Studio Version 16
Project("{3CD2A114-2C93-4D39-95B4-214DCC386A37}") = "DepthMask", "DepthMask\DepthMask.csproj", "{AF7B4795-7A4F-4238-BF1D-F0AC763C15C8}"
EndProject
Global
@ -16,10 +14,4 @@ Global
{AF7B4795-7A4F-4238-BF1D-F0AC763C15C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF7B4795-7A4F-4238-BF1D-F0AC763C15C8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7633F515-D77A-4A4D-998B-4EB65CD3A32C}
EndGlobalSection
EndGlobal

@ -1,51 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AF7B4795-7A4F-4238-BF1D-F0AC763C15C8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DepthMask</RootNamespace>
<AssemblyName>DepthMask</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TargetFramework>net48</TargetFramework>
<LangVersion>8</LangVersion>
<IsPackable>false</IsPackable>
<PlatformTarget>x64</PlatformTarget>
<NoWarn>1701;1702;CS0649;CS1591</NoWarn>
<AssemblyVersion>1.1.2</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<Private>False</Private>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>dlls\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>dlls\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="UnityEngine">
<Private>False</Private>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>dlls\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>dlls\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ModuleDepthMask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Remove="dlls\**" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/Releases/DepthMask/Gamedata'"</PostBuildEvent>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Remove="dlls\**" />
</ItemGroup>
<ItemGroup>
<None Remove="dlls\**" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="cp -v '$(TargetPath)' '$(SolutionDir)/Releases/DepthMask/Gamedata'"/>
</Target>
</Project>

@ -43,12 +43,14 @@ namespace DepthMask
// the part variant system is implemented extremely stupidly
// so we have to make this whole module more complicated as a result
GameEvents.onVariantApplied.Add(OnVariantApplied);
GameEvents.onPartRepaired.Add(OnPartRepaired);
}
private void OnDestroy()
{
GameEvents.onVariantApplied.Remove(OnVariantApplied);
GameEvents.onPartRepaired.Remove(OnPartRepaired);
}
@ -94,6 +96,11 @@ namespace DepthMask
if (appliedPart == this.part) UpdateAllMaterials();
}
public void OnPartRepaired(Part repairedPart)
{
// Part repair resets part of the mesh from the prefab, so it needs to be reapplied
if (repairedPart == this.part) UpdateAllMaterials();
}
private void UpdateAllMaterials()
{

@ -1,38 +1 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Depth Mask")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Cineboxandrew")]
[assembly: AssemblyProduct("DepthMask")]
[assembly: AssemblyCopyright("Copyright © Andrew Cassidy 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("AF7B4795-7A4F-4238-BF1D-F0AC763C15C8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: KSPAssembly("DepthMask", 1, 0, 0)]
[assembly: KSPAssembly("DepthMask", 1, 1, 2)]

@ -1,6 +1,6 @@
# ModuleDepthMask v1.1.1
# ModuleDepthMask v1.1.2
This plugin allows for parts to have hollow insets that dont clip into other parts, ideal for engine nozzles, landing gear, air intakes, solar panel bays, and more. It is a standalone version of the depth mask module included in the [Restock](https://github.com/PorktoberRevolution/ReStocked) dll.
This plugin allows for parts to have hollow insets that dont clip into other parts, ideal for engine nozzles, landing gear, air intakes, solar panel bays, and more. It is a standalone version of the depth mask module included in the [Restock](https://github.com/PorktoberRevolution/ReStocked) dll, which will be included in the next major Restock update along with the additon of depth masks to several stock parts. Works with KSP 1.11.
### Usage
1. Add a depth mask mesh to your part model. It should cover up the hollow area you want to prevent clipping in, without sticking out. You can have multiple mask objects sharing the same name and they will all be used.

Loading…
Cancel
Save