8000 Add support enable/disable Rich Presence (Discord) by ElaXan · Pull Request #11 · YuukiPS/Launcher-PC · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support enable/disable Rich Presence (Discord) #11

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

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Json/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Game
public class Extra
{
public bool Akebi = false;
public bool RPC = false;
}

//public int patch_metode = 1; // 1=NO PATCH, 2=RSA ()this should not be necessary because it is controlled by game server
Expand Down
16 changes: 15 additions & 1 deletion Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Net.NetworkInformation;
using System.Reflection;
using YuukiPS_Launcher.Extra;
using YuukiPS_Launcher.Json;
using YuukiPS_Launcher.Json.GameClient;
using YuukiPS_Launcher.Yuuki;
Expand Down Expand Up @@ -68,7 +69,14 @@ private void Main_Load(object sender, EventArgs e)
LoadProfile(configdata.profile_default);

// Extra
discord.Ready();
if (Enable_RPC.Checked)
{
Console.WriteLine("Discord RPC enable");
discord.Ready();
} else
{
Console.WriteLine("Discord RPC disable");
}

notbootyet = false;
}
Expand Down Expand Up @@ -169,6 +177,7 @@ public void LoadProfile(string load_profile = "")
GetServerHost.Text = default_profile.server.url;
// Extra
Extra_Cheat.Checked = default_profile.game.extra.Akebi;
Enable_RPC.Checked = default_profile.game.extra.RPC;

// Get Data Game
if (!CheckVersionGame(default_profile.game.type))
Expand Down Expand Up @@ -198,6 +207,7 @@ public void SaveProfile(string name_save = "Default")

// Extra
tmp_profile.game.extra.Akebi = Extra_Cheat.Checked;
tmp_profile.game.extra.RPC = Enable_RPC.Checked;

// Nama Profile
tmp_profile.name = name_save;
Expand Down Expand Up @@ -312,7 +322,7 @@ public void DoStart()
}
else
{
if(get_version != null && get_version.nosupport != "")
if (get_version != null && get_version.nosupport != "")
{
MessageBox.Show(get_version.nosupport, "Game version not supported");
Process.Start(new ProcessStartInfo(API.WEB_LINK) { UseShellExecute = true });
Expand Down Expand Up @@ -1767,5 +1777,18 @@ private void Extra_Cheat_CheckedChanged(object sender, EventArgs e)
{

}

private void Extra_Enable_RPC_CheckedChanged(object sender, EventArgs e)
{
if (Enable_RPC.Checked)
{
Console.WriteLine("Enable RPC");
discord.Ready();
} else
{
Console.WriteLine("Disable RPC. This may take a few seconds");
discord.Stop();
}
}
}
}
4 changes: 2 additions & 2 deletions YuukiPS Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ApplicationManifest>Properties\app.manifest</ApplicationManifest>

<AssemblyVersion>2023.11.10.0714</AssemblyVersion>
<FileVersion>2023.11.10.0714</FileVersion>
<AssemblyVersion>2023.12.21.1933</AssemblyVersion>
<FileVersion>2023.11.10.1933</FileVersion>

<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AssemblyName>YuukiPS</AssemblyName>
Expand Down
0