aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/TitleScreen.cs
diff options
context:
space:
mode:
Diffstat (limited to 'TimeHACK.Main/TitleScreen.cs')
-rw-r--r--TimeHACK.Main/TitleScreen.cs113
1 files changed, 84 insertions, 29 deletions
diff --git a/TimeHACK.Main/TitleScreen.cs b/TimeHACK.Main/TitleScreen.cs
index 8180216..a5cdade 100644
--- a/TimeHACK.Main/TitleScreen.cs
+++ b/TimeHACK.Main/TitleScreen.cs
@@ -2,7 +2,8 @@
using System;
using System.Drawing;
using System.Windows.Forms;
-using System.Runtime.InteropServices;
+using TimeHACK.OS.Win95;
+using TimeHACK.Engine;
namespace TimeHACK
{
@@ -10,11 +11,12 @@ namespace TimeHACK
{
public static System.Drawing.Text.PrivateFontCollection pfc = new System.Drawing.Text.PrivateFontCollection();
public static Windows95 frm95;
+ public static string username;
+ public static string progress = "95";
public TitleScreen()
{
InitializeComponent();
-
}
private void closebutton_Click(object sender, EventArgs e)
@@ -22,35 +24,64 @@ namespace TimeHACK
Close();
}
+ private void VM_WidthHeight_KeyPress(object sender, KeyPressEventArgs e)
+ {
+ if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) &&
+ (e.KeyChar != '.'))
+ {
+ e.Handled = true;
+ }
+
+ // only allow one decimal point
+ if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1))
+ {
+ e.Handled = true;
+ }
+ }
+
// When the TitleScreen Loads
private void TitleScreen_Load(object sender, EventArgs e)
{
+
// Set GameVersion
- gameversion.Text = "TimeHACK " + Program.gameID + " by TimeHACKDevs";
+ gameversion.Text = "TimeHACK " + Program.gameID;
// Initialize Font
pfc.AddFontFile(AppDomain.CurrentDomain.BaseDirectory + "\\LeviWindows.ttf");
+ pfc.AddFontFile(AppDomain.CurrentDomain.BaseDirectory + "\\windows_command_prompt.ttf");
+ gameversion.Font = new Font(pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, (0));
// Start the VM Mode timer
vmModeTimer.Start();
}
+ private static void leet()
+ {
+ WindowManager wm = new WindowManager();
+ UserControl leet = new UserControl();
+ leet.Width = 500;
+ leet.Height = 500;
+ Label label1 = new Label();
+ label1.Parent = leet;
+ label1.AutoSize = true;
+ label1.Text = "Thank you for making TimeHACK possible.";
+ wm.startWin95(leet, "Thank You", null, true, true);
+ }
+
// The VM Mode timer / checker. Updates every 100ms
- private void timer1_Tick(object sender, EventArgs e)
+ private void vmModeTimer_Tick(object sender, EventArgs e)
{
// Check for VM mode
if (vm_mode.Checked == true)
{
- widthBox.Visible = true;
- charX.Visible = true;
- heightBox.Visible = true;
+ VM_Width.Visible = true;
+ VM_Height.Visible = true;
}
// If VM Mode is disabled
else
{
- widthBox.Visible = false;
- charX.Visible = false;
- heightBox.Visible = false;
+ VM_Width.Visible = false;
+ VM_Height.Visible = false;
}
}
@@ -61,6 +92,11 @@ namespace TimeHACK
// When NewGame is Clicked
private void NewGame_Click(object sender, EventArgs e)
{
+ if (Convert.ToInt32(VM_Width.Text) == 1337 && Convert.ToInt32(VM_Height.Text) == 1337)
+ {
+ leet();
+ }
+ else
// If VM Mode is not enabled
if (vm_mode.Checked != true)
{
@@ -75,30 +111,49 @@ namespace TimeHACK
// If VM Mode is enabled
else
{
- // Check VM Mode Resolutions
- int parsedWidth = 0;
- int parsedHeight = 0;
- if (!int.TryParse(widthBox.Text, out parsedWidth))
+ // Generate desktop with size entered by user
+ frm95 = new Windows95();
+ frm95.FormBorderStyle = FormBorderStyle.None;
+ frm95.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text));
+ frm95.FormBorderStyle = FormBorderStyle.Fixed3D;
+ frm95.Show();
+ Hide();
+ }
+
+ }
+
+ public void BSODRewind(object sender, EventArgs e)
+ {
+ if (progress == "95")
+ {
+ frm95.Close();
+ frm95 = null;
+
+ // If VM Mode is not enabled
+ if (vm_mode.Checked != true)
{
- MessageBox.Show("'" + widthBox.Text + "' is not a valid value.");
- Application.Restart();
+ // Generate fullscreen desktop
+ frm95 = new Windows95();
+ frm95.TopMost = true;
+ frm95.FormBorderStyle = FormBorderStyle.None;
+ frm95.WindowState = FormWindowState.Maximized;
+ frm95.Show();
+ Hide();
}
- if (!int.TryParse(heightBox.Text, out parsedHeight))
+ // If VM Mode is enabled
+ else
{
- MessageBox.Show("'" + heightBox.Text + "' is not a valid value.");
- Application.Restart();
+ // Generate desktop with size entered by user
+ frm95 = new Windows95();
+ frm95.FormBorderStyle = FormBorderStyle.None;
+ frm95.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text));
+ frm95.FormBorderStyle = FormBorderStyle.Fixed3D;
+ frm95.Show();
+ Hide();
}
- // Generate desktop with size entered by user
- Windows95 frm = new Windows95();
- frm.FormBorderStyle = FormBorderStyle.None;
- frm.Size = new Size(parsedWidth, parsedHeight);
- frm.FormBorderStyle = FormBorderStyle.Fixed3D;
- frm.Show();
- Hide();
}
-
-
}
+
private void NewGame_MouseEnter(object sender, EventArgs e)
{
NewGame.Image = Resources.MSNewGame;
@@ -148,7 +203,7 @@ namespace TimeHACK
private void gameversion_MouseLeave(object sender, EventArgs e)
{
- gameversion.Text = "TimeHACK " + Program.gameID + " by TimeHACKDevs";
+ gameversion.Text = "TimeHACK " + Program.gameID;
}
}
}