Fix crash with default skin when failing a tower chart
This commit is contained in:
parent
9e3248e6d2
commit
7a8f090188
@ -50,17 +50,21 @@ namespace TJAPlayer3
|
||||
[DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void Shutdown();
|
||||
|
||||
/*
|
||||
[DllImport("discord-rpc", EntryPoint = "Discord_RunCallbacks", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void RunCallbacks();
|
||||
*/
|
||||
|
||||
[DllImport("discord-rpc", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdatePresence(ref RichPresence presence);
|
||||
|
||||
/*
|
||||
[DllImport("discord-rpc", EntryPoint = "Discord_ClearPresence", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void ClearPresence();
|
||||
|
||||
[DllImport("discord-rpc", EntryPoint = "Discord_UpdateHandlers", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void UpdateHandlers(ref EventHandlers handlers);
|
||||
*/
|
||||
}
|
||||
|
||||
public static class Discord
|
||||
@ -100,8 +104,8 @@ namespace TJAPlayer3
|
||||
|
||||
if (startTimeStamp != 0) presence.startTimestamp = startTimeStamp;
|
||||
if (endTimeStamp != 0) presence.endTimestamp = endTimeStamp;
|
||||
presence.largeImageKey = StrToPtr("rewrite");
|
||||
presence.largeImageText = StrToPtr("Ver." + TJAPlayer3.VERSION);
|
||||
presence.largeImageKey = StrToPtr("OpenTaiko".ToLowerInvariant());
|
||||
presence.largeImageText = StrToPtr(TJAPlayer3.AppDisplayThreePartVersion);
|
||||
if (!string.IsNullOrEmpty(smallImageKey)) presence.smallImageKey = StrToPtr(smallImageKey);
|
||||
if (!string.IsNullOrEmpty(smallImageText)) presence.smallImageText = StrToPtr(smallImageText);
|
||||
|
||||
|
@ -132,21 +132,21 @@ namespace TJAPlayer3
|
||||
int[] y = new int[] { 0, 176 };
|
||||
|
||||
this.ctEnd_ClearFailed.t進行();
|
||||
if (this.ctEnd_ClearFailed.n現在の値 <= 20)
|
||||
if (this.ctEnd_ClearFailed.n現在の値 <= 20 || TJAPlayer3.Tx.ClearFailed == null)
|
||||
{
|
||||
TJAPlayer3.Tx.End_ClearFailed[this.ctEnd_ClearFailed.n現在の値].t2D描画(TJAPlayer3.app.Device, 505, y[i] + 145);
|
||||
TJAPlayer3.Tx.End_ClearFailed[Math.Min(this.ctEnd_ClearFailed.n現在の値, TJAPlayer3.Tx.End_ClearFailed.Length - 1)]?.t2D描画(TJAPlayer3.app.Device, 505, y[i] + 145);
|
||||
}
|
||||
if (this.ctEnd_ClearFailed.n現在の値 >= 20 && this.ctEnd_ClearFailed.n現在の値 <= 67)
|
||||
else if(this.ctEnd_ClearFailed.n現在の値 >= 20 && this.ctEnd_ClearFailed.n現在の値 <= 67)
|
||||
{
|
||||
TJAPlayer3.Tx.ClearFailed.t2D描画(TJAPlayer3.app.Device, 502, y[i] + 192);
|
||||
TJAPlayer3.Tx.ClearFailed?.t2D描画(TJAPlayer3.app.Device, 502, y[i] + 192);
|
||||
}
|
||||
else if (this.ctEnd_ClearFailed.n現在の値 == 68)
|
||||
{
|
||||
TJAPlayer3.Tx.ClearFailed1.t2D描画(TJAPlayer3.app.Device, 502, y[i] + 192);
|
||||
TJAPlayer3.Tx.ClearFailed1?.t2D描画(TJAPlayer3.app.Device, 502, y[i] + 192);
|
||||
}
|
||||
else if (this.ctEnd_ClearFailed.n現在の値 >= 69)
|
||||
{
|
||||
TJAPlayer3.Tx.ClearFailed2.t2D描画(TJAPlayer3.app.Device, 502, y[i] + 192);
|
||||
TJAPlayer3.Tx.ClearFailed2?.t2D描画(TJAPlayer3.app.Device, 502, y[i] + 192);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -288,13 +288,17 @@ namespace TJAPlayer3
|
||||
// this.stream = new StreamWriter("noteTest.txt", false);
|
||||
//}
|
||||
// Discord Presence の更新
|
||||
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ファイル名 : "",
|
||||
Properties.Discord.Stage_InGame + (TJAPlayer3.ConfigIni.b太鼓パートAutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""),
|
||||
0,
|
||||
Discord.GetUnixTime() + (long)TJAPlayer3.DTX.listChip[TJAPlayer3.DTX.listChip.Count - 1].n発声時刻ms / 1000,
|
||||
endTimeStamp,
|
||||
TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? difficultyName.ToLower() : "",
|
||||
TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? String.Format("COURSE:{0} ({1})", difficultyName, TJAPlayer3.stage選曲.n確定された曲の難易度) : "");
|
||||
TJAPlayer3.ConfigIni.SendDiscordPlayingInformation ? String.Format("COURSE:{0} ({1})", difficultyName, TJAPlayer3.stage選曲.n確定された曲の難易度[0]) : "");
|
||||
}
|
||||
public override void On非活性化()
|
||||
{
|
||||
|
@ -474,7 +474,7 @@ namespace TJAPlayer3
|
||||
}
|
||||
|
||||
// Discord Presenseの更新
|
||||
Discord.UpdatePresence(TJAPlayer3.DTX.TITLE + ".tja", Properties.Discord.Stage_Result + (TJAPlayer3.ConfigIni.b太鼓パートAutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""), TJAPlayer3.StartupTime);
|
||||
Discord.UpdatePresence(TJAPlayer3.DTX.strファイル名 + ".tja", Properties.Discord.Stage_Result + (TJAPlayer3.ConfigIni.b太鼓パートAutoPlay == true ? " (" + Properties.Discord.Info_IsAuto + ")" : ""), TJAPlayer3.StartupTime);
|
||||
|
||||
|
||||
#region [Earned medals]
|
||||
|
@ -104,9 +104,6 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualBasic" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\Test\dll\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
@ -352,6 +349,9 @@
|
||||
<PackageReference Include="LargeAddressAware">
|
||||
<Version>1.0.5</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Newtonsoft.Json">
|
||||
<Version>13.0.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="ReadJEnc">
|
||||
<Version>1.3.1.2</Version>
|
||||
</PackageReference>
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user