protected void button(string text, ContentNoArgs action) { if (GUILayout.Button(text)) { action(); } }
protected void button(string text, GUIStyle style, ContentNoArgs action) { if (GUILayout.Button(text, style)) { action(); } }
protected void button(string text, GUIStyle style, float button_width, ContentNoArgs action) { if (GUILayout.Button(text, style, width(button_width))) { action(); } }
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(); }
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); }
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; }
protected void begin_group(Rect container, GUIStyle group_style, ContentNoArgs content) { GUI.BeginGroup(container, group_style); content(); GUI.EndGroup(); }
protected void begin_group(Rect container, ContentNoArgs content) { GUI.BeginGroup(container, get_section_style()); content(); GUI.EndGroup(); }
protected void v_section(GUIStyle style, ContentNoArgs content) { GUILayout.BeginVertical(style); content(); GUILayout.EndVertical(); }
protected void v_section(ContentNoArgs content) { GUILayout.BeginVertical(get_section_style()); content(); GUILayout.EndVertical(); }
protected void section(GUIStyle style, ContentNoArgs content) { GUILayout.BeginHorizontal(style); content(); GUILayout.EndHorizontal(); }
protected void section(ContentNoArgs content) { GUILayout.BeginHorizontal(get_section_style()); content(); GUILayout.EndHorizontal(); }
protected void gui_state(bool condition, ContentNoArgs content) { GUI.enabled = condition; content(); GUI.enabled = true; }
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(); } }
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(); } }