|
@@ -248,8 +248,8 @@ namespace SongBrowser.UI
|
|
|
|
|
|
Button playButton = Resources.FindObjectsOfTypeAll<Button>().First(x => x.name == "PlayButton");
|
|
|
RectTransform playButtonRect = (playButton.transform as RectTransform);
|
|
|
- Sprite arrowIcon = SongBrowserApplication.Instance.CachedIcons["ArrowIcon"];
|
|
|
- Sprite borderSprite = SongBrowserApplication.Instance.CachedIcons["RoundRectBigStroke"];
|
|
|
+ Sprite arrowIcon = Resources.FindObjectsOfTypeAll<Sprite>().First(x => x.name == "ArrowIcon");
|
|
|
+ Sprite borderSprite = Resources.FindObjectsOfTypeAll<Sprite>().First(x => x.name == "RoundRectBigStroke");
|
|
|
|
|
|
// Create Sorting Songs By-Buttons
|
|
|
Logger.Debug("Start creation of UI...");
|
|
@@ -1554,163 +1554,6 @@ namespace SongBrowser.UI
|
|
|
|
|
|
return noteJumpSpeed;
|
|
|
}
|
|
|
-
|
|
|
-#if DEBUG
|
|
|
- /// <summary>
|
|
|
- /// Not normally called by the game-engine. Dependent on SongBrowserApplication to call it.
|
|
|
- /// </summary>
|
|
|
- public void LateUpdate()
|
|
|
- {
|
|
|
- CheckDebugUserInput();
|
|
|
- }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// Map some key presses directly to UI interactions to make testing easier.
|
|
|
- /// </summary>
|
|
|
- private void CheckDebugUserInput()
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- if (this._levelPackLevelsViewController != null && this._levelPackLevelsViewController.isActiveAndEnabled)
|
|
|
- {
|
|
|
- bool isShiftKeyDown = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
|
|
|
-
|
|
|
- if (isShiftKeyDown && Input.GetKeyDown(KeyCode.X))
|
|
|
- {
|
|
|
- this._beatmapCharacteristicSelectionViewController.HandleDifficultySegmentedControlDidSelectCell(null, 1);
|
|
|
- }
|
|
|
- else if (Input.GetKeyDown(KeyCode.X))
|
|
|
- {
|
|
|
- this._beatmapCharacteristicSelectionViewController.HandleDifficultySegmentedControlDidSelectCell(null, 0);
|
|
|
- }
|
|
|
-
|
|
|
- // back
|
|
|
- if (Input.GetKeyDown(KeyCode.Escape))
|
|
|
- {
|
|
|
- this._levelSelectionNavigationController.GoBackButtonPressed();
|
|
|
- }
|
|
|
-
|
|
|
- // select current sort mode again (toggle inverting)
|
|
|
- if (isShiftKeyDown && Input.GetKeyDown(KeyCode.BackQuote))
|
|
|
- {
|
|
|
- _sortButtonGroup[_sortButtonLastPushedIndex].Button.onClick.Invoke();
|
|
|
- }
|
|
|
- // cycle sort modes
|
|
|
- else if (Input.GetKeyDown(KeyCode.BackQuote))
|
|
|
- {
|
|
|
- _sortButtonLastPushedIndex = (_sortButtonLastPushedIndex + 1) % _sortButtonGroup.Count;
|
|
|
- _sortButtonGroup[_sortButtonLastPushedIndex].Button.onClick.Invoke();
|
|
|
- }
|
|
|
-
|
|
|
- // filter favorites
|
|
|
- if (Input.GetKeyDown(KeyCode.F1))
|
|
|
- {
|
|
|
- OnFavoriteFilterButtonClickEvent();
|
|
|
- }
|
|
|
-
|
|
|
- // filter playlists
|
|
|
- if (Input.GetKeyDown(KeyCode.F2))
|
|
|
- {
|
|
|
- OnPlaylistButtonClickEvent();
|
|
|
- }
|
|
|
-
|
|
|
- // filter search
|
|
|
- if (Input.GetKeyDown(KeyCode.F3))
|
|
|
- {
|
|
|
- OnSearchButtonClickEvent();
|
|
|
- }
|
|
|
-
|
|
|
- // delete
|
|
|
- if (Input.GetKeyDown(KeyCode.Delete))
|
|
|
- {
|
|
|
- _deleteButton.onClick.Invoke();
|
|
|
- }
|
|
|
-
|
|
|
- // c - select difficulty for top song
|
|
|
- if (Input.GetKeyDown(KeyCode.C))
|
|
|
- {
|
|
|
- _levelPacksTableView.SelectCellWithIdx(5);
|
|
|
- _levelPacksTableView.HandleDidSelectColumnEvent(null, 2);
|
|
|
-
|
|
|
- TableView listTableView = this._levelPackLevelsTableView.GetPrivateField<TableView>("_tableView");
|
|
|
- this._levelPackLevelsTableView.HandleDidSelectRowEvent(listTableView, 2);
|
|
|
- listTableView.ScrollToCellWithIdx(2, TableView.ScrollPositionType.Beginning, false);
|
|
|
-
|
|
|
- //this._levelDifficultyViewController.HandleDifficultySegmentedControlDidSelectCell(null, 0);
|
|
|
- }
|
|
|
-
|
|
|
- // v - select difficulty for top song
|
|
|
- if (Input.GetKeyDown(KeyCode.V))
|
|
|
- {
|
|
|
- this.SelectAndScrollToLevel(_levelPackLevelsTableView, _model.SortedSongList[0].levelID);
|
|
|
- this._levelDifficultyViewController.HandleDifficultySegmentedControlDidSelectCell(null, 0);
|
|
|
- }
|
|
|
-
|
|
|
- // return - start a song
|
|
|
- if (Input.GetKeyDown(KeyCode.Return))
|
|
|
- {
|
|
|
- if (_playButton.isActiveAndEnabled)
|
|
|
- {
|
|
|
- _playButton.onClick.Invoke();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // change song index
|
|
|
- if (isShiftKeyDown && Input.GetKeyDown(KeyCode.N))
|
|
|
- {
|
|
|
- _pageUpFastButton.onClick.Invoke();
|
|
|
- }
|
|
|
- else if (Input.GetKeyDown(KeyCode.N))
|
|
|
- {
|
|
|
- _lastRow = (_lastRow - 1) != -1 ? (_lastRow - 1) % this._model.SortedSongList.Count : 0;
|
|
|
- this.SelectAndScrollToLevel(_levelPackLevelsTableView, _model.SortedSongList[_lastRow].levelID);
|
|
|
- }
|
|
|
-
|
|
|
- if (isShiftKeyDown && Input.GetKeyDown(KeyCode.M))
|
|
|
- {
|
|
|
- _pageDownFastButton.onClick.Invoke();
|
|
|
- }
|
|
|
- else if (Input.GetKeyDown(KeyCode.M))
|
|
|
- {
|
|
|
- _lastRow = (_lastRow + 1) % this._model.SortedSongList.Count;
|
|
|
- this.SelectAndScrollToLevel(_levelPackLevelsTableView, _model.SortedSongList[_lastRow].levelID);
|
|
|
- }
|
|
|
-
|
|
|
- // add to favorites
|
|
|
- if (Input.GetKeyDown(KeyCode.KeypadPlus))
|
|
|
- {
|
|
|
- ToggleSongInPlaylist();
|
|
|
- }
|
|
|
- }
|
|
|
- else if (_deleteDialog != null && _deleteDialog.isInViewControllerHierarchy)
|
|
|
- {
|
|
|
- // accept delete
|
|
|
- if (Input.GetKeyDown(KeyCode.Return))
|
|
|
- {
|
|
|
- _deleteDialog.GetPrivateField<Button>("_okButton").onClick.Invoke();
|
|
|
- }
|
|
|
-
|
|
|
- if (Input.GetKeyDown(KeyCode.Escape))
|
|
|
- {
|
|
|
- _deleteDialog.GetPrivateField<Button>("_cancelButton").onClick.Invoke();
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (Input.GetKeyDown(KeyCode.B))
|
|
|
- {
|
|
|
- Logger.Debug("Invoking OK Button");
|
|
|
- VRUIViewController view = Resources.FindObjectsOfTypeAll<VRUIViewController>().First(x => x.name == "StandardLevelResultsViewController");
|
|
|
- view.GetComponentsInChildren<Button>().First(x => x.name == "Ok").onClick.Invoke();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
- Logger.Exception("Debug Input caused Exception: ", e);
|
|
|
- }
|
|
|
- }
|
|
|
-#endif
|
|
|
}
|
|
|
}
|
|
|
|