Skip to content

Commit

Permalink
Added a button which opens the N4U Preferences window to 'Manage Nuge…
Browse files Browse the repository at this point in the history
…t Packages' window
  • Loading branch information
UnquotidianVi authored and JoC0de committed Jan 8, 2023
1 parent 129c161 commit 6fe75ad
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Assets/NuGet/Editor/NugetWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,16 @@ private void DrawOnlineHeader()
{
Refresh(true);
}

if (GUILayout.Button("Preferences", GUILayout.Width(80)))
{
#if UNITY_2018_3_OR_NEWER
SettingsService.OpenUserPreferences("Preferences/NuGet For Unity");
#else
EditorApplication.ExecuteMenuItem("Edit/Preferences...");
#endif
GetWindow<NugetWindow>().Close();
}
}
EditorGUILayout.EndHorizontal();

Expand Down Expand Up @@ -710,6 +720,20 @@ private void DrawInstalledHeader()
{
var enterPressed = Event.current.Equals(Event.KeyboardEvent("return"));

EditorGUILayout.BeginHorizontal();
{
if (GUILayout.Button("Preferences", GUILayout.Width(80)))
{
#if UNITY_2018_3_OR_NEWER
SettingsService.OpenUserPreferences("Preferences/NuGet For Unity");
#else
EditorApplication.ExecuteMenuItem("Edit/Preferences...");
#endif
GetWindow<NugetWindow>().Close();
}
}
EditorGUILayout.EndHorizontal();

EditorGUILayout.BeginHorizontal();
{
var oldFontSize = GUI.skin.textField.fontSize;
Expand Down Expand Up @@ -772,6 +796,16 @@ private void DrawUpdatesHeader()
{
Refresh(true);
}

if (GUILayout.Button("Preferences", GUILayout.Width(80)))
{
#if UNITY_2018_3_OR_NEWER
SettingsService.OpenUserPreferences("Preferences/NuGet For Unity");
#else
EditorApplication.ExecuteMenuItem("Edit/Preferences...");
#endif
GetWindow<NugetWindow>().Close();
}
}
EditorGUILayout.EndHorizontal();

Expand Down

0 comments on commit 6fe75ad

Please sign in to comment.