private void UpdateContext() { GUI_OmniRange = RTUtil.FormatSI(Omni, "m"); GUI_DishRange = RTUtil.FormatSI(Dish, "m"); GUI_EnergyReq = RTUtil.FormatConsumption(Consumption); Events["EventTarget"].guiName = RTUtil.TargetName(Target); }
public override string GetInfo() { var info = new StringBuilder(); if (ShowEditor_OmniRange && Mode1OmniRange > 0) { info.AppendFormat("Omni range: {0} / {1}", RTUtil.FormatSI(Mode0OmniRange * RangeMultiplier, "m"), RTUtil.FormatSI(Mode1OmniRange * RangeMultiplier, "m")).AppendLine(); } if (ShowEditor_DishRange && Mode1DishRange > 0) { info.AppendFormat("Dish range: {0} / {1}", RTUtil.FormatSI(Mode0DishRange * RangeMultiplier, "m"), RTUtil.FormatSI(Mode1DishRange * RangeMultiplier, "m")).AppendLine(); } if (ShowEditor_EnergyReq && EnergyCost > 0) { info.AppendFormat("Energy req.: {0}", RTUtil.FormatConsumption(EnergyCost * ConsumptionMultiplier)).AppendLine(); } if (ShowEditor_DishAngle && CanTarget) { info.AppendFormat("Cone angle: {0} degrees", DishAngle.ToString("F2")).AppendLine(); } if (IsRTActive) { info.AppendLine("Activated by default"); } if (MaxQ > 0) { info.AppendLine("Snaps under high dynamic pressure"); } return(info.ToString().TrimEnd(Environment.NewLine.ToCharArray())); }
public override string GetInfo() { var info = new StringBuilder(); if (ShowEditor_OmniRange && Unlocked) { info.AppendFormat("Integrated Omni: {1} always-on", RTUtil.FormatSI(OmniRange, "m"), RTUtil.FormatSI(OmniRange, "m")); } return(info.ToString()); }
public override void OnStart(StartState state) { if (RTCore.Instance != null) { GameEvents.onVesselWasModified.Add(OnVesselModified); GameEvents.onPartUndock.Add(OnPartUndock); mRegisteredId = vessel.id; RTCore.Instance.Antennas.Register(vessel.id, this); SetState(true); GUI_OmniRange = RTUtil.FormatSI(Omni, "m"); } }
public override string GetInfo() { var info = new StringBuilder(); if (ShowEditor_OmniRange && Mode1OmniRange > 0) { info.AppendFormat("Omni range: {0} / {1}", RTUtil.FormatSI(Mode0OmniRange * RangeMultiplier, "m"), RTUtil.FormatSI(Mode1OmniRange * RangeMultiplier, "m")).AppendLine(); } if (ShowEditor_DishRange && Mode1DishRange > 0) { info.AppendFormat("Dish range: {0} / {1}", RTUtil.FormatSI(Mode0DishRange * RangeMultiplier, "m"), RTUtil.FormatSI(Mode1DishRange * RangeMultiplier, "m")).AppendLine(); } if (ShowEditor_DishAngle && CanTarget) { info.AppendFormat("Cone angle: {0} degrees", DishAngle.ToString("F2")).AppendLine(); } if (IsRTActive) { info.AppendLine("<color=#89929B>Activated by default</color>"); } if (MaxQ > 0) { info.AppendLine("<b><color=#FDA401>Snaps under high dynamic pressure</color></b>"); } if (this.IsNonRetractable) { info.AppendLine("<b><color=#FDA401>Antenna is not retractable</color></b>"); } if (ShowEditor_EnergyReq && EnergyCost > 0) { info.AppendLine().Append("<b><color=#99ff00ff>Requires:</color></b>").AppendLine(); info.AppendFormat("<b>ElectricCharge: </b>{0}", RTUtil.FormatConsumption(EnergyCost * ConsumptionMultiplier)).AppendLine(); } return(info.ToString().TrimEnd(Environment.NewLine.ToCharArray())); }
public override void OnStart(StartState state) { // workarround for ksp 1.0 if (mTransmitterConfig == null) { mTransmitterConfig = new ConfigNode("TRANSMITTER"); mTransmitterConfig.AddValue("PacketInterval", RTPacketInterval); mTransmitterConfig.AddValue("PacketSize", RTPacketSize); mTransmitterConfig.AddValue("PacketResourceCost", RTPacketResourceCost); mTransmitterConfig.AddValue("name", "ModuleRTDataTransmitter"); } if (RTCore.Instance != null) { GameEvents.onVesselWasModified.Add(OnVesselModified); GameEvents.onPartUndock.Add(OnPartUndock); mRegisteredId = vessel.id; RTCore.Instance.Antennas.Register(vessel.id, this); SetState(true); GUI_OmniRange = RTUtil.FormatSI(Omni, "m"); } }
public override string GetInfo() { var info = new StringBuilder(); if (ShowEditor_OmniRange && Mode1OmniRange > 0) { info.AppendFormat(Localizer.Format("#RT_Editor_Omni") + " {0}: {1} / {2}", AntennaInfoDescriptionFromRangeModel(), RTUtil.FormatSI(Mode0OmniRange * RangeMultiplier, "m"), RTUtil.FormatSI(Mode1OmniRange * RangeMultiplier, "m")).AppendLine();//"Omni" } if (ShowEditor_DishRange && Mode1DishRange > 0) { info.AppendFormat(Localizer.Format("#RT_Editor_Dish") + " {0}: {1} / {2}", AntennaInfoDescriptionFromRangeModel(), RTUtil.FormatSI(Mode0DishRange * RangeMultiplier, "m"), RTUtil.FormatSI(Mode1DishRange * RangeMultiplier, "m")).AppendLine();//"Dish" } if (ShowEditor_DishAngle && CanTarget) { info.AppendFormat(Localizer.Format("#RT_Editor_Coneangle") + " {0} " + Localizer.Format("#RT_degrees"), DishAngle.ToString("F3")).AppendLine();//"Cone angle:degrees" } if (IsRTActive) { info.AppendLine("<color=green>" + Localizer.Format("#RT_Editor_Activatedbydefault") + "</color>");//"Activated by default" } if (MaxQ > 0) { info.AppendLine("<b><color=#FDA401>" + Localizer.Format("#RT_Editor_Snaps") + "</color></b>");//"Snaps under high dynamic pressure" } if (this.IsNonRetractable) { info.AppendLine("<b><color=#FDA401>" + Localizer.Format("#RT_Editor_Notretractable") + "</color></b>");//"Antenna is not retractable" } if (ShowEditor_EnergyReq && EnergyCost > 0) { info.AppendLine().Append("<b><color=#99ff00ff>" + Localizer.Format("#RT_Editor_Requires") + "</color></b>").AppendLine(); //"Requires:" info.AppendFormat("<b>" + Localizer.Format("#RT_Editor_ElectricCharge") + " </b>" + "{0}", RTUtil.FormatConsumption(EnergyCost * ConsumptionMultiplier)).AppendLine(); //"ElectricCharge: } return(info.ToString().TrimEnd(Environment.NewLine.ToCharArray())); }
public override string GetInfo() { var info = new StringBuilder(); if (ShowEditor_OmniRange && Unlocked) { info.AppendFormat(Localizer.Format("#RT_Editor_TechnologyPerk_info1", "{1}"), RTUtil.FormatSI(OmniRange, "m"), RTUtil.FormatSI(OmniRange, "m"));//"Integrated Omni: {1} always-on" } return(info.ToString()); }