Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase to fix conflicts #190

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SongBrowserPlugin/Configuration/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ internal class PluginConfig
/// </summary>
public virtual void Changed()
{
if (this.SearchTerms.Count > MaxSearchTerms)
if (SearchTerms.Count > MaxSearchTerms)
{
this.SearchTerms.RemoveRange(MaxSearchTerms, this.SearchTerms.Count - MaxSearchTerms);
SearchTerms.RemoveRange(MaxSearchTerms, SearchTerms.Count - MaxSearchTerms);
}
}

Expand Down
13 changes: 6 additions & 7 deletions SongBrowserPlugin/Configuration/SongFilterMode.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SongBrowser.Configuration
namespace SongBrowser.Configuration
{
public enum SongFilterMode
{
Easy = BeatmapDifficulty.Easy,
Normal = BeatmapDifficulty.Normal,
Hard = BeatmapDifficulty.Hard,
Expert = BeatmapDifficulty.Expert,
ExpertPlus = BeatmapDifficulty.ExpertPlus,
None,
Favorites,
Playlist,
Expand Down
5 changes: 1 addition & 4 deletions SongBrowserPlugin/Configuration/SongMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using IPA.Config.Stores.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SongBrowser.Configuration
{
Expand All @@ -18,7 +15,7 @@ internal class SongMetadataStore
public virtual SongMetadata GetMetadataForLevelID(string levelID)
{
if (!Songs.ContainsKey(levelID))
SongMetadataStore.Instance.Songs.Add(levelID, new SongMetadata());
Instance.Songs.Add(levelID, new SongMetadata());
return Songs[levelID];
}
}
Expand Down
8 changes: 1 addition & 7 deletions SongBrowserPlugin/Configuration/SongSortMode.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SongBrowser.Configuration
namespace SongBrowser.Configuration
{
public enum SongSortMode
{
Expand Down
5 changes: 2 additions & 3 deletions SongBrowserPlugin/DataAccess/Playlist.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
using BeatSaberPlaylistsLib;
using System.Collections.Generic;
using System.IO;


namespace SongBrowser.DataAccess
{
class Playlist
{
internal static PlaylistManager defaultManager = BeatSaberPlaylistsLib.PlaylistManager.DefaultManager.CreateChildManager("SongBrowser");
internal static PlaylistManager defaultManager = PlaylistManager.DefaultManager.CreateChildManager("SongBrowser");

public static BeatSaberPlaylistsLib.Types.IPlaylist CreateNew(string playlistName, IReadOnlyList<IPreviewBeatmapLevel> beatmapLevels)
{
BeatSaberPlaylistsLib.Types.IPlaylist playlist = defaultManager.CreatePlaylist("", playlistName, "SongBrowser", "");
var playlist = defaultManager.CreatePlaylist("", playlistName, "SongBrowser", "");
foreach (var beatmapLevel in beatmapLevels)
{
playlist.Add(beatmapLevel);
Expand Down
156 changes: 75 additions & 81 deletions SongBrowserPlugin/DataAccess/SongBrowserModel.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ static void Prefix(FlowCoordinator flowCoordinator, Action finishedCallback = nu
if (flowType == typeof(SoloFreePlayFlowCoordinator))
{
Logger.Info("Initializing SongBrowser for Single Player Mode");
SongBrowser.SongBrowserApplication.Instance.HandleSoloModeSelection();
SongBrowserApplication.Instance.HandleSoloModeSelection();
}
else if (flowType == typeof(MultiplayerLevelSelectionFlowCoordinator))
{
Logger.Info("Initializing SongBrowser for Multiplayer Mode");
SongBrowser.SongBrowserApplication.Instance.HandleMultiplayerModeSelection();
SongBrowserApplication.Instance.HandleMultiplayerModeSelection();
}
else if (flowType == typeof(PartyFreePlayFlowCoordinator))
{
Logger.Info("Initializing SongBrowser for Party Mode");
SongBrowser.SongBrowserApplication.Instance.HandlePartyModeSelection();
SongBrowserApplication.Instance.HandlePartyModeSelection();
}
else if (flowType == typeof(CampaignFlowCoordinator))
{
Logger.Info("Initializing SongBrowser for Multiplayer Mode");
SongBrowser.SongBrowserApplication.Instance.HandleCampaignModeSelection();
SongBrowserApplication.Instance.HandleCampaignModeSelection();
}

return;
Expand Down
12 changes: 6 additions & 6 deletions SongBrowserPlugin/Internals/BeatSaberExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class BeatSaberUIExtensions
#region Button Extensions
public static void SetButtonText(this Button _button, string _text)
{
HMUI.CurvedTextMeshPro textMesh = _button.GetComponentInChildren<HMUI.CurvedTextMeshPro>();
var textMesh = _button.GetComponentInChildren<HMUI.CurvedTextMeshPro>();
if (textMesh != null)
{
textMesh.SetText(_text);
Expand All @@ -38,7 +38,7 @@ public static void ToggleWordWrapping(this Button _button, bool enableWordWrappi

public static void SetButtonBackgroundActive(this Button parent, bool active)
{
HMUI.ImageView img = parent.GetComponentsInChildren<HMUI.ImageView>().Last(x => x.name == "BG");
var img = parent.GetComponentsInChildren<HMUI.ImageView>().Last(x => x.name == "BG");
if (img != null)
{
img.gameObject.SetActive(active);
Expand All @@ -47,7 +47,7 @@ public static void SetButtonBackgroundActive(this Button parent, bool active)

public static void SetButtonUnderlineColor(this Button parent, Color color)
{
HMUI.ImageView img = parent.GetComponentsInChildren<HMUI.ImageView>().FirstOrDefault(x => x.name == "Underline");
var img = parent.GetComponentsInChildren<HMUI.ImageView>().FirstOrDefault(x => x.name == "Underline");
if (img != null)
{
img.color = color;
Expand All @@ -56,7 +56,7 @@ public static void SetButtonUnderlineColor(this Button parent, Color color)

public static void SetButtonBorder(this Button button, Color color)
{
HMUI.ImageView img = button.GetComponentsInChildren<HMUI.ImageView>().FirstOrDefault(x => x.name == "Border");
var img = button.GetComponentsInChildren<HMUI.ImageView>().FirstOrDefault(x => x.name == "Border");
if (img != null)
{
img.color0 = color;
Expand All @@ -71,12 +71,12 @@ public static void SetButtonBorder(this Button button, Color color)
#region ViewController Extensions
public static Button CreateUIButton(this HMUI.ViewController parent, string name, string buttonTemplate, Vector2 anchoredPosition, Vector2 sizeDelta, UnityAction onClick = null, string buttonText = "BUTTON")
{
Button btn = BeatSaberUI.CreateUIButton(name, parent.rectTransform, buttonTemplate, anchoredPosition, sizeDelta, onClick, buttonText);
var btn = BeatSaberUI.CreateUIButton(name, parent.rectTransform, buttonTemplate, anchoredPosition, sizeDelta, onClick, buttonText);
return btn;
}
public static Button CreateIconButton(this HMUI.ViewController parent, string name, string buttonTemplate, Vector2 anchoredPosition, Vector2 sizeDelta, UnityAction onClick, Sprite icon, string hint)
{
Button btn = BeatSaberUI.CreateIconButton(name, parent.rectTransform, buttonTemplate, anchoredPosition, sizeDelta, onClick, icon, hint);
var btn = BeatSaberUI.CreateIconButton(name, parent.rectTransform, buttonTemplate, anchoredPosition, sizeDelta, onClick, icon, hint);
return btn;
}
#endregion
Expand Down
Loading