Skip to content

Commit

Permalink
Working with 0.11.2.
Browse files Browse the repository at this point in the history
Version bump.
  • Loading branch information
halsafar committed Aug 25, 2018
1 parent 870075f commit 3c3b50c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
12 changes: 7 additions & 5 deletions SongBrowserPlugin/DataAccess/SongBrowserModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,12 @@ private void UpdateSongInfos(GameplayMode gameplayMode)
_log.Trace("UpdateSongInfos for Gameplay Mode {0}", gameplayMode);

// Get the level collection from song loader
SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes collections = SongLoaderPlugin.SongLoader.Instance.GetPrivateField<SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes>("_customLevelCollectionsForGameplayModes");
_gameplayModeCollection = collections.GetCollection(gameplayMode) as SongLoaderPlugin.OverrideClasses.CustomLevelCollectionSO;
_originalSongs = collections.GetLevels(gameplayMode).ToList();
LevelCollectionsForGameplayModes levelCollections = Resources.FindObjectsOfTypeAll<LevelCollectionsForGameplayModes>().FirstOrDefault();
List<LevelCollectionsForGameplayModes.LevelCollectionForGameplayMode> levelCollectionsForGameModes = ReflectionUtil.GetPrivateField<LevelCollectionsForGameplayModes.LevelCollectionForGameplayMode[]>(levelCollections, "_collections").ToList();

_originalSongs = levelCollections.GetLevels(gameplayMode).ToList();
_sortedSongs = _originalSongs;

_levelIdToCustomLevel = new Dictionary<string, SongLoaderPlugin.OverrideClasses.CustomLevel>();
foreach (var level in SongLoader.CustomLevels)
{
Expand Down Expand Up @@ -614,8 +616,8 @@ private void FilterPlaylist()
List<String> playlistNameListOrdered = this.CurrentPlaylist.songs.Select(x => x.songName).Distinct().ToList();
Dictionary<String, int> songNameToIndex = playlistNameListOrdered.Select((val, index) => new { Index = index, Value = val }).ToDictionary(i => i.Value, i => i.Index);
HashSet<String> songNames = new HashSet<String>(playlistNameListOrdered);
SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes collections = SongLoaderPlugin.SongLoader.Instance.GetPrivateField<SongLoaderPlugin.OverrideClasses.CustomLevelCollectionsForGameplayModes>("_customLevelCollectionsForGameplayModes");
List<StandardLevelSO> songList = collections.GetLevels(_currentGamePlayMode).Where(x => songNames.Contains(x.songName)).ToList();
LevelCollectionsForGameplayModes levelCollections = Resources.FindObjectsOfTypeAll<LevelCollectionsForGameplayModes>().FirstOrDefault();
List<StandardLevelSO> songList = levelCollections.GetLevels(_currentGamePlayMode).Where(x => songNames.Contains(x.songName)).ToList();
_log.Debug("\tMatching songs found for playlist: {0}", songList.Count);
_originalSongs = songList;
_filteredSongs = songList
Expand Down
2 changes: 1 addition & 1 deletion SongBrowserPlugin/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public string Name

public string Version
{
get { return "v2.2.6"; }
get { return "v2.2.7"; }
}

public void OnApplicationStart()
Expand Down
2 changes: 1 addition & 1 deletion SongBrowserPlugin/SongBrowserApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void AcquireUIElements()
/// </summary>
/// <param name="arg1"></param>
/// <param name="arg2"></param>
private void HandleSoloModeSelectionViewControllerDidSelectMode(SoloModeSelectionViewController arg1, SoloModeSelectionViewController.SubMenuType arg2)
private void HandleSoloModeSelectionViewControllerDidSelectMode(SoloModeSelectionViewController arg1, SoloModeSelectionViewController.MenuType arg2)
{
_log.Trace("HandleSoloModeSelectionViewControllerDidSelectMode() - GameplayMode={0}", arg2);
this._songBrowserUI.UpdateSongList();
Expand Down
2 changes: 0 additions & 2 deletions SongBrowserPlugin/SongBrowserPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="BeatSaverApi\BeatSaverApi.cs" />
<Compile Include="BeatSaverApi\BeatSaverAPIResults.cs" />
<Compile Include="DataAccess\Playlist.cs" />
<Compile Include="DataAccess\PlaylistReader.cs" />
<Compile Include="DataAccess\PlaylistSong.cs" />
Expand Down
11 changes: 5 additions & 6 deletions SongBrowserPlugin/UI/Keyboard/SearchKeyboardViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ protected override void DidActivate(bool firstActivation, ActivationType type)

_searchKeyboard = _searchKeyboardGO.AddComponent<CustomUIKeyboard>();

_searchKeyboard.uiKeyboardKeyEvent = delegate (char input) { _inputString += input; UpdateInputText(); };
_searchKeyboard.uiKeyboardDeleteEvent = delegate () { _inputString = _inputString.Substring(0, _inputString.Length - 1); UpdateInputText(); };
_searchKeyboard.uiKeyboardKeyEvent += delegate (char input) { _inputString += input; UpdateInputText(); };
_searchKeyboard.uiKeyboardDeleteEvent += delegate () { _inputString = _inputString.Substring(0, _inputString.Length - 1); UpdateInputText(); };
}

if (_inputText == null)
Expand All @@ -50,13 +50,12 @@ protected override void DidActivate(bool firstActivation, ActivationType type)

if (_searchButton == null)
{
_searchButton = UIBuilder.CreateUIButton(rectTransform, "ApplyButton");
_searchButton = UIBuilder.CreateUIButton(rectTransform, "SettingsButton");
UIBuilder.SetButtonText(ref _searchButton, "Search");
(_searchButton.transform as RectTransform).sizeDelta = new Vector2(30f, 10f);
(_searchButton.transform as RectTransform).anchoredPosition = new Vector2(-15f, 1.5f);
(_searchButton.transform as RectTransform).anchoredPosition = new Vector2(-65f, 1.5f);
_searchButton.onClick.RemoveAllListeners();
_searchButton.onClick.AddListener(delegate ()
{
_searchButton.onClick.AddListener(delegate () {
searchButtonPressed?.Invoke(_inputString);
DismissModalViewController(null, false);
});
Expand Down
4 changes: 2 additions & 2 deletions SongBrowserPlugin/UI/UIBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static public Button CreateUIButton(RectTransform parent, String buttonTemplateN
static public Button CreateUIButton(RectTransform parent, Button buttonTemplate)
{
Button btn = UnityEngine.Object.Instantiate(buttonTemplate, parent, false);
UnityEngine.Object.DestroyImmediate(btn.GetComponent<GameEventOnUIButtonClick>());
UnityEngine.Object.DestroyImmediate(btn.GetComponent<SignalOnUIButtonClick>());
btn.onClick = new Button.ButtonClickedEvent();
btn.name = "CustomUIButton";

Expand Down Expand Up @@ -190,7 +190,7 @@ public static Button CreateIconButton(RectTransform parent, Button buttonTemplat
public static Button CreateBackButton(RectTransform parent)
{
Button dismissButton = CreateUIButton(parent, "BackArrowButton");
UnityEngine.Object.DestroyImmediate(dismissButton.GetComponent<GameEventOnUIButtonClick>());
UnityEngine.Object.DestroyImmediate(dismissButton.GetComponent<SignalOnUIButtonClick>());
dismissButton.onClick = new Button.ButtonClickedEvent();
dismissButton.name = "CustomUIButton";

Expand Down

0 comments on commit 3c3b50c

Please sign in to comment.