-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
054d447
commit ddfd4f2
Showing
62 changed files
with
876 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using System.Windows.Forms; | ||
|
||
namespace GTA_Suspend | ||
{ | ||
public partial class Form1 : Form | ||
{ | ||
public Form1() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void durationBox_TextChanged(object sender, EventArgs e) | ||
{ | ||
Properties.Settings.Default.duration = durationBox.Text; | ||
Properties.Settings.Default.Save(); | ||
} | ||
|
||
private void Form1_Load(object sender, EventArgs e) | ||
{ | ||
closeRadioButton.Checked = Properties.Settings.Default.closeAfter; | ||
programToSuspend.Text = Properties.Settings.Default.program; | ||
durationBox.Text = Properties.Settings.Default.duration; | ||
} | ||
|
||
private void runButton_Click(object sender, EventArgs e) | ||
{ | ||
var durationString = durationBox.Text; | ||
bool canConvert = long.TryParse(durationString, out _); | ||
bool closeAfter = closeRadioButton.Checked; | ||
|
||
string program = programToSuspend.Text; | ||
|
||
if (program == "" || program == " ") | ||
{ | ||
MessageBox.Show("Invalid Program Name\nMake sure you just wrote the program name - don't include .exe"); | ||
} | ||
else | ||
{ | ||
if (canConvert) | ||
{ | ||
var duration = int.Parse(durationString); | ||
// Suspend GTA | ||
System.Diagnostics.Process.Start("pssuspend.exe", program); | ||
// Pause for duration specified | ||
System.Threading.Thread.Sleep(duration * 1000); | ||
// Resume GTA | ||
program += " -r"; | ||
System.Diagnostics.Process.Start("pssuspend.exe", program); | ||
|
||
if (closeAfter) | ||
{ | ||
System.Windows.Forms.Application.Exit(); | ||
} | ||
} | ||
else | ||
{ | ||
MessageBox.Show("Duration is not a number"); | ||
} | ||
} | ||
|
||
|
||
|
||
} | ||
|
||
private void label2_Click(object sender, EventArgs e) | ||
{ | ||
|
||
} | ||
|
||
private void button1_Click(object sender, EventArgs e) | ||
{ | ||
string url = "http://github.com/jack-bailey/gta-suspend"; | ||
System.Diagnostics.Process.Start("explorer.exe", url); | ||
} | ||
|
||
private void programToSuspend_TextChanged(object sender, EventArgs e) | ||
|
||
{ | ||
Properties.Settings.Default.program = programToSuspend.Text; | ||
Properties.Settings.Default.Save(); | ||
} | ||
|
||
private void closeRadioButton_CheckedChanged(object sender, EventArgs e) | ||
{ | ||
Properties.Settings.Default.closeAfter = closeRadioButton.Checked; | ||
Properties.Settings.Default.Save(); | ||
} | ||
} | ||
} |
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,60 @@ | ||
<root> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
<xsd:complexType> | ||
<xsd:choice maxOccurs="unbounded"> | ||
<xsd:element name="metadata"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" use="required" type="xsd:string" /> | ||
<xsd:attribute name="type" type="xsd:string" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="assembly"> | ||
<xsd:complexType> | ||
<xsd:attribute name="alias" type="xsd:string" /> | ||
<xsd:attribute name="name" type="xsd:string" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="data"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | ||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="resheader"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:choice> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>2.0</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
</root> |
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,25 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<RootNamespace>GTA_Suspend</RootNamespace> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="Properties\Settings.Designer.cs"> | ||
<DesignTimeSharedInput>True</DesignTimeSharedInput> | ||
<AutoGen>True</AutoGen> | ||
<DependentUpon>Settings.settings</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="Properties\Settings.settings"> | ||
<Generator>SettingsSingleFileGenerator</Generator> | ||
<LastGenOutput>Settings.Designer.cs</LastGenOutput> | ||
</None> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<_LastSelectedProfileId>C:\Users\jack\OneDrive\Tech Stuff\GTAV\GTA Suspend\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Update="Form1.cs"> | ||
<SubType>Form</SubType> | ||
</Compile> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.31410.357 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GTA Suspend", "GTA Suspend.csproj", "{0D099FBE-7CED-494C-B227-A7C8D7E67388}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{0D099FBE-7CED-494C-B227-A7C8D7E67388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0D099FBE-7CED-494C-B227-A7C8D7E67388}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0D099FBE-7CED-494C-B227-A7C8D7E67388}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0D099FBE-7CED-494C-B227-A7C8D7E67388}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {EC6E0DA9-42BB-45E6-B2A8-351503B4E5AE} | ||
EndGlobalSection | ||
EndGlobal |
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,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace GTA_Suspend | ||
{ | ||
static class Program | ||
{ | ||
/// <summary> | ||
/// The main entry point for the application. | ||
/// </summary> | ||
[STAThread] | ||
static void Main() | ||
{ | ||
Application.SetHighDpiMode(HighDpiMode.SystemAware); | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(false); | ||
Application.Run(new Form1()); | ||
} | ||
} | ||
} |
Oops, something went wrong.