Skip to content

Commit

Permalink
Merge pull request #78 from post-kerbin-mining-corporation/dev
Browse files Browse the repository at this point in the history
Prepare 1.12 updates
  • Loading branch information
ChrisAdderley authored Jul 3, 2021
2 parents fb7fa77 + db2893b commit dbf0cd7
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 4 deletions.
25 changes: 25 additions & 0 deletions GameData/DynamicBatteryStorage/DynamicBatteryStorageSettings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ DYNAMICBATTERYSTORAGE
module = ModuleScienceConverter
module = ModuleSpaceDustScanner
module = ModuleSpaceDustTelescope
module = SCANsat
}
// These control the handlers that are used to monitor power
// Don't touch these unless you know what you're doing
Expand All @@ -156,6 +157,7 @@ DYNAMICBATTERYSTORAGE
// Does this item count as a continuous power source for the purpose of the UI?
continuous = true
}

PARTMODULEHANDLER
{
name = ModuleCurvedSolarPanel
Expand Down Expand Up @@ -289,6 +291,29 @@ DYNAMICBATTERYSTORAGE
continuous = true
}

PARTMODULEHANDLER
{
// The name of the module
name = SCANsat
// The type of handler - can be Power or Heat
type = Power
// The name of the handler to use
handlerModuleName = SCANsatPowerHandler
// Is this shown in the UI at all?
visible = true
// Do we use solar distance attenuation?
solarEfficiencyEffects = false
// Is this module a producer by default?
producer = false
// Is this module a consumer by default?
consumer = true
// Does this item start off as active in the UI? Should canonically be true for constant sources/draws
simulated = true
// Does this item count as a continuous power source for the purpose of the UI?
continuous = true
}

// Heat
PARTMODULEHANDLER
{
name = ModuleResourceHarvester
Expand Down
Binary file modified GameData/DynamicBatteryStorage/Plugins/DynamicBatteryStorage.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
{
"MAJOR":2,
"MINOR":2,
"PATCH":2,
"PATCH":3,
"BUILD":0
},
"KSP_VERSION":
{
"MAJOR":1,
"MINOR":11,
"MINOR":12,
"PATCH":1
},
"KSP_VERSION_MIN":{
Expand All @@ -22,7 +22,7 @@
},
"KSP_VERSION_MAX":{
"MAJOR":1,
"MINOR":11,
"MINOR":12,
"PATCH":99
}
}
1 change: 1 addition & 0 deletions Source/DynamicBatteryStorage/DynamicBatteryStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<Compile Include="Handlers\Power\NFTPowerHandlers.cs" />
<Compile Include="Handlers\Power\RealBatteryPowerHandlers.cs" />
<Compile Include="Handlers\Power\RemoteTechPowerHandler.cs" />
<Compile Include="Handlers\Power\ScanSatPowerHandler.cs" />
<Compile Include="Handlers\Power\StockPowerHandlers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings.cs" />
Expand Down
43 changes: 43 additions & 0 deletions Source/DynamicBatteryStorage/Handlers/Power/ScanSatPowerHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;

namespace DynamicBatteryStorage
{
public class SCANsatPowerHandler : ModuleDataHandler
{
public SCANsatPowerHandler(HandlerModuleData moduleData) : base(moduleData)
{ }
protected override double GetValueEditor()
{
for (int i = pm.resHandler.inputResources.Count - 1; i >= 0; i--)
{
if (pm.resHandler.inputResources[i].name == "ElectricCharge")
{
return -(float)pm.resHandler.inputResources[i].rate;


}
}

return 0f;
}
protected override double GetValueFlight()
{
bool results = false;
bool.TryParse(pm.Fields.GetValue("scanning").ToString(), out results);

if (results)
{
for (int i = pm.resHandler.inputResources.Count - 1; i >= 0; i--)
{
if (pm.resHandler.inputResources[i].name == "ElectricCharge")
{
return -(float)pm.resHandler.inputResources[i].rate;
}
}
}
return 0f;

}
}

}
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v2.2.3
------
- Marked KSP 1.12
- Added support for SCANSat

v2.2.2
------
- Fixed a loading log message not being gated behind debug correctly
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==============================
Dynamic Battery Storage v2.2.2
Dynamic Battery Storage v2.2.3
==============================

A small utility mod for Kerbal Space Program, intended to support my other projects. Effectively required by Near Future Electrical, CryoEngines, KerballAtomics and CryoTanks.
Expand Down

0 comments on commit dbf0cd7

Please sign in to comment.