Skip to content

Commit

Permalink
Merge pull request #101 from dkavolis/dev
Browse files Browse the repository at this point in the history
0.16.0.0 Update
  • Loading branch information
dkavolis authored Aug 26, 2020
2 parents a87a4cd + 3b04f0f commit e22225a
Show file tree
Hide file tree
Showing 221 changed files with 7,961 additions and 2,147 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ dotnet_style_predefined_type_for_locals_parameters_members=true:hint
dotnet_style_predefined_type_for_member_access=true:hint

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators=always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators=always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators=always_for_clarity:silent
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:silent
dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:silent
dotnet_style_parentheses_in_other_operators=never_if_unnecessary:silent

# Modifier preferences
Expand Down
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ obj
/Ships
/GameData/FerramAerospaceResearch/Custom*.cfg
/GameData/FerramAerospaceResearch/FARForceDataUpdate.cfg
GameData/FerramAerospaceResearch/Plugins/FARLogger_*
*.suo
*.DotSettings
*.user
Expand All @@ -20,9 +21,6 @@ releases
.pytest_cache
*.pyc

// unignore Debug build DLLs
!bin/[Dd]ebug/[Ff]erram*.dll

// Rider
.idea

Expand All @@ -35,6 +33,7 @@ Unity/FerramAerospaceResearch*/[Oo]bj/
Unity/FerramAerospaceResearch*/[Bb]uild/
Unity/FerramAerospaceResearch*/[Bb]uilds/
Unity/FerramAerospaceResearch*/[Ll]ogs/
Unity/[Bb]uild/

# Never ignore Asset meta data
!Unity/FerramAerospaceResearch*/[Aa]ssets/**/*.meta
Expand Down Expand Up @@ -91,10 +90,14 @@ Unity/FerramAerospaceResearch*/[Aa]ssets/PartTools
Unity/FerramAerospaceResearch*/[Aa]ssets/SquadCore

# External editor scripts
Unity/FerramAerospaceResearch*/[Aa]ssets/Editor/**/*
Unity/FerramAerospaceResearch*/[Aa]ssets/Editor/*
!Unity/FerramAerospaceResearch*/[Aa]ssets/Editor/Bundle.cs
!Unity/FerramAerospaceResearch*/[Aa]ssets/Editor/Assets.cs
!Unity/FerramAerospaceResearch*/[Aa]ssets/Editor/Tests/

# Rider generated files in Unity directory
Unity/FerramAerospaceResearch*/[Aa]ssets/Plugins/Editor*
Unity/FerramAerospaceResearch*/.idea

# burst compiler
Logs/*
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<KSP_DIR_BUILD>C:\Zaidimai\KSP 1.9.0\</KSP_DIR_BUILD>
<PostBuildCommand>
<PropertyGroup>
<KSP_DIR_BUILD>C:\Zaidimai\KSP 1.10\</KSP_DIR_BUILD>
<PostBuildCommand>
cd "$(SolutionDir)""
python -m buildtools postbuild -f "$(SolutionDir)config.json" -c "$(Configuration)" -t</PostBuildCommand>
</PropertyGroup>
</PropertyGroup>
</Project>
19 changes: 19 additions & 0 deletions FerramAerospaceResearch.Base/Config/DebugConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using FerramAerospaceResearch.Reflection;

namespace FerramAerospaceResearch.Config
{
[ConfigNode("Debug")]
public class DebugConfig
{
[ConfigValue("logLevel")]
public static LogLevel Level
{
get { return FARLogger.Level; }
set { FARLogger.Level = value; }
}

// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global - reflection
[ConfigValue("dumpOnLoad")]
public bool DumpOnLoad { get; set; } = false;
}
}
29 changes: 29 additions & 0 deletions FerramAerospaceResearch.Base/Config/FlightLogConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using FerramAerospaceResearch.Reflection;

namespace FerramAerospaceResearch.Config
{
[ConfigNode("FlightLog")]
public class FlightLogConfig
{
private string directory = PathUtil.Combine(PathUtil.PParentDir, "Logs", PathUtil.ModDirectoryName);

[ConfigValue("directory")]
public string Directory
{
get { return directory; }
set { directory = PathUtil.Combine(PathUtil.PParentDir, value); }
}

[ConfigValue("nameFormat")]
public StringFormatter NameFormat { get; } = new StringFormatter("<<<VESSEL_NAME>>>_<<<DATETIME>>>.csv");

[ConfigValue("datetimeFormat")]
public string DatetimeFormat { get; set; } = "yyyy_MM_dd_HH_mm_ss";

[ConfigValue("period")]
public Observable<int> LogPeriod { get; } = new Observable<int>(50);

[ConfigValue("flushPeriod")]
public Observable<int> FlushPeriod { get; } = new Observable<int>(10);
}
}
44 changes: 44 additions & 0 deletions FerramAerospaceResearch.Base/Config/GUIColors.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using FerramAerospaceResearch.Reflection;
using UnityEngine;

namespace FerramAerospaceResearch.Config
{
[ConfigNode("GuiColors")]
public class GUIColors
{
private readonly Color[] colors = {Color.cyan, Color.red, Color.yellow, Color.green};

[ConfigValue]
public Color ClColor
{
get { return colors[0]; }
set { colors[0] = value; }
}

[ConfigValue]
public Color CdColor
{
get { return colors[1]; }
set { colors[1] = value; }
}

[ConfigValue]
public Color CmColor
{
get { return colors[2]; }
set { colors[2] = value; }
}

[ConfigValue("L_DColor")]
public Color LdColor
{
get { return colors[3]; }
set { colors[3] = value; }
}

public Color GetColor(int index)
{
return colors[index];
}
}
}
52 changes: 52 additions & 0 deletions FerramAerospaceResearch.Base/Config/ResourceNode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using FerramAerospaceResearch.Reflection;

namespace FerramAerospaceResearch.Config
{
public class ResourceNode
{
public ResourceNode(string url = "", string loader = "default")
{
Url.Value = url;
Loader.Value = loader;
}

[ConfigValue("url")]
public Observable<string> Url { get; } = new Observable<string>();

[ConfigValue("loader")]
public Observable<string> Loader { get; } = new Observable<string>("default");

public static implicit operator string(ResourceNode node)
{
return node.Url;
}
}

[ConfigNode("TEXTURE")]
public class TextureNode : ResourceNode
{
public TextureNode(string url = "", string loader = "default") : base(url, loader)
{
}
}

[ConfigNode("SHADER")]
public class ShaderNode : ResourceNode
{
public ShaderNode(string url = "", string loader = "default") : base(url, loader)
{
}
}

[ConfigNode("SHADER")]
public class DebugVoxelNode : ShaderNode
{
public DebugVoxelNode(string url = "", string loader = "default") : base(url, loader)
{
}

[ConfigValue("_Cutoff")]
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Global - reflection
public float Cutoff { get; set; } = 0.45f;
}
}
32 changes: 32 additions & 0 deletions FerramAerospaceResearch.Base/Config/ShaderConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using FerramAerospaceResearch.Reflection;

namespace FerramAerospaceResearch.Config
{
[ConfigNode("Shaders")]
public class ShaderConfig
{
[ConfigValue("bundleLinux")]
public Observable<string> BundleLinux { get; } =
new Observable<string>("FerramAerospaceResearch/Assets/farshaders_linux.far",
PathUtil.CombineDelegate(PathUtil.ParentDir));

[ConfigValue("bundleWindows")]
public Observable<string> BundleWindows { get; } =
new Observable<string>("FerramAerospaceResearch/Assets/farshaders_windows.far",
PathUtil.CombineDelegate(PathUtil.ParentDir));

[ConfigValue("bundleMac")]
public Observable<string> BundleMac { get; } =
new Observable<string>("FerramAerospaceResearch/Assets/farshaders_macosx.far",
PathUtil.CombineDelegate(PathUtil.ParentDir));

[ConfigValue("debugVoxel")]
public DebugVoxelNode DebugVoxel { get; } = new DebugVoxelNode("FerramAerospaceResearch/Debug Voxel Mesh");

[ConfigValue("lineRenderer")]
public ShaderNode LineRenderer { get; } = new ShaderNode("Hidden/Internal-Colored");

[ConfigValue("debugVoxelFallback")]
public ShaderNode DebugVoxelFallback { get; } = new ShaderNode("Sprites/Default");
}
}
20 changes: 20 additions & 0 deletions FerramAerospaceResearch.Base/Config/TextureConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using FerramAerospaceResearch.Reflection;

namespace FerramAerospaceResearch.Config
{
[ConfigNode("Textures")]
public class TextureConfig
{
[ConfigValue("iconButtonBlizzy")]
public TextureNode IconButtonBlizzy { get; } =
new TextureNode("FerramAerospaceResearch/Textures/icon_button_blizzy");

[ConfigValue("iconButtonStock")]
public TextureNode IconButtonStock { get; } =
new TextureNode("FerramAerospaceResearch/Textures/icon_button_stock");

[ConfigValue("spriteDebugVoxel")]
public TextureNode SpriteDebugVoxel { get; } =
new TextureNode("FerramAerospaceResearch/Textures/sprite_debug_voxel");
}
}
24 changes: 24 additions & 0 deletions FerramAerospaceResearch.Base/FARAddonAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;

namespace FerramAerospaceResearch
{
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public class FARAddonAttribute : Attribute
{
/// <summary>
/// Whether this addon should have its reference kept after instantiation
/// </summary>
public readonly bool Persistant;

/// <summary>
/// Priority of instantiation, higher values get instantiated earlier
/// </summary>
public readonly int Priority;

public FARAddonAttribute(int priority = 0, bool persistant = false)
{
Priority = priority;
Persistant = persistant;
}
}
}
Loading

0 comments on commit e22225a

Please sign in to comment.