Пример #1
0
        internal static void Display(int windowId)
        {
            // Reset Tooltip active flag...
            ToolTipActive = false;

            Rect rect = new Rect(496, 4, 16, 16);

            if (GUI.Button(rect, new GUIContent("", "Close Window")))
            {
                ShowWindow = false;
                ToolTip    = "";
            }
            if (Event.current.type == EventType.Repaint && ShowToolTips)
            {
                ToolTip = RMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
            }

            GUILayout.BeginVertical();
            RmUtils.DebugScrollPosition = GUILayout.BeginScrollView(RmUtils.DebugScrollPosition, GUILayout.Height(300), GUILayout.Width(500));
            GUILayout.BeginVertical();

            foreach (string error in RmUtils.ErrorList)
            {
                GUILayout.TextArea(error, GUILayout.Width(460));
            }

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

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Clear log", GUILayout.Height(20)))
            {
                RmUtils.ErrorList.Clear();
                RmUtils.ErrorList.Add("Info:  Log Cleared at " + DateTime.UtcNow + " UTC.");
            }
            if (GUILayout.Button("Save Log", GUILayout.Height(20)))
            {
                // Create log file and save.
                Savelog();
            }
            if (GUILayout.Button("Close", GUILayout.Height(20)))
            {
                // Create log file and save.
                ShowWindow = false;
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUI.DragWindow(new Rect(0, 0, Screen.width, 30));
            RMSettings.RepositionWindow(ref Position);
        }
Пример #2
0
        internal static void Display(int windowId)
        {
            //Title = SmUtils.Localize("#smloc_settings_001");
            // set input locks when mouseover window...
            //_inputLocked = GuiUtils.PreventClickthrough(ShowWindow, Position, _inputLocked);

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

            Rect rect = new Rect(Position.width - 20, 4, 16, 16);

            // "Close Window.\r\nSettings will not be immediately saved,\r\n but will be remembered while in game.")))
            if (GUI.Button(rect, new GUIContent("", Localizer.Format("#autoLOC_RM_1052"))))     // #autoLOC_RM_1052 = Close Window
            {
                ToolTip = "";
                RMSettings.RestoreTempSettings();
                ShowWindow = false;
            }
            if (Event.current.type == EventType.Repaint && ShowToolTips)
            {
                ToolTip = RMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
            }

            GUILayout.BeginVertical();

            DisplayTabButtons();

            _displayViewerPosition = GUILayout.BeginScrollView(_displayViewerPosition, RMStyle.ScrollStyle,
                                                               GUILayout.Height(300), GUILayout.Width(380));
            GUILayout.BeginVertical();

            DisplaySelectedTab(_displayViewerPosition);

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

            DisplayActionButtons();

            GUILayout.EndVertical();

            GUI.DragWindow(new Rect(0, 0, Screen.width, 30));
            RMSettings.RepositionWindow(ref Position);
        }
Пример #3
0
        internal static void Display(int windowId)
        {
            // Reset Tooltip active flag...
            ToolTipActive = false;

            Rect rect = new Rect(680, 4, 16, 16);

            if (GUI.Button(rect, new GUIContent("", "Close Window")))
            {
                ToolTip    = "";
                ShowWindow = false;
            }
            if (Event.current.type == EventType.Repaint && ShowToolTips)
            {
                ToolTip = RMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
            }

            GUILayout.BeginVertical();
            DisplayRosterFilter();

            DisplayHeadings();

            _scrollViewerPosition = GUILayout.BeginScrollView(_scrollViewerPosition, RMStyle.ScrollStyle, GUILayout.Height(280), GUILayout.Width(680));
            GUILayout.BeginVertical();
            if (IsAll || IsDispute || IsStrike)
            {
                DisplayDisputes();
            }
            if (IsAll || IsContracted)
            {
                DisplayContracted();
            }

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

            GUILayout.BeginHorizontal();
            List <RMKerbal> disputekerbals = new List <RMKerbal>(RMLifeSpan.Instance.RMKerbals.AllrmKerbals.Values.Where(a => a.SalaryContractDispute).ToList());
            string          buttonToolTip;

            if (disputekerbals.Any())
            {
                buttonToolTip = "Accept All Payrises. Kerbals will continue working.";
                if (GUILayout.Button(new GUIContent("Accept All", buttonToolTip), RMStyle.ButtonStyle))
                {
                    // Accept all disputes.
                    foreach (RMKerbal disputekerbal in disputekerbals.Where(disputekerbal => !disputekerbal.SalaryContractDisputeProcessed))
                    {
                        AcceptDispute(disputekerbal);
                    }
                    ToolTip    = "";
                    ShowWindow = false;
                }
                rect = GUILayoutUtility.GetLastRect();
                if (Event.current.type == EventType.Repaint && ShowToolTips)
                {
                    ToolTip = RMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
                }

                buttonToolTip = "Decline All Payrises, All listed kerbals will become tourists until you can pay them.";
                if (GUILayout.Button(new GUIContent("Decline All", buttonToolTip), RMStyle.ButtonStyle))
                {
                    // Decline all disputes.
                    foreach (RMKerbal disputekerbal in disputekerbals.Where(disputekerbal => !disputekerbal.SalaryContractDisputeProcessed))
                    {
                        DeclineDispute(disputekerbal);
                    }
                    ToolTip    = "";
                    ShowWindow = false;
                }
                rect = GUILayoutUtility.GetLastRect();
                if (Event.current.type == EventType.Repaint && ShowToolTips)
                {
                    ToolTip = RMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
                }
            }
            if (_recontractFlag)
            {
                buttonToolTip = "ReContract All Disputed Kerbals.";
                if (GUILayout.Button(new GUIContent("Recontract All", buttonToolTip), RMStyle.ButtonStyle))
                {
                    // ReContract all disputes.
                    foreach (RMKerbal disputekerbal in disputekerbals.Where(disputekerbal => disputekerbal.SalaryContractDisputeProcessed))
                    {
                        ReContract(disputekerbal);
                    }
                    ToolTip    = "";
                    ShowWindow = false;
                }
                rect = GUILayoutUtility.GetLastRect();
                if (Event.current.type == EventType.Repaint && ShowToolTips)
                {
                    ToolTip = RMToolTips.SetActiveToolTip(rect, GUI.tooltip, ref ToolTipActive, 10);
                }
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();

            GUI.DragWindow(new Rect(0, 0, Screen.width, 30));
            RMSettings.RepositionWindow(ref Position);
        }