Skip to content

Commit

Permalink
upgrade to ksp 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodrigv committed Oct 24, 2019
1 parent 47da57a commit 3af4d95
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 38 deletions.
58 changes: 52 additions & 6 deletions BDArmory.Core/BDArmory.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<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>
Expand All @@ -21,6 +22,7 @@
<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
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
72 changes: 60 additions & 12 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 Down Expand Up @@ -41,6 +42,7 @@
<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,26 +51,76 @@
<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" />
Expand Down Expand Up @@ -627,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
6 changes: 3 additions & 3 deletions BDArmory/Modules/ModuleTargetingCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -765,15 +765,15 @@ void WindowTargetCam(int windowID)
{
if (!SlewingMouseCam) SlewingMouseCam = true;
}
if (Event.current.type == EventType.repaint && SlewingMouseCam)
if (Event.current.type == EventType.Repaint && SlewingMouseCam)
{
if (Mouse.delta.x != 0 && Mouse.delta.y != 0)
{
SlewRoutine(Mouse.delta);
}
}

if (Event.current.type == EventType.repaint && imageRect.Contains(Event.current.mousePosition))
if (Event.current.type == EventType.Repaint && imageRect.Contains(Event.current.mousePosition))
{
if (!wasZooming) isZooming = true;
}
Expand All @@ -782,7 +782,7 @@ void WindowTargetCam(int windowID)
{
ZoomRoutine(Input.mouseScrollDelta);
}
if (Event.current.type == EventType.repaint && !imageRect.Contains(Event.current.mousePosition))
if (Event.current.type == EventType.Repaint && !imageRect.Contains(Event.current.mousePosition))
{
if (wasZooming) isZooming = false;
}
Expand Down
2 changes: 1 addition & 1 deletion BDArmory/UI/BDGUIComboBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public int Show()

switch (Event.current.GetTypeForControl(controlID))
{
case EventType.mouseUp:
case EventType.MouseUp:
{
if (isClickedComboButton)
{
Expand Down
2 changes: 1 addition & 1 deletion BDArmory/UI/BDTeamSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private void TeamSelectorWindow(int id)
GUI.EndScrollView();

// Buttons
if (Event.current.type == EventType.keyUp)
if (Event.current.type == EventType.KeyUp)
{
if ((Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.KeypadEnter) && !string.IsNullOrEmpty(newTeamName.Trim()))
{
Expand Down

0 comments on commit 3af4d95

Please sign in to comment.