-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Retr0-01/cs2-update
CS2 Update
- Loading branch information
Showing
33 changed files
with
212 additions
and
83 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net6.0-windows</TargetFramework> | ||
<UseWindowsForms>True</UseWindowsForms> | ||
<RootNamespace>RichPresenceApp</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>annotations</Nullable> | ||
<IsPublishable>True</IsPublishable> | ||
<ApplicationIcon>favicon.ico</ApplicationIcon> | ||
<DebugType>none</DebugType> | ||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> | ||
<StartupObject>RichPresenceApp.Program</StartupObject> | ||
<IncludeAllContentForSelfExtract>True</IncludeAllContentForSelfExtract> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'" /> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" /> | ||
|
||
<ItemGroup> | ||
<None Remove=".gitattributes" /> | ||
<None Remove=".gitignore" /> | ||
<None Remove="CODE_OF_CONDUCT.md" /> | ||
<None Remove="favicon.ico" /> | ||
<None Remove="gamestate_integration_discord-rp.cfg" /> | ||
<None Remove="LICENSE.md" /> | ||
<None Remove="README.md" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="favicon.ico" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" /> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
namespace RichPresenceApp; | ||
|
||
public class SystemTray | ||
{ | ||
public static NotifyIcon NotifyIcon; | ||
static ContextMenuStrip ContextMenu; | ||
|
||
public static void Setup() | ||
{ | ||
Thread trayThread = new( delegate () | ||
{ | ||
Icon csIcon = Icon.ExtractAssociatedIcon( Application.ExecutablePath ); | ||
NotifyIcon = new(); | ||
NotifyIcon.Icon = csIcon; | ||
NotifyIcon.Text = "CS2 Discord Rich Presence"; | ||
|
||
ContextMenu = new(); | ||
ToolStripMenuItem statusMenuItem = new( "Status: Active", SystemIcons.Information.ToBitmap(), Click_Handler ); | ||
statusMenuItem.Enabled = false; | ||
ToolStripMenuItem openConsoleMenuItem = new( "Open Console", csIcon.ToBitmap(), Click_Handler ); | ||
ToolStripMenuItem exitMenuItem = new( "Quit App", SystemIcons.Hand.ToBitmap(), Click_Handler ); | ||
ContextMenu.Items.AddRange( new ToolStripItem[] { statusMenuItem, openConsoleMenuItem, exitMenuItem } ); | ||
NotifyIcon.ContextMenuStrip = ContextMenu; | ||
|
||
NotifyIcon.BalloonTipIcon = ToolTipIcon.Info; | ||
NotifyIcon.BalloonTipTitle = "No Distractions ;)"; | ||
NotifyIcon.BalloonTipText = "The CS2 Discord Rich Presence application will run in the background."; | ||
|
||
NotifyIcon.Visible = true; | ||
NotifyIcon.ShowBalloonTip( 10000 ); | ||
|
||
Application.Run(); | ||
} ); | ||
|
||
trayThread.Name = "System Tray Thread"; | ||
trayThread.IsBackground = true; | ||
trayThread.SetApartmentState( ApartmentState.STA ); | ||
trayThread.Start(); | ||
} | ||
|
||
private static void Click_Handler( object sender, EventArgs e ) | ||
{ | ||
ToolStripItem item = (ToolStripItem)sender; | ||
|
||
if ( item.Text == "Open Console" ) | ||
{ | ||
ConsoleManager.SetConsoleWindowVisibility( true ); | ||
item.Text = "Close Console"; | ||
} | ||
else if ( item.Text == "Close Console" ) | ||
{ | ||
ConsoleManager.SetConsoleWindowVisibility( false ); | ||
item.Text = "Open Console"; | ||
} | ||
else if ( item.Text == "Quit App" ) | ||
Environment.Exit( Environment.ExitCode ); | ||
} | ||
} |
Oops, something went wrong.