Skip to content

Commit a1a2b9a

Browse files
committed
Added locked files to status panel and project panel.
1 parent 4b70bf8 commit a1a2b9a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/GitStatusPanel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ public class GitStatusPanel : EditorWindow
2424

2525
private string[] _untrackedFiles;
2626

27+
private string[] _lockedFiles;
28+
2729
private DateTime _lastUpdated;
2830

2931
private EditorCoroutine _coroutine;
@@ -87,6 +89,7 @@ private void OnGUI()
8789

8890
GUILayout.Label($"Number of Changes: {_changedFiles?.Length}");
8991
GUILayout.Label($"Untracked Files: {_untrackedFiles?.Length}");
92+
GUILayout.Label($"Locked Files: {_lockedFiles?.Length}");
9093
GUILayout.Label($"Last Updated: {_lastUpdated}");
9194

9295
if (GUILayout.Button("Refresh"))
@@ -109,6 +112,8 @@ private void UpdateData()
109112

110113
_untrackedFiles = Git.UntrackedFiles();
111114

115+
_lockedFiles = Git.LockedFiles();
116+
112117
_lastUpdated = DateTime.Now;
113118

114119
Repaint();

Assets/Plugins/CandyCoded.GitStatus/Scripts/CustomEditor/ProjectPanel.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ public class ProjectPanel : AssetPostprocessor
2020

2121
private static string[] _untrackedFiles;
2222

23+
private static string[] _lockedFiles;
24+
2325
static ProjectPanel()
2426
{
2527

@@ -30,6 +32,8 @@ static ProjectPanel()
3032

3133
_untrackedFiles = Git.UntrackedFiles();
3234

35+
_lockedFiles = Git.LockedFiles();
36+
3337
}
3438

3539
private static void ProjectWindowItemOnGui(string guid, Rect selectionRect)
@@ -71,6 +75,12 @@ private static void ProjectWindowItemOnGui(string guid, Rect selectionRect)
7175
GUI.DrawTexture(rect, GitIcons.Untracked, ScaleMode.ScaleToFit);
7276

7377
}
78+
else if (_lockedFiles.Contains(path))
79+
{
80+
81+
GUI.DrawTexture(rect, GitIcons.Locked, ScaleMode.ScaleToFit);
82+
83+
}
7484

7585
}
7686

@@ -85,6 +95,8 @@ private static void OnPostprocessAllAssets(
8595

8696
_untrackedFiles = Git.UntrackedFiles();
8797

98+
_lockedFiles = Git.LockedFiles();
99+
88100
}
89101

90102
}

0 commit comments

Comments
 (0)