コード例 #1
0
        private void Display(int windowId)
        {
            try
            {
                Rect rect = new Rect(position.width - 29, 4, 25, 25);
                if (GUI.Button(rect, new GUIContent("X", "Close Window")))
                {
                    showWindow = false;
                }

                GUILayout.BeginVertical();
                GUI.enabled = true;

                GUILayout.Space(10);
                foreach (SkyLabExperimentData node in SkyLabConfig.Experiments)
                {
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button("Study " + node.Name, GUILayout.Height(30)))
                    {
                        activeLab.DoScienceThing(node);
                        showWindow = false;
                    }
                    GUILayout.Space(5);
                    GUILayout.EndHorizontal();
                }

                GUILayout.EndVertical();
                GUI.DragWindow(new Rect(0, 0, Screen.width, 30));
                LtAddon.RepositionWindow(ref position);
            }
            catch (Exception ex)
            {
                Util.LogMessage($"WindowSkyLab.Display. Error: {ex.Message} \r\n\r\n{ex.StackTrace}", Util.LogType.Error);
            }
        }
コード例 #2
0
        private void Window(int windowID)
        {
            GUILayout.BeginVertical();

            foreach (SkyLabExperimentData node in configcore.experiments)
            {
                GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false));

                if (GUILayout.Button("Study " + node.DisplayName, GUILayout.Height(50)))
                {
                    ActiveLab.DoScienceThing(node);
                    Active = false;
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false));

            if (GUILayout.Button("Close", GUILayout.Height(50)))
            {
                Active = false;
            }

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