Skip to content

Commit

Permalink
Merge pull request #26 from Sigma88/Development
Browse files Browse the repository at this point in the history
Sigma Dimensions v0.7.0
  • Loading branch information
Sigma88 committed Dec 4, 2016
2 parents ad09849 + c6b0518 commit 4f12080
Show file tree
Hide file tree
Showing 16 changed files with 324 additions and 53 deletions.
7 changes: 7 additions & 0 deletions Changelog.txt
@@ -1,3 +1,10 @@
**v0.7.0**

- Included SigmaDimensions.dll plugin
- Added the parameter resizeBuildings
- Added support for PQSCity repositioning


**v0.6.3**

- Fixed display of atmosphere pressure in the tracking station
Expand Down
Expand Up @@ -97,12 +97,4 @@
}
}
}
@Body[Kerbin]
{
%SpaceCenter
{
&heightMapDeformity = 70
&absoluteOffset = 0
}
}
}
24 changes: 9 additions & 15 deletions GameData/Sigma/Dimensions/Configs/ReDimension/advancedSettings.cfg
Expand Up @@ -56,6 +56,14 @@
{
%scanAltitude = 1
}
@SigmaDimensions:HAS[~resizeBuildings[>0],#Resize[<1]]:AFTER[SigDim]
{
%resizeBuildings = #$Resize$
}
@SigmaDimensions:HAS[~resizeBuildings[>0],~Resize[<1]]:AFTER[SigDim]
{
%resizeBuildings = 1
}

// Create SigmaDimensions node in each body

Expand All @@ -64,21 +72,7 @@
@Body,*
{
!SigmaDimensions,* {}
SigmaDimensions
{
Resize = #$@SigmaDimensions/Resize$
Rescale = #$@SigmaDimensions/Rescale$
Atmosphere = #$@SigmaDimensions/Atmosphere$
dayLengthMultiplier = #$@SigmaDimensions/dayLengthMultiplier$
geeASLmultiplier = #$@SigmaDimensions/geeASLmultiplier$
landscape = #$@SigmaDimensions/landscape$
atmoVisualEffect = #$@SigmaDimensions/atmoVisualEffect$
resizeScatter = #$@SigmaDimensions/resizeScatter$
CustomSoISize = #$@SigmaDimensions/CustomSoISize$
CustomRingSize = #$@SigmaDimensions/CustomRingSize$
atmoASL = #$@SigmaDimensions/atmoASL$
tempASL = #$@SigmaDimensions/tempASL$
}
#@SigmaDimensions {}
}
@Asteroid,*
{
Expand Down

This file was deleted.

22 changes: 2 additions & 20 deletions GameData/Sigma/Dimensions/Configs/ReDimension/setDimensions.cfg
Expand Up @@ -64,18 +64,6 @@
@innerRadius *= #$../../SigmaDimensions/CustomRingSize$
}
}
@SpaceCenter
{
%Resize = #$../SigmaDimensions/Resize$
%landscape = #$../SigmaDimensions/landscape$
@heightMapDeformity *= 0.9255
@absoluteOffset += #$heightMapDeformity$
@absoluteOffset *= #$Resize$
@absoluteOffset *= #$landscape$
@heightMapDeformity = 0
%repositionRadiusOffset = #$absoluteOffset$
@repositionRadiusOffset -= 22.3
}
@Ocean,*
{
@HazardousOcean,*
Expand All @@ -90,14 +78,6 @@
@key,* ^= : 0 0 0 x$: :
}
}
@SpaceCenter:HAS[#Resize[<0.75],#Resize[>0.009]]
{
@Resize = 0.75
}
@SpaceCenter
{
@radius *= #$Resize$
}
}
@Body[Kerbin]:HAS[~removePQSmods[*MapDecalTangent*]]
{
Expand All @@ -109,13 +89,15 @@
{
%Resize = #$../../../SigmaDimensions/Resize$
@radius /= #$Resize$
@Resize /= #$../../../SigmaDimensions/resizeBuildings$
}
@MapDecalTangent:HAS[#Resize[<0.75],#Resize[>0.009]]
{
@Resize = 0.75
}
@MapDecalTangent
{
@Resize *= #$../../../SigmaDimensions/resizeBuildings$
@radius *= #$Resize$
}
}
Expand Down
4 changes: 2 additions & 2 deletions GameData/Sigma/Dimensions/Configs/Sigma-Dimensions.version
Expand Up @@ -12,8 +12,8 @@
"VERSION":
{
"MAJOR": 0,
"MINOR": 6,
"PATCH": 3,
"MINOR": 7,
"PATCH": 0,
"BUILD": 0
},
"KSP_VERSION":
Expand Down
Binary file not shown.
9 changes: 9 additions & 0 deletions GameData/Sigma/Dimensions/README.txt
Expand Up @@ -128,6 +128,15 @@ Altitude limits for orbital scanners is multiplied by the "Resize" and "scanAlti

---

# resizeBuildings (default value = 0)

- Automatic when zero, custom when set to a positive number.

AUTOMATIC: buildings size is multiplied by "Resize" when shrinking planets.
CUSTOM: buildings size is multiplied by this parameter.

---




Expand Down
1 change: 1 addition & 0 deletions GameData/Sigma/Dimensions/Settings.cfg
Expand Up @@ -23,4 +23,5 @@ SigmaDimensions
atmoASL = 1
tempASL = 1
scanAltitude = 1
resizeBuildings = 0
}
Binary file added [Source]/Distribution/SigmaDimensions.dll
Binary file not shown.
13 changes: 13 additions & 0 deletions [Source]/SigmaDimensions/Properties/AssemblyInfo.cs
@@ -0,0 +1,13 @@
using System.Reflection;

[assembly: AssemblyTitle("Sigma Dimensions")]
[assembly: AssemblyDescription("The universal rescale mod for KSP.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Sigma88")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Copyright (C) Sigma88 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: KSPAssembly("SigmaDimensions", 1, 0)]
[assembly: KSPAssemblyDependency("Kopernicus", 1, 0)]
[assembly: AssemblyVersion("1.0.0")]
98 changes: 98 additions & 0 deletions [Source]/SigmaDimensions/SigmaDimensions.cs
@@ -0,0 +1,98 @@
using UnityEngine;
using Kopernicus;


namespace SigmaDimensionsPlugin
{
[KSPAddon(KSPAddon.Startup.MainMenu, true)]
public class SigmaDimensions : MonoBehaviour
{
public double resize = 1;
public double landscape = 1;
public double resizeBuildings = 1;
public CelestialBody body = null;

void Start()
{
foreach (CelestialBody cb in FlightGlobals.Bodies)
{
body = cb;
resize = body.Has("resize") ? body.Get<double>("resize") : 1;
landscape = body.Has("landscape") ? body.Get<double>("landscape") : 1;
resizeBuildings = body.Has("resizeBuildings") ? body.Get<double>("resizeBuildings") : 1;

foreach (PQSCity mod in body.GetComponentsInChildren<PQSCity>(true))
{
CityFixer(mod);
}

foreach (PQSCity2 mod in body.GetComponentsInChildren<PQSCity2>(true))
{
City2Fixer(mod);
}
}
}

void CityFixer(PQSCity pqs)
{
double groundLevel = body.pqsController.GetSurfaceHeight(pqs.repositionRadial) - body.Radius;

if (!pqs.repositionToSphere && !pqs.repositionToSphereSurface)
{
// Offset = Distance from the center of the planet

double fromRadius = pqs.repositionRadiusOffset - (body.Radius / resize);
double builtInOffset = fromRadius - groundLevel / (resize * landscape);

pqs.repositionRadiusOffset = body.Radius + groundLevel + builtInOffset * resizeBuildings;
}
if (pqs.repositionToSphere && !pqs.repositionToSphereSurface)
{
// Offset = Distance from the radius of the planet

double builtInOffset = pqs.repositionRadiusOffset - groundLevel / (resize * landscape);

pqs.repositionRadiusOffset = groundLevel + builtInOffset * resizeBuildings;
}
if (pqs.repositionToSphereSurface && pqs.repositionToSphereSurfaceAddHeight && resizeBuildings != 1)
{
// Offset = Distance from the surface of the planet

pqs.repositionRadiusOffset *= resizeBuildings;
}
if (resizeBuildings != 1)
{
// Resize the Building

pqs.transform.localScale *= (float)resizeBuildings;
}
}

void City2Fixer(PQSCity2 pqs)
{
double groundLevel = body.pqsController.GetSurfaceHeight(pqs.PlanetRelativePosition) - body.Radius;

if (!pqs.snapToSurface)
{
// Offset = Distance from the center of the planet

double fromRadius = pqs.alt - (body.Radius / resize);
double builtInOffset = fromRadius - groundLevel / (resize * landscape);

pqs.alt = body.Radius + groundLevel + builtInOffset * resizeBuildings;
}
else
{
// Offset = Distance from the surface of the planet

pqs.snapHeightOffset *= resizeBuildings;
}
if (resizeBuildings != 1)
{
// Resize the Building

pqs.transform.localScale *= (float)resizeBuildings;
}
}
}
}
69 changes: 69 additions & 0 deletions [Source]/SigmaDimensions/SigmaDimensions.csproj
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.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>{B3769F47-5A16-43C9-995F-1B3B15BE97CC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SigmaDimensionsPlugin</RootNamespace>
<AssemblyName>SigmaDimensions</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>..\Distribution\</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>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="SpaceCenterFixer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SigmaDimensions.cs" />
<Compile Include="SigmaDimensionsLoader.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Sigma-Binary\[Source]\KerbalSpaceProgram\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Kopernicus, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Sigma-Binary\[Source]\Kopernicus\Kopernicus.dll</HintPath>
</Reference>
<Reference Include="Kopernicus.Components, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Sigma-Binary\[Source]\Kopernicus\Kopernicus.Components.dll</HintPath>
</Reference>
<Reference Include="Kopernicus.OnDemand, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Sigma-Binary\[Source]\Kopernicus\Kopernicus.OnDemand.dll</HintPath>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Sigma-Binary\[Source]\KerbalSpaceProgram\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
</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>
22 changes: 22 additions & 0 deletions [Source]/SigmaDimensions/SigmaDimensions.sln
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SigmaDimensions", "SigmaDimensions.csproj", "{B3769F47-5A16-43C9-995F-1B3B15BE97CC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3769F47-5A16-43C9-995F-1B3B15BE97CC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

0 comments on commit 4f12080

Please sign in to comment.