From 9328abe3848262d9d52e847f0029ed1144399f7b Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 20 May 2017 13:33:32 +0100 Subject: Added my SaveSystem! --- TimeHACK.Main/SaveDialogs/NewGameDialog.cs | 97 ++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 TimeHACK.Main/SaveDialogs/NewGameDialog.cs (limited to 'TimeHACK.Main/SaveDialogs/NewGameDialog.cs') diff --git a/TimeHACK.Main/SaveDialogs/NewGameDialog.cs b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs new file mode 100644 index 0000000..227edfd --- /dev/null +++ b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs @@ -0,0 +1,97 @@ +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!"); + } + } +} -- cgit v1.2.3 From aaf2960c693b8a555cc0e228132e11227aa65281 Mon Sep 17 00:00:00 2001 From: Alex-TIMEHACK Date: Sat, 20 May 2017 13:35:34 +0100 Subject: Make a minor adjustment to my SaveSystem! --- .vs/TimeHACK/v15/.suo | Bin 156672 -> 156672 bytes TimeHACK.Main/SaveDialogs/NewGameDialog.cs | 2 ++ TimeHACK.Main/bin/Release/TimeHACK.application | 2 +- TimeHACK.Main/bin/Release/TimeHACK.exe | Bin 4812288 -> 4812288 bytes TimeHACK.Main/bin/Release/TimeHACK.exe.manifest | 2 +- TimeHACK.Main/bin/Release/TimeHACK.pdb | Bin 249344 -> 249344 bytes TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe | Bin 4812288 -> 4812288 bytes TimeHACK.Main/obj/Release/TimeHACK.application | 2 +- TimeHACK.Main/obj/Release/TimeHACK.exe | Bin 4812288 -> 4812288 bytes TimeHACK.Main/obj/Release/TimeHACK.exe.manifest | 2 +- TimeHACK.Main/obj/Release/TimeHACK.pdb | Bin 249344 -> 249344 bytes 11 files changed, 6 insertions(+), 4 deletions(-) (limited to 'TimeHACK.Main/SaveDialogs/NewGameDialog.cs') diff --git a/.vs/TimeHACK/v15/.suo b/.vs/TimeHACK/v15/.suo index af9fd08..47719f4 100644 Binary files a/.vs/TimeHACK/v15/.suo and b/.vs/TimeHACK/v15/.suo differ diff --git a/TimeHACK.Main/SaveDialogs/NewGameDialog.cs b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs index 227edfd..20895cb 100644 --- a/TimeHACK.Main/SaveDialogs/NewGameDialog.cs +++ b/TimeHACK.Main/SaveDialogs/NewGameDialog.cs @@ -47,12 +47,14 @@ namespace TimeHACK { ProfileName = txtProfName.Text; if (DevMode == true) + { if (Directory.Exists(ProfileDirectory)) { Directory.Delete(ProfileDirectory, true); Successful = true; this.Close(); } + } if (!Directory.Exists(ProfileDirectory)) { diff --git a/TimeHACK.Main/bin/Release/TimeHACK.application b/TimeHACK.Main/bin/Release/TimeHACK.application index 055a7f3..9ade0ab 100644 --- a/TimeHACK.Main/bin/Release/TimeHACK.application +++ b/TimeHACK.Main/bin/Release/TimeHACK.application @@ -14,7 +14,7 @@ - btyohAVc+4Sb51EUMC2WPcUaog+43R54sTs+wcGFXps= + ENTn7t1t261AVKr1rjMRpP9Qg3oVkKGXFM3DsueB79g= diff --git a/TimeHACK.Main/bin/Release/TimeHACK.exe b/TimeHACK.Main/bin/Release/TimeHACK.exe index a0ec537..c570f0c 100644 Binary files a/TimeHACK.Main/bin/Release/TimeHACK.exe and b/TimeHACK.Main/bin/Release/TimeHACK.exe differ diff --git a/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest b/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest index 5aabcc3..17ebb49 100644 --- a/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest +++ b/TimeHACK.Main/bin/Release/TimeHACK.exe.manifest @@ -63,7 +63,7 @@ - ZM+Y7lQ8FJWiXzXVRe9IyUX7OOiMMpcs9z5UaYLK604= + aHpmb2rmm80xa4/waiF18Jzl63icUPagQfq/eo+mJ84= diff --git a/TimeHACK.Main/bin/Release/TimeHACK.pdb b/TimeHACK.Main/bin/Release/TimeHACK.pdb index 2a84a2c..fcd48e7 100644 Binary files a/TimeHACK.Main/bin/Release/TimeHACK.pdb and b/TimeHACK.Main/bin/Release/TimeHACK.pdb differ diff --git a/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe b/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe index a0ec537..c570f0c 100644 Binary files a/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe and b/TimeHACK.Main/bin/Release/app.publish/TimeHACK.exe differ diff --git a/TimeHACK.Main/obj/Release/TimeHACK.application b/TimeHACK.Main/obj/Release/TimeHACK.application index 055a7f3..9ade0ab 100644 --- a/TimeHACK.Main/obj/Release/TimeHACK.application +++ b/TimeHACK.Main/obj/Release/TimeHACK.application @@ -14,7 +14,7 @@ - btyohAVc+4Sb51EUMC2WPcUaog+43R54sTs+wcGFXps= + ENTn7t1t261AVKr1rjMRpP9Qg3oVkKGXFM3DsueB79g= diff --git a/TimeHACK.Main/obj/Release/TimeHACK.exe b/TimeHACK.Main/obj/Release/TimeHACK.exe index a0ec537..c570f0c 100644 Binary files a/TimeHACK.Main/obj/Release/TimeHACK.exe and b/TimeHACK.Main/obj/Release/TimeHACK.exe differ diff --git a/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest b/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest index 5aabcc3..17ebb49 100644 --- a/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest +++ b/TimeHACK.Main/obj/Release/TimeHACK.exe.manifest @@ -63,7 +63,7 @@ - ZM+Y7lQ8FJWiXzXVRe9IyUX7OOiMMpcs9z5UaYLK604= + aHpmb2rmm80xa4/waiF18Jzl63icUPagQfq/eo+mJ84= diff --git a/TimeHACK.Main/obj/Release/TimeHACK.pdb b/TimeHACK.Main/obj/Release/TimeHACK.pdb index 2a84a2c..fcd48e7 100644 Binary files a/TimeHACK.Main/obj/Release/TimeHACK.pdb and b/TimeHACK.Main/obj/Release/TimeHACK.pdb differ -- cgit v1.2.3