aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main/SaveDialogs/NewGameDialog.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-05-20 13:42:23 +0100
committerGitHub <[email protected]>2017-05-20 13:42:23 +0100
commit9af6e5bbff5138a4140958968affc79ec3447139 (patch)
tree92f79c16d75b779fa20e24844b7739c0fec51568 /TimeHACK.Main/SaveDialogs/NewGameDialog.cs
parenteafc3296a00d057b3adb4af08b2320d2de1f1d52 (diff)
parentc322a51694c130f036df17ec3027a5b30eb9472c (diff)
downloadhistacom2-9af6e5bbff5138a4140958968affc79ec3447139.tar.gz
histacom2-9af6e5bbff5138a4140958968affc79ec3447139.tar.bz2
histacom2-9af6e5bbff5138a4140958968affc79ec3447139.zip
Merge pull request #74 from Alex-TIMEHACK/master
Added my SaveSystem!
Diffstat (limited to 'TimeHACK.Main/SaveDialogs/NewGameDialog.cs')
-rw-r--r--TimeHACK.Main/SaveDialogs/NewGameDialog.cs99
1 files changed, 99 insertions, 0 deletions
diff --git a/TimeHACK.Main/SaveDialogs/NewGameDialog.cs b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs
new file mode 100644
index 0000000..20895cb
--- /dev/null
+++ b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs
@@ -0,0 +1,99 @@
+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;
+using TimeHACK.Engine;
+using Newtonsoft.Json;
+using static TimeHACK.Engine.SaveSystem;
+using System.IO;
+
+namespace TimeHACK
+{
+ public partial class NewGameDialog : Form
+ {
+ public Boolean Successful = false;
+ public NewGameDialog()
+ {
+ InitializeComponent();
+ }
+
+ private void btnHelp_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("You can choose a profile name - this will create a new profile! Whenever you want to Load a game, click 'Load Game' and then choose a profile (You can have as many profiles as you want)");
+ }
+
+ private void btnCancl_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void btnInfo_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("The game's profiles are stored in your Documents /TimeHACK/Profiles - the rest is for you to figure out!");
+ }
+
+ private void btnOk_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (txtProfName.Text != "")
+ {
+ if (!(txtProfName.Text.Length > 20))
+ {
+ ProfileName = txtProfName.Text;
+ if (DevMode == true)
+ {
+ if (Directory.Exists(ProfileDirectory))
+ {
+ Directory.Delete(ProfileDirectory, true);
+ Successful = true;
+ this.Close();
+ }
+ }
+
+ if (!Directory.Exists(ProfileDirectory))
+ {
+ Successful = true;
+ this.Close();
+ }
+ else
+ {
+ MessageBox.Show("That profile already exists! \n USEFUL INFO: Use 'Load Game' to manage your profiles - from there you can delete the profile!");
+ }
+ }
+ else
+ {
+ MessageBox.Show("The profile name cannot be longer than 20 characters");
+ }
+
+ }
+ else
+ {
+ MessageBox.Show("You must enter a profile name!");
+ }
+ } catch (Exception ex)
+ {
+
+ }
+ }
+
+ private void NewGameDialog_Load(object sender, EventArgs e)
+ {
+ if (DevMode == true)
+ {
+ btnDevMode.Show();
+ }
+ }
+
+ private void btnDevMode_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("DevMode is a mode Designed for Development of the game, if you are seeing this that means it is activated! All DevMode does is if a Profile already exists then rather than asking you to choose a different name it just " +
+ "deletes the old one! This means that you won't have 1 million profiles everytime you want to test something in the game!");
+ }
+ }
+}