protected override void WindowGUI(int windowID)
        {
            GUI.skin         = isCompact ? GuiUtils.compactSkin : GuiUtils.skin;
            GUI.contentColor = text;

            GUILayout.BeginVertical();
            for (int i = 0; i < items.Count; i++)
            {
                InfoItem item = items[i];
                if (HighLogic.LoadedSceneIsEditor ? item.showInEditor : item.showInFlight)
                {
                    item.DrawItem();
                }
                else
                {
                    GUILayout.Label(Localizer.Format(item.name));//
                }
            }
            if (items.Count == 0)
            {
                GUILayout.Label(Localizer.Format("#MechJeb_WindowEd_CustomInfoWindow_Label1"));                  //Add items to this window with the custom window editor.
            }
            GUILayout.EndVertical();

            if (!IsOverlay && GUI.Button(new Rect(10, 0, 13, 20), "E", GuiUtils.yellowOnHover))
            {
                MechJebModuleCustomWindowEditor editor = core.GetComputerModule <MechJebModuleCustomWindowEditor>();
                if (editor != null)
                {
                    editor.enabled      = true;
                    editor.editedWindow = this;
                }
            }

            if (!IsOverlay && GUI.Button(new Rect(25, 0, 13, 20), "C", GuiUtils.yellowOnHover))
            {
                MuUtils.SystemClipboard = ToSharingString();
                ScreenMessages.PostScreenMessage(Localizer.Format("#MechJeb_WindowEd_CustomInfoWindow_Scrmsg1", GetName()), 3.0f, ScreenMessageStyle.UPPER_RIGHT);//Configuration of <<1>> window copied to clipboard.
            }

            base.WindowGUI(windowID);
        }
Beispiel #2
0
        protected override void WindowGUI(int windowID)
        {
            GUILayout.BeginVertical();
            for (int i = 0; i < items.Count; i++)
            {
                InfoItem item = items[i];
                if (HighLogic.LoadedSceneIsEditor ? item.showInEditor : item.showInFlight)
                {
                    item.DrawItem();
                }
                else
                {
                    GUILayout.Label(item.name);
                }
            }
            if (items.Count == 0)
            {
                GUILayout.Label("Add items to this window with the custom window editor.");
            }
            GUILayout.EndVertical();

            if (GUI.Button(new Rect(10, 0, 13, 20), "E", GuiUtils.yellowOnHover))
            {
                MechJebModuleCustomWindowEditor editor = core.GetComputerModule <MechJebModuleCustomWindowEditor>();
                if (editor != null)
                {
                    editor.enabled      = true;
                    editor.editedWindow = this;
                }
            }

            if (GUI.Button(new Rect(25, 0, 13, 20), "C", GuiUtils.yellowOnHover))
            {
                MuUtils.SystemClipboard = ToSharingString();
                ScreenMessages.PostScreenMessage("Configuration of \"" + GetName() + "\" window copied to clipboard.", 3.0f, ScreenMessageStyle.UPPER_RIGHT);
            }

            base.WindowGUI(windowID);
        }