From e60798fbbb564db0adfa86c881bdf4f055726ae3 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 30 Oct 2023 10:31:34 -0700 Subject: [PATCH] CachedLocalizer cleanup Signed-off-by: Lamont Granquist --- MechJeb2/CachedLocalizer.cs | 478 ++++++++++-------- MechJeb2/MechJebModuleAscentMenu.cs | 86 ++-- .../MechJebModuleAscentPVGSettingsMenu.cs | 10 +- MechJeb2/MechJebModuleAscentSettingsMenu.cs | 24 +- MechJeb2/MechJebModuleCustomInfoWindow.cs | 4 +- MechJeb2/MechJebModuleInfoItems.cs | 2 +- MechJeb2/MechJebModuleStagingController.cs | 28 +- MechJeb2/MechJebModuleThrustController.cs | 20 +- MechJeb2/MechJebStageStatsHelper.cs | 32 +- 9 files changed, 379 insertions(+), 305 deletions(-) diff --git a/MechJeb2/CachedLocalizer.cs b/MechJeb2/CachedLocalizer.cs index 8a0b83cc..9743bb9d 100644 --- a/MechJeb2/CachedLocalizer.cs +++ b/MechJeb2/CachedLocalizer.cs @@ -1,4 +1,5 @@ -using KSP.Localization; +using System; +using KSP.Localization; using UnityEngine; namespace MuMech @@ -7,77 +8,150 @@ public class CachedLocalizer : MonoBehaviour { public static CachedLocalizer Instance { get; private set; } - public string MechJeb_Ascent_button1, MechJeb_Ascent_button2, MechJeb_Ascent_button3, MechJeb_Ascent_button4, MechJeb_Ascent_button5; - public string MechJeb_Ascent_button6, MechJeb_Ascent_button7, MechJeb_Ascent_button8, MechJeb_Ascent_button9, MechJeb_Ascent_button10; - public string MechJeb_Ascent_button11, MechJeb_Ascent_button12, MechJeb_Ascent_button13, MechJeb_Ascent_button14, MechJeb_Ascent_button15; - public string MechJeb_Ascent_button17; - public string MechJeb_Ascent_label1, MechJeb_Ascent_label2, MechJeb_Ascent_label3, MechJeb_Ascent_label4, MechJeb_Ascent_label5; - public string MechJeb_Ascent_label6, MechJeb_Ascent_label7, MechJeb_Ascent_label8, MechJeb_Ascent_label9, MechJeb_Ascent_label10; - public string MechJeb_Ascent_label11, MechJeb_Ascent_label12, MechJeb_Ascent_label13, MechJeb_Ascent_label14, MechJeb_Ascent_label15; - public string MechJeb_Ascent_label16, MechJeb_Ascent_label17, MechJeb_Ascent_label18, MechJeb_Ascent_label19, MechJeb_Ascent_label20; - public string MechJeb_Ascent_label21, MechJeb_Ascent_label22, MechJeb_Ascent_label23, MechJeb_Ascent_label24, MechJeb_Ascent_label25; - public string MechJeb_Ascent_label26, MechJeb_Ascent_label27, MechJeb_Ascent_label28, MechJeb_Ascent_label29, MechJeb_Ascent_label30; - public string MechJeb_Ascent_label31, MechJeb_Ascent_label32, MechJeb_Ascent_label33, MechJeb_Ascent_label34, MechJeb_Ascent_label35; - public string MechJeb_Ascent_label36, MechJeb_Ascent_label37, MechJeb_Ascent_label38, MechJeb_Ascent_label39, MechJeb_Ascent_label40; - public string MechJeb_Ascent_label41, MechJeb_Ascent_label42, MechJeb_Ascent_label44; - public string MechJeb_Ascent_attachAlt, MechJeb_Ascent_warnAttachAltHigh, MechJeb_Ascent_warnAttachAltLow; - - public string MechJeb_Ascent_LaunchToTargetLan, - MechJeb_Ascent_LaunchToLan, - MechJeb_Ascent_LaunchingToTargetLAN, - MechJeb_Ascent_LaunchingToManualLAN; - - public string MechJeb_Ascent_msg2, MechJeb_Ascent_msg3; - public string MechJeb_Ascent_hotStaging, MechJeb_Ascent_dropSolids, MechJeb_Ascent_leadTime; - - public string MechJeb_Ascent_checkbox2, MechJeb_Ascent_checkbox3, MechJeb_Ascent_checkbox4, MechJeb_Ascent_checkbox5; - - public string MechJeb_Ascent_checkbox6, - MechJeb_Ascent_checkbox7, - MechJeb_Ascent_checkbox8, - MechJeb_Ascent_checkbox9, - MechJeb_Ascent_checkbox10; - - public string MechJeb_Ascent_checkbox11, - MechJeb_Ascent_checkbox12, - MechJeb_Ascent_checkbox13, - MechJeb_Ascent_checkbox14, - MechJeb_Ascent_checkbox15; - - public string MechJeb_Ascent_status9, MechJeb_Ascent_status10; - public string MechJeb_Ascent_status11; - - public string MechJeb_Ascent_checkbox16, - MechJeb_Ascent_checkbox17, - MechJeb_Ascent_checkbox18, - MechJeb_Ascent_checkbox19, - MechJeb_Ascent_checkbox20; - - public string MechJeb_NavBallGuidance_btn1, MechJeb_NavBallGuidance_btn2; - - public string MechJeb_InfoItems_UnlimitedText; - public string MechJeb_InfoItems_label1; - public string MechJeb_InfoItems_showEmpty, MechJeb_InfoItems_hideEmpty; - public string MechJeb_InfoItems_button5; - public string MechJeb_InfoItems_button6; - public string MechJeb_InfoItems_StatsColumn0; - - public string MechJeb_InfoItems_StatsColumn1, - MechJeb_InfoItems_StatsColumn2, - MechJeb_InfoItems_StatsColumn3, - MechJeb_InfoItems_StatsColumn4, - MechJeb_InfoItems_StatsColumn5; - - public string MechJeb_InfoItems_StatsColumn6, - MechJeb_InfoItems_StatsColumn7, - MechJeb_InfoItems_StatsColumn8, - MechJeb_InfoItems_StatsColumn9, - MechJeb_InfoItems_StatsColumn10; - - public string MechJeb_InfoItems_StatsColumn11, MechJeb_InfoItems_StatsColumn12, MechJeb_InfoItems_StatsColumn13; - - public string MechJeb_Ascent_title, MechJeb_WindowEd_title; - public string MechJeb_WindowEd_CustomInfoWindow_Label1; + [NonSerialized] + public string MechJebAscentButton1, + MechJebAscentButton2, + MechJebAscentButton3, + MechJebAscentButton4, + MechJebAscentButton5, + MechJebAscentButton6, + MechJebAscentButton7, + MechJebAscentButton8, + MechJebAscentButton9, + MechJebAscentButton10, + MechJebAscentButton11, + MechJebAscentButton12, + MechJebAscentButton13, + MechJebAscentButton14, + MechJebAscentButton15, + MechJebAscentButton17; + + [NonSerialized] + public string + MechJebAscentLabel1, + MechJebAscentLabel2, + MechJebAscentLabel3, + MechJebAscentLabel4, + MechJebAscentLabel5, + MechJebAscentLabel6, + MechJebAscentLabel7, + MechJebAscentLabel8, + MechJebAscentLabel9, + MechJebAscentLabel10, + MechJebAscentLabel11, + MechJebAscentLabel12, + MechJebAscentLabel13, + MechJebAscentLabel14, + MechJebAscentLabel15, + MechJebAscentLabel16, + MechJebAscentLabel17, + MechJebAscentLabel18, + MechJebAscentLabel19, + MechJebAscentLabel20, + MechJebAscentLabel21, + MechJebAscentLabel22, + MechJebAscentLabel23, + MechJebAscentLabel24, + MechJebAscentLabel25, + MechJebAscentLabel26, + MechJebAscentLabel27, + MechJebAscentLabel28, + MechJebAscentLabel29, + MechJebAscentLabel30, + MechJebAscentLabel31, + MechJebAscentLabel32, + MechJebAscentLabel33, + MechJebAscentLabel34, + MechJebAscentLabel35, + MechJebAscentLabel36, + MechJebAscentLabel37, + MechJebAscentLabel38, + MechJebAscentLabel39, + MechJebAscentLabel40, + MechJebAscentLabel41, + MechJebAscentLabel42, + MechJebAscentLabel44; + + [NonSerialized] + public string MechJebAscentAttachAlt, MechJebAscentWarnAttachAltHigh, MechJebAscentWarnAttachAltLow; + + [NonSerialized] + public string MechJebAscentLaunchToTargetLan, + MechJebAscentLaunchToLan, + MechJebAscentLaunchingToTargetLAN, + MechJebAscentLaunchingToManualLAN; + + [NonSerialized] + public string MechJebAscentMsg2, MechJebAscentMsg3; + + [NonSerialized] + public string MechJebAscentHotStaging, MechJebAscentDropSolids, MechJebAscentLeadTime; + + [NonSerialized] + public string MechJebAscentCheckbox2, + MechJebAscentCheckbox3, + MechJebAscentCheckbox4, + MechJebAscentCheckbox5, + MechJebAscentCheckbox6, + MechJebAscentCheckbox7, + MechJebAscentCheckbox8, + MechJebAscentCheckbox9, + MechJebAscentCheckbox10, + MechJebAscentCheckbox11, + MechJebAscentCheckbox12, + MechJebAscentCheckbox13, + MechJebAscentCheckbox14, + MechJebAscentCheckbox15, + MechJebAscentCheckbox16, + MechJebAscentCheckbox17, + MechJebAscentCheckbox18, + MechJebAscentCheckbox19, + MechJebAscentCheckbox20; + + [NonSerialized] + public string MechJebAscentStatus9, + MechJebAscentStatus10, + MechJebAscentStatus11; + + [NonSerialized] + public string MechJebNavBallGuidanceBtn1, MechJebNavBallGuidanceBtn2; + + [NonSerialized] + public string MechJebInfoItemsUnlimitedText; + + [NonSerialized] + public string MechJebInfoItemsLabel1; + + [NonSerialized] + public string MechJebInfoItemsShowEmpty, MechJebInfoItemsHideEmpty; + + [NonSerialized] + public string MechJebInfoItemsButton5; + + [NonSerialized] + public string MechJebInfoItemsButton6; + + [NonSerialized] + public string MechJebInfoItemsStatsColumn0, + MechJebInfoItemsStatsColumn1, + MechJebInfoItemsStatsColumn2, + MechJebInfoItemsStatsColumn3, + MechJebInfoItemsStatsColumn4, + MechJebInfoItemsStatsColumn5, + MechJebInfoItemsStatsColumn6, + MechJebInfoItemsStatsColumn7, + MechJebInfoItemsStatsColumn8, + MechJebInfoItemsStatsColumn9, + MechJebInfoItemsStatsColumn10, + MechJebInfoItemsStatsColumn11, + MechJebInfoItemsStatsColumn12, + MechJebInfoItemsStatsColumn13; + + [NonSerialized] + public string MechJebAscentTitle, MechJebWindowEdTitle; + + [NonSerialized] + public string MechJebWindowEdCustomInfoWindowLabel1; public static void Bootstrap() { @@ -92,137 +166,137 @@ public static void Bootstrap() private void UpdateCachedStrings() { - MechJeb_Ascent_button1 = Localizer.Format("#MechJeb_Ascent_button1"); - MechJeb_Ascent_button2 = Localizer.Format("#MechJeb_Ascent_button2"); - MechJeb_Ascent_button3 = Localizer.Format("#MechJeb_Ascent_button3"); - MechJeb_Ascent_button4 = Localizer.Format("#MechJeb_Ascent_button4"); - MechJeb_Ascent_button5 = Localizer.Format("#MechJeb_Ascent_button5"); - MechJeb_Ascent_button6 = Localizer.Format("#MechJeb_Ascent_button6"); - MechJeb_Ascent_button7 = Localizer.Format("#MechJeb_Ascent_button7"); - MechJeb_Ascent_button8 = Localizer.Format("#MechJeb_Ascent_button8"); - MechJeb_Ascent_button9 = Localizer.Format("#MechJeb_Ascent_button9"); - MechJeb_Ascent_button10 = Localizer.Format("#MechJeb_Ascent_button10"); - MechJeb_Ascent_button11 = Localizer.Format("#MechJeb_Ascent_button11"); - MechJeb_Ascent_button12 = Localizer.Format("#MechJeb_Ascent_button12"); - MechJeb_Ascent_button13 = Localizer.Format("#MechJeb_Ascent_button13"); - MechJeb_Ascent_button14 = Localizer.Format("#MechJeb_Ascent_button14"); - MechJeb_Ascent_button15 = Localizer.Format("#MechJeb_Ascent_button15"); - MechJeb_Ascent_button17 = Localizer.Format("#MechJeb_Ascent_button17"); - - MechJeb_Ascent_label1 = Localizer.Format("#MechJeb_Ascent_label1"); - MechJeb_Ascent_label2 = Localizer.Format("#MechJeb_Ascent_label2"); - MechJeb_Ascent_label3 = Localizer.Format("#MechJeb_Ascent_label3"); - MechJeb_Ascent_label4 = Localizer.Format("#MechJeb_Ascent_label4"); - MechJeb_Ascent_label5 = Localizer.Format("#MechJeb_Ascent_label5"); - MechJeb_Ascent_label6 = Localizer.Format("#MechJeb_Ascent_label6"); + MechJebAscentButton1 = Localizer.Format("#MechJeb_Ascent_button1"); + MechJebAscentButton2 = Localizer.Format("#MechJeb_Ascent_button2"); + MechJebAscentButton3 = Localizer.Format("#MechJeb_Ascent_button3"); + MechJebAscentButton4 = Localizer.Format("#MechJeb_Ascent_button4"); + MechJebAscentButton5 = Localizer.Format("#MechJeb_Ascent_button5"); + MechJebAscentButton6 = Localizer.Format("#MechJeb_Ascent_button6"); + MechJebAscentButton7 = Localizer.Format("#MechJeb_Ascent_button7"); + MechJebAscentButton8 = Localizer.Format("#MechJeb_Ascent_button8"); + MechJebAscentButton9 = Localizer.Format("#MechJeb_Ascent_button9"); + MechJebAscentButton10 = Localizer.Format("#MechJeb_Ascent_button10"); + MechJebAscentButton11 = Localizer.Format("#MechJeb_Ascent_button11"); + MechJebAscentButton12 = Localizer.Format("#MechJeb_Ascent_button12"); + MechJebAscentButton13 = Localizer.Format("#MechJeb_Ascent_button13"); + MechJebAscentButton14 = Localizer.Format("#MechJeb_Ascent_button14"); + MechJebAscentButton15 = Localizer.Format("#MechJeb_Ascent_button15"); + MechJebAscentButton17 = Localizer.Format("#MechJeb_Ascent_button17"); + + MechJebAscentLabel1 = Localizer.Format("#MechJeb_Ascent_label1"); + MechJebAscentLabel2 = Localizer.Format("#MechJeb_Ascent_label2"); + MechJebAscentLabel3 = Localizer.Format("#MechJeb_Ascent_label3"); + MechJebAscentLabel4 = Localizer.Format("#MechJeb_Ascent_label4"); + MechJebAscentLabel5 = Localizer.Format("#MechJeb_Ascent_label5"); + MechJebAscentLabel6 = Localizer.Format("#MechJeb_Ascent_label6"); //MechJeb_Ascent_label7 = Localizer.Format("#MechJeb_Ascent_label7"); - MechJeb_Ascent_label8 = Localizer.Format("#MechJeb_Ascent_label8"); - MechJeb_Ascent_label9 = Localizer.Format("#MechJeb_Ascent_label9"); - MechJeb_Ascent_label10 = Localizer.Format("#MechJeb_Ascent_label10"); - MechJeb_Ascent_label11 = Localizer.Format("#MechJeb_Ascent_label11"); - MechJeb_Ascent_label12 = Localizer.Format("#MechJeb_Ascent_label12"); - MechJeb_Ascent_label13 = Localizer.Format("#MechJeb_Ascent_label13"); - MechJeb_Ascent_label14 = Localizer.Format("#MechJeb_Ascent_label14"); - MechJeb_Ascent_label15 = Localizer.Format("#MechJeb_Ascent_label15"); - MechJeb_Ascent_label16 = Localizer.Format("#MechJeb_Ascent_label16"); - MechJeb_Ascent_label17 = Localizer.Format("#MechJeb_Ascent_label17"); - MechJeb_Ascent_label18 = Localizer.Format("#MechJeb_Ascent_label18"); - MechJeb_Ascent_label19 = Localizer.Format("#MechJeb_Ascent_label19"); - MechJeb_Ascent_label20 = Localizer.Format("#MechJeb_Ascent_label20"); - MechJeb_Ascent_label21 = Localizer.Format("#MechJeb_Ascent_label21"); - MechJeb_Ascent_label22 = Localizer.Format("#MechJeb_Ascent_label22"); - MechJeb_Ascent_label23 = Localizer.Format("#MechJeb_Ascent_label23"); - MechJeb_Ascent_label24 = Localizer.Format("#MechJeb_Ascent_label24"); - MechJeb_Ascent_label25 = Localizer.Format("#MechJeb_Ascent_label25"); - MechJeb_Ascent_label26 = Localizer.Format("#MechJeb_Ascent_label26"); - MechJeb_Ascent_label27 = Localizer.Format("#MechJeb_Ascent_label27"); - MechJeb_Ascent_label28 = Localizer.Format("#MechJeb_Ascent_label28"); - MechJeb_Ascent_label29 = Localizer.Format("#MechJeb_Ascent_label29"); - MechJeb_Ascent_label30 = Localizer.Format("#MechJeb_Ascent_label30"); - MechJeb_Ascent_label31 = Localizer.Format("#MechJeb_Ascent_label31"); - MechJeb_Ascent_label32 = Localizer.Format("#MechJeb_Ascent_label32"); - MechJeb_Ascent_label33 = Localizer.Format("#MechJeb_Ascent_label33"); - MechJeb_Ascent_label34 = Localizer.Format("#MechJeb_Ascent_label34"); - MechJeb_Ascent_label35 = Localizer.Format("#MechJeb_Ascent_label35"); - MechJeb_Ascent_label36 = Localizer.Format("#MechJeb_Ascent_label36"); - MechJeb_Ascent_label37 = Localizer.Format("#MechJeb_Ascent_label37"); - MechJeb_Ascent_label38 = Localizer.Format("#MechJeb_Ascent_label38"); - MechJeb_Ascent_label39 = Localizer.Format("#MechJeb_Ascent_label39"); - MechJeb_Ascent_label40 = Localizer.Format("#MechJeb_Ascent_label40"); - MechJeb_Ascent_label41 = Localizer.Format("#MechJeb_Ascent_label41"); - MechJeb_Ascent_label42 = Localizer.Format("#MechJeb_Ascent_label42"); - - MechJeb_Ascent_label44 = Localizer.Format("#MechJeb_Ascent_label44"); - - MechJeb_Ascent_checkbox2 = Localizer.Format("#MechJeb_Ascent_checkbox2"); - MechJeb_Ascent_checkbox3 = Localizer.Format("#MechJeb_Ascent_checkbox3"); - MechJeb_Ascent_checkbox4 = Localizer.Format("#MechJeb_Ascent_checkbox4"); - MechJeb_Ascent_checkbox5 = Localizer.Format("#MechJeb_Ascent_checkbox5"); - MechJeb_Ascent_checkbox6 = Localizer.Format("#MechJeb_Ascent_checkbox6"); - MechJeb_Ascent_checkbox7 = Localizer.Format("#MechJeb_Ascent_checkbox7"); - MechJeb_Ascent_checkbox8 = Localizer.Format("#MechJeb_Ascent_checkbox8"); - MechJeb_Ascent_checkbox9 = Localizer.Format("#MechJeb_Ascent_checkbox9"); - MechJeb_Ascent_checkbox10 = Localizer.Format("#MechJeb_Ascent_checkbox10"); - MechJeb_Ascent_checkbox11 = Localizer.Format("#MechJeb_Ascent_checkbox11"); - MechJeb_Ascent_checkbox12 = Localizer.Format("#MechJeb_Ascent_checkbox12"); - MechJeb_Ascent_checkbox13 = Localizer.Format("#MechJeb_Ascent_checkbox13"); - MechJeb_Ascent_checkbox14 = Localizer.Format("#MechJeb_Ascent_checkbox14"); - MechJeb_Ascent_checkbox15 = Localizer.Format("#MechJeb_Ascent_checkbox15"); - MechJeb_Ascent_checkbox16 = Localizer.Format("#MechJeb_Ascent_checkbox16"); - MechJeb_Ascent_checkbox17 = Localizer.Format("#MechJeb_Ascent_checkbox17"); - MechJeb_Ascent_checkbox18 = Localizer.Format("#MechJeb_Ascent_checkbox18"); - MechJeb_Ascent_checkbox19 = Localizer.Format("#MechJeb_Ascent_checkbox19"); - MechJeb_Ascent_checkbox20 = Localizer.Format("#MechJeb_Ascent_checkbox20"); - - MechJeb_Ascent_status9 = Localizer.Format("#MechJeb_Ascent_status9"); - MechJeb_Ascent_status10 = Localizer.Format("#MechJeb_Ascent_status10"); - MechJeb_Ascent_status11 = Localizer.Format("#MechJeb_Ascent_status11"); - - - MechJeb_Ascent_attachAlt = Localizer.Format("#MechJeb_Ascent_attachAlt"); - MechJeb_Ascent_warnAttachAltHigh = Localizer.Format("#MechJeb_Ascent_warnAttachAltHigh"); - MechJeb_Ascent_warnAttachAltLow = Localizer.Format("#MechJeb_Ascent_warnAttachAltLow"); - MechJeb_Ascent_LaunchToTargetLan = Localizer.Format("#MechJeb_Ascent_LaunchToTargetLan"); - MechJeb_Ascent_LaunchToLan = Localizer.Format("#MechJeb_Ascent_LaunchToLan"); - MechJeb_Ascent_LaunchingToTargetLAN = Localizer.Format("#MechJeb_Ascent_LaunchingToTargetLAN"); - MechJeb_Ascent_LaunchingToManualLAN = Localizer.Format("#MechJeb_Ascent_LaunchingToManualLAN"); - - MechJeb_Ascent_msg2 = Localizer.Format("#MechJeb_Ascent_msg2"); - MechJeb_Ascent_msg3 = Localizer.Format("#MechJeb_Ascent_msg3"); - MechJeb_Ascent_hotStaging = Localizer.Format("#MechJeb_Ascent_hotStaging"); - MechJeb_Ascent_dropSolids = Localizer.Format("#MechJeb_Ascent_dropSolids"); - MechJeb_Ascent_leadTime = Localizer.Format("#MechJeb_Ascent_leadTime"); - - MechJeb_InfoItems_UnlimitedText = Localizer.Format("#MechJeb_InfoItems_UnlimitedText"); - MechJeb_InfoItems_label1 = Localizer.Format("#MechJeb_InfoItems_label1"); - - MechJeb_InfoItems_button5 = Localizer.Format("#MechJeb_InfoItems_button5"); - MechJeb_InfoItems_button6 = Localizer.Format("#MechJeb_InfoItems_button6"); - - MechJeb_InfoItems_StatsColumn0 = Localizer.Format("#MechJeb_InfoItems_StatsColumn0"); - MechJeb_InfoItems_StatsColumn1 = Localizer.Format("#MechJeb_InfoItems_StatsColumn1"); - MechJeb_InfoItems_StatsColumn2 = Localizer.Format("#MechJeb_InfoItems_StatsColumn2"); - MechJeb_InfoItems_StatsColumn3 = Localizer.Format("#MechJeb_InfoItems_StatsColumn3"); - MechJeb_InfoItems_StatsColumn4 = Localizer.Format("#MechJeb_InfoItems_StatsColumn4"); - MechJeb_InfoItems_StatsColumn5 = Localizer.Format("#MechJeb_InfoItems_StatsColumn5"); - MechJeb_InfoItems_StatsColumn6 = Localizer.Format("#MechJeb_InfoItems_StatsColumn6"); - MechJeb_InfoItems_StatsColumn7 = Localizer.Format("#MechJeb_InfoItems_StatsColumn7"); - MechJeb_InfoItems_StatsColumn8 = Localizer.Format("#MechJeb_InfoItems_StatsColumn8"); - MechJeb_InfoItems_StatsColumn9 = Localizer.Format("#MechJeb_InfoItems_StatsColumn9"); - MechJeb_InfoItems_StatsColumn10 = Localizer.Format("#MechJeb_InfoItems_StatsColumn10"); - MechJeb_InfoItems_StatsColumn11 = Localizer.Format("#MechJeb_InfoItems_StatsColumn11"); - MechJeb_InfoItems_StatsColumn12 = Localizer.Format("#MechJeb_InfoItems_StatsColumn12"); - MechJeb_InfoItems_StatsColumn13 = Localizer.Format("#MechJeb_InfoItems_StatsColumn13"); - - MechJeb_InfoItems_showEmpty = Localizer.Format("#MechJeb_InfoItems_showEmpty"); - MechJeb_InfoItems_hideEmpty = Localizer.Format("#MechJeb_InfoItems_hideEmpty"); - - MechJeb_NavBallGuidance_btn1 = Localizer.Format("#MechJeb_NavBallGuidance_btn1"); - MechJeb_NavBallGuidance_btn2 = Localizer.Format("#MechJeb_NavBallGuidance_btn2"); - - MechJeb_Ascent_title = Localizer.Format("#MechJeb_Ascent_title"); - MechJeb_WindowEd_title = Localizer.Format("#MechJeb_WindowEd_title"); - MechJeb_WindowEd_CustomInfoWindow_Label1 = Localizer.Format("#MechJeb_WindowEd_CustomInfoWindow_Label1"); + MechJebAscentLabel8 = Localizer.Format("#MechJeb_Ascent_label8"); + MechJebAscentLabel9 = Localizer.Format("#MechJeb_Ascent_label9"); + MechJebAscentLabel10 = Localizer.Format("#MechJeb_Ascent_label10"); + MechJebAscentLabel11 = Localizer.Format("#MechJeb_Ascent_label11"); + MechJebAscentLabel12 = Localizer.Format("#MechJeb_Ascent_label12"); + MechJebAscentLabel13 = Localizer.Format("#MechJeb_Ascent_label13"); + MechJebAscentLabel14 = Localizer.Format("#MechJeb_Ascent_label14"); + MechJebAscentLabel15 = Localizer.Format("#MechJeb_Ascent_label15"); + MechJebAscentLabel16 = Localizer.Format("#MechJeb_Ascent_label16"); + MechJebAscentLabel17 = Localizer.Format("#MechJeb_Ascent_label17"); + MechJebAscentLabel18 = Localizer.Format("#MechJeb_Ascent_label18"); + MechJebAscentLabel19 = Localizer.Format("#MechJeb_Ascent_label19"); + MechJebAscentLabel20 = Localizer.Format("#MechJeb_Ascent_label20"); + MechJebAscentLabel21 = Localizer.Format("#MechJeb_Ascent_label21"); + MechJebAscentLabel22 = Localizer.Format("#MechJeb_Ascent_label22"); + MechJebAscentLabel23 = Localizer.Format("#MechJeb_Ascent_label23"); + MechJebAscentLabel24 = Localizer.Format("#MechJeb_Ascent_label24"); + MechJebAscentLabel25 = Localizer.Format("#MechJeb_Ascent_label25"); + MechJebAscentLabel26 = Localizer.Format("#MechJeb_Ascent_label26"); + MechJebAscentLabel27 = Localizer.Format("#MechJeb_Ascent_label27"); + MechJebAscentLabel28 = Localizer.Format("#MechJeb_Ascent_label28"); + MechJebAscentLabel29 = Localizer.Format("#MechJeb_Ascent_label29"); + MechJebAscentLabel30 = Localizer.Format("#MechJeb_Ascent_label30"); + MechJebAscentLabel31 = Localizer.Format("#MechJeb_Ascent_label31"); + MechJebAscentLabel32 = Localizer.Format("#MechJeb_Ascent_label32"); + MechJebAscentLabel33 = Localizer.Format("#MechJeb_Ascent_label33"); + MechJebAscentLabel34 = Localizer.Format("#MechJeb_Ascent_label34"); + MechJebAscentLabel35 = Localizer.Format("#MechJeb_Ascent_label35"); + MechJebAscentLabel36 = Localizer.Format("#MechJeb_Ascent_label36"); + MechJebAscentLabel37 = Localizer.Format("#MechJeb_Ascent_label37"); + MechJebAscentLabel38 = Localizer.Format("#MechJeb_Ascent_label38"); + MechJebAscentLabel39 = Localizer.Format("#MechJeb_Ascent_label39"); + MechJebAscentLabel40 = Localizer.Format("#MechJeb_Ascent_label40"); + MechJebAscentLabel41 = Localizer.Format("#MechJeb_Ascent_label41"); + MechJebAscentLabel42 = Localizer.Format("#MechJeb_Ascent_label42"); + + MechJebAscentLabel44 = Localizer.Format("#MechJeb_Ascent_label44"); + + MechJebAscentCheckbox2 = Localizer.Format("#MechJeb_Ascent_checkbox2"); + MechJebAscentCheckbox3 = Localizer.Format("#MechJeb_Ascent_checkbox3"); + MechJebAscentCheckbox4 = Localizer.Format("#MechJeb_Ascent_checkbox4"); + MechJebAscentCheckbox5 = Localizer.Format("#MechJeb_Ascent_checkbox5"); + MechJebAscentCheckbox6 = Localizer.Format("#MechJeb_Ascent_checkbox6"); + MechJebAscentCheckbox7 = Localizer.Format("#MechJeb_Ascent_checkbox7"); + MechJebAscentCheckbox8 = Localizer.Format("#MechJeb_Ascent_checkbox8"); + MechJebAscentCheckbox9 = Localizer.Format("#MechJeb_Ascent_checkbox9"); + MechJebAscentCheckbox10 = Localizer.Format("#MechJeb_Ascent_checkbox10"); + MechJebAscentCheckbox11 = Localizer.Format("#MechJeb_Ascent_checkbox11"); + MechJebAscentCheckbox12 = Localizer.Format("#MechJeb_Ascent_checkbox12"); + MechJebAscentCheckbox13 = Localizer.Format("#MechJeb_Ascent_checkbox13"); + MechJebAscentCheckbox14 = Localizer.Format("#MechJeb_Ascent_checkbox14"); + MechJebAscentCheckbox15 = Localizer.Format("#MechJeb_Ascent_checkbox15"); + MechJebAscentCheckbox16 = Localizer.Format("#MechJeb_Ascent_checkbox16"); + MechJebAscentCheckbox17 = Localizer.Format("#MechJeb_Ascent_checkbox17"); + MechJebAscentCheckbox18 = Localizer.Format("#MechJeb_Ascent_checkbox18"); + MechJebAscentCheckbox19 = Localizer.Format("#MechJeb_Ascent_checkbox19"); + MechJebAscentCheckbox20 = Localizer.Format("#MechJeb_Ascent_checkbox20"); + + MechJebAscentStatus9 = Localizer.Format("#MechJeb_Ascent_status9"); + MechJebAscentStatus10 = Localizer.Format("#MechJeb_Ascent_status10"); + MechJebAscentStatus11 = Localizer.Format("#MechJeb_Ascent_status11"); + + + MechJebAscentAttachAlt = Localizer.Format("#MechJeb_Ascent_attachAlt"); + MechJebAscentWarnAttachAltHigh = Localizer.Format("#MechJeb_Ascent_warnAttachAltHigh"); + MechJebAscentWarnAttachAltLow = Localizer.Format("#MechJeb_Ascent_warnAttachAltLow"); + MechJebAscentLaunchToTargetLan = Localizer.Format("#MechJeb_Ascent_LaunchToTargetLan"); + MechJebAscentLaunchToLan = Localizer.Format("#MechJeb_Ascent_LaunchToLan"); + MechJebAscentLaunchingToTargetLAN = Localizer.Format("#MechJeb_Ascent_LaunchingToTargetLAN"); + MechJebAscentLaunchingToManualLAN = Localizer.Format("#MechJeb_Ascent_LaunchingToManualLAN"); + + MechJebAscentMsg2 = Localizer.Format("#MechJeb_Ascent_msg2"); + MechJebAscentMsg3 = Localizer.Format("#MechJeb_Ascent_msg3"); + MechJebAscentHotStaging = Localizer.Format("#MechJeb_Ascent_hotStaging"); + MechJebAscentDropSolids = Localizer.Format("#MechJeb_Ascent_dropSolids"); + MechJebAscentLeadTime = Localizer.Format("#MechJeb_Ascent_leadTime"); + + MechJebInfoItemsUnlimitedText = Localizer.Format("#MechJeb_InfoItems_UnlimitedText"); + MechJebInfoItemsLabel1 = Localizer.Format("#MechJeb_InfoItems_label1"); + + MechJebInfoItemsButton5 = Localizer.Format("#MechJeb_InfoItems_button5"); + MechJebInfoItemsButton6 = Localizer.Format("#MechJeb_InfoItems_button6"); + + MechJebInfoItemsStatsColumn0 = Localizer.Format("#MechJeb_InfoItems_StatsColumn0"); + MechJebInfoItemsStatsColumn1 = Localizer.Format("#MechJeb_InfoItems_StatsColumn1"); + MechJebInfoItemsStatsColumn2 = Localizer.Format("#MechJeb_InfoItems_StatsColumn2"); + MechJebInfoItemsStatsColumn3 = Localizer.Format("#MechJeb_InfoItems_StatsColumn3"); + MechJebInfoItemsStatsColumn4 = Localizer.Format("#MechJeb_InfoItems_StatsColumn4"); + MechJebInfoItemsStatsColumn5 = Localizer.Format("#MechJeb_InfoItems_StatsColumn5"); + MechJebInfoItemsStatsColumn6 = Localizer.Format("#MechJeb_InfoItems_StatsColumn6"); + MechJebInfoItemsStatsColumn7 = Localizer.Format("#MechJeb_InfoItems_StatsColumn7"); + MechJebInfoItemsStatsColumn8 = Localizer.Format("#MechJeb_InfoItems_StatsColumn8"); + MechJebInfoItemsStatsColumn9 = Localizer.Format("#MechJeb_InfoItems_StatsColumn9"); + MechJebInfoItemsStatsColumn10 = Localizer.Format("#MechJeb_InfoItems_StatsColumn10"); + MechJebInfoItemsStatsColumn11 = Localizer.Format("#MechJeb_InfoItems_StatsColumn11"); + MechJebInfoItemsStatsColumn12 = Localizer.Format("#MechJeb_InfoItems_StatsColumn12"); + MechJebInfoItemsStatsColumn13 = Localizer.Format("#MechJeb_InfoItems_StatsColumn13"); + + MechJebInfoItemsShowEmpty = Localizer.Format("#MechJeb_InfoItems_showEmpty"); + MechJebInfoItemsHideEmpty = Localizer.Format("#MechJeb_InfoItems_hideEmpty"); + + MechJebNavBallGuidanceBtn1 = Localizer.Format("#MechJeb_NavBallGuidance_btn1"); + MechJebNavBallGuidanceBtn2 = Localizer.Format("#MechJeb_NavBallGuidance_btn2"); + + MechJebAscentTitle = Localizer.Format("#MechJeb_Ascent_title"); + MechJebWindowEdTitle = Localizer.Format("#MechJeb_WindowEd_title"); + MechJebWindowEdCustomInfoWindowLabel1 = Localizer.Format("#MechJeb_WindowEd_CustomInfoWindow_Label1"); } } } diff --git a/MechJeb2/MechJebModuleAscentMenu.cs b/MechJeb2/MechJebModuleAscentMenu.cs index 231a3ff6..75c517d9 100644 --- a/MechJeb2/MechJebModuleAscentMenu.cs +++ b/MechJeb2/MechJebModuleAscentMenu.cs @@ -111,9 +111,9 @@ private void VisibleSectionsGUIElements() Profiler.BeginSample("MJ.GUIWindow.TopButtons"); GUILayout.BeginVertical(GUI.skin.box); - if (_autopilot.Enabled && GUILayout.Button(CachedLocalizer.Instance.MechJeb_Ascent_button1)) //Disengage autopilot + if (_autopilot.Enabled && GUILayout.Button(CachedLocalizer.Instance.MechJebAscentButton1)) //Disengage autopilot _autopilot.Users.Remove(this); - else if (!_autopilot.Enabled && GUILayout.Button(CachedLocalizer.Instance.MechJeb_Ascent_button2)) //Engage autopilot + else if (!_autopilot.Enabled && GUILayout.Button(CachedLocalizer.Instance.MechJebAscentButton2)) //Engage autopilot _autopilot.Users.Add(this); GUILayout.EndVertical(); Profiler.EndSample(); @@ -128,40 +128,40 @@ private void ShowTargetingGUIElements() { if (_ascentSettings.OptimizeStage >= 0) { - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label1, _ascentSettings.DesiredOrbitAltitude, - "km"); //Target Periapsis - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label2, _ascentSettings.DesiredApoapsis, "km"); //Target Apoapsis: - GuiUtils.ToggledTextBox(ref _ascentSettings.AttachAltFlag, CachedLocalizer.Instance.MechJeb_Ascent_attachAlt, + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel1, _ascentSettings.DesiredOrbitAltitude, + "km"); //Target Periapsis + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel2, _ascentSettings.DesiredApoapsis, "km"); //Target Apoapsis: + GuiUtils.ToggledTextBox(ref _ascentSettings.AttachAltFlag, CachedLocalizer.Instance.MechJebAscentAttachAlt, _ascentSettings.DesiredAttachAlt, "km"); } else { if (!_launchingWithAnyPlaneControl) GuiUtils.SimpleTextBox("Flight Path Angle", _ascentSettings.DesiredFPA, "°"); - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_attachAlt, + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentAttachAlt, _ascentSettings.DesiredAttachAltFixed, "km"); } if (_ascentSettings.DesiredApoapsis >= 0 && _ascentSettings.DesiredApoapsis < _ascentSettings.DesiredOrbitAltitude) - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_label3, GuiUtils.yellowLabel); //Ap < Pe: circularizing orbit + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentLabel3, GuiUtils.yellowLabel); //Ap < Pe: circularizing orbit else if (_ascentSettings.AttachAltFlag && _ascentSettings.DesiredAttachAlt > _ascentSettings.DesiredApoapsis) - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_warnAttachAltHigh, + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentWarnAttachAltHigh, GuiUtils.orangeLabel); //Attach > Ap: apoapsis insertion if (_ascentSettings.DesiredApoapsis < 0) - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_label4, GuiUtils.orangeLabel); //Hyperbolic target orbit (neg Ap) + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentLabel4, GuiUtils.orangeLabel); //Hyperbolic target orbit (neg Ap) if (_ascentSettings.AttachAltFlag && _ascentSettings.DesiredAttachAlt < _ascentSettings.DesiredOrbitAltitude) - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_warnAttachAltLow, + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentWarnAttachAltLow, GuiUtils.orangeLabel); //Attach < Pe: periapsis insertion } else { - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label5, _ascentSettings.DesiredOrbitAltitude, "km"); //Orbit altitude + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel5, _ascentSettings.DesiredOrbitAltitude, "km"); //Orbit altitude } GUILayout.BeginHorizontal(); - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label6, _ascentSettings.DesiredInclination, "º", 75, GuiUtils.skin.label, - false); //Orbit inc. - if (GUILayout.Button(CachedLocalizer.Instance.MechJeb_Ascent_button13, GuiUtils.ExpandWidth(false))) //Current + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel6, _ascentSettings.DesiredInclination, "º", 75, GuiUtils.skin.label, + false); //Orbit inc. + if (GUILayout.Button(CachedLocalizer.Instance.MechJebAscentButton13, GuiUtils.ExpandWidth(false))) //Current _ascentSettings.DesiredInclination.val = Math.Round(VesselState.latitude, 3); GUILayout.EndHorizontal(); @@ -182,14 +182,14 @@ private void ShowGuidanceSettingsGUIElements() { GUILayout.BeginVertical(GUI.skin.box); - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label8, _ascentSettings.TurnStartAltitude, + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel8, _ascentSettings.TurnStartAltitude, "km"); //Turn start altitude: - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label9, _ascentSettings.TurnStartVelocity, - "m/s"); //Turn start velocity: - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label10, _ascentSettings.TurnStartPitch, "deg"); //Turn start pitch: - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label11, _ascentSettings.IntermediateAltitude, - "km"); //Intermediate altitude: - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label12, _ascentSettings.HoldAPTime, "s"); //Hold AP Time: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel9, _ascentSettings.TurnStartVelocity, + "m/s"); //Turn start velocity: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel10, _ascentSettings.TurnStartPitch, "deg"); //Turn start pitch: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel11, _ascentSettings.IntermediateAltitude, + "km"); //Intermediate altitude: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel12, _ascentSettings.HoldAPTime, "s"); //Hold AP Time: GUILayout.EndVertical(); } @@ -261,20 +261,20 @@ private void ShowAutoWarpGUIElements() GUILayout.BeginVertical(GUI.skin.box); if (Core.Node.Autowarp) - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label33, _ascentSettings.WarpCountDown, "s", 35); //Launch countdown: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel33, _ascentSettings.WarpCountDown, "s", 35); //Launch countdown: bool targetExists = Core.Target.NormalTargetExists; if (!_launchingWithAnyPlaneControl && !targetExists) { _launchingToPlane = _launchingToRendezvous = _launchingToMatchLan = false; - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_label34); //Select a target for a timed launch. + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentLabel34); //Select a target for a timed launch. } if (!_launchingWithAnyPlaneControl) { // Launch to Rendezvous if (targetExists && _ascentSettings.AscentType != AscentType.PVG - && GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJeb_Ascent_button14, _ascentSettings.LaunchPhaseAngle, "º", + && GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJebAscentButton14, _ascentSettings.LaunchPhaseAngle, "º", width: 40)) //Launch to rendezvous: { _launchingToRendezvous = true; @@ -284,7 +284,7 @@ private void ShowAutoWarpGUIElements() } //Launch into plane of target - if (targetExists && GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJeb_Ascent_button15, _ascentSettings.LaunchLANDifference, "º", + if (targetExists && GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJebAscentButton15, _ascentSettings.LaunchLANDifference, "º", width: LAN_WIDTH)) //Launch into plane of target { _launchingToPlane = true; @@ -301,7 +301,7 @@ private void ShowAutoWarpGUIElements() //Launch to target LAN if (targetExists && _ascentSettings.AscentType == AscentType.PVG - && GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJeb_Ascent_LaunchToTargetLan, + && GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJebAscentLaunchToTargetLan, _ascentSettings.LaunchLANDifference, "º", width: LAN_WIDTH)) //Launch to target LAN { @@ -320,7 +320,7 @@ private void ShowAutoWarpGUIElements() //Launch to LAN if (_ascentSettings.AscentType == AscentType.PVG) { - if (GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJeb_Ascent_LaunchToLan, _ascentSettings.DesiredLan, "º", + if (GuiUtils.ButtonTextBox(CachedLocalizer.Instance.MechJebAscentLaunchToLan, _ascentSettings.DesiredLan, "º", width: LAN_WIDTH)) //Launch to LAN { _launchingToLan = true; @@ -340,7 +340,7 @@ private void ShowAutoWarpGUIElements() if (_launchingWithAnyPlaneControl) { GUILayout.Label(launchTimer); - if (GUILayout.Button(CachedLocalizer.Instance.MechJeb_Ascent_button17)) //Abort + if (GUILayout.Button(CachedLocalizer.Instance.MechJebAscentButton17)) //Abort _launchingToPlane = _launchingToRendezvous = _launchingToMatchLan = _launchingToLan = _autopilot.TimedLaunch = false; } @@ -368,24 +368,24 @@ private void UpdateStrings() heading = $"heading: {Core.Guidance.Heading:F1}"; tgo = $"tgo: {Core.Guidance.Tgo:F3}"; pitch = $"pitch: {Core.Guidance.Pitch:F1}"; - label26 = $"{CachedLocalizer.Instance.MechJeb_Ascent_label26}{Core.Guidance.Status}"; - label27 = $"{CachedLocalizer.Instance.MechJeb_Ascent_label27}{Core.Glueball.SuccessfulConverges}"; - label28 = $"{CachedLocalizer.Instance.MechJeb_Ascent_label28}{Core.Glueball.LastLmStatus}"; + label26 = $"{CachedLocalizer.Instance.MechJebAscentLabel26}{Core.Guidance.Status}"; + label27 = $"{CachedLocalizer.Instance.MechJebAscentLabel27}{Core.Glueball.SuccessfulConverges}"; + label28 = $"{CachedLocalizer.Instance.MechJebAscentLabel28}{Core.Glueball.LastLmStatus}"; n = $"n: {Core.Glueball.LastLmIterations}({Core.Glueball.MaxLmIterations})"; - label29 = $"{CachedLocalizer.Instance.MechJeb_Ascent_label29} {GuiUtils.TimeToDHMS(Core.Glueball.Staleness)}"; + label29 = $"{CachedLocalizer.Instance.MechJebAscentLabel29} {GuiUtils.TimeToDHMS(Core.Glueball.Staleness)}"; znorm = $"znorm: {Core.Glueball.LastZnorm:G5}"; if (Core.Glueball.Exception != null) - label30 = $"{CachedLocalizer.Instance.MechJeb_Ascent_label30}{Core.Glueball.Exception.Message}"; + label30 = $"{CachedLocalizer.Instance.MechJebAscentLabel30}{Core.Glueball.Exception.Message}"; - if (_launchingToPlane) launchTimer = CachedLocalizer.Instance.MechJeb_Ascent_msg2; //Launching to target plane - else if (_launchingToRendezvous) launchTimer = CachedLocalizer.Instance.MechJeb_Ascent_msg3; //Launching to rendezvous - else if (_launchingToMatchLan) launchTimer = CachedLocalizer.Instance.MechJeb_Ascent_LaunchingToTargetLAN; //Launching to target LAN - else if (_launchingToLan) launchTimer = CachedLocalizer.Instance.MechJeb_Ascent_LaunchingToManualLAN; //Launching to manual LAN + if (_launchingToPlane) launchTimer = CachedLocalizer.Instance.MechJebAscentMsg2; //Launching to target plane + else if (_launchingToRendezvous) launchTimer = CachedLocalizer.Instance.MechJebAscentMsg3; //Launching to rendezvous + else if (_launchingToMatchLan) launchTimer = CachedLocalizer.Instance.MechJebAscentLaunchingToTargetLAN; //Launching to target LAN + else if (_launchingToLan) launchTimer = CachedLocalizer.Instance.MechJebAscentLaunchingToManualLAN; //Launching to manual LAN else launchTimer = string.Empty; if (_autopilot.TMinus > 3 * VesselState.deltaT) launchTimer += $": T-{GuiUtils.TimeToDHMS(_autopilot.TMinus, 1)}"; - autopilotStatus = CachedLocalizer.Instance.MechJeb_Ascent_label35 + _autopilot.Status; + autopilotStatus = CachedLocalizer.Instance.MechJebAscentLabel35 + _autopilot.Status; Profiler.EndSample(); } @@ -431,12 +431,12 @@ protected override void WindowGUI(int windowID) if (_autopilot.Enabled) GUILayout.Label(autopilotStatus); //Autopilot status: if (Core.DeactivateControl) - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_label36, GuiUtils.redLabel); //CONTROL DISABLED (AVIONICS) + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentLabel36, GuiUtils.redLabel); //CONTROL DISABLED (AVIONICS) if (!Vessel.patchedConicsUnlocked() && _ascentSettings.AscentType != AscentType.PVG) { GUILayout.Label(CachedLocalizer.Instance - .MechJeb_Ascent_label37); //"Warning: MechJeb is unable to circularize without an upgraded Tracking Station." + .MechJebAscentLabel37); //"Warning: MechJeb is unable to circularize without an upgraded Tracking Station." } GUILayout.BeginHorizontal(); @@ -454,7 +454,7 @@ protected override void WindowGUI(int windowID) if (_ascentSettings.AscentType == AscentType.CLASSIC) _classicPathMenu.Enabled = - GUILayout.Toggle(_classicPathMenu.Enabled, CachedLocalizer.Instance.MechJeb_Ascent_checkbox10); //Edit ascent path + GUILayout.Toggle(_classicPathMenu.Enabled, CachedLocalizer.Instance.MechJebAscentCheckbox10); //Edit ascent path RefreshRateGUI(); @@ -522,7 +522,7 @@ private string PhaseString(Solution solution, double t, int pvgPhase) public override GUILayoutOption[] WindowOptions() => new[] { GUILayout.Width(275), GUILayout.Height(30) }; - public override string GetName() => CachedLocalizer.Instance.MechJeb_Ascent_title; //"Ascent Guidance" + public override string GetName() => CachedLocalizer.Instance.MechJebAscentTitle; //"Ascent Guidance" public override string IconName() => "Ascent Guidance"; } diff --git a/MechJeb2/MechJebModuleAscentPVGSettingsMenu.cs b/MechJeb2/MechJebModuleAscentPVGSettingsMenu.cs index 8407fb11..0aac1fc4 100644 --- a/MechJeb2/MechJebModuleAscentPVGSettingsMenu.cs +++ b/MechJeb2/MechJebModuleAscentPVGSettingsMenu.cs @@ -108,21 +108,21 @@ protected override void WindowGUI(int windowID) GUILayout.EndVertical(); GUILayout.BeginVertical(GUI.skin.box); - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label13, _ascentSettings.PitchStartVelocity, "m/s", - 40); //Booster Pitch start: - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label14, _ascentSettings.PitchRate, "°/s", 40); //Booster Pitch rate: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel13, _ascentSettings.PitchStartVelocity, "m/s", + 40); //Booster Pitch start: + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel14, _ascentSettings.PitchRate, "°/s", 40); //Booster Pitch rate: GUILayout.EndVertical(); GUILayout.BeginVertical(GUI.skin.box); GuiUtils.SimpleTextBox("Q Trigger:", _ascentSettings.DynamicPressureTrigger, "kPa", 40); GuiUtils.ToggledTextBox(ref _ascentSettings.StagingTriggerFlag, "PVG After Stage:", _ascentSettings.StagingTrigger, width: 40); - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label17, _ascentSettings.LimitQa, "Pa-rad"); //Qα limit + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel17, _ascentSettings.LimitQa, "Pa-rad"); //Qα limit if (_ascentSettings.LimitQa < 1000 || _ascentSettings.LimitQa > 4000) { if (_ascentSettings.LimitQa < 0 || _ascentSettings.LimitQa > 10000) GUILayout.Label("Qα limit has been clamped to between 0 and 10000 Pa-rad", GuiUtils.redLabel); else - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_label20, + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentLabel20, GuiUtils.yellowLabel); //Qα limit is recommended to be 1000 to 4000 Pa-rad } diff --git a/MechJeb2/MechJebModuleAscentSettingsMenu.cs b/MechJeb2/MechJebModuleAscentSettingsMenu.cs index d2042242..5626c1fa 100644 --- a/MechJeb2/MechJebModuleAscentSettingsMenu.cs +++ b/MechJeb2/MechJebModuleAscentSettingsMenu.cs @@ -15,8 +15,8 @@ public MechJebModuleAscentSettingsMenu(MechJebCore core) : base(core) private MechJebModuleAscentSettings _ascentSettings => Core.AscentSettings; private MechJebModuleAscentBaseAutopilot _autopilot => Core.Ascent; - private readonly string _climbString = $"{CachedLocalizer.Instance.MechJeb_Ascent_label22}: "; - private readonly string _turnString = $"{CachedLocalizer.Instance.MechJeb_Ascent_label23}: "; + private readonly string _climbString = $"{CachedLocalizer.Instance.MechJebAscentLabel22}: "; + private readonly string _turnString = $"{CachedLocalizer.Instance.MechJebAscentLabel23}: "; private void ShowAscentSettingsGUIElements() { @@ -37,7 +37,7 @@ private void ShowAscentSettingsGUIElements() Core.Thrust.ElectricThrottle = false; } - _ascentSettings.ForceRoll = GUILayout.Toggle(_ascentSettings.ForceRoll, CachedLocalizer.Instance.MechJeb_Ascent_checkbox2); //Force Roll + _ascentSettings.ForceRoll = GUILayout.Toggle(_ascentSettings.ForceRoll, CachedLocalizer.Instance.MechJebAscentCheckbox2); //Force Roll if (_ascentSettings.ForceRoll) { GUILayout.BeginHorizontal(); @@ -52,7 +52,7 @@ private void ShowAscentSettingsGUIElements() { GUIStyle s = _ascentSettings.LimitingAoA ? GuiUtils.greenToggle : null; string sCurrentMaxAoA = $"º ({_autopilot.CurrentMaxAoA:F1}°)"; - GuiUtils.ToggledTextBox(ref _ascentSettings.LimitAoA, CachedLocalizer.Instance.MechJeb_Ascent_checkbox3, _ascentSettings.MaxAoA, + GuiUtils.ToggledTextBox(ref _ascentSettings.LimitAoA, CachedLocalizer.Instance.MechJebAscentCheckbox3, _ascentSettings.MaxAoA, sCurrentMaxAoA, s, 30); //Limit AoA to @@ -63,7 +63,7 @@ private void ShowAscentSettingsGUIElements() GUIStyle sl = _ascentSettings.LimitingAoA && VesselState.dynamicPressure < _ascentSettings.AOALimitFadeoutPressure ? GuiUtils.greenLabel : GuiUtils.skin.label; - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label24, _ascentSettings.AOALimitFadeoutPressure, "Pa", 50, + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel24, _ascentSettings.AOALimitFadeoutPressure, "Pa", 50, sl); //Dynamic Pressure Fadeout GUILayout.EndHorizontal(); } @@ -76,28 +76,28 @@ private void ShowAscentSettingsGUIElements() // corrective steering only applies to Classic GUILayout.BeginHorizontal(); _ascentSettings.CorrectiveSteering = GUILayout.Toggle(_ascentSettings.CorrectiveSteering, - CachedLocalizer.Instance.MechJeb_Ascent_checkbox4, + CachedLocalizer.Instance.MechJebAscentCheckbox4, GuiUtils.ExpandWidth(false)); //Corrective steering if (_ascentSettings.CorrectiveSteering) - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label25, _ascentSettings.CorrectiveSteeringGain, width: 40, + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel25, _ascentSettings.CorrectiveSteeringGain, width: 40, horizontalFraming: false); // Gain GUILayout.EndHorizontal(); } - _ascentSettings.Autostage = GUILayout.Toggle(_ascentSettings.Autostage, CachedLocalizer.Instance.MechJeb_Ascent_checkbox5); //Autostage + _ascentSettings.Autostage = GUILayout.Toggle(_ascentSettings.Autostage, CachedLocalizer.Instance.MechJebAscentCheckbox5); //Autostage if (_ascentSettings.Autostage) Core.Staging.AutostageSettingsInfoItem(); _ascentSettings.AutodeploySolarPanels = - GUILayout.Toggle(_ascentSettings.AutodeploySolarPanels, CachedLocalizer.Instance.MechJeb_Ascent_checkbox6); //Auto-deploy solar panels + GUILayout.Toggle(_ascentSettings.AutodeploySolarPanels, CachedLocalizer.Instance.MechJebAscentCheckbox6); //Auto-deploy solar panels _ascentSettings.AutoDeployAntennas = - GUILayout.Toggle(_ascentSettings.AutoDeployAntennas, CachedLocalizer.Instance.MechJeb_Ascent_checkbox7); //Auto-deploy antennas + GUILayout.Toggle(_ascentSettings.AutoDeployAntennas, CachedLocalizer.Instance.MechJebAscentCheckbox7); //Auto-deploy antennas GUILayout.BeginHorizontal(); - Core.Node.Autowarp = GUILayout.Toggle(Core.Node.Autowarp, CachedLocalizer.Instance.MechJeb_Ascent_checkbox8); //Auto-warp + Core.Node.Autowarp = GUILayout.Toggle(Core.Node.Autowarp, CachedLocalizer.Instance.MechJebAscentCheckbox8); //Auto-warp if (_ascentSettings.AscentType != AscentType.PVG) { _ascentSettings.SkipCircularization = - GUILayout.Toggle(_ascentSettings.SkipCircularization, CachedLocalizer.Instance.MechJeb_Ascent_checkbox9); //Skip Circularization + GUILayout.Toggle(_ascentSettings.SkipCircularization, CachedLocalizer.Instance.MechJebAscentCheckbox9); //Skip Circularization } else { diff --git a/MechJeb2/MechJebModuleCustomInfoWindow.cs b/MechJeb2/MechJebModuleCustomInfoWindow.cs index 51acead7..3a9ee589 100644 --- a/MechJeb2/MechJebModuleCustomInfoWindow.cs +++ b/MechJeb2/MechJebModuleCustomInfoWindow.cs @@ -109,7 +109,7 @@ protected override void WindowGUI(int windowID) if (items.Count == 0) GUILayout.Label(CachedLocalizer.Instance - .MechJeb_WindowEd_CustomInfoWindow_Label1); //Add items to this window with the custom window editor. + .MechJebWindowEdCustomInfoWindowLabel1); //Add items to this window with the custom window editor. RefreshRateGUI(); @@ -554,7 +554,7 @@ protected override void WindowGUI(int windowID) public override GUILayoutOption[] WindowOptions() => new[] { GUILayout.Width(200), GUILayout.Height(540) }; - public override string GetName() => CachedLocalizer.Instance.MechJeb_WindowEd_title; //Custom Window Editor + public override string GetName() => CachedLocalizer.Instance.MechJebWindowEdTitle; //Custom Window Editor public override string IconName() => "Custom Window Editor"; diff --git a/MechJeb2/MechJebModuleInfoItems.cs b/MechJeb2/MechJebModuleInfoItems.cs index a78033e7..b3d95343 100644 --- a/MechJeb2/MechJebModuleInfoItems.cs +++ b/MechJeb2/MechJebModuleInfoItems.cs @@ -309,7 +309,7 @@ public string MaximumVesselMass() EditorDriver.editorFacility == EditorFacility.VAB); return maximumVesselMass < float.MaxValue ? $"{maximumVesselMass:F3} t" - : CachedLocalizer.Instance.MechJeb_InfoItems_UnlimitedText; //"Unlimited" + : CachedLocalizer.Instance.MechJebInfoItemsUnlimitedText; //"Unlimited" } [ValueInfoItem("#MechJeb_DryMass", InfoItem.Category.Vessel, showInEditor = true, format = "F3", units = "t")] //Dry mass diff --git a/MechJeb2/MechJebModuleStagingController.cs b/MechJeb2/MechJebModuleStagingController.cs index d432d1e4..10e32b0d 100644 --- a/MechJeb2/MechJebModuleStagingController.cs +++ b/MechJeb2/MechJebModuleStagingController.cs @@ -176,24 +176,24 @@ public void AutostageOnce(object user) protected override void OnModuleDisabled() => AutostagingOnce = false; - private readonly string _sFairingMinDynamicPressure = $" {CachedLocalizer.Instance.MechJeb_Ascent_label39} <"; - private readonly string _sFairingMinAltitude = $" {CachedLocalizer.Instance.MechJeb_Ascent_label40} >"; - private readonly string _sFairingMaxAerothermalFlux = $" {CachedLocalizer.Instance.MechJeb_Ascent_label41} <"; + private readonly string _sFairingMinDynamicPressure = $" {CachedLocalizer.Instance.MechJebAscentLabel39} <"; + private readonly string _sFairingMinAltitude = $" {CachedLocalizer.Instance.MechJebAscentLabel40} >"; + private readonly string _sFairingMaxAerothermalFlux = $" {CachedLocalizer.Instance.MechJebAscentLabel41} <"; private readonly string _sHotstaging = - $"{CachedLocalizer.Instance.MechJeb_Ascent_hotStaging} {CachedLocalizer.Instance.MechJeb_Ascent_leadTime}"; + $"{CachedLocalizer.Instance.MechJebAscentHotStaging} {CachedLocalizer.Instance.MechJebAscentLeadTime}"; private readonly string _sDropSolids = - $"{CachedLocalizer.Instance.MechJeb_Ascent_dropSolids} {CachedLocalizer.Instance.MechJeb_Ascent_leadTime}"; + $"{CachedLocalizer.Instance.MechJebAscentDropSolids} {CachedLocalizer.Instance.MechJebAscentLeadTime}"; - private readonly string _sLeadTime = $"{CachedLocalizer.Instance.MechJeb_Ascent_leadTime}: "; + private readonly string _sLeadTime = $"{CachedLocalizer.Instance.MechJebAscentLeadTime}: "; [GeneralInfoItem("#MechJeb_AutostagingSettings", InfoItem.Category.Misc)] //Autostaging settings public void AutostageSettingsInfoItem() { GUILayout.BeginVertical(GUI.skin.box); - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label42, AutostageLimit, width: 40); //"Stop at stage #" + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel42, AutostageLimit, width: 40); //"Stop at stage #" GUILayout.BeginHorizontal(); GUILayout.Label("Delays: "); @@ -205,19 +205,19 @@ public void AutostageSettingsInfoItem() ClampAutostageThrust(); - GUILayout.Label(CachedLocalizer.Instance.MechJeb_Ascent_label38); //"Stage fairings when:" + GUILayout.Label(CachedLocalizer.Instance.MechJebAscentLabel38); //"Stage fairings when:" GuiUtils.SimpleTextBox(_sFairingMinDynamicPressure, FairingMaxDynamicPressure, "kPa", 50); //"dynamic pressure" GuiUtils.SimpleTextBox(_sFairingMinAltitude, FairingMinAltitude, "km", 50); //altitude GuiUtils.SimpleTextBox(_sFairingMaxAerothermalFlux, FairingMaxAerothermalFlux, "W/m²", 50); //aerothermal flux GUILayout.BeginHorizontal(); - HotStaging = GUILayout.Toggle(HotStaging, CachedLocalizer.Instance.MechJeb_Ascent_hotStaging); //"Support hotstaging" + HotStaging = GUILayout.Toggle(HotStaging, CachedLocalizer.Instance.MechJebAscentHotStaging); //"Support hotstaging" GUILayout.FlexibleSpace(); GuiUtils.SimpleTextBox(_sLeadTime, HotStagingLeadTime, "s", 35); //"lead time" GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); - DropSolids = GUILayout.Toggle(DropSolids, CachedLocalizer.Instance.MechJeb_Ascent_dropSolids); //"Drop solids early" + DropSolids = GUILayout.Toggle(DropSolids, CachedLocalizer.Instance.MechJebAscentDropSolids); //"Drop solids early" GUILayout.FlexibleSpace(); GuiUtils.SimpleTextBox(_sLeadTime, DropSolidsLeadTime, "s", 35); //"lead time" GUILayout.EndHorizontal(); @@ -228,16 +228,16 @@ public void AutostageSettingsInfoItem() [ValueInfoItem("#MechJeb_Autostagingstatus", InfoItem.Category.Misc)] //Autostaging status public string AutostageStatus() { - if (!Enabled) return CachedLocalizer.Instance.MechJeb_Ascent_status9; //"Autostaging off" - if (AutostagingOnce) return CachedLocalizer.Instance.MechJeb_Ascent_status10; //"Will autostage next stage only" - return CachedLocalizer.Instance.MechJeb_Ascent_status11 + (int)AutostageLimit; //"Autostaging until stage #" + if (!Enabled) return CachedLocalizer.Instance.MechJebAscentStatus9; //"Autostaging off" + if (AutostagingOnce) return CachedLocalizer.Instance.MechJebAscentStatus10; //"Will autostage next stage only" + return CachedLocalizer.Instance.MechJebAscentStatus11 + (int)AutostageLimit; //"Autostaging until stage #" } [GeneralInfoItem("#MechJeb_ClampAutostageThrust", InfoItem.Category.Misc)] //Clamp Autostage Thrust private void ClampAutostageThrust() { double prev = Core.Staging.ClampAutoStageThrustPct; - GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJeb_Ascent_label44, Core.Staging.ClampAutoStageThrustPct, "%", + GuiUtils.SimpleTextBox(CachedLocalizer.Instance.MechJebAscentLabel44, Core.Staging.ClampAutoStageThrustPct, "%", 50); //"Clamp AutoStage Thrust " // ReSharper disable once CompareOfFloatsByEqualityOperator if (prev != Core.Staging.ClampAutoStageThrustPct) diff --git a/MechJeb2/MechJebModuleThrustController.cs b/MechJeb2/MechJebModuleThrustController.cs index d2b1737a..3b5f1a22 100644 --- a/MechJeb2/MechJebModuleThrustController.cs +++ b/MechJeb2/MechJebModuleThrustController.cs @@ -52,7 +52,7 @@ public MechJebModuleThrustController(MechJebCore core) public void LimitToMaxDynamicPressureInfoItem() { GUIStyle s = Limiter == LimitMode.DYNAMIC_PRESSURE ? GuiUtils.greenToggle : null; - GuiUtils.ToggledTextBox(ref LimitDynamicPressure, CachedLocalizer.Instance.MechJeb_Ascent_checkbox11, MaxDynamicPressure, "pa", s, 80); + GuiUtils.ToggledTextBox(ref LimitDynamicPressure, CachedLocalizer.Instance.MechJebAscentCheckbox11, MaxDynamicPressure, "pa", s, 80); } [Persistent(pass = (int)Pass.GLOBAL)] @@ -63,7 +63,7 @@ public void LimitToPreventOverheatsInfoItem() { GUIStyle s = Limiter == LimitMode.TEMPERATURE ? GuiUtils.greenToggle : GuiUtils.skin.toggle; LimitToPreventOverheats = - GUILayout.Toggle(LimitToPreventOverheats, CachedLocalizer.Instance.MechJeb_Ascent_checkbox12, s); //"Prevent engine overheats" + GUILayout.Toggle(LimitToPreventOverheats, CachedLocalizer.Instance.MechJebAscentCheckbox12, s); //"Prevent engine overheats" } [ToggleInfoItem("#MechJeb_SmoothThrottle", InfoItem.Category.Thrust)] //Smooth throttle @@ -83,7 +83,7 @@ public void LimitToPreventFlameoutInfoItem() { GUIStyle s = Limiter == LimitMode.FLAMEOUT ? GuiUtils.greenToggle : GuiUtils.skin.toggle; LimitToPreventFlameout = - GUILayout.Toggle(LimitToPreventFlameout, CachedLocalizer.Instance.MechJeb_Ascent_checkbox13, s); //"Prevent jet flameout" + GUILayout.Toggle(LimitToPreventFlameout, CachedLocalizer.Instance.MechJebAscentCheckbox13, s); //"Prevent jet flameout" } [Persistent(pass = (int)Pass.GLOBAL)] @@ -94,7 +94,7 @@ public void LimitToPreventUnstableIgnitionInfoItem() { GUIStyle s = Limiter == LimitMode.UNSTABLE_IGNITION ? GuiUtils.greenToggle : GuiUtils.skin.toggle; LimitToPreventUnstableIgnition = - GUILayout.Toggle(LimitToPreventUnstableIgnition, CachedLocalizer.Instance.MechJeb_Ascent_checkbox14, s); //"Prevent unstable ignition" + GUILayout.Toggle(LimitToPreventUnstableIgnition, CachedLocalizer.Instance.MechJebAscentCheckbox14, s); //"Prevent unstable ignition" } [Persistent(pass = (int)Pass.GLOBAL)] @@ -104,7 +104,7 @@ public void LimitToPreventUnstableIgnitionInfoItem() public void AutoRCsUllageInfoItem() { GUIStyle s = Limiter == LimitMode.AUTO_RCS_ULLAGE ? GuiUtils.greenToggle : GuiUtils.skin.toggle; - AutoRCSUllaging = GUILayout.Toggle(AutoRCSUllaging, CachedLocalizer.Instance.MechJeb_Ascent_checkbox15, s); //"Use RCS to ullage" + AutoRCSUllaging = GUILayout.Toggle(AutoRCSUllaging, CachedLocalizer.Instance.MechJebAscentCheckbox15, s); //"Use RCS to ullage" } // 5% safety margin on flameouts @@ -126,7 +126,7 @@ public void AutoRCsUllageInfoItem() public void LimitAccelerationInfoItem() { GUIStyle s = Limiter == LimitMode.ACCELERATION ? GuiUtils.greenToggle : null; - GuiUtils.ToggledTextBox(ref LimitAcceleration, CachedLocalizer.Instance.MechJeb_Ascent_checkbox16, MaxAcceleration, "m/s²", s, + GuiUtils.ToggledTextBox(ref LimitAcceleration, CachedLocalizer.Instance.MechJebAscentCheckbox16, MaxAcceleration, "m/s²", s, 30); //"Limit acceleration to" } @@ -141,7 +141,7 @@ public void LimitAccelerationInfoItem() public void LimitThrottleInfoItem() { GUIStyle s = Limiter == LimitMode.THROTTLE ? MaxThrottle > 0d ? GuiUtils.greenToggle : GuiUtils.redToggle : null; - GuiUtils.ToggledTextBox(ref LimitThrottle, CachedLocalizer.Instance.MechJeb_Ascent_checkbox17, MaxAcceleration, "%", s, + GuiUtils.ToggledTextBox(ref LimitThrottle, CachedLocalizer.Instance.MechJebAscentCheckbox17, MaxAcceleration, "%", s, 30); //"Limit throttle to" } @@ -155,7 +155,7 @@ public void LimitThrottleInfoItem() public void LimiterMinThrottleInfoItem() { GUIStyle s = Limiter == LimitMode.MIN_THROTTLE ? GuiUtils.greenToggle : null; - GuiUtils.ToggledTextBox(ref LimiterMinThrottle, CachedLocalizer.Instance.MechJeb_Ascent_checkbox18, MinThrottle, "%", s, + GuiUtils.ToggledTextBox(ref LimiterMinThrottle, CachedLocalizer.Instance.MechJebAscentCheckbox18, MinThrottle, "%", s, 30); //"Keep limited throttle over" } @@ -171,7 +171,7 @@ public void DifferentialThrottleMenu() ? Core.Thrust.DifferentialThrottleSuccess == DifferentialThrottleStatus.SUCCESS ? GuiUtils.greenToggle : GuiUtils.yellowToggle : GuiUtils.skin.toggle; DifferentialThrottle = - GUILayout.Toggle(DifferentialThrottle, CachedLocalizer.Instance.MechJeb_Ascent_checkbox19, s); //"Differential throttle" + GUILayout.Toggle(DifferentialThrottle, CachedLocalizer.Instance.MechJebAscentCheckbox19, s); //"Differential throttle" if (oldDifferentialThrottle && !Core.Thrust.DifferentialThrottle) Core.Thrust.DisableDifferentialThrottle(); @@ -204,7 +204,7 @@ public void LimitElectricInfoItem() else if (ElectricEngineRunning()) s = GuiUtils.greenLabel; ElectricThrottle = - GUILayout.Toggle(ElectricThrottle, CachedLocalizer.Instance.MechJeb_Ascent_checkbox20, s, + GUILayout.Toggle(ElectricThrottle, CachedLocalizer.Instance.MechJebAscentCheckbox20, s, GuiUtils.LayoutWidth(110)); //"Electric limit Lo" GuiUtils.SimpleTextField(ElectricThrottleLo, 30); GUILayout.Label("% Hi", GuiUtils.ExpandWidth(false)); diff --git a/MechJeb2/MechJebStageStatsHelper.cs b/MechJeb2/MechJebStageStatsHelper.cs index 4c17b27c..d5bcc831 100644 --- a/MechJeb2/MechJebStageStatsHelper.cs +++ b/MechJeb2/MechJebStageStatsHelper.cs @@ -116,19 +116,19 @@ private void InitalizeStageHeaderData() stageHeaderData.Clear(); stageHeaderData.Add(StageData.KSPStage, "Stage" + SPACING); - stageHeaderData.Add(StageData.InitialMass, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn1 + SPACING); - stageHeaderData.Add(StageData.FinalMass, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn2 + SPACING); - stageHeaderData.Add(StageData.StagedMass, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn3 + SPACING); - stageHeaderData.Add(StageData.BurnedMass, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn4 + SPACING); - stageHeaderData.Add(StageData.Thrust, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn13 + SPACING); - stageHeaderData.Add(StageData.VacInitialTWR, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn5 + SPACING); - stageHeaderData.Add(StageData.VacMaxTWR, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn6 + SPACING); - stageHeaderData.Add(StageData.AtmoInitialTWR, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn7 + SPACING); - stageHeaderData.Add(StageData.AtmoMaxTWR, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn8 + SPACING); - stageHeaderData.Add(StageData.Isp, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn9 + SPACING); - stageHeaderData.Add(StageData.AtmoDeltaV, (showRcs ? "RCS ∆Vmin" : CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn10) + SPACING); - stageHeaderData.Add(StageData.VacDeltaV, (showRcs ? "RCS ∆Vmax" : CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn11) + SPACING); - stageHeaderData.Add(StageData.Time, CachedLocalizer.Instance.MechJeb_InfoItems_StatsColumn12 + SPACING); + stageHeaderData.Add(StageData.InitialMass, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn1 + SPACING); + stageHeaderData.Add(StageData.FinalMass, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn2 + SPACING); + stageHeaderData.Add(StageData.StagedMass, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn3 + SPACING); + stageHeaderData.Add(StageData.BurnedMass, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn4 + SPACING); + stageHeaderData.Add(StageData.Thrust, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn13 + SPACING); + stageHeaderData.Add(StageData.VacInitialTWR, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn5 + SPACING); + stageHeaderData.Add(StageData.VacMaxTWR, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn6 + SPACING); + stageHeaderData.Add(StageData.AtmoInitialTWR, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn7 + SPACING); + stageHeaderData.Add(StageData.AtmoMaxTWR, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn8 + SPACING); + stageHeaderData.Add(StageData.Isp, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn9 + SPACING); + stageHeaderData.Add(StageData.AtmoDeltaV, (showRcs ? "RCS ∆Vmin" : CachedLocalizer.Instance.MechJebInfoItemsStatsColumn10) + SPACING); + stageHeaderData.Add(StageData.VacDeltaV, (showRcs ? "RCS ∆Vmax" : CachedLocalizer.Instance.MechJebInfoItemsStatsColumn11) + SPACING); + stageHeaderData.Add(StageData.Time, CachedLocalizer.Instance.MechJebInfoItemsStatsColumn12 + SPACING); } private void GatherStages(List stages) @@ -217,7 +217,7 @@ public void AllStageStats() GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); - GUILayout.Label(CachedLocalizer.Instance.MechJeb_InfoItems_label1); //"Stage stats" + GUILayout.Label(CachedLocalizer.Instance.MechJebInfoItemsLabel1); //"Stage stats" if (GUILayout.Button(timeSeconds ? "s" : "dhms", GUILayout.ExpandWidth(false))) { @@ -226,7 +226,7 @@ public void AllStageStats() } if (GUILayout.Button( - showEmpty ? CachedLocalizer.Instance.MechJeb_InfoItems_showEmpty : CachedLocalizer.Instance.MechJeb_InfoItems_hideEmpty, + showEmpty ? CachedLocalizer.Instance.MechJebInfoItemsShowEmpty : CachedLocalizer.Instance.MechJebInfoItemsHideEmpty, GUILayout.ExpandWidth(false))) { showEmpty = !showEmpty; @@ -249,7 +249,7 @@ public void AllStageStats() if (!HighLogic.LoadedSceneIsEditor) { if (GUILayout.Button( - liveSLT ? CachedLocalizer.Instance.MechJeb_InfoItems_button5 : CachedLocalizer.Instance.MechJeb_InfoItems_button6, + liveSLT ? CachedLocalizer.Instance.MechJebInfoItemsButton5 : CachedLocalizer.Instance.MechJebInfoItemsButton6, GUILayout.ExpandWidth(false))) //"Live SLT" "0Alt SLT" { liveSLT = !liveSLT;