Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 //Run when button is clicked
 public override void OnClick(GitGudWindow window)
 {
     GitCore.Push(true, (output) =>
     {
         GitEvents.TriggerOnLocalChange();
     });
 }
Exemplo n.º 4
0
        public override void Render(GitGudWindow window)
        {
            if (stashes == null)
            {
                return;
            }

            stashListGUI.Render(stashes);
        }
Exemplo n.º 5
0
        public override void Render(GitGudWindow window)
        {
            if (commitsDict == null)
            {
                return;
            }

            commitList.Render(commits, commitsDict);
        }
Exemplo n.º 6
0
        //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();
        }
Exemplo n.º 7
0
        //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();
            }
        }
Exemplo n.º 8
0
 //Run when button is clicked
 public override void OnClick(GitGudWindow window)
 {
 }
Exemplo n.º 9
0
 public static void ShowWindow()
 {
     //Show existing window instance. If one doesn't exist, make one.
     GitGudWindow.GetWindow(typeof(GitGudWindow), false, "GitGud");
 }
Exemplo n.º 10
0
 //Run when button is clicked
 public virtual void OnClick(GitGudWindow window)
 {
 }
Exemplo n.º 11
0
 //Run when button is clicked
 public override void OnClick(GitGudWindow window)
 {
     stashWindow = StashWindow.ShowWindow(OnFinishStashWindow);
 }
Exemplo n.º 12
0
 public virtual void Render(GitGudWindow window)
 {
 }
Exemplo n.º 13
0
 //Run when button is clicked
 public override void OnClick(GitGudWindow window)
 {
     BranchWindow.ShowWindow(GitEvents.TriggerOnLocalChange);
 }