Skip to content

Commit

Permalink
Merge pull request #743 from jrodrigv/master
Browse files Browse the repository at this point in the history
Release for KSP 1.8.1
  • Loading branch information
jrodrigv authored Nov 7, 2019
2 parents 6364402 + 3a55373 commit 2061875
Show file tree
Hide file tree
Showing 39 changed files with 981 additions and 474 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ BDArmory/LocalDev/Refs/UnityEngine.dll
/packages/Microsoft.Net.Compilers.2.8.0
/_ReSharper.Caches/ReSharperPlatformVs15182_74c703de.BDArmory.00
/BDArmory/_ReSharper.Caches/ReSharperPlatformVs15183_74c703de.BDArmory.00
/BDArmory/_ReSharper.Caches/ReSharperPlatformVs16191_4011600b.BDArmory.00
/BDArmory/_ReSharper.Caches/ReSharperPlatformVs16191_4011600b.BDArmory.01
/_ReSharper.Caches/ReSharperPlatformVs16191_4011600b.00
60 changes: 53 additions & 7 deletions BDArmory.Core/BDArmory.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BDArmory.Core</RootNamespace>
<AssemblyName>BDArmory.Core</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>6</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -30,6 +32,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>6</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="BDAPersistantSettingsField.cs" />
Expand Down Expand Up @@ -57,19 +60,62 @@
<Compile Include="Utils\LayerMask.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\_LocalDev\KSPRefs\Assembly-CSharp-firstpass.dll</HintPath>
<Reference Include="KSPAssets, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\KSPAssets.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine">
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.InputModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextCoreModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.TextCoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UIElementsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
22 changes: 12 additions & 10 deletions BDArmory.Core/Extension/PartExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,18 @@ public static void RefreshAssociatedWindows(this Part part)
//Thanks FlowerChild
//refreshes part action window

IEnumerator<UIPartActionWindow> window = UnityEngine.Object.FindObjectsOfType(typeof(UIPartActionWindow)).Cast<UIPartActionWindow>().GetEnumerator();
while (window.MoveNext())
{
if (window.Current == null) continue;
if (window.Current.part == part)
{
window.Current.displayDirty = true;
}
}
window.Dispose();
//IEnumerator<UIPartActionWindow> window = UnityEngine.Object.FindObjectsOfType(typeof(UIPartActionWindow)).Cast<UIPartActionWindow>().GetEnumerator();
//while (window.MoveNext())
//{
// if (window.Current == null) continue;
// if (window.Current.part == part)
// {
// window.Current.displayDirty = true;
// }
//}
//window.Dispose();

MonoUtilities.RefreshContextWindows(part);
}

public static bool IsMissile(this Part part)
Expand Down
30 changes: 29 additions & 1 deletion BDArmory.Core/Extension/VesselExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace BDArmory.Core.Extension
using System;
using UnityEngine;

namespace BDArmory.Core.Extension
{
public static class VesselExtensions
{
Expand Down Expand Up @@ -41,5 +44,30 @@ public static Vector3d Velocity(this Vessel v)
return new Vector3d(0, 0, 0);
}
}

public static double GetFutureAltitude(this Vessel vessel, float predictionTime = 10)
{
Vector3 futurePosition = vessel.CoM + vessel.Velocity() * predictionTime
+ 0.5f * vessel.acceleration_immediate * Mathf.Pow(predictionTime, 2);

return GetRadarAltitudeAtPos(futurePosition);
}

public static Vector3 GetFuturePosition (this Vessel vessel, float predictionTime = 10)
{
return vessel.CoM + vessel.Velocity() * predictionTime + 0.5f * vessel.acceleration_immediate * Math.Pow(predictionTime, 2);
}

public static float GetRadarAltitudeAtPos(Vector3 position)
{
double latitudeAtPos = FlightGlobals.currentMainBody.GetLatitude(position);
double longitudeAtPos = FlightGlobals.currentMainBody.GetLongitude(position);

float radarAlt = Mathf.Clamp(
(float)(FlightGlobals.currentMainBody.GetAltitude(position) -
FlightGlobals.currentMainBody.TerrainAltitude(latitudeAtPos, longitudeAtPos)), 0,
(float)FlightGlobals.currentMainBody.GetAltitude(position));
return radarAlt;
}
}
}
5 changes: 0 additions & 5 deletions BDArmory.Core/Module/HitpointTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public class HitpointTracker : PartModule
UI_ProgressBar(affectSymCounterparts = UI_Scene.None, controlEnabled = false, scene = UI_Scene.All, maxValue = 100000, minValue = 0, requireFullControl = false)]
public float Hitpoints;

[KSPField]
bool hasPrefabRun = false;

[KSPField(isPersistant = true, guiActive = true, guiActiveEditor = true, guiName = "Armor Thickness"),
UI_FloatRange(minValue = 1f, maxValue = 500f, stepIncrement = 5f, scene = UI_Scene.All)]
public float Armor = 10f;
Expand Down Expand Up @@ -41,7 +38,6 @@ public class HitpointTracker : PartModule
private readonly float hitpointMultiplier = BDArmorySettings.HITPOINT_MULTIPLIER;

private float previousHitpoints;
private bool _firstSetup = true;
private bool _updateHitpoints = false;
private bool _forceUpdateHitpointsUI = false;
private const int HpRounding = 100;
Expand Down Expand Up @@ -101,7 +97,6 @@ public void SetupPrefab()
if (!ArmorSet) overrideArmorSetFromConfig();

previousHitpoints = maxHitPoints_;
hasPrefabRun = true;
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions BDArmory.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
// 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.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyVersion("1.3.2.0")]
[assembly: AssemblyFileVersion("1.3.2.0")]
[assembly: KSPAssembly("BDArmory.Core", 1, 0)]
3 changes: 3 additions & 0 deletions BDArmory.Core/Services/ModuleDamageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public override string GetExplodeMode_svc(Part p)

public override bool HasFireFX_svc(Part p)
{
if (p == null) return false;
if (p.Modules.GetModule<HitpointTracker>() == null) return false;

return p.Modules.GetModule<HitpointTracker>().GetFireFX();
}

Expand Down
76 changes: 63 additions & 13 deletions BDArmory/BDArmory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
<OutputType>Library</OutputType>
<RootNamespace>BDArmory</RootNamespace>
<AssemblyName>BDArmory</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
Expand All @@ -36,11 +37,12 @@
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;ENABLE_PROFILER</DefineConstants>
<DebugType>full</DebugType>
<DebugType>portable</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<LangVersion>default</LangVersion>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -49,28 +51,80 @@
<CodeAnalysisRuleSet>BasicCorrectnessRules.ruleset</CodeAnalysisRuleSet>
<Optimize>true</Optimize>
<CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Reference Include="Assembly-CSharp">
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\_LocalDev\KSPRefs\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="KSPAssets">
<Reference Include="KSPAssets, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\KSPAssets.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="UnityEngine">
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.AssetBundleModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ImageConversionModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.ImageConversionModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.InputModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.JSONSerializeModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.JSONSerializeModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.ParticleSystemModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.ParticleSystemModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextCoreModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.TextCoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIElementsModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UIElementsModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
<HintPath>..\..\_LocalDev\KSPRefs\UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Guidances\BallisticGuidance.cs" />
<Compile Include="Guidances\IGuidance.cs" />
<Compile Include="Misc\BDTeam.cs" />
<Compile Include="UI\BDStagingAreaGauge.cs" />
<Compile Include="UI\BDAEditorCategory.cs" />
Expand Down Expand Up @@ -625,10 +679,6 @@ xcopy /E /Y "$(TargetDir)"BDArmory*.dll "$(ProjectDir)Distribution\GameData\%25M

if $(ConfigurationName) == Debug (
@echo building debug files and symbols...
FOR %25%25A IN ("$(TargetDir)"BDArmory*.dll) DO (
call "%25PDB2MDB_EXE%25" %25%25A
)
copy /Y "$(TargetDir)"BDArmory*.dll.mdb "%25KSP_DIR%25\GameData\%25ModName%25\Plugins\"
copy /Y "$(TargetDir)"BDArmory*.pdb "%25KSP_DIR%25\GameData\%25ModName%25\Plugins\"
)

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions BDArmory/Distribution/GameData/BDArmory/BDArmory.version
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
{
"MAJOR":1,
"MINOR":3,
"PATCH":1,
"PATCH":2,
"BUILD":0
},
"KSP_VERSION":
{
"MAJOR":1,
"MINOR":7,
"PATCH":0
"MINOR":8,
"PATCH":1
},
"KSP_VERSION_MIN":
{
"MAJOR":1,
"MINOR":7,
"PATCH":0
"MINOR":8,
"PATCH":1
},
"KSP_VERSION_MAX":
{
"MAJOR":1,
"MINOR":7,
"MINOR":8,
"PATCH":999
}
}
Loading

0 comments on commit 2061875

Please sign in to comment.