Skip to content

Commit eee3bfe

Browse files
authored
Source
1 parent 69c87bf commit eee3bfe

38 files changed

+8536
-2
lines changed

FiveM-Crasher-2.sln

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.32002.261
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FiveM-Crasher-2", "FiveM\FiveM-Crasher-2.csproj", "{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Debug|x64 = Debug|x64
12+
Release|Any CPU = Release|Any CPU
13+
Release|x64 = Release|x64
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Debug|x64.ActiveCfg = Debug|x64
19+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Debug|x64.Build.0 = Debug|x64
20+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Release|x64.ActiveCfg = Release|x64
23+
{CA2B05A1-18EE-4F80-9DEA-A16F8623D939}.Release|x64.Build.0 = Release|x64
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {F7AE94FB-924B-4749-9F3C-1B3711202FD8}
30+
EndGlobalSection
31+
EndGlobal

FiveM/Communication/Dialog.Designer.cs

Lines changed: 127 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FiveM/Communication/Dialog.cs

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
using System;
2+
using MaterialSkin;
3+
using MaterialSkin.Controls;
4+
using System.Windows.Forms;
5+
6+
namespace Scylla.Communication {
7+
public partial class Dialog : MaterialForm {
8+
9+
int _counter = 10;
10+
string _content;
11+
private bool _preventMove = true;
12+
private bool _quit;
13+
14+
public Dialog(string content, int t, bool quit) {
15+
16+
var materialSkinManager = MaterialSkinManager.Instance;
17+
18+
materialSkinManager.EnforceBackcolorOnAllComponents = false;
19+
materialSkinManager.AddFormToManage(this);
20+
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
21+
22+
materialSkinManager.ColorScheme = new ColorScheme
23+
(Primary.Blue600,Primary.Blue700,Primary.Blue200,Accent.Blue400,TextShade.WHITE);
24+
25+
InitializeComponent();
26+
27+
_counter = t;
28+
DialogFormat(content, quit);
29+
}
30+
31+
private void DialogFormat(string content, bool quit) {
32+
_content = content;
33+
contentDialog.Text = $"{content}\n";
34+
_quit = quit;
35+
36+
if (quit)
37+
{
38+
Timer t = new Timer();
39+
t.Start();
40+
t.Interval = 1000;
41+
t.Tick += new EventHandler(TimerTick);
42+
return;
43+
}
44+
45+
btnDialog.Text = $"OK";
46+
}
47+
48+
private void TimerTick(object sender, EventArgs e) {
49+
btnDialog.Text = $"Exiting in {_counter}";
50+
_counter -= 1;
51+
52+
if (_counter >= 0)
53+
return;
54+
55+
Environment.Exit(0);
56+
}
57+
58+
private void btnDialog_Click(object sender, EventArgs e) {
59+
if (_quit)
60+
Environment.Exit(1);
61+
else
62+
this.Close();
63+
}
64+
65+
private void Dialog_Load(object sender, EventArgs e) {
66+
}
67+
68+
private void Dialog_FormClosing(object sender, FormClosingEventArgs e) {
69+
if (_quit)
70+
Environment.Exit(1);
71+
}
72+
73+
protected override void WndProc(ref Message m)
74+
{
75+
const int WM_SYSCOMMAND = 0x0112;
76+
const int SC_MOVE = 0xF010;
77+
78+
if (_preventMove)
79+
{
80+
switch(m.Msg)
81+
{
82+
case WM_SYSCOMMAND:
83+
int command = m.WParam.ToInt32() & 0xfff0;
84+
if (command == SC_MOVE)
85+
return;
86+
break;
87+
}
88+
}
89+
base.WndProc(ref m);
90+
}
91+
92+
}
93+
}

0 commit comments

Comments
 (0)