using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental; using UnityEditor.VersionControl; using UnityEngine; using UnityEngine.UIElements; namespace UnityEditor.VFX.UI { class VFXVCSDropdownButton : DropDownButtonBase { static readonly Dictionary s_StatusToTexture = new(); static readonly Dictionary s_StatusToPathMap = new() { { Asset.States.OutOfSync, "VersionControl/P4_OutOfSync.png" }, { Asset.States.CheckedOutLocal, "VersionControl/P4_CheckOutLocal.png" }, { Asset.States.CheckedOutRemote, "VersionControl/P4_CheckOutRemote.png" }, { Asset.States.AddedLocal, "VersionControl/P4_AddedLocal.png" }, }; static readonly Dictionary s_StatusToTooltip = new() { { Asset.States.OutOfSync, "Click to check out" }, { Asset.States.CheckedOutLocal, "Already checked out" }, { Asset.States.CheckedOutRemote, "Checked out remotely" }, { Asset.States.AddedLocal, "Added locally" }, }; const string MainButtonName = "checkout"; readonly Button m_RevertButton; readonly Button m_SubmitButton; readonly Button m_GetLatestButton; Image m_VCSStatusImage; public VFXVCSDropdownButton(VFXView vfxView) : base( nameof(VFXVCSDropdownButton), vfxView, "VFXVCSDropDownPanel", "Checkout", "checkout", EditorResources.iconsPath + "UnityEditor.VersionControl.png", true, false) { m_RevertButton = m_PopupContent.Q