Skip to content

Commit

Permalink
Update 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
KoRrNiK committed May 31, 2021
1 parent 1a18101 commit 8cb9551
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 20 deletions.
26 changes: 26 additions & 0 deletions rtcw-velocity/Form1.Designer.cs

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

86 changes: 66 additions & 20 deletions rtcw-velocity/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using System.Windows.Forms;
using Memory;

using System.Runtime.InteropServices;

namespace rtcw_velocity
{
public partial class Form1 : Form
Expand All @@ -21,9 +23,22 @@ public Form1()
InitializeComponent();
}

/*private static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
private const UInt32 SWP_NOSIZE = 0x0001;
private const UInt32 SWP_NOMOVE = 0x0002;
private const UInt32 TOPMOST_FLAGS = SWP_NOMOVE | SWP_NOSIZE;
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
*/

string nameGame = "WolfSP";

bool processOpen = false;
bool isShow = false;
bool isShowRecord = true;
bool checkLoad = false;

int pID = 0;

Expand All @@ -33,14 +48,40 @@ public Form1()

float userMaxSpeed = 0;

private void timer9_Tick(object sender, EventArgs e)
{
if (processOpen && !checkLoad)
{

if (m.ReadByte(nameGame + ".exe+A4021C") == 0)
{
m.CloseProcess();
}
}
}

private void timer1_Tick(object sender, EventArgs e)
{
processOpen = processOpen = m.OpenProcess("WolfSP");
pID = m.GetProcIdFromName("WolfSP");
processOpen = processOpen = m.OpenProcess(nameGame);
pID = m.GetProcIdFromName(nameGame);

if (processOpen)
{

processOpenLabel.ForeColor = Color.Green;
processOpenLabel.Text = "Game Found";

processID.ForeColor = Color.Green;
processID.Text = pID.ToString();

float value = m.ReadFloat("cgamex86.dll+FAFBC");

if (value > 0 && !checkLoad)
{
timer9.Stop();
checkLoad = true;
}

int newvalue = (int)value;

userMaxSpeed = Math.Max(userMaxSpeed, value);
Expand All @@ -60,25 +101,25 @@ private void timer1_Tick(object sender, EventArgs e)
recordspeedlabel.Text = "";
}


processOpenLabel.ForeColor = Color.Green;
processOpenLabel.Text = "Game Found";

processID.ForeColor = Color.Green;
processID.Text = pID.ToString();

Properties.Settings.Default.maxspeed = userMaxSpeed;
Properties.Settings.Default.Save();



}
else
{
velocity_value.Text = "N/A";
{

if (checkLoad)
{
timer9.Start();
checkLoad = false;
}

velocity_value.Text = "N/A";
processOpenLabel.ForeColor = Color.DarkRed;
processID.ForeColor = Color.DarkRed;
processOpenLabel.Text = "N/A";
processID.Text = "N/A";
maxspeedlabel.Text = "N/A";
}


Expand All @@ -88,7 +129,11 @@ private void timer1_Tick(object sender, EventArgs e)
private void Form1_Load(object sender, EventArgs e)
{

timer3.Start();
//SetWindowPos(this.Handle, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS);

timer1.Start(); // speed
timer3.Start(); // rgb tittle
timer9.Start(); // check load

settingsPanel.Hide();

Expand Down Expand Up @@ -127,7 +172,6 @@ private void Form1_Load(object sender, EventArgs e)
velocity_value.Text = "N/A";


timer1.Start();
}

private void button1_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -164,7 +208,6 @@ private void panel1_DoubleClick(object sender, EventArgs e)
{
isShow = false;
timer2.Start();

}
else
{
Expand All @@ -187,16 +230,13 @@ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
recordspeedlabel.Font = maxspeedlabel.Font;
recordspeedlabel.Font = new Font(recordspeedlabel.Font.Name, 9, recordspeedlabel.Font.Style);


var cvt = new FontConverter();
string s = cvt.ConvertToString(velocity_value.Font);
Font f = cvt.ConvertFromString(s) as Font;

fontNameLabel.Text = s;
Properties.Settings.Default.Font = velocity_value.Font;



Properties.Settings.Default.Save();
}
catch { }
Expand Down Expand Up @@ -265,7 +305,6 @@ private void panel1_MouseDown(object sender, MouseEventArgs e)

}


// COLORS TITTLE

private void timer3_Tick(object sender, EventArgs e)
Expand Down Expand Up @@ -334,6 +373,8 @@ private void timer8_Tick(object sender, EventArgs e)
}
}

/* ------------- */

private void button4_Click(object sender, EventArgs e)
{

Expand All @@ -351,6 +392,11 @@ private void button3_Click(object sender, EventArgs e)
userMaxSpeed = 0;
}

private void button5_Click(object sender, EventArgs e)
{
Application.Restart();
}

private void up_bar_button1_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
Expand Down

0 comments on commit 8cb9551

Please sign in to comment.