Skip to content

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

Open
speecil wants to merge 94 commits intoScoreSaber:mainfrom
speecil:main
Open

The Everything Update (UI Overhaul + Bug Fixes)#30
speecil wants to merge 94 commits intoScoreSaber:mainfrom
speecil:main

Conversation

@speecil
Copy link
Contributor

@speecil speecil commented Oct 23, 2024

  • no longer uses the base game leaderboard
  • uses leaderboard core
  • fixed profile pictures
  • fixed cell clicking
  • added map info modal
  • added map link button to leaderboard
  • added ranking status header below panelview (coloured header that shows ranked status like stars)
  • added country rank to the panelview
  • fixed replay playback inconsistencies
  • removed old unity imgui replay ui
  • new screen space replay ui on desktop (with timebar scrubber)
  • fixed legacy replay method error
  • added setting to hide replay watermark if you are the user in the replay

image
image

I have probably forgotten something...

Copy link
Member

@Qwasyx Qwasyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely the last time I can do a review this year, but here you go.

public void HandleMultiplayerGameStartPostfix(MultiplayerLevelSelectionFlowCoordinator __instance, ILevelGameplaySetupData levelGameplaySetupData) {

// i dont like this, but i have to do it, just in case the users selected level doesnt match what the game started with
BeatmapLevel beatmapLevel = SongCore.Loader.GetLevelByHash(levelGameplaySetupData.beatmapKey.levelId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work for multiple reasons:

  • GetLevelByHash requires a hash, not levelid
  • It can only deal with custom maps.

What you really want to use is GetLevelById which fixes both problems

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

beatmapKey.beatmapCharacteristic.SerializedName(),
hash,
(int)beatmapLevel.songDuration,
((int)beatmapKey.difficulty * 2) + 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we still going with the (by the game long removed) numeric difficulty instead of string difficulty? (Sorry if this was already sufficiently resolved, but this big review is starting to get a bit out of hand and confusing.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Numeric would be easier overall, but im fine with changing it if the backend changes it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what sense would numeric be easier? Don't you have to keep converting it everywhere?

Container.Bind<ReplayService>().AsSingle().NonLazy();
Container.BindInterfacesAndSelfTo<ScoreSaberRichPresenceService>().AsSingle();
Container.BindInterfacesAndSelfTo<RichPresenceService>().AsSingle();
Container.Bind<ScoreSaberHttpClient>().FromInstance(new ScoreSaberHttpClient(new("ScoreSaber-PC", Plugin.Instance.LibVersion, 5, 120))).AsSingle();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use named parameters here, otherwise just random numbers are not great for readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

string difficulty,
ScoreSaberLeaderboardViewController.ScoreSaberScoresScope scope,
int page = 1,
bool hideNA = false) : base(ApiConfig.UrlBases.APIv1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation looks weird… put leaderboardId still into line 6 and then align all other parameters with that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of that @Umbranoxio, we should probably add a sensible auto formatter/linter to this project too, especially with more people working on it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed the indentation. Once a formatter is chosen let me know

string authType,
string nonce,
string friends,
string name) : base(ApiConfig.UrlBases.APIv1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same indentation thing here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

if (loginStatus != LoginStatus.Success) {
ChangeLoginStatus(LoginStatus.Error, "Failed to authenticate with ScoreSaber! Please restart your game");
ChangeLoginStatus(LoginStatus.Error, $"Failed, attempting again ({attempt} of 3 tries...)");
await Task.Delay(4000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also being shown after the 3rd attempt too with a wait of 4s until it shows you that it failed without every trying again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

private const string _protocolAndSubdomain = "wss://realtime.";
private const string _socketAddress = "/socket"; // change to scoresaber subdomain once ready. wss://realtime.scoresaber.com/socket

public string TimeRightNow => DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing timezone info.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

[EditorBrowsable(EditorBrowsableState.Never)]
public static class IsExternalInit {
}
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awful file name (unless this is actually required like this, but I doubt it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was from umbra, im not sure what for

LibVersion = Assembly.GetExecutingAssembly().GetName().Version;
HttpInstance = new Http(new HttpOptions() { baseURL = "https://scoresaber.com/api", applicationName = "ScoreSaber-PC", version = LibVersion });
harmony = new Harmony("com.umbranox.BeatSaber.ScoreSaber");
harmony.PatchAll(Assembly.GetExecutingAssembly());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering we are no longer honoring Settings.disableScoreSaber, we should at the very least add comment in the Settings.cs file that this setting no longer does anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

<OutputType>Library</OutputType>
<LangVersion>8.0</LangVersion>
<LangVersion>9</LangVersion>
<Nullable>disable</Nullable>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why explicitly disable this if you are gonne reenable it in tons of files? We should be consistent here and either enable it everywhere or disable it everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabled it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants