Skip to content

Commit

Permalink
initial 1.37.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwasyx committed Aug 19, 2024
1 parent 3d8fa09 commit e780821
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 28 deletions.
11 changes: 5 additions & 6 deletions ScoreSaber/Core/ReplaySystem/Legacy/LegacyReplayPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using IPA.Utilities;
using ScoreSaber.Core.Utils;
using UnityEngine.SpatialTracking;
using BeatSaber.GameSettings;

namespace ScoreSaber.Core.ReplaySystem.Legacy {

Expand All @@ -19,7 +18,7 @@ internal class LegacyReplayPlayer : IInitializable, ITickable, IDisposable {
private readonly AudioTimeSyncController _audioTimeSyncController;
private readonly MainCamera _mainCamera;
private readonly SaberManager _saberManager;
private readonly MainSettingsHandler _mainSettingsHandler;
private readonly SettingsManager _settingsManager;
private PlayerTransforms _playerTransforms;
private readonly IFPFCSettings _fpfcSettings;
private ComboController _comboController;
Expand All @@ -39,7 +38,7 @@ internal class LegacyReplayPlayer : IInitializable, ITickable, IDisposable {

internal LegacyReplayPlayer(List<Z.Keyframe> keyframes, ScoreController scoreController,
RelativeScoreAndImmediateRankCounter relativeScoreAndImmediateRankCounter, AudioTimeSyncController audioTimeSyncController,
MainCamera mainCamera, SaberManager saberManager, PlayerTransforms playerTransforms, IFPFCSettings fpfcSettings, ComboController comboController, MainSettingsHandler mainSettingsHandler) {
MainCamera mainCamera, SaberManager saberManager, PlayerTransforms playerTransforms, IFPFCSettings fpfcSettings, ComboController comboController, SettingsManager settingsManager) {

_fpfcSettings = fpfcSettings;
_comboController = comboController;
Expand All @@ -54,7 +53,7 @@ internal LegacyReplayPlayer(List<Z.Keyframe> keyframes, ScoreController scoreCon
_mainCamera = mainCamera;
_saberManager = saberManager;
_playerTransforms = playerTransforms;
_mainSettingsHandler = mainSettingsHandler;
_settingsManager = settingsManager;
_scoreUIController = Resources.FindObjectsOfTypeAll<ScoreUIController>().FirstOrDefault();
}

Expand Down Expand Up @@ -91,9 +90,9 @@ private void SetupCameras() {
//InGame Camera
GameObject spectatorObject = new GameObject("SpectatorParent");
_spectatorCamera = UnityEngine.Object.Instantiate(_desktopCamera);
spectatorObject.transform.position = new Vector3(_mainSettingsHandler.instance.roomCenter.x, _mainSettingsHandler.instance.roomCenter.y, _mainSettingsHandler.instance.roomCenter.z);
spectatorObject.transform.position = new Vector3(_settingsManager.settings.room.center.x, _settingsManager.settings.room.center.y, _settingsManager.settings.room.center.z);
Quaternion rotation = new Quaternion {
eulerAngles = new Vector3(0.0f, _mainSettingsHandler.instance.roomRotation, 0.0f)
eulerAngles = new Vector3(0.0f, _settingsManager.settings.room.rotation, 0.0f)
};
spectatorObject.transform.rotation = rotation;
_spectatorCamera.stereoTargetEye = StereoTargetEyeMask.Both;
Expand Down
15 changes: 7 additions & 8 deletions ScoreSaber/Core/ReplaySystem/Playback/PosePlayer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BeatSaber.GameSettings;
using IPA.Utilities;
using IPA.Utilities;
using ScoreSaber.Core.ReplaySystem.Data;
using ScoreSaber.Extensions;
using SiraUtil.Tools.FPFC;
Expand All @@ -18,7 +17,7 @@ internal class PosePlayer : TimeSynchronizer, IInitializable, ITickable, IScroll
private readonly SaberManager _saberManager;
private readonly VRPoseGroup[] _sortedPoses;
private readonly IFPFCSettings _fpfcSettings;
private readonly MainSettingsHandler _mainSettingsHandler;
private readonly SettingsManager _settingsManager;
private readonly IReturnToMenuController _returnToMenuController;
public event Action<VRPoseGroup> DidUpdatePose;
private PlayerTransforms _playerTransforms;
Expand All @@ -29,7 +28,7 @@ internal class PosePlayer : TimeSynchronizer, IInitializable, ITickable, IScroll

private bool initialFPFCState;

public PosePlayer(ReplayFile file, MainCamera mainCamera, SaberManager saberManager, IReturnToMenuController returnToMenuController, IFPFCSettings fpfcSettings, PlayerTransforms playerTransforms, MainSettingsHandler mainSettingsHandler) {
public PosePlayer(ReplayFile file, MainCamera mainCamera, SaberManager saberManager, IReturnToMenuController returnToMenuController, IFPFCSettings fpfcSettings, PlayerTransforms playerTransforms, SettingsManager settingsManager) {

_fpfcSettings = fpfcSettings;
initialFPFCState = fpfcSettings.Enabled;
Expand All @@ -40,7 +39,7 @@ public PosePlayer(ReplayFile file, MainCamera mainCamera, SaberManager saberMana
_sortedPoses = file.poseKeyframes.ToArray();
_returnToMenuController = returnToMenuController;
_spectatorOffset = new Vector3(0f, 0f, -2f);
_mainSettingsHandler = mainSettingsHandler;
_settingsManager = settingsManager;
_playerTransforms = playerTransforms;
}

Expand Down Expand Up @@ -79,9 +78,9 @@ private void SetupCameras() {
//InGame Camera
GameObject spectatorObject = new GameObject("SpectatorParent");
_spectatorCamera = UnityEngine.Object.Instantiate(_desktopCamera);
spectatorObject.transform.position = new Vector3(_mainSettingsHandler.instance.roomCenter.x + _spectatorOffset.x, _mainSettingsHandler.instance.roomCenter.y + _spectatorOffset.y, _mainSettingsHandler.instance.roomCenter.z + _spectatorOffset.z);
spectatorObject.transform.position = new Vector3(_settingsManager.settings.room.center.x + _spectatorOffset.x, _settingsManager.settings.room.center.y + _spectatorOffset.y, _settingsManager.settings.room.center.z + _spectatorOffset.z);
Quaternion rotation = new Quaternion {
eulerAngles = new Vector3(0.0f, _mainSettingsHandler.instance.roomRotation, 0.0f)
eulerAngles = new Vector3(0.0f, _settingsManager.settings.room.rotation, 0.0f)
};
spectatorObject.transform.rotation = rotation;
_spectatorCamera.stereoTargetEye = StereoTargetEyeMask.Both;
Expand Down Expand Up @@ -195,7 +194,7 @@ public void TimeUpdate(float newTime) {

public void SetSpectatorOffset(Vector3 value) {

_spectatorCamera.transform.parent.position = new Vector3(_mainSettingsHandler.instance.roomCenter.x + value.x, _mainSettingsHandler.instance.roomCenter.y + value.y, _mainSettingsHandler.instance.roomCenter.z + value.z);
_spectatorCamera.transform.parent.position = new Vector3(_settingsManager.settings.room.center.x + value.x, _settingsManager.settings.room.center.y + value.y, _settingsManager.settings.room.center.z + value.z);

_spectatorOffset = value;
}
Expand Down
16 changes: 7 additions & 9 deletions ScoreSaber/Core/ReplaySystem/Recorders/MetadataRecorder.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
using System;
using System.Collections.Generic;
using ScoreSaber.Core.ReplaySystem.Data;
using UnityEngine;
using Zenject;
using BeatSaber.GameSettings;

namespace ScoreSaber.Core.ReplaySystem.Recorders
{
internal class MetadataRecorder : TimeSynchronizer, IInitializable, IDisposable
{
BeatmapObjectSpawnController.InitData _beatmapObjectSpawnControllerInitData;
private readonly GameplayCoreSceneSetupData _gameplayCoreSceneSetupData;
private readonly MainSettingsHandler _mainSettingsHandler;
private readonly SettingsManager _settingsManager;
private readonly IGameEnergyCounter _gameEnergyCounter;
private float _failTime;

public MetadataRecorder(GameplayCoreSceneSetupData gameplayCoreSceneSetupData, BeatmapObjectSpawnController.InitData beatmapObjectSpawnControllerInitData, IGameEnergyCounter gameEnergyCounter, MainSettingsHandler mainSettingsHandler) {
public MetadataRecorder(GameplayCoreSceneSetupData gameplayCoreSceneSetupData, BeatmapObjectSpawnController.InitData beatmapObjectSpawnControllerInitData, IGameEnergyCounter gameEnergyCounter, SettingsManager settingsManager) {

_beatmapObjectSpawnControllerInitData = beatmapObjectSpawnControllerInitData;
_gameEnergyCounter = gameEnergyCounter;
_gameplayCoreSceneSetupData = gameplayCoreSceneSetupData;
_mainSettingsHandler = mainSettingsHandler;
_settingsManager = settingsManager;
}


Expand All @@ -43,9 +41,9 @@ private void GameEnergyCounter_gameEnergyDidReach0Event() {
public Metadata Export() {

VRPosition roomCenter = new VRPosition() {
X = _mainSettingsHandler.instance.roomCenter.x,
Y = _mainSettingsHandler.instance.roomCenter.y,
Z = _mainSettingsHandler.instance.roomCenter.z
X = _settingsManager.settings.room.center.x,
Y = _settingsManager.settings.room.center.y,
Z = _settingsManager.settings.room.center.z
};

return new Metadata() {
Expand All @@ -58,7 +56,7 @@ public Metadata Export() {
NoteSpawnOffset = _beatmapObjectSpawnControllerInitData.noteJumpValue,
LeftHanded = _gameplayCoreSceneSetupData.playerSpecificSettings.leftHanded,
InitialHeight = _gameplayCoreSceneSetupData.playerSpecificSettings.playerHeight,
RoomRotation = _mainSettingsHandler.instance.roomRotation,
RoomRotation = _settingsManager.settings.room.rotation,
RoomCenter = roomCenter,
FailTime = _failTime
};
Expand Down
5 changes: 2 additions & 3 deletions ScoreSaber/Core/ReplaySystem/UI/ImberUIPositionController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using BeatSaber.GameSettings;
using HMUI;
using HMUI;
using ScoreSaber.Core.Data;
using System;
using System.Collections;
Expand Down Expand Up @@ -35,7 +34,7 @@ internal class ImberUIPositionController : IInitializable, ITickable, IDisposabl
private Vector3 _controllerOffset;


public ImberUIPositionController(IGamePause gamePause, ImberScrubber imberScrubber, PauseMenuManager pauseMenuManager, MainImberPanelView mainImberPanelView, VRControllerAccessor vrControllerAccessor, MainSettingsHandler mainSettingsHandler) {
public ImberUIPositionController(IGamePause gamePause, ImberScrubber imberScrubber, PauseMenuManager pauseMenuManager, MainImberPanelView mainImberPanelView, VRControllerAccessor vrControllerAccessor) {

_gamePause = gamePause;
_imberScrubber = imberScrubber;
Expand Down
10 changes: 10 additions & 0 deletions ScoreSaber/ScoreSaber.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BeatSaber.Settings">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BeatSaber.Settings.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="BGLib.AppFlow">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\BGLib.AppFlow.dll</HintPath>
<Private>False</Private>
Expand Down Expand Up @@ -141,6 +146,11 @@
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Unity.Mathematics">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Unity.Mathematics.dll</HintPath>
<Private>False</Private>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Unity.XR.OpenXR">
<HintPath>$(BeatSaberDir)\Beat Saber_Data\Managed\Unity.XR.OpenXR.dll</HintPath>
<Private>False</Private>
Expand Down
4 changes: 2 additions & 2 deletions ScoreSaber/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"$schema": "https://raw.githubusercontent.com/nike4613/ModSaber-MetadataFileSchema/master/Schema.json",
"author": "Umbranox",
"description": "Allows you to upload scores to an online leaderboard, earn PP from ranked maps and compare scores with others.",
"gameVersion": "1.37.2",
"gameVersion": "1.37.3",
"icon": "ScoreSaber.logo.png",
"id": "ScoreSaber",
"name": "ScoreSaber",
"version": "3.3.9",
"version": "3.3.10",
"dependsOn": {
"BSIPA": "^4.3.0",
"BeatSaberMarkupLanguage": "^1.9.0",
Expand Down

0 comments on commit e780821

Please sign in to comment.