diff --git a/.gitignore b/.gitignore index 3e759b7..8e6d539 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,4 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ +DepthMask/dlls diff --git a/DepthMask.sln b/DepthMask.sln index f91243b..c605b1f 100644 --- a/DepthMask.sln +++ b/DepthMask.sln @@ -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 diff --git a/DepthMask/DepthMask.csproj b/DepthMask/DepthMask.csproj index e2bd339..a99d636 100644 --- a/DepthMask/DepthMask.csproj +++ b/DepthMask/DepthMask.csproj @@ -1,51 +1,42 @@ - - - + - Debug - AnyCPU - {AF7B4795-7A4F-4238-BF1D-F0AC763C15C8} - Library - Properties - DepthMask - DepthMask - v3.5 - 512 - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + net48 + 8 + false + x64 + 1701;1702;CS0649;CS1591 + 1.1.2 + - - False + + dlls\Assembly-CSharp.dll + + + dlls\UnityEngine.dll - - - - False + + dlls\UnityEngine.CoreModule.dll + + + dlls\UnityEngine.PhysicsModule.dll + - - + - - - sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/Releases/DepthMask/Gamedata'" - + + + + + + + + + + + + + diff --git a/DepthMask/ModuleDepthMask.cs b/DepthMask/ModuleDepthMask.cs index 6a383e4..0756017 100644 --- a/DepthMask/ModuleDepthMask.cs +++ b/DepthMask/ModuleDepthMask.cs @@ -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() { diff --git a/DepthMask/Properties/AssemblyInfo.cs b/DepthMask/Properties/AssemblyInfo.cs index 077743e..1ffdd1d 100644 --- a/DepthMask/Properties/AssemblyInfo.cs +++ b/DepthMask/Properties/AssemblyInfo.cs @@ -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)] diff --git a/README.md b/README.md index edf0b44..37874cc 100644 --- a/README.md +++ b/README.md @@ -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.