Beispiel #1
0
 protected void button(string text, ContentNoArgs action)
 {
     if (GUILayout.Button(text))
     {
         action();
     }
 }
Beispiel #2
0
 protected void button(string text, GUIStyle style, ContentNoArgs action)
 {
     if (GUILayout.Button(text, style))
     {
         action();
     }
 }
Beispiel #3
0
 protected void button(string text, GUIStyle style, float button_width, ContentNoArgs action)
 {
     if (GUILayout.Button(text, style, width(button_width)))
     {
         action();
     }
 }
Beispiel #4
0
 protected void section(float section_width, float section_height, ContentNoArgs content)
 {
     GUILayout.BeginHorizontal(get_section_style(), GUILayout.Width(section_width), GUILayout.MaxWidth(section_width),
                               GUILayout.Height(section_height), GUILayout.MaxHeight(section_height));
     content();
     GUILayout.EndHorizontal();
 }
Beispiel #5
0
        protected Rect section(GUIStyle style, ContentNoArgs content, ClickEvents click_event)
        {
            GUILayout.BeginHorizontal(style);
            content();
            GUILayout.EndHorizontal();
            Rect container = GUILayoutUtility.GetLastRect();

            handle_click_event(container, click_event);
            return(container);
        }
Beispiel #6
0
        protected void error_dialog(ContentNoArgs content, string title = "KerbalX API Error")
        {
            ModalDialog dialog = show_modal_dialog(d => {
                content();
                section(() => {
                    fspace();
                    button("Close", 60f, close_dialog);
                });
            });

            dialog.dialog_pos.width = 600;
            dialog.dialog_pos.x     = Screen.width / 2 - (dialog.dialog_pos.width / 2);
            dialog.dialog_pos.y     = Screen.height * 0.3f;
            dialog.window_title     = title;
        }
Beispiel #7
0
 protected void begin_group(Rect container, GUIStyle group_style, ContentNoArgs content)
 {
     GUI.BeginGroup(container, group_style);
     content();
     GUI.EndGroup();
 }
Beispiel #8
0
 protected void begin_group(Rect container, ContentNoArgs content)
 {
     GUI.BeginGroup(container, get_section_style());
     content();
     GUI.EndGroup();
 }
Beispiel #9
0
 protected void v_section(GUIStyle style, ContentNoArgs content)
 {
     GUILayout.BeginVertical(style);
     content();
     GUILayout.EndVertical();
 }
Beispiel #10
0
 protected void v_section(ContentNoArgs content)
 {
     GUILayout.BeginVertical(get_section_style());
     content();
     GUILayout.EndVertical();
 }
Beispiel #11
0
 protected void section(GUIStyle style, ContentNoArgs content)
 {
     GUILayout.BeginHorizontal(style);
     content();
     GUILayout.EndHorizontal();
 }
Beispiel #12
0
 protected void section(ContentNoArgs content)
 {
     GUILayout.BeginHorizontal(get_section_style());
     content();
     GUILayout.EndHorizontal();
 }
Beispiel #13
0
 protected void gui_state(bool condition, ContentNoArgs content)
 {
     GUI.enabled = condition;
     content();
     GUI.enabled = true;
 }
Beispiel #14
0
 protected void button(GUIContent content, GUIStyle style, float button_width, float button_height, ContentNoArgs action)
 {
     if (GUILayout.Button(content, style, width(button_width), height(button_height)))
     {
         action();
     }
 }
Beispiel #15
0
 protected void button(string text, GUIStyle style, float button_width, float max_width, ContentNoArgs action)
 {
     if (GUILayout.Button(text, style, GUILayout.Width(button_width), GUILayout.MaxWidth(max_width), GUILayout.ExpandWidth(true)))
     {
         action();
     }
 }