Skip to content

Commit

Permalink
Initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DMagic1 committed Sep 20, 2016
1 parent 034257d commit d2e195d
Show file tree
Hide file tree
Showing 9 changed files with 1,057 additions and 0 deletions.
31 changes: 31 additions & 0 deletions GameData/KerbNetController/License.txt
@@ -0,0 +1,31 @@
The MIT License (MIT)
KerbNet Controller

Copyright (c) 2016 DMagic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


---------------

License for texture created by DMagic:

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License


Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Source/BetterKerbNet.sln
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BetterKerbNet", "BetterKerbNet\BetterKerbNet.csproj", "{5E84FA70-913F-4B8A-B186-C6F5CF95411D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5E84FA70-913F-4B8A-B186-C6F5CF95411D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E84FA70-913F-4B8A-B186-C6F5CF95411D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E84FA70-913F-4B8A-B186-C6F5CF95411D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5E84FA70-913F-4B8A-B186-C6F5CF95411D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
63 changes: 63 additions & 0 deletions Source/BetterKerbNet/BetterKerbNet.csproj
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5E84FA70-913F-4B8A-B186-C6F5CF95411D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BetterKerbNet</RootNamespace>
<AssemblyName>BetterKerbNet</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Output\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>Output\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\KSP Dev\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine">
<HintPath>..\..\KSP Dev\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\KSP Dev\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="KerbNetDevourerSettings.cs" />
<Compile Include="KerbNetStorage.cs" />
<Compile Include="KerbNetToolbar.cs" />
<Compile Include="ModuleKerbNetDevourer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
118 changes: 118 additions & 0 deletions Source/BetterKerbNet/KerbNetDevourerSettings.cs
@@ -0,0 +1,118 @@
#region license
/*The MIT License (MIT)
KerbNetDevourerSettings - In game settings for KerbNet Controller
Copyright (c) 2016 DMagic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion

using System.Reflection;
using UnityEngine;

namespace BetterKerbNet
{

public class KerbNetDevourerSettings : GameParameters.CustomParameterNode
{
private const string easyDescription = "The best possible FoV range and anomaly scanning chance is used for all KerbNet display modes";
private const string medDescription = "The best FoV range and anomaly scanning chance are calculated separately for each KerbNet display mode";
private const string hardDescription = "Individual KerbNet scanning modules are used to set the FoV range ane anomaly scanning chance for each display mode";

[GameParameters.CustomIntParameterUI("FoV Difficulty", toolTip = "", minValue = 0, maxValue = 2, autoPersistance = true)]
public int setting = 1;
[GameParameters.CustomStringParameterUI("Selected Mode:", lines = 4, autoPersistance = false)]
public string description;
[GameParameters.CustomParameterUI("Show Tooltips", autoPersistance = true)]
public bool showTooltips = true;
[GameParameters.CustomParameterUI("Remember Last FoV Value", autoPersistance = true)]
public bool rememberFoV;
[GameParameters.CustomParameterUI("Remember Last Display Mode", toolTip = "Automatically start in the same display mode as when last used", autoPersistance = true)]
public bool rememberMode;
[GameParameters.CustomParameterUI("Remember Last Overlay Mode", toolTip = "Automatically adjust the grid overlay to that when last used", autoPersistance = true)]
public bool rememberOverlay;
[GameParameters.CustomParameterUI("Remember Auto-Refresh Setting", autoPersistance = true)]
public bool autoRefresh;

public override GameParameters.GameMode GameMode
{
get { return GameParameters.GameMode.ANY; }
}

public override bool HasPresets
{
get { return true; }
}

public override string Section
{
get { return "DMagic Mods"; }
}

public override int SectionOrder
{
get { return 1; }
}

public override string Title
{
get { return "KerbNet Controller"; }
}

public override void SetDifficultyPreset(GameParameters.Preset preset)
{
switch (preset)
{
case GameParameters.Preset.Easy:
case GameParameters.Preset.Normal:
description = easyDescription;
setting = 0;
break;
case GameParameters.Preset.Moderate:
case GameParameters.Preset.Custom:
description = medDescription;
setting = 1;
break;
case GameParameters.Preset.Hard:
description = hardDescription;
setting = 2;
break;
}
}

public override bool Enabled(MemberInfo member, GameParameters parameters)
{
switch(setting)
{
case 0:
default:
description = easyDescription;
break;
case 1:
description = medDescription;
break;
case 2:
description = hardDescription;
break;
}

return true;
}
}
}
54 changes: 54 additions & 0 deletions Source/BetterKerbNet/KerbNetStorage.cs
@@ -0,0 +1,54 @@
#region license
/*The MIT License (MIT)
KerbNetStorage - Storage module for some KerbNet interface information
Copyright (c) 2016 DMagic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion

using KSP.UI.Dialogs;

namespace BetterKerbNet
{
public class KerbNetStorage
{
private string _mode;

public KerbNetStorage(string m)
{
_mode = m;
}

public float BestMinFoV;
public float BestMaxFoV;
public float BestAnomalyChance;
public float WidestRange;
public float MaxFoV;
public float MinFoV;
public Part CurrentPart;
public IAccessKerbNet Accessor;

public string Mode
{
get { return _mode; }
}

}
}

0 comments on commit d2e195d

Please sign in to comment.