コード例 #1
0
    void DisplayButtons()
    {
        if (viewMode == BrowserViewMode.ArtistMode)
        {
            GUILayout.FlexibleSpace();
        }

        if (GUILayout.Button("Commit", versionControlSkin.GetStyle("Buttons_Main_Commit"), GUILayout.Width(64), GUILayout.Height(64)))
        {
            BrowserUtility.OnButton_Commit(this);
        }

        if (viewMode != BrowserViewMode.ArtistMode)
        {
            GUI.enabled = false;
            GUI.color  *= .75f;

            if (GUILayout.Button("Checkout", versionControlSkin.GetStyle("Buttons_Main_Checkout"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Checkout(this);
            }

            GUI.color   = Color.white;
            GUI.enabled = BrowserUtility.guiEnabled;
        }

        if (GUILayout.Button("Reset", versionControlSkin.GetStyle("Buttons_Main_Reset"), GUILayout.Width(64), GUILayout.Height(64)))
        {
            BrowserUtility.OnButton_Reset(this);
        }

        if (viewMode != BrowserViewMode.ArtistMode)
        {
            GUI.enabled = false;
            GUI.color  *= .75f;

            if (GUILayout.Button("Stash", versionControlSkin.GetStyle("Buttons_Main_Stash"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                Debug.Log("not implemented");
            }

            GUI.color   = Color.white;
            GUI.enabled = BrowserUtility.guiEnabled;

            GUI.enabled = BrowserUtility.guiEnabled && BrowserUtility.workingTreeSelected;

            if (GUILayout.Button("Add", versionControlSkin.GetStyle("Buttons_Main_Add"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Add(this);
            }

            GUI.enabled = BrowserUtility.guiEnabled && BrowserUtility.anyFileSelected;

            if (GUILayout.Button("Remove", versionControlSkin.GetStyle("Buttons_Main_Remove"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Remove(this);
            }

            GUI.enabled = BrowserUtility.guiEnabled;

            if (GUILayout.Button("Fetch", versionControlSkin.GetStyle("Buttons_Main_Fetch"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Fetch(this);
            }
        }

        if (GUILayout.Button("Pull", versionControlSkin.GetStyle("Buttons_Main_Pull"), GUILayout.Width(64), GUILayout.Height(64)))
        {
            BrowserUtility.OnButton_Pull(this);
        }

        if (GUILayout.Button("Push", versionControlSkin.GetStyle("Buttons_Main_Push"), GUILayout.Width(64), GUILayout.Height(64)))
        {
            BrowserUtility.OnButton_Push(this);
        }

        if (viewMode != BrowserViewMode.ArtistMode)
        {
            if (GUILayout.Button("Branch", versionControlSkin.GetStyle("Buttons_Main_Branch"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Branch(this);
            }

            GUI.enabled = false;
            GUI.color  *= .75f;

            if (GUILayout.Button("Merge", versionControlSkin.GetStyle("Buttons_Main_Merge"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Merge(this);
            }

            if (GUILayout.Button("Tag", versionControlSkin.GetStyle("Buttons_Main_Tag"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Tag(this);
            }

            GUI.color   = Color.white;
            GUI.enabled = BrowserUtility.guiEnabled;
        }

        GUILayout.FlexibleSpace();

        if (viewMode != BrowserViewMode.ArtistMode)
        {
            if (GUILayout.Button("Settings", versionControlSkin.GetStyle("Buttons_Main_Settings"), GUILayout.Width(64), GUILayout.Height(64)))
            {
                BrowserUtility.OnButton_Settings(this);
            }
        }
    }