Skip to content

Commit

Permalink
Fix number formatting for score, combo and accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
DJDavid98 committed Nov 13, 2022
1 parent 4c05710 commit 4862efb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,14 @@ private Discord.Activity GetActivityData()
if (LiveData.Instance.TimeElapsed > 0)
{
var rank = GetReadableRank(LiveData.Instance.Rank);
playDetail = $" {LiveData.Instance.Score:N} x{LiveData.Instance.Combo} {LiveData.Instance.Accuracy}% ({rank})";
var score = LiveData.Instance.Score;
var combo = LiveData.Instance.Combo > 0 ? $" x{LiveData.Instance.Combo:N0}" : "";
var accuracy = LiveData.Instance.Accuracy;
playDetail = $" {score:N0}{combo} {accuracy:F2}% ({rank})";
if (!MapData.Instance.LevelPaused)
{
activity.Timestamps.End = DateTimeToUnixTimestamp(DateTime.Now.AddSeconds(-Convert.ToDouble(LiveData.Instance.TimeElapsed)).AddSeconds(MapData.Instance.Duration));
var elapsedTime = Convert.ToDouble(LiveData.Instance.TimeElapsed);
activity.Timestamps.End = DateTimeToUnixTimestamp(DateTime.Now.AddSeconds(-elapsedTime).AddSeconds(MapData.Instance.Duration));
}
}

Expand Down
5 changes: 2 additions & 3 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down Expand Up @@ -32,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyVersion("1.0.1")]
[assembly: AssemblyFileVersion("1.0.1")]
1 change: 1 addition & 0 deletions RichPresenceResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static class RichPresenceAssetKeys
public static readonly string Timbaland = "timbaland";
public static readonly string Triangle = "triangle";
public static readonly string Weave = "weave";
public static readonly string TheWeekend = "the_weekend";

// Map types
public static readonly string BlankMapType = "blank_map_type";
Expand Down
12 changes: 6 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"$schema": "https://raw.githubusercontent.com/bsmg/BSIPA-MetadataFileSchema/master/Schema.json",
"id": "bsrpc",
"name": "bsrpc",
"author": "",
"version": "1.0.0",
"author": "DJDavid98",
"version": "1.0.1",
"description": "Discord Rich Presence integration for Beat Saber",
"gameVersion": "1.20.0",
"gameVersion": "1.26.0",
"dependsOn": {
"BSIPA": "^4.2.0",
"DataPuller": "^2.1.0",
"DiscordCore": "^1.0.10"
"BSIPA": "4.2.2",
"DataPuller": "2.1.0",
"DiscordCore": "1.0.10"
},
"links": {
"project-source": "https://github.com/DJDavid98/bsrpc"
Expand Down

0 comments on commit 4862efb

Please sign in to comment.