1
0
mirror of synced 2025-01-19 01:24:08 +01:00

Fix Discord RPC

This commit is contained in:
0aubsq 2022-02-05 04:42:33 +01:00
parent 683711434f
commit 6c1700612c
4 changed files with 30 additions and 6 deletions

View File

@ -69,6 +69,24 @@ namespace TJAPlayer3
public static class Discord
{
public static string DiffToString(int diff)
{
string[] diffArr =
{
" Easy ",
" Normal ",
" Hard ",
" Extreme ",
" Extra ",
" Tower ",
" Dan "
};
int level = TJAPlayer3.stage選曲.r確定された曲.nLevel[diff];
return (diffArr[Math.Min(diff, 6)] + "Lv." + level);
}
private static readonly List<IntPtr> _buffers = new List<IntPtr>(10);
@ -104,7 +122,7 @@ namespace TJAPlayer3
if (startTimeStamp != 0) presence.startTimestamp = startTimeStamp;
if (endTimeStamp != 0) presence.endTimestamp = endTimeStamp;
presence.largeImageKey = StrToPtr("OpenTaiko".ToLowerInvariant());
presence.largeImageKey = StrToPtr("logo".ToLowerInvariant());
presence.largeImageText = StrToPtr(TJAPlayer3.AppDisplayThreePartVersion);
if (!string.IsNullOrEmpty(smallImageKey)) presence.smallImageKey = StrToPtr(smallImageKey);
if (!string.IsNullOrEmpty(smallImageText)) presence.smallImageText = StrToPtr(smallImageText);

View File

@ -2524,7 +2524,7 @@ for (int i = 0; i < 3; i++) {
#endregion
#region Discordの処理
Discord.Initialize("784989629728161813");
Discord.Initialize("939341030141096007");
StartupTime = Discord.GetUnixTime();
Discord.UpdatePresence("", Properties.Discord.Stage_StartUp, StartupTime);
#endregion

View File

@ -291,9 +291,11 @@ namespace TJAPlayer3
var endTimeStamp = TJAPlayer3.DTX.listChip.Count == 0
? 0
: Discord.GetUnixTime() + (long)TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms / 1000;
var difficultyName = TJAPlayer3.DifficultyNumberToEnum(TJAPlayer3.stage選曲.n確定された曲の難易度[0]).ToString();
Discord.UpdatePresence(TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.DTX.strファイル名 : "",
var difficultyName = TJAPlayer3.DifficultyNumberToEnum(TJAPlayer3.stage選曲.n確定された曲の難易度[0]).ToString();
Discord.UpdatePresence(TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stage選曲.r確定された曲.strタイトル
+ Discord.DiffToString(TJAPlayer3.stage選曲.n確定された曲の難易度[0])
: "",
Properties.Discord.Stage_InGame + (TJAPlayer3.ConfigIni.b太鼓パートAutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""),
0,
endTimeStamp,

View File

@ -474,7 +474,11 @@ namespace TJAPlayer3
}
// Discord Presenseの更新
Discord.UpdatePresence(TJAPlayer3.DTX.strファイル名 + ".tja", Properties.Discord.Stage_Result + (TJAPlayer3.ConfigIni.b太鼓パートAutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""), TJAPlayer3.StartupTime);
Discord.UpdatePresence(TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? TJAPlayer3.stage選曲.r確定された曲.strタイトル
+ Discord.DiffToString(TJAPlayer3.stage選曲.n確定された曲の難易度[0])
: "",
Properties.Discord.Stage_Result + (TJAPlayer3.ConfigIni.b太鼓パートAutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""),
TJAPlayer3.StartupTime);
#region [Earned medals]