Пример #1
0
        public static void MainWindow(int id)
        {
            // Close Button
            if (GUI.Button(new Rect(AHEditor.rectMainWindow.size.x - 22, 2, 20, 20), "X"))
            {
                AHEditor.CloseMainWindow();
            }

            GUILayout.BeginVertical();

            // Choose direct / relay antennas
            GUILayout.Label(/*Selected type*/ Localizer.Format("#autoLOC_AH_0004") + " : " + antennaTypeStr);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button(
                    /*Direct*/ Localizer.Format("#autoLOC_AH_0002")
                    + " (" + /*All Antennas*/ Localizer.Format("#autoLOC_AH_0005") + ")"))
            {
                antennaTypeStr      = /*Direct*/ Localizer.Format("#autoLOC_AH_0002");
                antennaTypeIsDirect = true;
            }
            if (GUILayout.Button(/*Relay*/ Localizer.Format("#autoLOC_AH_0003")))
            {
                antennaTypeStr      = /*Relay*/ Localizer.Format("#autoLOC_AH_0003");
                antennaTypeIsDirect = false;
            }
            GUILayout.EndHorizontal();

            // Pick a target :
            GUILayout.Label(
                /*Current target*/ Localizer.Format("#autoLOC_AH_0006")
                + " : " + AHEditor.targetName
                + "  (" + AHEditor.targetPower.ToString("N0") + ")");
            if (GUILayout.Button(/*Pick A Target*/ Localizer.Format("#autoLOC_AH_0007")))
            {
                if (AHEditor.showTargetWindow)
                {
                    AHEditor.CloseTargetWindow();
                }
                else
                {
                    AHEditor.showTargetWindow = true;
                }
            }

            // Number display :
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();
            GUILayout.Label(/*Status*/ Localizer.Format("#autoLOC_AH_0008") + " : ");
            GUILayout.Label(/*Power*/ Localizer.Format("#autoLOC_AH_0009") + " : ");
            GUILayout.Label(/*Max Range*/ Localizer.Format("#autoLOC_AH_0010") + " : ");
            GUILayout.Label(/*Max Distance At 100%*/ Localizer.Format("#autoLOC_AH_0011") + " : ");
            GUILayout.EndVertical();
            GUILayout.BeginVertical();
            if (antennaTypeIsDirect)
            {
                GUILayout.Label(AHEditor.statusStringDirect);
                GUILayout.Label(AHEditor.directBetterPower.ToString("N0"));
                GUILayout.Label(AHEditor.directBetterRange.ToString("N0") + "m");
                GUILayout.Label(AHEditor.directDistanceAt100.ToString("N0") + "m");
            }
            else
            {
                GUILayout.Label(AHEditor.statusStringRelay);
                GUILayout.Label(AHEditor.relayBetterPower.ToString("N0"));
                GUILayout.Label(AHEditor.relayBetterRange.ToString("N0") + "m");
                GUILayout.Label(AHEditor.relayDistanceAt100.ToString("N0") + "m");
            }
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();

            GUILayout.Space(16f);
            GUIStyle guiStyleCenter = new GUIStyle(GUI.skin.GetStyle("Label"));

            guiStyleCenter.alignment = TextAnchor.MiddleCenter;

            GUILayout.BeginHorizontal();
            if (antennaTypeIsDirect)
            {
                GUILayout.Label(AHEditor.directDistanceAt75.ToString("N0") + "m", guiStyleCenter);
                GUILayout.Label(AHEditor.directDistanceAt25.ToString("N0") + "m", guiStyleCenter);
            }
            else
            {
                GUILayout.Label(AHEditor.relayDistanceAt75.ToString("N0") + "m", guiStyleCenter);
                GUILayout.Label(AHEditor.relayDistanceAt25.ToString("N0") + "m", guiStyleCenter);
            }
            GUILayout.EndHorizontal();

            GUILayout.Label(AHUtil.signalPerDistanceTex);

            if (antennaTypeIsDirect)
            {
                GUILayout.Label(AHEditor.directDistanceAt50.ToString("N0") + "m", guiStyleCenter);
            }
            else
            {
                GUILayout.Label(AHEditor.relayDistanceAt50.ToString("N0") + "m", guiStyleCenter);
            }

            // Planet view button :
            if (GUILayout.Button(/*Signal Strength / Distance*/ Localizer.Format("#autoLOC_AH_0060")
                                 + " / " + Localizer.Format("#autoLOC_AH_0059")))
            {
                if (AHEditor.showPlanetWindow)
                {
                    AHEditor.ClosePlanetWindow();
                }
                else
                {
                    AHEditor.showPlanetWindow = true;
                }
            }

            if (GUILayout.Button(/*Add Ship to the Target List*/ Localizer.Format("#autoLOC_AH_0013")))
            {
                AHEditor.AddShipToShipList();
            }

            GUILayout.EndVertical();
            GUI.DragWindow();
        }