diff --git a/src/kOS/Module/kOSProcessor.cs b/src/kOS/Module/kOSProcessor.cs index 29b272d5f..bfacd0c3f 100644 --- a/src/kOS/Module/kOSProcessor.cs +++ b/src/kOS/Module/kOSProcessor.cs @@ -48,6 +48,8 @@ public string Tag private bool firstUpdate = true; private bool objectsInitialized = false; + public float AdditionalMass { get; set; } + /// How many times have instances of this class been constructed during this process run? private static int constructorCount; @@ -86,14 +88,14 @@ public string Tag [KSPField(isPersistant = true, guiName = "CPU/Disk Upgrade Cost", guiActive = false, guiActiveEditor = true)] public float additionalCost = 0F; - [KSPField(isPersistant = false, guiName = "CPU/Disk Upgrade Mass", guiActive = false, guiActiveEditor = true)] - public float additionalMass = 0F; + [KSPField(isPersistant = false, guiName = "CPU/Disk Upgrade Mass", guiActive = false, guiActiveEditor = true, guiUnits = "Kg", guiFormat = "0.00")] + public float additionalMassGui = 0F; [KSPField(isPersistant = false, guiActive = false, guiActiveEditor = false)] public float diskSpaceCostFactor = 0.0244140625F; //implies approx 100funds for 4096bytes of diskSpace [KSPField(isPersistant = false, guiActive = false, guiActiveEditor = false)] - public float diskSpaceMassFactor = 0.0000048829F; //implies approx 0.020kg for 4096bytes of diskSpace + public float diskSpaceMassFactor = 0.0000000048829F; //implies approx 0.020kg for 4096bytes of diskSpace [KSPField(isPersistant = true, guiActive = false)] public int MaxPartId = 100; @@ -249,7 +251,8 @@ private void UpdateCostAndMass() { float spaceDelta = diskSpace - baseDiskSpace; additionalCost = (float)System.Math.Round(spaceDelta * diskSpaceCostFactor, 0); - additionalMass = spaceDelta * diskSpaceMassFactor; + AdditionalMass = spaceDelta * diskSpaceMassFactor; + additionalMassGui = AdditionalMass * 1000; } //implement IPartMassModifier component @@ -257,7 +260,7 @@ public float GetModuleMass(float defaultMass, ModifierStagingSituation sit) { // the 'sit' arg is irrelevant to us, but the interface requires it. - return baseModuleMass + additionalMass; + return baseModuleMass + AdditionalMass; } //implement IPartMassModifier component public ModifierChangeWhen GetModuleMassChangeWhen()