Skip to content

Commit

Permalink
rebuild for 1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Caskey committed Apr 29, 2018
1 parent 5c114e4 commit 8196111
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public MixtureConfigNode()

public MixtureConfigNode(string serialized)
{
//EMRUtils.Log("Creating MixtureConfigNode from: ", serialized);
EMRUtils.Log("Creating MixtureConfigNode from: ", serialized);
var parts = serialized.Split(DELIM);
configName = parts[0];
ratio = float.Parse(parts[1]);
Expand Down Expand Up @@ -98,7 +98,7 @@ public override string ToString()
}
}
string resultString = sBuilder.ToStringAndRelease().TrimEnd(DELIM);
//EMRUtils.Log("Serialized: ", resultString);
EMRUtils.Log("Serialized: ", resultString);
return resultString;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using EMRController.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand All @@ -23,6 +24,7 @@ public MixtureConfigNodePair(MixtureConfigNode min, MixtureConfigNode max)
Max = max;

if (min == null || max == null) {
EMRUtils.Log("One or both of the MixtureConfigNodes were null, disabling");
Disabled = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ private void BuildFromNodes(IEnumerable<MixtureConfigNode> nodes) {
allNodes.Add(name, pair);
}

EMRUtils.Log("Added " + allNodes.Count + " config nodes");

List<String> configList = nodes.Select(item => item.ToString()).ToList();
Serialized = ObjectSerializer.Serialize(configList);
}
Expand Down
15 changes: 9 additions & 6 deletions Source/EMRController/EMRController/EMRController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ private MixtureConfigNodePair CurrentNodePair {

public override void OnLoad(ConfigNode node)
{
//EMRUtils.Log("OnLoad called");
EMRUtils.Log("OnLoad called");
if (GameSceneFilter.AnyInitializing.IsLoaded()) {
//EMRUtils.Log("Loading");
EMRUtils.Log("Loading");
LoadMixtureConfigNodes(node);
//EMRUtils.Log("Loaded");
EMRUtils.Log("Loaded");
}
base.OnLoad(node);
}
Expand Down Expand Up @@ -349,6 +349,7 @@ public override void OnStart(StartState state)
propellantResources = new PropellantResources(engineModule);
}

EMRUtils.Log("Detecting configs");
DetectConfig();
DeserializeNodes();
BindCallbacks();
Expand All @@ -374,8 +375,10 @@ public override void OnStart(StartState state)

private void ToggleControlsBasedOnConfigs()
{
EMRUtils.Log("Toggling Controls based on configs");
if (CurrentNodePair.Disabled) {
emrEnabled = false;
EMRUtils.Log("Current node pair is disabled, disabling EMR");
}

Events["ToggleEMR"].guiActive = !CurrentNodePair.Disabled;
Expand Down Expand Up @@ -527,7 +530,7 @@ private MixtureConfigNode GenerateMixtureConfigNodeForRatio(float ratio)

private void SetEditorFields()
{
//EMRUtils.Log("Setting editor fields");
EMRUtils.Log("Setting editor fields");
UI_FloatEdit startFloatEdit = (UI_FloatEdit)Fields["startingEMR"].uiControlEditor;
UI_FloatEdit finalFloatEdit = (UI_FloatEdit)Fields["finalEMR"].uiControlEditor;
startFloatEdit.minValue = CurrentNodePair.Min.ratio;
Expand Down Expand Up @@ -575,11 +578,11 @@ private void DetectConfig()
{
currentConfigName = "";
if (mecModule == null) {
//EMRUtils.Log("Detecting ModuleEngineConfigs");
EMRUtils.Log("Detecting ModuleEngineConfigs");
foreach (var module in part.Modules) {
if (module.GetType().FullName == "RealFuels.ModuleEngineConfigs") {
mecModule = module;
//EMRUtils.Log("Found ModuleEngineConfigs");
EMRUtils.Log("Found ModuleEngineConfigs");
break;
}
}
Expand Down
11 changes: 5 additions & 6 deletions Source/EMRController/EMRController/EMRController.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AssemblyName>EMRController</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -30,19 +31,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Dependencies\1.4.2\Assembly-CSharp.dll</HintPath>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\Dependencies\1.4.3\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Dependencies\1.4.2\UnityEngine.dll</HintPath>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\Dependencies\1.4.3\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Source/EMRController/EMRController/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EMRController")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
5 changes: 4 additions & 1 deletion Source/EMRController/EMRController/Utils/EMRUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace EMRController.Utils
static class EMRUtils
{
private const string logName = "EMR";
private static bool enabled = false;
public static void Log(params object[] message)
{
Log(Array.ConvertAll(message, item => item.ToString()));
Expand All @@ -21,7 +22,9 @@ public static void Log(params string[] message)
foreach (string part in message) {
builder.Append(part);
}
UnityEngine.Debug.Log(builder.ToStringAndRelease());
if (enabled) {
UnityEngine.Debug.Log(builder.ToStringAndRelease());
}
}
}
}

0 comments on commit 8196111

Please sign in to comment.