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 80 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
80 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
17bf7f4
replay consistency
speecil Dec 22, 2024
020100a
yellow menu button
speecil Dec 22, 2024
448f951
Replay updates / bugfixes
speecil Dec 26, 2024
61d0f05
Qwasyx Review 4?
speecil Dec 27, 2024
15dba32
fix timescale text folding itself
speecil Dec 28, 2024
1c21390
handle end of song correctly
speecil Jan 3, 2025
7a69e2b
fix replay softlock
speecil Jan 3, 2025
7624715
More replay consistency
speecil Jan 5, 2025
2198fa7
update gitignore
speecil Jan 10, 2025
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
119 changes: 119 additions & 0 deletions ScoreSaber/Core/AffinityPatches/MenuPresencePatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
using HarmonyLib;
using ScoreSaber.Core.Services;
using SiraUtil.Affinity;
using SiraUtil.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zenject;

namespace ScoreSaber.Core.AffinityPatches {
public class MenuPresencePatches : IAffinity {

[Inject] private readonly ScoreSaberRichPresenceService _richPresenceService = null;
[Inject] private readonly SiraLog _log = null;

[AffinityPatch(typeof(SinglePlayerLevelSelectionFlowCoordinator), "HandleStandardLevelDidFinish")]
[AffinityPostfix]
public void HandleStopStandardLevelPostfix() {
var jsonObject = new SceneChangeEvent() {
Timestamp = _richPresenceService.TimeRightNow,
Scene = Scene.menu
};

_richPresenceService.SendUserProfileChannel("scene_change", jsonObject);
_log.Notice("Sent scene change event to rich presence service");
}

[AffinityPatch(typeof(SinglePlayerLevelSelectionFlowCoordinator), nameof(SinglePlayerLevelSelectionFlowCoordinator.StartLevel))]
[AffinityPostfix]
public void HandleStartLevelPostfix(SinglePlayerLevelSelectionFlowCoordinator __instance, Action beforeSceneSwitchCallback, bool practice) {

string hash = string.Empty;

if (!__instance.selectedBeatmapLevel.hasPrecalculatedData) {
hash = "#" + __instance.selectedBeatmapLevel.levelID;
} else {
hash = __instance.selectedBeatmapLevel.levelID.Split('_')[2];
}

bool isPractice = practice;
Services.GameMode gameMode = Services.GameMode.solo;

if (isPractice) {
gameMode = Services.GameMode.practice;

// this is to privatise the practice mode song, as it would be exposed in the rich presence, still not shown in UI though.
var songeventSilly = new SongStartEvent(_richPresenceService.TimeRightNow, gameMode,
"HYPER SONIC MEGA DEATH **** CORE",
string.Empty,
"oce v...",
"echelon#6295",
"Standard",
"A297DECDFB0B3FE6F14F0BEF788AEBAC978E825E",
(int)2000000000,
((1 + 1 - 1) * 0) + 1, // those who know 💀💀💀 🥭🥭🥭
0,
1);

_richPresenceService.SendUserProfileChannel("start_song", songeventSilly);
return;
}

GameplayModifiers gameplayModifiers = __instance.gameplayModifiers;
int startTime = 0;
if (__instance.isInPracticeView) {
startTime = (int)__instance._practiceViewController._practiceSettings.startSongTime;
}

var songevent = new SongStartEvent(_richPresenceService.TimeRightNow, gameMode,
__instance.selectedBeatmapLevel.songName,
__instance.selectedBeatmapLevel.songSubName,
Data.Models.ScoreSaberUploadData.FriendlyLevelAuthorName(__instance.selectedBeatmapLevel.allMappers, __instance.selectedBeatmapLevel.allLighters),
__instance.selectedBeatmapLevel.songAuthorName,
__instance.selectedBeatmapKey.beatmapCharacteristic.SerializedName(),
hash,
(int)__instance.selectedBeatmapLevel.songDuration,
((int)__instance.selectedBeatmapKey.difficulty * 2) + 1,
startTime,
gameplayModifiers.songSpeedMul);

_richPresenceService.SendUserProfileChannel("start_song", songevent);
}

[AffinityPatch(typeof(MultiplayerLevelSelectionFlowCoordinator), nameof(MultiplayerLevelSelectionFlowCoordinator.HandleLobbyGameStateControllerGameStarted))]
[AffinityPostfix]
public void HandleMultiplayerGameStartPostfix(MultiplayerLevelSelectionFlowCoordinator __instance, ILevelGameplaySetupData levelGameplaySetupData) {

string hash = string.Empty;

if (!levelGameplaySetupData.beatmapKey.levelId.StartsWith("custom_level_")) {
hash = "#" + __instance.selectedBeatmapLevel.levelID;
} else {
hash = __instance.selectedBeatmapLevel.levelID.Split('_')[2];
}

// i dont like this, but i have to do it
BeatmapLevel beatmapLevel = SongCore.Loader.GetLevelByHash(levelGameplaySetupData.beatmapKey.levelId);

GameplayModifiers gameplayModifiers = levelGameplaySetupData.gameplayModifiers;
int startTime = 0;

var songevent = new SongStartEvent(_richPresenceService.TimeRightNow, GameMode.multiplayer,
beatmapLevel.songName,
beatmapLevel.songSubName,
beatmapLevel.allMappers.Join().ToString(),
beatmapLevel.songAuthorName,
levelGameplaySetupData.beatmapKey.beatmapCharacteristic.SerializedName(),
hash,
(int)beatmapLevel.songDuration,
((int)levelGameplaySetupData.beatmapKey.difficulty * 2) + 1,
startTime,
gameplayModifiers.songSpeedMul);

_richPresenceService.SendUserProfileChannel("start_song", songevent);
}
}
}
1 change: 1 addition & 0 deletions ScoreSaber/Core/Data/Internal/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ internal static Settings LoadSettings() {
decoded.replayUISize = 1.25f;
decoded.startReplayUIHidden = false;
decoded.enableRichPresence = true;
decoded.hideWatermarkIfUsersReplay = false;
}
SaveSettings(decoded);
}
Expand Down
4 changes: 2 additions & 2 deletions ScoreSaber/Core/Data/Models/LeaderboardUploadData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal static ScoreSaberUploadData Create(BeatmapLevel beatmapLevel, BeatmapKe
data.songName = beatmapLevel.songName;
data.songSubName = beatmapLevel.songSubName;
data.songAuthorName = beatmapLevel.songAuthorName;
data.levelAuthorName = friendlyLevelAuthorName(beatmapLevel.allMappers, beatmapLevel.allLighters);
data.levelAuthorName = FriendlyLevelAuthorName(beatmapLevel.allMappers, beatmapLevel.allLighters);
data.bpm = Convert.ToInt32(beatmapLevel.beatsPerMinute);

data.playerName = playerInfo.playerName;
Expand All @@ -84,7 +84,7 @@ internal static ScoreSaberUploadData Create(BeatmapLevel beatmapLevel, BeatmapKe
return data;
}

static string friendlyLevelAuthorName(string[] mappers, string[] lighters) {
public static string FriendlyLevelAuthorName(string[] mappers, string[] lighters) {
List<string> mappersAndLighters = new List<string>();
mappersAndLighters.AddRange(mappers);
mappersAndLighters.AddRange(lighters);
Expand Down
17 changes: 1 addition & 16 deletions ScoreSaber/Core/Data/Models/ScoreSaberTeam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace ScoreSaber.Core.Data.Models
internal class ScoreSaberTeam
{
[JsonProperty("TeamMembers")]
public Dictionary<TeamType, List<TeamMember>> TeamMembers { get; set; }
public Dictionary<string, List<TeamMember>> TeamMembers { get; set; }
}

internal class TeamMember
Expand All @@ -28,19 +28,4 @@ internal class TeamMember
[JsonProperty("YouTube")]
internal string YouTube { get; set; }
}

[JsonConverter(typeof(StringEnumConverter))]
internal enum TeamType
{
Backend,
Frontend,
Mod,
PPv3,
Admin,
RT,
NAT,
QAT,
CAT,
CCT
}
}
4 changes: 2 additions & 2 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.AffinityPatches;
using ScoreSaber.Core.Daemons;
using ScoreSaber.Core.Data.Models;
using ScoreSaber.Core.ReplaySystem;
using ScoreSaber.Core.ReplaySystem.UI;
Expand All @@ -15,7 +16,6 @@
using ScoreSaber.UI.PromoBanner;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Zenject;

namespace ScoreSaber.Core {
Expand Down
78 changes: 0 additions & 78 deletions ScoreSaber/Core/ReplaySystem/Accessors.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ internal static bool Prefix(RelativeScoreAndImmediateRankCounter __instance, int

if (Plugin.ReplayState.IsPlaybackEnabled && !Plugin.ReplayState.IsLegacyReplay) {
if (score == 0 && maxPossibleScore == 0) {
Accessors.RelativeScore(ref __instance, 1f);
Accessors.ImmediateRank(ref __instance, RankModel.Rank.SS);
__instance.relativeScore = 1f;
__instance.immediateRank = RankModel.Rank.SS;
___relativeScoreOrImmediateRankDidChangeEvent.Invoke();
return false;
}
Expand Down
Loading