Ejemplo n.º 1
0
 protected void button(string text, ContentNoArgs action)
 {
     if (GUILayout.Button(text))
     {
         action();
     }
 }
Ejemplo n.º 2
0
 protected void button(string text, GUIStyle style, ContentNoArgs action)
 {
     if (GUILayout.Button(text, style))
     {
         action();
     }
 }
Ejemplo n.º 3
0
 protected void button(string text, GUIStyle style, float button_width, ContentNoArgs action)
 {
     if (GUILayout.Button(text, style, width(button_width)))
     {
         action();
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 7
0
 protected void begin_group(Rect container, GUIStyle group_style, ContentNoArgs content)
 {
     GUI.BeginGroup(container, group_style);
     content();
     GUI.EndGroup();
 }
Ejemplo n.º 8
0
 protected void begin_group(Rect container, ContentNoArgs content)
 {
     GUI.BeginGroup(container, get_section_style());
     content();
     GUI.EndGroup();
 }
Ejemplo n.º 9
0
 protected void v_section(GUIStyle style, ContentNoArgs content)
 {
     GUILayout.BeginVertical(style);
     content();
     GUILayout.EndVertical();
 }
Ejemplo n.º 10
0
 protected void v_section(ContentNoArgs content)
 {
     GUILayout.BeginVertical(get_section_style());
     content();
     GUILayout.EndVertical();
 }
Ejemplo n.º 11
0
 protected void section(GUIStyle style, ContentNoArgs content)
 {
     GUILayout.BeginHorizontal(style);
     content();
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 12
0
 protected void section(ContentNoArgs content)
 {
     GUILayout.BeginHorizontal(get_section_style());
     content();
     GUILayout.EndHorizontal();
 }
Ejemplo n.º 13
0
 protected void gui_state(bool condition, ContentNoArgs content)
 {
     GUI.enabled = condition;
     content();
     GUI.enabled = true;
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
     }
 }