Skip to content

Commit

Permalink
Merge pull request #71 from ChrisAdderley/dev
Browse files Browse the repository at this point in the history
Release 2.1.10
  • Loading branch information
ChrisAdderley authored Oct 30, 2020
2 parents 9e50bf4 + 94ab4c6 commit 365d2f3
Show file tree
Hide file tree
Showing 14 changed files with 152 additions and 22 deletions.
29 changes: 29 additions & 0 deletions GameData/DynamicBatteryStorage/DynamicBatteryStorageSettings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ DYNAMICBATTERYSTORAGE
title = #LOC_DynamicBatteryStorage_UI_Category_Science
module = ModuleScienceConverter
module = ModuleSpaceDustScanner
module = ModuleSpaceDustTelescope
}
// These control the handlers that are used to monitor power
// Don't touch these unless you know what you're doing
Expand Down Expand Up @@ -656,6 +657,34 @@ DYNAMICBATTERYSTORAGE
}
}
PARTMODULEHANDLER
{
name = ModuleSpaceDustTelescope
type = Power
handlerModuleName = GenericFieldDataHandler
// 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
HANDLER_CONFIG
{
// Field to poll in editor
editorFieldName = CurrentPowerConsumption
// Field to poll in flight
flightFieldName = CurrentPowerConsumption
// Multiply the output by these if you need to. Convention is that a consumer is negative.
editorValueScalar = 1.0
flightValueScalar = 1.0
}
}
PARTMODULEHANDLER
{
name = ModuleSpaceDustHarvester
type = Power
Expand Down
86 changes: 86 additions & 0 deletions GameData/DynamicBatteryStorage/Localization/fr-fr.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// traduit par vinix38
Localization
{
fr-fr
{
// Main Panel
#LOC_DynamicBatteryStorage_UI_WindowName = Gestionnaire des Système du Futur Proche
#LOC_DynamicBatteryStorage_UI_ThermalModeName = THERMIQUE
#LOC_DynamicBatteryStorage_UI_ElectricalModeName = ELECTRIQUE

#LOC_DynamicBatteryStorage_UI_ElectricalFlowUnits = CE/s
#LOC_DynamicBatteryStorage_UI_ElectricalUnits = CE
#LOC_DynamicBatteryStorage_UI_ThermalFlowUnits = kW
#LOC_DynamicBatteryStorage_UI_TimeUnits = s
#LOC_DynamicBatteryStorage_UI_DistanceUnits = m


// Electrical View
// Solar Panel Manager
#LOC_DynamicBatteryStorage_UI_SolarManagerTitle = Simulateur de Panneaux Solaires
#LOC_DynamicBatteryStorage_UI_EclipseTimeTitle = Temps en Eclipse
#LOC_DynamicBatteryStorage_UI_BodySelectionTitle = Corps de Référence
#LOC_DynamicBatteryStorage_UI_SolarAltitudeTitle = Altitude Solaire Moyenne
#LOC_DynamicBatteryStorage_UI_OrbitAltitudeTitle = Hauteur Orbitale du Corps
#LOC_DynamicBatteryStorage_UI_SolarEfficiencyTitle = Efficacité Estimée des Panneaux

// Battery Panel
#LOC_DynamicBatteryStorage_UI_BatteryManagerTitle = Statut des Batteries
#LOC_DynamicBatteryStorage_UI_BatteryTimeDepletion = Epuisées dans
#LOC_DynamicBatteryStorage_UI_BatteryTimeCharging = Rechargées dans
#LOC_DynamicBatteryStorage_UI_BatteryTimeStable = Stable
#LOC_DynamicBatteryStorage_UI_BatteryTimeFullCharge = Pleine Charge dans

// Dynamic Battery Panel
#LOC_DynamicBatteryStorage_UI_DBSManagerTitle = Ajustement Dynamique des Batteries
#LOC_DynamicBatteryStorage_UI_DBSManagerBufferSize = Tampon Requis
#LOC_DynamicBatteryStorage_UI_DBSManagerBufferPart = Pièce Affectée
#LOC_DynamicBatteryStorage_UI_DBSDebugTitle = Donnés Internes
#LOC_DynamicBatteryStorage_UI_DBSVesselCachedTitle = CE en Cache du Vaisseau
#LOC_DynamicBatteryStorage_UI_DBSPartCachedTitle = CE en Cache de la pièce

#LOC_DynamicBatteryStorage_UI_DBSErrorController = Contrôleur non-détecté
#LOC_DynamicBatteryStorage_UI_DBSErrorTimewarp = Système désactivé en dessous de <<1>>x
#LOC_DynamicBatteryStorage_UI_DBSNoError = Système de Compensation activé

// Flows panel
#LOC_DynamicBatteryStorage_UI_FlowPanelTitle = Flux Electrique
#LOC_DynamicBatteryStorage_UI_TotalPowerGenerationTitle = Puissance Générée Totale
#LOC_DynamicBatteryStorage_UI_TotalPowerConsumptionTitle = Puissance Consommée Totale


// Intermittent panel
#LOC_DynamicBatteryStorage_UI_SimulationPanelTitle = Changer simulation
#LOC_DynamicBatteryStorage_UI_ConstantPanelTitle = Tout
#LOC_DynamicBatteryStorage_UI_IntermittentPanelTitle = Sur-Demande
#LOC_DynamicBatteryStorage_UI_IntermittentToggle = Changer
#LOC_DynamicBatteryStorage_UI_IntermittentOff = OFF
#LOC_DynamicBatteryStorage_UI_IntermittentOn = ON

// Thermal View
// Flows panel
#LOC_DynamicBatteryStorage_UI_HeatFlowPanelTitle = Flux de chaleur
#LOC_DynamicBatteryStorage_UI_HeatFlowPanelNotOk = <color=#fd6868> La dissipation de chaleur du vaisseau est insuffisante, certaines pièces pourraient surchauffer</color>
#LOC_DynamicBatteryStorage_UI_HeatFlowPanelOk = La dissipation de chaleur du vaisseau est adéquate.
#LOC_DynamicBatteryStorage_UI_TotalHeatConsumptionTitle = Rejet de Chaleur Total
#LOC_DynamicBatteryStorage_UI_TotalHeatGenerationTitle = Production de Chaleur Totale

// UI Categories
#LOC_DynamicBatteryStorage_UI_Category_SolarPanels = Panneaux Solaires
#LOC_DynamicBatteryStorage_UI_Category_Radiators = Radiateurs
#LOC_DynamicBatteryStorage_UI_Category_Converters = Convertisseurs
#LOC_DynamicBatteryStorage_UI_Category_Harvesters = Foreuses
#LOC_DynamicBatteryStorage_UI_Category_Generators = Générateurs
#LOC_DynamicBatteryStorage_UI_Category_Reactors = Réacteurs
#LOC_DynamicBatteryStorage_UI_Category_FissionReactors = Réacteurs à Fission
#LOC_DynamicBatteryStorage_UI_Category_FusionReactors = Réacteurs à Fusion
#LOC_DynamicBatteryStorage_UI_Category_Batteries = Stockage d'énergie
#LOC_DynamicBatteryStorage_UI_Category_FuelTanks = Réservoir à carburant
#LOC_DynamicBatteryStorage_UI_Category_Lights = Lumières
#LOC_DynamicBatteryStorage_UI_Category_Command = Modules de Commande
#LOC_DynamicBatteryStorage_UI_Category_Communication = Transmetteurs
#LOC_DynamicBatteryStorage_UI_Category_Habitation = Modules d'Habitation
#LOC_DynamicBatteryStorage_UI_Category_Engines = Propulseurs
#LOC_DynamicBatteryStorage_UI_Category_Science = Science
}
}
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,7 +6,7 @@
{
"MAJOR":2,
"MINOR":1,
"PATCH":9,
"PATCH":10,
"BUILD":0
},
"KSP_VERSION":
Expand Down
25 changes: 9 additions & 16 deletions Source/DynamicBatteryStorage/DynamicBatteryStorage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -47,25 +47,25 @@
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputModule">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.InputModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TextRenderingModule">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\..\..\..\..\Games\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -103,15 +103,8 @@
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\UnityEngine.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\KSPAssets.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\Ionic.Zip.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\KSPTrackIR.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\Mono.Cecil.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\TDx.TDxInput.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\UnityEngine.UI.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\Assembly-CSharp.dll"
del "C:\Games\Steam\steamapps\common\Kerbal Space Program\GameData\DynamicBatteryStorage\Plugins\Assembly-CSharp-firstpass.dll"</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<!-- 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ public KopernicusSolarPanelPowerHandler(HandlerModuleData moduleData):base(modul
public override bool Initialize(PartModule pm)
{
base.Initialize(pm);
panel = (ModuleDeployableSolarPanel)pm;
try
{
panel = (ModuleDeployableSolarPanel)pm;
}
catch (InvalidCastException)
{
return false;
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion Source/DynamicBatteryStorage/UI/UISolarPanelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ protected double CalculateOcclusionTime()
/// </summary>
protected float CalculatePanelScalar()
{
return (float)((1d / (sunRefOrbitHeight*sunRefOrbitHeight)) *(refSunOrbitAlt) ) ;
return (float)((1d / (sunRefOrbitHeight*sunRefOrbitHeight)) *(refSunOrbitAlt* refSunOrbitAlt) ) ;
}

}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ C:\Users\Chris\KSP\Repos\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\
C:\Users\Chris\KSP\Repos\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.dll
C:\Users\Chris\KSP\Repos\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.pdb
C:\Users\Chris\KSP\Repos\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.csprojAssemblyReference.cache
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\GameData\DynamicBatteryStorage\Plugins\DynamicBatteryStorage.dll
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\GameData\DynamicBatteryStorage\Plugins\DynamicBatteryStorage.pdb
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.csprojAssemblyReference.cache
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.csproj.CoreCompileInputs.cache
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.csproj.CopyComplete
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.dll
C:\Users\Chris\KSP\Repositories\DynamicBatteryStorage\Source\DynamicBatteryStorage\obj\Debug\DynamicBatteryStorage.pdb
Binary file modified Source/DynamicBatteryStorage/obj/Debug/DynamicBatteryStorage.dll
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v2.1.10
-------
- Added French translation from vinix38
- Fixed a missing exponent in the Solar Panel UI planner
- Some fixes for solar panel detection in old (pre 1.9) Kopernicus versions
- Added support for ModuleSpaceDustTelescope

v2.1.9
------
- Compatibility with Kopernicus 1.9+
Expand Down
6 changes: 3 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==============================
Dynamic Battery Storage v2.1.9
==============================
===============================
Dynamic Battery Storage v2.1.10
===============================

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 365d2f3

Please sign in to comment.