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

The Everything Update (UI Overhaul + Bug Fixes) #30

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0d16bca
begin moving scoresaber to leaderboardcore
speecil Oct 13, 2024
f59914c
More stuff i forgot, not working
speecil Oct 14, 2024
b4caac8
Closer, but bsml macros are laughing at me
speecil Oct 15, 2024
b5c2569
somewhere
speecil Oct 15, 2024
fbcc9d4
Fixed Page
speecil Oct 15, 2024
7722966
Merge remote-tracking branch 'upstream/main'
speecil Oct 16, 2024
1479e6b
Showing scores now, still buggy
speecil Oct 16, 2024
ef71707
VERY WORKING STATE
speecil Oct 16, 2024
0805e41
Cache leaderboardInfoMaps and fade cell text in
speecil Oct 17, 2024
9ad13ed
Handle ost
speecil Oct 17, 2024
82bf098
MapInfoModal, fix lb pfp on first launch with less than 10 cells
speecil Oct 17, 2024
2c4c5a2
fix panelview misalignment
speecil Oct 17, 2024
9e37d6a
begin desktop imber ui
speecil Oct 18, 2024
d53b9ae
Ensure seperator is not scaled
speecil Oct 18, 2024
7f41d33
Add graphic raycaster and scaler
speecil Oct 18, 2024
c25e39c
Display Imber on desktop, not clickable rn
speecil Oct 19, 2024
130bc29
Graphic raycaster on viewcontroller
speecil Oct 19, 2024
d92b5d2
Working imber ui + scrubber, cant move it around yet
speecil Oct 21, 2024
e78761b
Move desktop imber ui, add settings, bug fixes
speecil Oct 22, 2024
3a1fdf2
Add hiding replay watermark if it is the users replay
speecil Oct 22, 2024
60c3dde
Fix replay sync
speecil Oct 22, 2024
fc4d7ca
Make sure playback is paused while scrubbing
speecil Oct 22, 2024
2e7f7d6
Fix legacyreplayplayer throwing
speecil Oct 22, 2024
80242d5
Update README.md
speecil Oct 22, 2024
46e6902
C to unlock/lock cursor while in replay
speecil Oct 22, 2024
d8c058f
Merge branch 'main' of https://github.com/speecil/scoresaber-plugin
speecil Oct 22, 2024
5dc64aa
Make tab selector bigger in imber desktop
speecil Oct 22, 2024
90ed814
Fix energyplayer
speecil Oct 22, 2024
70a4d95
smooth profile picture fade in
speecil Oct 23, 2024
602d70e
Improve timebar
speecil Oct 23, 2024
a2cbeb8
Move tweening service, add gaymode and denyah mode back
speecil Oct 23, 2024
4b44641
Enable controller details in score modal
speecil Oct 23, 2024
3795421
forgot about the bsml
speecil Oct 23, 2024
50a2374
Increase score modal height
speecil Oct 23, 2024
9604a51
Ensure time is paused while scrubbing from bg
speecil Oct 23, 2024
ee1e2db
Actually remove LB Patches file :)
speecil Oct 23, 2024
0c15aec
remove LeaderboardMap unity engine include
speecil Nov 4, 2024
5244203
enable scrub keybinds
speecil Nov 4, 2024
4eca372
set if users replay earlier
speecil Nov 4, 2024
bd4806d
save fpfc variable to plugin
speecil Nov 4, 2024
6149138
align panelview prompt left
speecil Nov 4, 2024
890479e
make header text show map info instead
speecil Nov 4, 2024
dddb5a3
add desktop replay ui toggle hint
speecil Nov 4, 2024
32a94f6
make replay ui not italic
speecil Nov 4, 2024
1f4fedb
:)
speecil Nov 4, 2024
fdd30f9
Unskew buttons too
speecil Nov 4, 2024
0c6dd88
add CCT to team
speecil Nov 4, 2024
2e9a016
Promo Banner WIP
speecil Nov 10, 2024
c988bb7
Add arrow key bind to scrub +- 5 seconds
speecil Nov 16, 2024
2c9a812
fade desktop imber
speecil Nov 16, 2024
90b4e81
Rich presence init
speecil Dec 3, 2024
6b5dbe7
Add toggle for rich presence
speecil Dec 4, 2024
b98bc2f
bugfix richpresence
speecil Dec 4, 2024
367c845
Show current beatmap in rich presence, can download / go to beatmap
speecil Dec 5, 2024
cb18a0b
Add map presence UI to profile modal
speecil Dec 10, 2024
b0fad27
Qwasyx Review 1
speecil Dec 11, 2024
5c616cb
Qwasyx review 2
speecil Dec 11, 2024
0ae231b
Publicize DataModels
speecil Dec 11, 2024
4e25796
bugfix
speecil Dec 11, 2024
01f5b59
Qwasyx Review 3
speecil Dec 12, 2024
0c9bfdf
make rich p not on by default, popup modal
speecil Dec 12, 2024
14548c0
Qwasyx review 4
speecil Dec 12, 2024
dfc0c17
Umbra review 1
speecil Dec 14, 2024
16dcb3b
rich disclaimer bug fix
speecil Dec 14, 2024
875fd86
use menu button, umbra review 2
speecil Dec 14, 2024
cd62533
Make header use scoresaber diff colours
speecil Dec 14, 2024
40ae61a
Http client rewrite + small changes
speecil Dec 15, 2024
256182e
remove static http client, only injection
speecil Dec 15, 2024
56968cd
Allow OST score uploading
speecil Dec 15, 2024
8711994
Null check levelAuthorName
speecil Dec 15, 2024
3f7ab10
Update to 1.40, fix arc replay
speecil Dec 17, 2024
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
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# ScoreSaber-Plugin
Clone, and goodluck. The open source release of ScoreSaber was done hastily and quite a lot needs to be changed and plenty of "security through obscurity" practices covered by obfuscation can finally be removed, cleaning up the project.
ScoreSaber is Beat Saber's largest leaderboard system for custom songs, hosting 60 million scores across 170,000+ leaderboards, with more than 1 million users worldwide

Everything here is licensed under MIT and we'll be accepting contributors immediately, so if you're looking to help us out, that'd be greatly appreciated, we're going to need it.
![image](https://github.com/user-attachments/assets/f638f92b-d961-46e1-8277-d2628676128a)

Scores can also be viewed on [the website](https://scoresaber.com)

# Installation
## Method 1
- Install from your preferred mod manager
## Method 2
speecil marked this conversation as resolved.
Show resolved Hide resolved
- Download from the [releases](https://github.com/ScoreSaber/scoresaber-plugin/releases/latest)
3 changes: 3 additions & 0 deletions ScoreSaber/Core/AppInstaller.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ScoreSaber.Core.Daemons;
using ScoreSaber.Core.Services;
using System.Reflection;
using Zenject;

Expand All @@ -7,8 +8,10 @@ internal class AppInstaller : Installer {

public override void InstallBindings() {
Plugin.Container = Container;
Container.Bind<PlayerService>().AsSingle();

Container.Bind<ReplayService>().AsSingle().NonLazy();
Container.BindInterfacesAndSelfTo<ScoreSaberRichPresenceService>().AsSingle();
}
}
}
34 changes: 33 additions & 1 deletion ScoreSaber/Core/Data/Internal/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace ScoreSaber.Core.Data
{
internal class Settings
{
private static int _currentVersion => 8;
private static int _currentVersion => 9;

public bool hideReplayUI = false;

Expand Down Expand Up @@ -36,6 +36,11 @@ internal class Settings
public bool leftHandedReplayUI { get; set; }
public bool lockedReplayUIMode { get; set; }
public List<SpectatorPoseRoot> spectatorPositions { get; set; }
public Vec2 replayUIPosition { get; set; }
public float replayUISize { get; set; }
public bool startReplayUIHidden { get; set; }
public bool hideWatermarkIfUsersReplay { get; set; }
public bool enableRichPresence { get; set; }

internal static string dataPath => "UserData";
internal static string configPath => dataPath + @"\ScoreSaber";
Expand Down Expand Up @@ -65,6 +70,11 @@ public void SetDefaults() {
hasOpenedReplayUI = false;
leftHandedReplayUI = false;
lockedReplayUIMode = false;
replayUIPosition = new Vec2(new Vector2(0.12f, 0.14f));
replayUISize = 1.25f;
startReplayUIHidden = false;
hideWatermarkIfUsersReplay = false;
enableRichPresence = true;
Umbranoxio marked this conversation as resolved.
Show resolved Hide resolved
SetDefaultSpectatorPositions();
}

Expand Down Expand Up @@ -113,6 +123,12 @@ internal static Settings LoadSettings() {
if(decoded.fileVersion < 8) {
decoded.replayCameraSmoothing = true;
}
if (decoded.fileVersion < 9) {
decoded.replayUIPosition = new Vec2(new Vector2(0.12f, 0.14f));
decoded.replayUISize = 1.25f;
decoded.startReplayUIHidden = false;
speecil marked this conversation as resolved.
Show resolved Hide resolved
decoded.enableRichPresence = true;
}
SaveSettings(decoded);
}
return decoded;
Expand All @@ -136,6 +152,22 @@ internal static void SaveSettings(Settings settings) {
}
}

internal struct Vec2 {
[JsonProperty("x")]
internal float x { get; set; }
[JsonProperty("y")]
internal float y { get; set; }

internal Vec2(Vector2 position) {
x = position.x;
y = position.y;
}

internal Vector2 ToVector2() {
return new Vector2(x, y);
}
}

internal struct SpectatorPoseRoot {
[JsonProperty("name")]
internal string name { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion ScoreSaber/Core/Data/Models/ScoreSaberTeam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ internal enum TeamType
RT,
NAT,
QAT,
CAT
CAT,
CCT
speecil marked this conversation as resolved.
Show resolved Hide resolved
}
Umbranoxio marked this conversation as resolved.
Show resolved Hide resolved
}
2 changes: 2 additions & 0 deletions ScoreSaber/Core/Data/Wrappers/LeaderboardMap.cs
speecil marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ internal LeaderboardMap(Leaderboard leaderboard, BeatmapLevel beatmapLevel, Beat
}
return leaderboardTableScoreData;
}


}
}
19 changes: 15 additions & 4 deletions ScoreSaber/Core/MainInstaller.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ScoreSaber.Core.Daemons;
using ScoreSaber.Core.Data.Models;
using ScoreSaber.Core.ReplaySystem;
using ScoreSaber.Core.ReplaySystem.UI;
using ScoreSaber.Core.Services;
Expand All @@ -11,6 +12,7 @@
using ScoreSaber.UI.Main.Settings.ViewControllers;
using ScoreSaber.UI.Main.ViewControllers;
using ScoreSaber.UI.Multiplayer;
using ScoreSaber.UI.PromoBanner;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand All @@ -21,17 +23,26 @@ internal class MainInstaller : Installer {

public override void InstallBindings() {
Container.BindInstance(new object()).WithId("ScoreSaberUIBindings").AsCached();

Container.BindInterfacesAndSelfTo<MenuPresencePatches>().AsSingle();

Container.BindInterfacesAndSelfTo<PanelView>().FromNewComponentAsViewController().AsSingle();
Container.BindInterfacesAndSelfTo<ScoreSaberLeaderboardViewController>().FromNewComponentAsViewController().AsSingle();

Container.BindInterfacesTo<ScoreSaberLeaderboard>().AsSingle();

Container.Bind<TweeningService>().AsSingle();

Container.Bind<ReplayLoader>().AsSingle().NonLazy();
Container.BindInterfacesTo<ResultsViewReplayButtonController>().AsSingle();

Container.Bind<GlobalLeaderboardService>().AsSingle();
Container.Bind<LeaderboardService>().AsSingle();
Container.Bind<PlayerService>().AsSingle();

Container.Bind<MaxScoreCache>().AsSingle();


Container.Bind<PanelView>().FromNewComponentAsViewController().AsSingle();

Container.Bind<FAQViewController>().FromNewComponentAsViewController().AsSingle();
Container.Bind<TeamViewController>().FromNewComponentAsViewController().AsSingle();
Container.Bind<GlobalViewController>().FromNewComponentAsViewController().AsSingle();
Expand All @@ -54,8 +65,8 @@ public override void InstallBindings() {
Container.Bind<CellClickingView>().FromMethodMultiple(context => clickingViews).AsSingle().WhenInjectedInto<ScoreSaberLeaderboardViewController>();
clickingViews.ForEach(y => Container.QueueForInject(y));

Container.BindInterfacesAndSelfTo<ScoreSaberLeaderboardViewController>().AsSingle().NonLazy();
Container.BindInterfacesTo<LeaderboardPatches>().AsSingle();
Container.Bind<PromoBannerView>().FromNewComponentAsViewController().AsSingle();
Container.Bind<PromoBanner>().AsSingle().NonLazy();

#if RELEASE
Container.BindInterfacesAndSelfTo<UploadDaemon>().AsSingle().NonLazy();
Expand Down
1 change: 1 addition & 0 deletions ScoreSaber/Core/ReplaySystem/Accessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ internal static class Accessors
internal static readonly FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<GameNoteController>>.Accessor BurstSliderHeadNotePool = FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<GameNoteController>>.GetAccessor("_burstSliderHeadGameNotePoolContainer");
internal static readonly FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<BurstSliderGameNoteController>>.Accessor BurstSliderNotePool = FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<BurstSliderGameNoteController>>.GetAccessor("_burstSliderGameNotePoolContainer");
internal static readonly FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<GameNoteController>>.Accessor GameNotePool = FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<GameNoteController>>.GetAccessor("_basicGameNotePoolContainer");
internal static readonly FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<ObstacleController>>.Accessor ObstaclePool = FieldAccessor<BasicBeatmapObjectManager, MemoryPoolContainer<ObstacleController>>.GetAccessor("_obstaclePoolContainer");
speecil marked this conversation as resolved.
Show resolved Hide resolved
internal static readonly FieldAccessor<SaberSwingRatingCounter, LazyCopyHashSet<ISaberSwingRatingCounterDidChangeReceiver>>.Accessor ChangeReceivers = FieldAccessor<SaberSwingRatingCounter, LazyCopyHashSet<ISaberSwingRatingCounterDidChangeReceiver>>.GetAccessor("_didChangeReceivers");

internal static readonly FieldAccessor<ScoreController, int>.Accessor MultipliedScore = FieldAccessor<ScoreController, int>.GetAccessor("_multipliedScore");
Expand Down
3 changes: 3 additions & 0 deletions ScoreSaber/Core/ReplaySystem/Installers/ImberInstaller.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ScoreSaber.Core.ReplaySystem.UI;
using ScoreSaber.Core.Services;
using Zenject;

namespace ScoreSaber.Core.ReplaySystem.Installers
Expand All @@ -9,11 +10,13 @@ public override void InstallBindings() {

if (Plugin.ReplayState.IsPlaybackEnabled && !Plugin.ReplayState.IsLegacyReplay) {
Container.Bind<VRControllerAccessor>().AsSingle();
Container.Bind<TweeningService>().AsSingle();
Container.BindInterfacesTo<ImberManager>().AsSingle();
Container.BindInterfacesAndSelfTo<ImberScrubber>().AsSingle();
Container.BindInterfacesAndSelfTo<ImberSpecsReporter>().AsSingle();
Container.BindInterfacesAndSelfTo<ImberUIPositionController>().AsSingle();
Container.Bind<MainImberPanelView>().FromNewComponentAsViewController().AsSingle();
Container.BindInterfacesAndSelfTo<DesktopMainImberPanelView>().FromNewComponentAsViewController().AsSingle();
Container.Bind(typeof(ITickable), typeof(SpectateAreaController)).To<SpectateAreaController>().AsSingle();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public override void InstallBindings() {
if (_gameplayCoreSceneSetupData.playerSpecificSettings.automaticPlayerHeight)
Container.BindInterfacesTo<HeightPlayer>().AsSingle();
Container.BindInterfacesAndSelfTo<ReplayTimeSyncController>().AsSingle();
Container.Bind<NonVRReplayUI>().FromNewComponentOnNewGameObject().AsSingle().NonLazy();
Container.Bind<IAffinity>().To<CancelScoreControllerBufferFinisher>().AsSingle();
Container.Bind<IAffinity>().To<CancelSaberCuttingPatch>().AsSingle();
} else {
Expand Down
4 changes: 2 additions & 2 deletions ScoreSaber/Core/ReplaySystem/Legacy/LegacyReplayPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ private void UpdatePlaybackScore(Z.Keyframe keyframe) {

int maxPossibleRawScore = LeaderboardUtils.OldMaxRawScoreForNumberOfNotes(cutOrMissedNotes);

_relativeScoreAndImmediateRankCounter?.InvokeMethod<object, RelativeScoreAndImmediateRankCounter>("UpdateRelativeScoreAndImmediateRank", keyframe.score, keyframe.score, maxPossibleRawScore, maxPossibleRawScore);
_relativeScoreAndImmediateRankCounter.UpdateRelativeScoreAndImmediateRank(keyframe.score, keyframe.score, maxPossibleRawScore, maxPossibleRawScore);

_scoreUIController?.InvokeMethod<object, ScoreUIController>("UpdateScore", keyframe.score, keyframe.score);
_scoreUIController.UpdateScore(keyframe.score, keyframe.score);

}

Expand Down
19 changes: 10 additions & 9 deletions ScoreSaber/Core/ReplaySystem/Playback/EnergyPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,23 @@ public EnergyPlayer(ReplayFile file, GameEnergyCounter gameEnergyCounter, DiCont
}

public void TimeUpdate(float newTime) {
if (_sortedEnergyEvents.Length == 0) {
UpdateEnergy(1.0f);
return;
}

for (int c = 0; c < _sortedEnergyEvents.Length; c++) {
// TODO: this has potential to have problems if _sortedEnergyEvents[c].Time is within an epsilon of newTime, potentially applying energy changes twice or not at all
if (_sortedEnergyEvents[c].Time > newTime) {
float energy = c != 0 ? _sortedEnergyEvents[c - 1].Energy : 0.5f;
float energy = c != 0 ? _sortedEnergyEvents[c - 1].Energy : _sortedEnergyEvents[0].Energy;
UpdateEnergy(energy);
return;
}
}
UpdateEnergy(0.5f);
var lastEvent = _sortedEnergyEvents.LastOrDefault();
if (newTime >= lastEvent.Time && lastEvent.Energy <= Mathf.Epsilon) {
UpdateEnergy(0f);
}

UpdateEnergy(_sortedEnergyEvents.Last().Energy);
}


private void UpdateEnergy(float energy) {

bool isFailingEnergy = energy <= Mathf.Epsilon;
Expand All @@ -53,11 +54,11 @@ private void UpdateEnergy(float energy) {
_gameEnergyUIPanel.Init();
var director = Accessors.Director(ref _gameEnergyUIPanel);
director.Stop();
director.RebindPlayableGraphOutputs();
director.Evaluate();
Accessors.EnergyBar(ref _gameEnergyUIPanel).enabled = !isFailingEnergy;
}

FieldAccessor<GameEnergyCounter, Action<float>>.Get(_gameEnergyCounter, "gameEnergyDidChangeEvent").Invoke(energy);
_gameEnergyUIPanel.RefreshEnergyUI(energy);
}
}
}
Loading