public override void Render(GitGudWindow window) { EditorGUILayout.LabelField("GitGud: A rad source control from within Unity", EditorStyles.boldLabel); string gitPath = EditorGUILayout.TextField("Git Path", GitGudSettings.GetString("git_path")); GitGudSettings.SetString("git_path", gitPath); string projectPath = EditorGUILayout.TextField("Repo Path", GitGudSettings.GetString("repo_path")); GitGudSettings.SetString("repo_path", projectPath); GUIContent refreshOnEditContent = new GUIContent("Refresh on Edit", "If enabled, window will refresh when assets are edited"); bool refreshOnEdit = EditorGUILayout.Toggle(refreshOnEditContent, GitGudSettings.GetBool("refresh_on_edit")); GitGudSettings.SetBool("refresh_on_edit", refreshOnEdit); GUIContent debugContent = new GUIContent("Debug Mode", "If enabled, will log all commands run and all output git processes return"); bool debug = EditorGUILayout.Toggle(debugContent, GitGudSettings.GetBool("debug")); GitGudSettings.SetBool("debug", debug); if (GUILayout.Button("Reset to Default", GUILayout.ExpandWidth(false))) { GitGudSettings.ApplyDefaultSettings(); } }
public override void Render(GitGudWindow window) { //Error render if (error) { EditorGUILayout.LabelField("Something went wrong, and we have no smart error catching :^)"); EditorGUILayout.LabelField(errorString); return; } EditorGUILayout.LabelField("Local Changes: " + branchName, EditorStyles.largeLabel); RenderStageButtons(); unstagedFileViewer.Render(unstagedFiles); RenderUnstageButtons(); stagedFileViewer.Render(stagedFiles); /* * if (GUILayout.Button("Scan", GUILayout.ExpandWidth(false))) * Scan(); */ RenderCommitSection(); }
//Run when button is clicked public override void OnClick(GitGudWindow window) { GitCore.Push(true, (output) => { GitEvents.TriggerOnLocalChange(); }); }
public override void Render(GitGudWindow window) { if (stashes == null) { return; } stashListGUI.Render(stashes); }
public override void Render(GitGudWindow window) { if (commitsDict == null) { return; } commitList.Render(commits, commitsDict); }
//Run when button is clicked public override void OnClick(GitGudWindow window) { GenericMenu menu = new GenericMenu(); menu.AddDisabledItem(new GUIContent("Discard...")); menu.AddItem(new GUIContent("Discard All Unstaged"), false, DiscardUnstaged); menu.AddItem(new GUIContent("Reset Local Repo"), false, Reset); menu.ShowAsContext(); }
//Default button rendering public virtual void Render(GitGudWindow window) { EditorGUI.BeginDisabledGroup(IsDisabled()); bool clicked = GUILayout.Button(GetName(), "ToolbarButton", GUILayout.ExpandWidth(false)); EditorGUI.EndDisabledGroup(); if (clicked) { OnClick(window); } if (flexibleSpaceAfter) { GUILayout.FlexibleSpace(); } }
//Run when button is clicked public override void OnClick(GitGudWindow window) { }
public static void ShowWindow() { //Show existing window instance. If one doesn't exist, make one. GitGudWindow.GetWindow(typeof(GitGudWindow), false, "GitGud"); }
//Run when button is clicked public virtual void OnClick(GitGudWindow window) { }
//Run when button is clicked public override void OnClick(GitGudWindow window) { stashWindow = StashWindow.ShowWindow(OnFinishStashWindow); }
public virtual void Render(GitGudWindow window) { }
//Run when button is clicked public override void OnClick(GitGudWindow window) { BranchWindow.ShowWindow(GitEvents.TriggerOnLocalChange); }