Пример #1
0
        static void OnProjectWindowItemGUI(string guid, Rect selectionRect)
        {
            if (string.IsNullOrEmpty(guid))
            {
                return;
            }

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            AssetStatus assetStatus = mAssetStatusCache.GetStatusForGuid(guid);

            LockStatusData lockStatusData =
                ClassifyAssetStatus.IsLockedRemote(assetStatus) ?
                mAssetStatusCache.GetLockStatusData(guid) :
                null;

            string tooltipText = GetTooltipText(
                assetStatus,
                lockStatusData);

            DrawOverlayIcon.ForStatus(
                selectionRect,
                assetStatus,
                tooltipText);
        }
Пример #2
0
        internal static string GetTooltipText(
            AssetStatus statusValue,
            LockStatusData lockStatusData)
        {
            string statusText = GetStatusString(statusValue);

            if (lockStatusData == null)
            {
                return(statusText);
            }

            return(string.Format(
                       "{0} by:{1}\u25cf {2}{3}\u25cf workspace {4}",
                       statusText,
                       Environment.NewLine,
                       lockStatusData.LockedBy,
                       Environment.NewLine,
                       lockStatusData.WorkspaceName));
        }
Пример #3
0
        static void OnProjectWindowItemGUI(string guid, Rect selectionRect)
        {
            if (string.IsNullOrEmpty(guid))
            {
                return;
            }

            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            AssetStatus statusesToDraw = GetStatusesToDraw(
                mAssetStatusCache.GetStatusForGuid(guid));

            foreach (AssetStatus status in Enum.GetValues(typeof(AssetStatus)))
            {
                if (status == AssetStatus.None)
                {
                    continue;
                }

                if (!statusesToDraw.HasFlag(status))
                {
                    continue;
                }

                LockStatusData lockStatusData =
                    ClassifyAssetStatus.IsLockedRemote(status) ?
                    mAssetStatusCache.GetLockStatusData(guid) :
                    null;

                string tooltipText = GetTooltipText(
                    status,
                    lockStatusData);

                DrawOverlayIcon.ForStatus(
                    selectionRect,
                    status,
                    tooltipText);
            }
        }
Пример #4
0
        internal static string GetTooltipText(
            AssetStatus statusValue,
            LockStatusData lockStatusData)
        {
            string statusText = GetStatusString(statusValue);

            if (lockStatusData == null)
            {
                return(statusText);
            }

            // example:
            // Changed by:
            // * [email protected]
            // * workspace wkLocal"

            char bulletCharacter = '\u25cf';

            string line1 = PlasticLocalization.GetString(
                PlasticLocalization.Name.AssetOverlayTooltipStatus, statusText);

            string line2 = string.Format("{0} {1}",
                                         bulletCharacter,
                                         lockStatusData.LockedBy);

            string line3 = string.Format("{0} {1}",
                                         bulletCharacter,
                                         PlasticLocalization.GetString(
                                             PlasticLocalization.Name.AssetOverlayTooltipWorkspace,
                                             lockStatusData.WorkspaceName));

            return(string.Format(
                       "{0}" + Environment.NewLine +
                       "{1}" + Environment.NewLine +
                       "{2}",
                       line1,
                       line2,
                       line3));
        }