Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
Better, and more mod friendly method for closing the game
Browse files Browse the repository at this point in the history
  • Loading branch information
BLANKE1 committed Mar 30, 2022
1 parent 69e3bd8 commit c4ee13d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EasyQuit/EasyQuit.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using MelonLoader;
using UIExpansionKit.API;
using System.Diagnostics;
using UnityEngine;

[assembly: MelonInfo(typeof(KillGame.Main), "EasyQuit", "1.0.0", "BLANKE")]
[assembly: MelonGame("VRChat", "VRChat")]
Expand All @@ -13,7 +14,7 @@ public override void OnApplicationStart()
{
var Menu = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList);
Menu.AddLabel("Are you sure you want to close the game?");
Menu.AddSimpleButton("Close Game", () => Process.GetCurrentProcess().Kill());
Menu.AddSimpleButton("Close Game", () => Application.Quit());
Menu.AddSimpleButton("Close", () => Menu.Hide());
ExpansionKitApi.GetExpandedMenu(ExpandedMenu.QuickMenu).AddSimpleButton("Close Game", () => Menu.Show());
}
Expand Down
8 changes: 8 additions & 0 deletions EasyQuit/EasyQuit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
<OutputPath>bin\x64\Release\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="Il2Cppmscorlib, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\VRChat\MelonLoader\Managed\Il2Cppmscorlib.dll</HintPath>
</Reference>
<Reference Include="MelonLoader">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\VRChat\MelonLoader\MelonLoader.dll</HintPath>
</Reference>
Expand All @@ -53,6 +57,10 @@
<Reference Include="UIExpansionKit">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\VRChat\Mods\UIExpansionKit.dll</HintPath>
</Reference>
<Reference Include="UnhollowerBaseLib, Version=0.4.17.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\VRChat\MelonLoader\Managed\UnhollowerBaseLib.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.dll</HintPath>
</Reference>
Expand Down

0 comments on commit c4ee13d

Please sign in to comment.