public void Start() { initFrames = 0; try { engine = this.part.Modules.GetModule <ModuleEnginesFX>(); } catch { Debug.LogError(("BeamedPowerPropulsion.ThermalEngine : ModuleEnginesFX not found on part-" + this.part.partName)); } receiver = new ReceivedPower(); Fields["CoreTemp"].guiUnits = "K/" + maxCoreTemp.ToString() + "K"; Fields["SkinTemp"].guiUnits = "K/" + maxSkinTemp.ToString() + "K"; try { // editing engine's thrust limiter field's gui engine.Fields["thrustPercentage"].guiName = Localizer.Format("#LOC_BeamedPower_PercentMaxThrust"); engine.Fields["thrustPercentage"].guiUnits = "%"; ((UI_FloatRange)engine.Fields["thrustPercentage"].uiControlFlight).scene = UI_Scene.Flight; engine.Fields["thrustPercentage"].guiActiveEditor = false; } catch { Debug.LogWarning("BeamedPowerPropulsion.ThermalEngine : Unable to edit engine module Field"); } SetHeatParams(); SetLocalization(); }
// a lot of the usual part.cfg parameters for engines are now set within the code itself public void Start() { receiver = new ReceivedPower(); Fields["SkinTemp"].guiUnits = "K/" + this.part.skinMaxTemp.ToString() + "K"; try { engine = this.part.Modules.GetModule <ModuleEngines>(); } catch { Debug.LogError(("BeamedPowerPropulsion.PhotonSail : ModuleEngines not found on part-" + this.part.partName)); } try { // hiding redundant moduleengines ui parameters ((UI_FloatRange)engine.Fields["thrustPercentage"].uiControlFlight).scene = UI_Scene.None; ((UI_FloatRange)engine.Fields["thrustPercentage"].uiControlFlight).stepIncrement = 0.001f; engine.Fields["thrustPercentage"].guiActive = false; engine.Fields["thrustPercentage"].guiActiveEditor = false; engine.Fields["finalThrust"].guiActive = false; engine.Fields["fuelFlowGui"].guiActive = false; engine.Fields["status"].guiActive = false; } catch { Debug.LogWarning("BeamedPowerPropulsion.PhotonSail : Unable to edit engine module Fields"); } SetLocalization(); }