Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit df26f26

Browse files
Replacing favour with favor
1 parent b55ec61 commit df26f26

File tree

3 files changed

+72
-72
lines changed

3 files changed

+72
-72
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/ApplicationCache.cs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,52 +126,52 @@ public List<GitBranch> RemoteBranches
126126
}
127127

128128
[Location("views/branches.yaml", LocationAttribute.Location.LibraryFolder)]
129-
sealed class Favourites : ScriptObjectSingleton<Favourites>
129+
sealed class Favorites : ScriptObjectSingleton<Favorites>
130130
{
131-
[SerializeField] private List<string> favouriteBranches;
132-
public List<string> FavouriteBranches
131+
[SerializeField] private List<string> favoriteBranches;
132+
public List<string> FavoriteBranches
133133
{
134134
get
135135
{
136-
if (favouriteBranches == null)
137-
FavouriteBranches = new List<string>();
138-
return favouriteBranches;
136+
if (favoriteBranches == null)
137+
FavoriteBranches = new List<string>();
138+
return favoriteBranches;
139139
}
140140
set
141141
{
142-
favouriteBranches = value;
142+
favoriteBranches = value;
143143
Save(true);
144144
}
145145
}
146146

147-
public void SetFavourite(string branchName)
147+
public void SetFavorite(string branchName)
148148
{
149-
if (FavouriteBranches.Contains(branchName))
149+
if (FavoriteBranches.Contains(branchName))
150150
return;
151-
FavouriteBranches.Add(branchName);
151+
FavoriteBranches.Add(branchName);
152152
Save(true);
153153
}
154154

155-
public void UnsetFavourite(string branchName)
155+
public void UnsetFavorite(string branchName)
156156
{
157-
if (!FavouriteBranches.Contains(branchName))
157+
if (!FavoriteBranches.Contains(branchName))
158158
return;
159-
FavouriteBranches.Remove(branchName);
159+
FavoriteBranches.Remove(branchName);
160160
Save(true);
161161
}
162162

163-
public void ToggleFavourite(string branchName)
163+
public void ToggleFavorite(string branchName)
164164
{
165-
if (FavouriteBranches.Contains(branchName))
166-
FavouriteBranches.Remove(branchName);
165+
if (FavoriteBranches.Contains(branchName))
166+
FavoriteBranches.Remove(branchName);
167167
else
168-
FavouriteBranches.Add(branchName);
168+
FavoriteBranches.Add(branchName);
169169
Save(true);
170170
}
171171

172-
public bool IsFavourite(string branchName)
172+
public bool IsFavorite(string branchName)
173173
{
174-
return FavouriteBranches.Contains(branchName);
174+
return FavoriteBranches.Contains(branchName);
175175
}
176176
}
177177

src/UnityExtension/Assets/Editor/GitHub.Unity/Misc/Styles.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class Styles
8484
private static Texture2D branchIcon,
8585
activeBranchIcon,
8686
trackingBranchIcon,
87-
favouriteIconOn,
88-
favouriteIconOff,
87+
favoriteIconOn,
88+
favoriteIconOff,
8989
smallLogoIcon,
9090
bigLogoIcon,
9191
defaultAssetIcon,
@@ -663,29 +663,29 @@ public static Texture2D TrackingBranchIcon
663663
}
664664
}
665665

666-
public static Texture2D FavouriteIconOn
666+
public static Texture2D FavoriteIconOn
667667
{
668668
get
669669
{
670-
if (favouriteIconOn == null)
670+
if (favoriteIconOn == null)
671671
{
672-
favouriteIconOn = Utility.GetIcon("favorite-branch-indicator.png");
672+
favoriteIconOn = Utility.GetIcon("favorite-branch-indicator.png");
673673
}
674674

675-
return favouriteIconOn;
675+
return favoriteIconOn;
676676
}
677677
}
678678

679-
public static Texture2D FavouriteIconOff
679+
public static Texture2D FavoriteIconOff
680680
{
681681
get
682682
{
683-
if (favouriteIconOff == null)
683+
if (favoriteIconOff == null)
684684
{
685-
favouriteIconOff = FolderIcon;
685+
favoriteIconOff = FolderIcon;
686686
}
687687

688-
return favouriteIconOff;
688+
return favoriteIconOff;
689689
}
690690
}
691691

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/BranchesView.cs

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class BranchesView : Subview
2424
private const string WarningCheckoutBranchExistsOK = "Ok";
2525
private const string NewBranchCancelButton = "x";
2626
private const string NewBranchConfirmButton = "Create";
27-
private const string FavoritesSetting = "Favourites";
28-
private const string FavoritesTitle = "Favourites";
27+
private const string FavoritesSetting = "Favorites";
28+
private const string FavoritesTitle = "Favorites";
2929
private const string CreateBranchTitle = "Create Branch";
3030
private const string LocalTitle = "Local branches";
3131
private const string RemoteTitle = "Remote branches";
@@ -38,12 +38,12 @@ class BranchesView : Subview
3838
private bool showLocalBranches = true;
3939
private bool showRemoteBranches = true;
4040

41-
[NonSerialized] private List<BranchTreeNode> favourites = new List<BranchTreeNode>();
41+
[NonSerialized] private List<BranchTreeNode> favorites = new List<BranchTreeNode>();
4242
[NonSerialized] private int listID = -1;
4343
[NonSerialized] private List<GitBranch> newLocalBranches;
4444
[NonSerialized] private BranchTreeNode newNodeSelection;
4545
[NonSerialized] private BranchesMode targetMode;
46-
[NonSerialized] private bool favouritesHasChanged;
46+
[NonSerialized] private bool favoritesHasChanged;
4747

4848
[SerializeField] private BranchTreeNode activeBranchNode;
4949
[SerializeField] private BranchTreeNode localRoot;
@@ -52,7 +52,7 @@ class BranchesView : Subview
5252
[SerializeField] private List<Remote> remotes = new List<Remote>();
5353
[SerializeField] private Vector2 scroll;
5454
[SerializeField] private BranchTreeNode selectedNode;
55-
private List<string> favouritesList;
55+
private List<string> favoritesList;
5656

5757
public override void InitializeView(IView parent)
5858
{
@@ -64,7 +64,7 @@ public override void OnEnable()
6464
{
6565
base.OnEnable();
6666
AttachHandlers(Repository);
67-
favouritesHasChanged = true;
67+
favoritesHasChanged = true;
6868
}
6969

7070
public override void OnDisable()
@@ -81,10 +81,10 @@ public override void OnDataUpdate()
8181

8282
private void MaybeUpdateData()
8383
{
84-
if (favouritesHasChanged)
84+
if (favoritesHasChanged)
8585
{
86-
favouritesList = Manager.LocalSettings.Get(FavoritesSetting, new List<string>());
87-
favouritesHasChanged = false;
86+
favoritesList = Manager.LocalSettings.Get(FavoritesSetting, new List<string>());
87+
favoritesHasChanged = false;
8888
}
8989
}
9090

@@ -182,17 +182,17 @@ public void OnEmbeddedGUI()
182182

183183
GUILayout.BeginVertical(Styles.CommitFileAreaStyle);
184184
{
185-
// Favourites list
186-
if (favourites.Count > 0)
185+
// Favorites list
186+
if (favorites.Count > 0)
187187
{
188188
GUILayout.Label(FavoritesTitle);
189189
GUILayout.BeginHorizontal();
190190
{
191191
GUILayout.BeginVertical();
192192
{
193-
for (var index = 0; index < favourites.Count; ++index)
193+
for (var index = 0; index < favorites.Count; ++index)
194194
{
195-
OnTreeNodeGUI(favourites[index]);
195+
OnTreeNodeGUI(favorites[index]);
196196
}
197197
}
198198

@@ -286,12 +286,12 @@ public void OnEmbeddedGUI()
286286

287287
private int CompareBranches(GitBranch a, GitBranch b)
288288
{
289-
if (IsFavourite(a.Name))
289+
if (IsFavorite(a.Name))
290290
{
291291
return -1;
292292
}
293293

294-
if (IsFavourite(b.Name))
294+
if (IsFavorite(b.Name))
295295
{
296296
return 1;
297297
}
@@ -309,19 +309,19 @@ private int CompareBranches(GitBranch a, GitBranch b)
309309
return 0;
310310
}
311311

312-
private bool IsFavourite(BranchTreeNode branch)
312+
private bool IsFavorite(BranchTreeNode branch)
313313
{
314-
return IsFavourite(branch.Name);
314+
return IsFavorite(branch.Name);
315315
}
316316

317-
private bool IsFavourite(string branchName)
317+
private bool IsFavorite(string branchName)
318318
{
319319
if (string.IsNullOrEmpty(branchName))
320320
{
321321
return false;
322322
}
323323

324-
return favouritesList.Contains(branchName);
324+
return favoritesList.Contains(branchName);
325325
}
326326

327327
private void OnLocalBranchesUpdate(IEnumerable<GitBranch> list)
@@ -350,8 +350,8 @@ private void BuildTree(IEnumerable<GitBranch> local, IEnumerable<GitBranch> remo
350350
var tracking = new List<KeyValuePair<int, int>>();
351351
var localBranchNodes = new List<BranchTreeNode>();
352352

353-
// Prepare for updated favourites listing
354-
favourites.Clear();
353+
// Prepare for updated favorites listing
354+
favorites.Clear();
355355

356356
// Just build directly on the local root, keep track of active branch
357357
localRoot = new BranchTreeNode("", NodeType.Folder, false);
@@ -380,10 +380,10 @@ private void BuildTree(IEnumerable<GitBranch> local, IEnumerable<GitBranch> remo
380380
}
381381
}
382382

383-
// Add to favourites
384-
if (favouritesList.Contains(branch.Name))
383+
// Add to favorites
384+
if (favoritesList.Contains(branch.Name))
385385
{
386-
favourites.Add(node);
386+
favorites.Add(node);
387387
}
388388

389389
// Build into tree
@@ -424,10 +424,10 @@ private void BuildTree(IEnumerable<GitBranch> local, IEnumerable<GitBranch> remo
424424
}
425425
}
426426

427-
// Add to favourites
428-
if (favouritesList.Contains(branch.Name))
427+
// Add to favorites
428+
if (favoritesList.Contains(branch.Name))
429429
{
430-
favourites.Add(node);
430+
favorites.Add(node);
431431
}
432432

433433
// Build on the root of the remote, just like with locals
@@ -462,23 +462,23 @@ private void BuildTree(BranchTreeNode parent, BranchTreeNode child)
462462
BuildTree(folder, child);
463463
}
464464

465-
private void SetFavourite(BranchTreeNode branch, bool favourite)
465+
private void SetFavorite(BranchTreeNode branch, bool favorite)
466466
{
467467
if (string.IsNullOrEmpty(branch.Name))
468468
{
469469
return;
470470
}
471471

472-
if (!favourite)
472+
if (!favorite)
473473
{
474-
favourites.Remove(branch);
475-
Manager.LocalSettings.Set(FavoritesSetting, favourites.Select(x => x.Name).ToList());
474+
favorites.Remove(branch);
475+
Manager.LocalSettings.Set(FavoritesSetting, favorites.Select(x => x.Name).ToList());
476476
}
477477
else
478478
{
479-
favourites.Remove(branch);
480-
favourites.Add(branch);
481-
Manager.LocalSettings.Set(FavoritesSetting, favourites.Select(x => x.Name).ToList());
479+
favorites.Remove(branch);
480+
favorites.Add(branch);
481+
Manager.LocalSettings.Set(FavoritesSetting, favorites.Select(x => x.Name).ToList());
482482
}
483483
}
484484

@@ -621,12 +621,12 @@ private void OnTreeNodeGUI(BranchTreeNode node)
621621
var style = node.Active ? Styles.BoldLabel : Styles.Label;
622622
var rect = GUILayoutUtility.GetRect(content, style, GUILayout.MaxHeight(EditorGUIUtility.singleLineHeight));
623623
var clickRect = new Rect(0f, rect.y, Position.width, rect.height);
624-
var favouriteRect = new Rect(clickRect.xMax - clickRect.height * 2f, clickRect.y, clickRect.height, clickRect.height);
624+
var favoriteRect = new Rect(clickRect.xMax - clickRect.height * 2f, clickRect.y, clickRect.height, clickRect.height);
625625

626626
var selected = selectedNode == node;
627627
var keyboardFocus = GUIUtility.keyboardControl == listID;
628628

629-
// Selection highlight and favourite toggle
629+
// Selection highlight and favorite toggle
630630
if (selected)
631631
{
632632
if (Event.current.type == EventType.Repaint)
@@ -636,22 +636,22 @@ private void OnTreeNodeGUI(BranchTreeNode node)
636636

637637
if (node.Type != NodeType.Folder)
638638
{
639-
var favourite = IsFavourite(node);
639+
var favorite = IsFavorite(node);
640640
if (Event.current.type == EventType.Repaint)
641641
{
642-
GUI.DrawTexture(favouriteRect, favourite ? Styles.FavouriteIconOn : Styles.FavouriteIconOff);
642+
GUI.DrawTexture(favoriteRect, favorite ? Styles.FavoriteIconOn : Styles.FavoriteIconOff);
643643
}
644-
else if (Event.current.type == EventType.MouseDown && favouriteRect.Contains(Event.current.mousePosition))
644+
else if (Event.current.type == EventType.MouseDown && favoriteRect.Contains(Event.current.mousePosition))
645645
{
646-
SetFavourite(node, !favourite);
646+
SetFavorite(node, !favorite);
647647
Event.current.Use();
648648
}
649649
}
650650
}
651-
// Favourite status
652-
else if (Event.current.type == EventType.Repaint && node.Type != NodeType.Folder && IsFavourite(node.Name))
651+
// Favorite status
652+
else if (Event.current.type == EventType.Repaint && node.Type != NodeType.Folder && IsFavorite(node.Name))
653653
{
654-
GUI.DrawTexture(favouriteRect, Styles.FavouriteIconOn);
654+
GUI.DrawTexture(favoriteRect, Styles.FavoriteIconOn);
655655
}
656656

657657
// The actual icon and label

0 commit comments

Comments
 (0)