Exemple #1
0
        public static string FormatCircleSelect(GUICircleSelection circleSelect)
        {
            string circleSelectClean;

            switch (circleSelect)
            {
            case GUICircleSelection.ACTIVE:
                circleSelectClean = "#autoLOC_AH_0045";
                break;

            case GUICircleSelection.DSN:
                circleSelectClean = "#autoLOC_AH_0046";
                break;

            case GUICircleSelection.DSN_AND_RELAY:
                circleSelectClean = "#autoLOC_AH_0047";
                break;

            case GUICircleSelection.RELAY:
                circleSelectClean = "#autoLOC_AH_0048";
                break;

            case GUICircleSelection.NONE:
            default:
                circleSelectClean = "#autoLOC_AH_0049";
                break;
            }
            return(circleSelectClean);
        }
        private void SelectCircleTypeWindow(int id)
        {
            GUILayout.BeginVertical();

            if (GUILayout.Button(/*"Active"*/ Localizer.Format("#autoLOC_AH_0045"), guiStyleSelectActive))
            {
                currentCircleType = GUICircleSelection.ACTIVE;
                SelectCircleType();
            }
            if (GUILayout.Button(/*"DSN"*/ Localizer.Format("#autoLOC_AH_0046"), guiStyleSelectDSN))
            {
                currentCircleType = GUICircleSelection.DSN;
                SelectCircleType();
            }
            if (GUILayout.Button(/*"Relay(s)"*/ Localizer.Format("#autoLOC_AH_0048"), guiStyleSelectRelay))
            {
                currentCircleType = GUICircleSelection.RELAY;
                SelectCircleType();
            }
            if (GUILayout.Button(/*"DSN and Relay(s)"*/ Localizer.Format("#autoLOC_AH_0047"), guiStyleSelectRelayAndDSN))
            {
                currentCircleType = GUICircleSelection.DSN_AND_RELAY;
                SelectCircleType();
            }
            if (GUILayout.Button(/*"None"*/ Localizer.Format("#autoLOC_AH_0049"), guiStyleSelectNone))
            {
                currentCircleType = GUICircleSelection.NONE;
                SelectCircleType();
            }

            GUILayout.EndVertical();

            GUI.DragWindow();
        }
Exemple #3
0
        public void Start()
        {
            if (HighLogic.CurrentGame.Mode == Game.Modes.MISSION_BUILDER)
            {
                Destroy(this);
            }

            if (!HighLogic.CurrentGame.Parameters.CustomParams <AntennaHelperSettings> ().enableInTrackingStation)
            {
                Destroy(this);
                return;
            }

            targetPid = "";

            trackingStationLvl = ScenarioUpgradeableFacilities.GetFacilityLevel(SpaceCenterFacility.TrackingStation);
            dsnPower           = GameVariables.Instance.GetDSNRange(trackingStationLvl);

            waitFor = new WaitForSeconds(.1f);

            GameEvents.onPlanetariumTargetChanged.Add(NewTarget);
            GameEvents.OnMapFocusChange.Add(NewTarget);
            GameEvents.CommNet.OnCommStatusChange.Add(CommNetUpdate);

//			if (AHShipList.visitFlightOnce) {
//				GetListsShip ();
//				CreateMarkers ();
//			}

            // GUI
            rectMainWindow          = new Rect(0, 0, 150, 245);
            rectMainWindow.position = AHSettings.posTrackingStationMainWindow;
            mainWindowOn            = false;

            rectEditorShipWindow          = new Rect(0, 0, 350, 200);
            rectEditorShipWindow.position = AHSettings.posTrackingStationShipWindow;
            editorShipWindowOn            = false;

            circleTypeSelected = GUICircleSelection.ACTIVE;

            editorShipVab   = true;
            editorShipRelay = false;

            guiListEditorShipVabAll   = AHShipList.GetShipListAsList(true, false, "VAB");
            guiListEditorShipSphAll   = AHShipList.GetShipListAsList(true, false, "SPH");
            guiListEditorShipVabRelay = AHShipList.GetShipListAsList(true, true, "VAB");
            guiListEditorShipSphRelay = AHShipList.GetShipListAsList(true, true, "SPH");

            guiListEditorShipDisplay = guiListEditorShipVabAll;

            GameEvents.onGUIApplicationLauncherReady.Add(AddToolbarButton);
            GameEvents.onGUIApplicationLauncherDestroyed.Add(RemoveToolbarButton);
        }
Exemple #4
0
        private void MainWindow(int id)
        {
            GUILayout.BeginVertical();

            string transmitterName = "";

            if (targetPid != "" && listShipTransmitter.ContainsKey(targetPid))
            {
                transmitterName = listShipTransmitter [targetPid] ["name"];
            }

            GUILayout.Label(Localizer.Format("#autoLOC_AH_0050", new string[] { transmitterName }));
            GUILayout.Label(Localizer.Format("#autoLOC_AH_0051", new string[] { AHUtil.FormatCircleSelect(circleTypeSelected) }));
            GUILayout.Space(3f);
            if (GUILayout.Button(Localizer.Format("#autoLOC_AH_0045")))
            {
                circleTypeSelected = GUICircleSelection.ACTIVE;
                ShowCircles();
            }
            if (GUILayout.Button(Localizer.Format("#autoLOC_AH_0046")))
            {
                circleTypeSelected = GUICircleSelection.DSN;
                ShowCircles();
            }
            if (GUILayout.Button(Localizer.Format("#autoLOC_AH_0048")))
            {
                circleTypeSelected = GUICircleSelection.RELAY;
                ShowCircles();
            }
            if (GUILayout.Button(Localizer.Format("#autoLOC_AH_0047")))
            {
                circleTypeSelected = GUICircleSelection.DSN_AND_RELAY;
                ShowCircles();
            }

            GUILayout.Space(10f);
            if (GUILayout.Button(Localizer.Format("#autoLOC_AH_0044")))
            {
                editorShipWindowOn = !editorShipWindowOn;
            }

            GUILayout.EndVertical();

            GUI.DragWindow();
        }