Beispiel #1
0
        internal static void Display(int windowId)
        {
            Title = string.Format("{0} {1} - {2}", SMUtils.Localize("#smloc_manifest_002"), SMSettings.CurVersion, SMAddon.SmVessel.Vessel.vesselName);

            // set input locks when mouseover window...
            //_inputLocked = GuiUtils.PreventClickthrough(ShowWindow, Position, _inputLocked);

            // Reset Tooltip active flag...
            ToolTipActive = false;

            //GUIContent label = new GUIContent("", "Close Window");
            GUIContent label = new GUIContent("", SMUtils.Localize("#smloc_window_tt_001"));

            if (SMConditions.IsTransferInProgress())
            {
                //label = new GUIContent("", "Action in progress.  Cannot close window");
                label       = new GUIContent("", SMUtils.Localize("#smloc_window_tt_002"));
                GUI.enabled = false;
            }
            Rect rect = new Rect(Position.width - 20, 4, 16, 16);

            if (GUI.Button(rect, label))
            {
                SMAddon.OnSmButtonClicked();
                ToolTip = "";
                SMHighlighter.Update_Highlighter();
            }
            if (Event.current.type == EventType.Repaint && ShowToolTips)
            {
                ToolTip = SMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
            }
            GUI.enabled = true;
            try
            {
                GUILayout.BeginVertical();
                _smScrollViewerPosition = GUILayout.BeginScrollView(_smScrollViewerPosition, SMStyle.ScrollStyle,
                                                                    GUILayout.Height(100), GUILayout.Width(300));
                GUILayout.BeginVertical();

                // Prelaunch (landed) Gui
                if (SMConditions.IsInPreflight())
                {
                    PreLaunchGui();
                }

                // Now the Resource Buttons
                ResourceButtonsList();

                GUILayout.EndVertical();
                GUILayout.EndScrollView();

                //string resLabel = "No Resource Selected";
                string resLabel = SMUtils.Localize("#smloc_manifest_003");
                if (SMAddon.SmVessel.SelectedResources.Count == 1)
                {
                    resLabel = SMAddon.SmVessel.SelectedResources[0];
                }
                else if (SMAddon.SmVessel.SelectedResources.Count == 2)
                {
                    //resLabel = "Multiple Resources selected";
                    resLabel = SMUtils.Localize("#smloc_manifest_004");
                }
                GUILayout.Label(string.Format("{0}", resLabel), GUILayout.Width(300), GUILayout.Height(20));

                // Resource Details List Viewer
                ResourceDetailsViewer();

                // Window toggle Button List
                WindowToggleButtons();

                GUILayout.EndVertical();
                GUI.DragWindow(new Rect(0, 0, Screen.width, 30));
                SMAddon.RepositionWindow(ref Position);
            }
            catch (Exception ex)
            {
                if (!SMAddon.FrameErrTripped)
                {
                    SMUtils.LogMessage(
                        string.Format(" in WindowManifest.Display.  Error:  {0} \r\n\r\n{1}", ex.Message, ex.StackTrace),
                        SMUtils.LogType.Error, true);
                    SMAddon.FrameErrTripped = true;
                }
            }
        }