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

Commit

Permalink
Release update 1.0.0
Browse files Browse the repository at this point in the history
- Hide hand when zooming
- Add Position and Motion
- Add LookBehind
  • Loading branch information
Imrglop committed Jan 23, 2021
1 parent 3eaaa86 commit 6c46f30
Show file tree
Hide file tree
Showing 16 changed files with 644 additions and 35 deletions.
121 changes: 119 additions & 2 deletions Latite/LatiteForm.Designer.cs

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

62 changes: 53 additions & 9 deletions Latite/LatiteForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ namespace Latite
{
public partial class LatiteForm : Form
{
[DllImport("LatiteCore.dll")]
static extern void setEnabled(uint modId, bool enabled);
[DllImport("LatiteCore.dll")]
static extern void consoleMain();
[DllImport("LatiteCore.dll")]
static extern ulong attach();
// extern "C" LATITE_API bool connectedToMinecraft(int type = 2);
[DllImport("LatiteCore.dll")]
static extern bool connectedToMinecraft(int type = 2);
public static extern bool connectedToMinecraft(int type = 2);
[DllImport("LatiteCore.dll")]
static extern void detach();
[DllImport("LatiteCore.dll")]
Expand All @@ -37,11 +39,15 @@ public partial class LatiteForm : Form
static extern void mod_zoom_setBind(char bind);
[DllImport("LatiteCore.dll")]
static extern void mod_zoom_setAmount(float amount);
[DllImport("LatiteCore.dll")]
static extern void mod_lookBehind_setBind(char bind);
public LatiteForm()
{
InitializeComponent();
}

private Overlay OverlayForm = new Overlay();

readonly string[] Commands = { "help", "info", "print <text>", "clear", "connect", "disconnect" };
readonly string Info = "Latite Client\r\n\r\nLicense: GPLv3\r\n\r\nSource: github.com/Imrglop/Latite\r\n\r\nMade by Imrglop";
private bool IsConsole = false;
Expand All @@ -55,7 +61,7 @@ public void Coutln(string OutputString)
consoleOutput.Text += (OutputString + "\r\n");
}

private void ConnectToMc()
private void ConnectToMc(bool show = true)
{
try
{
Expand All @@ -76,15 +82,24 @@ private void ConnectToMc()
moduleWorker.RunWorkerAsync();
disconnectButton.Visible = true;
Coutln("Connected to Minecraft!");
MessageBox.Show("Connected to Minecraft!");
if (this.OverlayForm.IsDisposed)
{
this.OverlayForm = new Overlay();
}
this.OverlayForm.Show();
if (show)
MessageBox.Show("Connected to Minecraft!");
}
else
{
Coutln("Couldn't connect to Minecraft! Error code: " + Status.ToString());
var Result = MessageBox.Show("Could not connect to Minecraft! Error Code: " + Status.ToString(), "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Hand);
if (Result == DialogResult.Retry)
if (show)
{
ConnectToMc();
Coutln("Couldn't connect to Minecraft! Error code: " + Status.ToString());
var Result = MessageBox.Show("Could not connect to Minecraft! Error Code: " + Status.ToString(), "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Hand);
if (Result == DialogResult.Retry)
{
ConnectToMc();
}
}
}
}
Expand All @@ -111,6 +126,7 @@ private void DisconnectFromMc()
connectButton.Visible = true;
connectedToMinecraft(0); // false
connectedLabel.Visible = false;
this.OverlayForm.Close();
detach();
}
}
Expand Down Expand Up @@ -230,8 +246,36 @@ private void zoomBindBox_TextChanged(object sender, EventArgs e)

private void LatiteForm_Load(object sender, EventArgs e)
{
Overlay OverlayForm = new Overlay();
OverlayForm.Show();
ConnectToMc(false); // silently connect on launch
}

private void transparentOverlayToggle_CheckedChanged(object sender, EventArgs e)
{
this.OverlayForm.TransparentPanels(transparentOverlayToggle.Checked); ;
}

private void launchButton_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("minecraft://");
Thread.Sleep(100);
ConnectToMc(false);
}

private void zoomCheckbox_CheckedChanged(object sender, EventArgs e)
{
setEnabled(1, zoomCheckbox.Checked);
}

private void lookBehindEnabled_CheckedChanged(object sender, EventArgs e)
{
setEnabled(2, lookBehindEnabled.Checked);
}

private void lookBehindBind_TextChanged(object sender, EventArgs e)
{
string SetStr = zoomBindBox.Text.ToUpper();
if (SetStr.Length > 0)
mod_lookBehind_setBind(SetStr[0]);
}
}
}
3 changes: 3 additions & 0 deletions Latite/LatiteForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<metadata name="moduleWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>63</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
Loading

0 comments on commit 6c46f30

Please sign in to comment.