|
@@ -75,15 +75,43 @@ namespace Terra.Arbitrator.GUI
|
|
|
{
|
|
|
EditorGUILayout.BeginHorizontal(EditorStyles.helpBox);
|
|
|
|
|
|
- var status = change.Status switch {
|
|
|
- LibGit2Sharp.ChangeKind.Added => "[+]",
|
|
|
- LibGit2Sharp.ChangeKind.Deleted => "[-]",
|
|
|
- LibGit2Sharp.ChangeKind.Modified => "[M]",
|
|
|
- _ => "[?]"
|
|
|
- };
|
|
|
-
|
|
|
+ string status;
|
|
|
+ Color statusColor;
|
|
|
+
|
|
|
+ switch (change.Status)
|
|
|
+ {
|
|
|
+ case LibGit2Sharp.ChangeKind.Added:
|
|
|
+ status = "[+]";
|
|
|
+ statusColor = Color.green;
|
|
|
+ break;
|
|
|
+ case LibGit2Sharp.ChangeKind.Deleted:
|
|
|
+ status = "[-]";
|
|
|
+ statusColor = Color.red;
|
|
|
+ break;
|
|
|
+ case LibGit2Sharp.ChangeKind.Modified:
|
|
|
+ status = "[M]";
|
|
|
+ statusColor = new Color(1.0f, 0.6f, 0.0f);
|
|
|
+ break;
|
|
|
+ case LibGit2Sharp.ChangeKind.Renamed:
|
|
|
+ status = "[R]";
|
|
|
+ statusColor = new Color(0.6f, 0.6f, 1.0f);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ status = "[?]";
|
|
|
+ statusColor = Color.white;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ var originalColor = UnityEngine.GUI.color;
|
|
|
+ UnityEngine.GUI.color = statusColor;
|
|
|
EditorGUILayout.LabelField(new GUIContent(status, change.Status.ToString()), GUILayout.Width(25));
|
|
|
- EditorGUILayout.LabelField(new GUIContent(change.FilePath, change.FilePath));
|
|
|
+ UnityEngine.GUI.color = originalColor;
|
|
|
+
|
|
|
+ var filePathDisplay = change.Status == LibGit2Sharp.ChangeKind.Renamed
|
|
|
+ ? $"{change.OldFilePath} -> {change.FilePath}"
|
|
|
+ : change.FilePath;
|
|
|
+
|
|
|
+ EditorGUILayout.LabelField(new GUIContent(filePathDisplay, filePathDisplay));
|
|
|
|
|
|
if (GUILayout.Button("Diff", GUILayout.Width(60)))
|
|
|
{
|