Skip to content

Commit

Permalink
Now with 100% more LandControl
Browse files Browse the repository at this point in the history
StollD committed Jul 31, 2018
1 parent 1084d3c commit 3ceffb3
Showing 3 changed files with 66 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Kopernicus.Components/Kopernicus.Components.csproj
Original file line number Diff line number Diff line change
@@ -89,6 +89,7 @@
<Compile Include="ModularScatter\ScatterExperiment.cs" />
<Compile Include="NameChanger.cs" />
<Compile Include="OrbitRendererUpdater.cs" />
<Compile Include="PatchedMods\PQSLandControlPatched.cs" />
<Compile Include="PQS\KopernicusSimplexWrapper.cs" />
<Compile Include="Ring.cs" />
<Compile Include="RingSystem\DebrisField.cs" />
56 changes: 56 additions & 0 deletions src/Kopernicus.Components/PatchedMods/PQSLandControlPatched.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
* Kopernicus Planetary System Modifier
* -------------------------------------------------------------
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA
*
* This library is intended to be used as a plugin for Kerbal Space Program
* which is copyright 2011-2017 Squad. Your usage of Kerbal Space Program
* itself is governed by the terms of its EULA, not the license above.
*
* https://kerbalspaceprogram.com
*/

using System;

namespace Kopernicus
{
namespace Components
{
namespace PatchedMods
{
public class PQSLandControlPatched : PQSLandControl
{
// Where is the point in having variables if they are set to true automatically anyway?
public Boolean reallyCreateColors;
public Boolean reallyCreateScatter;

public override void OnVertexBuild(PQS.VertexBuildData data)
{
createColors = reallyCreateColors;

base.OnVertexBuild(data);
}

public override void OnQuadPreBuild(PQ quad)
{
createScatter = reallyCreateScatter;

base.OnQuadPreBuild(quad);
}
}
}
}
}
15 changes: 9 additions & 6 deletions src/Kopernicus/Configuration/ModLoader/LandControl.cs
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
using System;
using System.Linq;
using System.Reflection;
using Kopernicus.Components.PatchedMods;
using Kopernicus.UI;
using UnityEngine;

@@ -38,7 +39,7 @@ namespace Configuration
namespace ModLoader
{
[RequireConfigType(ConfigType.Node)]
public class LandControl : ModLoader<PQSLandControl>
public class LandControl : ModLoader<PQSLandControlPatched>
{
// Loader for a Ground Scatter
[RequireConfigType(ConfigType.Node)]
@@ -936,16 +937,18 @@ public NumericParser<Int32> altitudeSeed
[ParserTarget("createColors")]
public NumericParser<Boolean> createColors
{
get { return mod.createColors; }
set { mod.createColors = value; }
// Yes, really do what we want!
get { return mod.reallyCreateColors; }
set { mod.reallyCreateColors = value; }
}

// createScatter
[ParserTarget("createScatter")]
public NumericParser<Boolean> createScatter
{
get { return mod.createScatter; }
set { mod.createScatter = value; }
// Yes, really do what we want!
get { return mod.reallyCreateScatter; }
set { mod.reallyCreateScatter = value; }
}

// heightMap
@@ -1162,7 +1165,7 @@ public override void Create(PQS pqsVersion)
}

// Grabs a PQSMod of type T from a parameter with a given PQS
public override void Create(PQSLandControl _mod, PQS pqsVersion)
public override void Create(PQSLandControlPatched _mod, PQS pqsVersion)
{
base.Create(_mod, pqsVersion);

0 comments on commit 3ceffb3

Please sign in to comment.