Skip to content

Commit

Permalink
1170 for KSP 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbudda committed Oct 17, 2019
1 parent 0c33609 commit 986e407
Show file tree
Hide file tree
Showing 20 changed files with 145 additions and 87 deletions.
Binary file modified Assets/Plugins/KerbalEngineer.Unity.dll
Binary file not shown.
6 changes: 6 additions & 0 deletions Documents/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.1.7.0, 2019-10-16, KSP 1.8.0 #2686
- Update to KSP 1.8, target .NET 4.
- Fix readout colors reverting to default on GUI size change.
- Improve handling of invalid or outdated xml settings.
- Removed MiniAVC.dll for now.

1.1.6.0, 2019-4-10, KSP 1.7.0 #2483
- Version bump for 1.7.0
- Show localized biome name
Expand Down
3 changes: 0 additions & 3 deletions KerbalEngineer.Editor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.XML" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="UnityEngine">
<HintPath>Library\UnityAssemblies\UnityEngine.dll</HintPath>
<Private>False</Private>
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer.Unity/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[assembly: AssemblyTitle("KerbalEngineer.Unity")]
[assembly: AssemblyProduct("KerbalEngineer.Unity")]
[assembly: AssemblyCopyright("Copyright © CYBUTEK 2016")]
[assembly: AssemblyCopyright("Copyright © CYBUTEK/jrbudda 2019")]
[assembly: ComVisible(false)]
[assembly: Guid("5387bb1e-32b1-4bac-b03f-100570b9554c")]
[assembly: AssemblyVersion("1.0.0.0")]
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/EngineerGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class EngineerGlobals
/// <summary>
/// Current version of the Kerbal Engineer assembly.
/// </summary>
public const string ASSEMBLY_VERSION = "1.1.6.0";
public const string ASSEMBLY_VERSION = "1.1.7.0";

private static string assemblyFile;
private static string assemblyName;
Expand Down
8 changes: 7 additions & 1 deletion KerbalEngineer/Flight/FlightAppLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ public static bool IsHoverActivated
{
get
{
return GeneralSettings.Handler.Get("FlightAppLauncher_IsHoverActivated", true);
try
{
return GeneralSettings.Handler.Get("FlightAppLauncher_IsHoverActivated", true);
} catch
{
return true;
}
}

set
Expand Down
17 changes: 13 additions & 4 deletions KerbalEngineer/Flight/Readouts/Miscellaneous/Separator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,32 @@ public Separator()

public override void Draw(Unity.Flight.ISectionModule section)
{
GUILayout.Box(String.Empty, section.IsHud ? this.boxStyleHud : this.boxStyle);
GUILayout.Box("WHY THO", section.IsHud ? this.boxStyleHud : this.boxStyle);
}

#endregion

#region Methods: private

private static readonly Texture2D tex = TextureHelper.CreateTextureFromColour(new Color(1.0f, 1.0f, 1.0f, 0.5f));

private void InitialiseStyles()
{
this.boxStyle = new GUIStyle
{
normal =
{
background = TextureHelper.CreateTextureFromColour(new Color(1.0f, 1.0f, 1.0f, 0.5f))
background = tex,
textColor = new Color(1,1,1,0.5f)
},
active =
{
background = tex
},
fixedHeight = 1.0f,
stretchWidth = true
border = new RectOffset(0,0,0,1),
fixedHeight = 0.0f,
stretchWidth = true,
imagePosition = ImagePosition.ImageOnly
};

this.boxStyleHud = new GUIStyle(this.boxStyle)
Expand Down
12 changes: 11 additions & 1 deletion KerbalEngineer/Flight/Readouts/ReadoutModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System;

using KerbalEngineer.Flight.Sections;

using KerbalEngineer.Settings;
using UnityEngine;

#endregion
Expand Down Expand Up @@ -243,6 +243,11 @@ private void InitialiseStyles(bool force) {

if (NameStyle != null && !force) return;

ReadoutModule existing = ReadoutLibrary.GetReadout(this.Name);
Color c = HighLogic.Skin.label.normal.textColor;
if (existing != null)
c = existing.ValueStyle.normal.textColor;

NameStyle = new GUIStyle(HighLogic.Skin.label) {
normal =
{
Expand Down Expand Up @@ -309,6 +314,11 @@ private void InitialiseStyles(bool force) {
fontSize = (int)(11 * GuiDisplaySize.Offset),
fixedHeight = 18.0f * GuiDisplaySize.Offset
};


this.ValueStyle.normal.textColor = c;


}

private void OnSizeChanged() {
Expand Down
8 changes: 4 additions & 4 deletions KerbalEngineer/Flight/Sections/SectionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private void DrawCategories() {
/// </summary>
private void DrawCategorySelector() {
this.categoryList.enabled = GUILayout.Toggle(this.categoryList.enabled, "▼ SELECTED CATEGORY: " + ReadoutCategory.Selected.ToString().ToUpper() + "", this.categoryTitleButtonStyle);
if (Event.current.type == EventType.repaint) {
if (Event.current.type == EventType.Repaint) {
this.categoryList.SetPosition(GUILayoutUtility.GetLastRect().Translate(this.position), GUILayoutUtility.GetLastRect());
}
}
Expand Down Expand Up @@ -276,7 +276,7 @@ private void DrawInstalledReadouts() {
colorPicker.enabled = true;
}

if (Event.current.type == EventType.repaint && editingReadout == readout) {
if (Event.current.type == EventType.Repaint && editingReadout == readout) {
colorPicker.SetPosition(GUILayoutUtility.GetLastRect().Translate(this.position).Translate(new Rect(8, scrollRectInstalled.y - scrollPositionInstalled.y, 8, 8)), new Rect(0, 0, 180, 20));
}

Expand All @@ -300,7 +300,7 @@ private void DrawInstalledReadouts() {

GUILayout.EndScrollView();

if (Event.current.type == EventType.repaint) {
if (Event.current.type == EventType.Repaint) {
scrollRectInstalled = GUILayoutUtility.GetLastRect();
}

Expand Down Expand Up @@ -332,7 +332,7 @@ private void DrawPresetSaveButton() {
/// </summary>
private void DrawPresetSelector() {
this.presetList.enabled = GUILayout.Toggle(this.presetList.enabled, "▼ PRESETS ▼", this.categoryTitleButtonStyle, GUILayout.Width(150.0f));
if (Event.current.type == EventType.repaint) {
if (Event.current.type == EventType.Repaint) {
this.presetList.SetPosition(GUILayoutUtility.GetLastRect().Translate(this.position), GUILayoutUtility.GetLastRect());
}
}
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/Flight/Sections/SectionModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public bool IsHud {
/// <summary>
/// Gets the number of drawn readout lines.
/// </summary>
public int LineCount { get; private set; }
public int LineCount { get; set; }

/// <summary>
/// Gets and sets the name of the section.
Expand Down
58 changes: 29 additions & 29 deletions KerbalEngineer/GuiDisplaySize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#region Using Directives

using System;

using System.Diagnostics;
using KerbalEngineer.Settings;

#endregion
Expand Down Expand Up @@ -51,46 +51,46 @@ static GuiDisplaySize()
try
{
var handler = SettingHandler.Load("GuiDisplaySize.xml");
handler.GetSet("multiplier", ref multiplier);
handler.GetSet("increment", ref increment);
handler.Set("multiplier", 1.1);
increment = handler.GetSet("increment", increment);
handler.Save("GuiDisplaySize.xml");
offset = 1 + (increment * multiplier) - increment;
}
catch (Exception ex)
{
MyLogger.Exception(ex, "GuiDisplaySize->GuiDisplaySize");
}
offset = 1 + (increment * multiplier) - increment;
}

#endregion

#region Properties

public static float Multiplier
{
get { return multiplier; }
set
{
try
{
if (multiplier == value)
{
return;
}

multiplier = value;
var handler = SettingHandler.Load("GuiDisplaySize.xml");
handler.Set("multiplier", multiplier);
handler.Save("GuiDisplaySize.xml");
offset = 1 + (increment * multiplier) - increment;
OnSizeChanged();
}
catch (Exception ex)
{
MyLogger.Exception(ex, "GuiDisplaySize->Multiplier");
}
}
}
//public static float Multiplier
//{
// get { return multiplier; }
// set
// {
// try
// {
// if (multiplier == value)
// {
// return;
// }

// multiplier = value;
// var handler = SettingHandler.Load("GuiDisplaySize.xml");
// handler.Set("multiplier", multiplier);
// handler.Save("GuiDisplaySize.xml");
// offset = 1 + (increment * multiplier) - increment;
// OnSizeChanged();
// }
// catch (Exception ex)
// {
// MyLogger.Exception(ex, "GuiDisplaySize->Multiplier");
// }
// }
//}

public static int Increment
{
Expand Down
43 changes: 36 additions & 7 deletions KerbalEngineer/KerbalEngineer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>KerbalEngineer</RootNamespace>
<AssemblyName>KerbalEngineer</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
Expand All @@ -21,6 +22,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
Expand All @@ -32,6 +34,7 @@
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="AppLauncherButton.cs" />
Expand Down Expand Up @@ -291,10 +294,6 @@
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System">
<HintPath>..\Game\KSP_Data\Managed\System.dll</HintPath>
<Private>False</Private>
Expand All @@ -307,19 +306,49 @@
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.AssetBundleModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AssetBundleModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.PhysicsModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>X:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UIModule.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\KerbalEngineer.Unity\KerbalEngineer.Unity.csproj">
<Project>{5387bb1e-32b1-4bac-b03f-100570b9554c}</Project>
<Name>KerbalEngineer.Unity</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="PostBuildMacros">
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
Expand Down
2 changes: 1 addition & 1 deletion KerbalEngineer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("CYBUTEK")]
[assembly: AssemblyProduct("KerbalEngineer")]
[assembly: AssemblyCopyright("Copyright © CYBUTEK 2013")]
[assembly: AssemblyCopyright("Copyright © CYBUTEK/jrbudda 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
Loading

0 comments on commit 986e407

Please sign in to comment.