aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Main
diff options
context:
space:
mode:
authorJayXKanz666 <[email protected]>2017-07-03 00:33:12 +0200
committerJayXKanz666 <[email protected]>2017-07-03 00:33:12 +0200
commit685eb4733c4551843a23d03c57747b4032736bb3 (patch)
tree60f5e60fbf919ea1cb7a1091a47f2444c03f73f6 /TimeHACK.Main
parent71ec75dc79e2b5632216dc801dfeaf7510e25210 (diff)
downloadhistacom2-685eb4733c4551843a23d03c57747b4032736bb3.tar.gz
histacom2-685eb4733c4551843a23d03c57747b4032736bb3.tar.bz2
histacom2-685eb4733c4551843a23d03c57747b4032736bb3.zip
Fixed some stuff
-You can now enter in more than one command in the MS-DOS Prompt (yay?) -Changed sizeSel (Combobox in WinClassicTerminal.cs to Flat
Diffstat (limited to 'TimeHACK.Main')
-rw-r--r--TimeHACK.Main/GlobalPrograms/WinClassicTerminal.Designer.cs1
-rw-r--r--TimeHACK.Main/GlobalPrograms/WinClassicTerminal.cs31
2 files changed, 12 insertions, 20 deletions
diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.Designer.cs b/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.Designer.cs
index b505208..f251094 100644
--- a/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.Designer.cs
+++ b/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.Designer.cs
@@ -106,7 +106,6 @@
this.termMax.Size = new System.Drawing.Size(23, 22);
this.termMax.TabIndex = 5;
this.termMax.UseVisualStyleBackColor = true;
- this.termMax.Click += new System.EventHandler(this.termMax_Click);
//
// btnNothing
//
diff --git a/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.cs b/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.cs
index 99f7aed..731bec1 100644
--- a/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.cs
+++ b/TimeHACK.Main/GlobalPrograms/WinClassicTerminal.cs
@@ -13,6 +13,7 @@ using System.Threading;
using System.Reflection;
using System.Linq.Expressions;
using System.Diagnostics;
+using System.Text.RegularExpressions;
namespace TimeHACK.OS.Win95.Win95Apps
{
@@ -20,9 +21,10 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
public Engine.WindowManager wm = new Engine.WindowManager();
- public static int currentLine = 0;
+ public int currentLine = 0;
public static string prefix = @"C:\>";
public static string startupDir = $"{Engine.SaveSystem.ProfileMyComputerDirectory}";
+ public string output = "";
public WinClassicTerminal()
{
@@ -41,7 +43,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
sizeSel.SelectedIndex = 0;
// Set the font and append the prefix text
- cmdPrompt.Font = new System.Drawing.Font(TitleScreen.pfc.Families[1], 10F, System.Drawing.FontStyle.Regular);
+ cmdPrompt.Font = new Font(TitleScreen.pfc.Families[1], 10F, System.Drawing.FontStyle.Regular);
cmdPrompt.AppendText(prefix);
cmdPrompt.BringToFront();
@@ -82,16 +84,6 @@ namespace TimeHACK.OS.Win95.Win95Apps
wm.StartInfobox95("ERROR", "You need to have something in your clipboard to paste.", Properties.Resources.Win95Error); // Display an error message if the clipboard is null/empty
}
- private void termMax_Click(object sender, EventArgs e)
- {
- var windowState = ((Engine.Template.WinClassic)this.TopLevelControl).WindowState;
-
- if (windowState == FormWindowState.Normal)
- windowState = FormWindowState.Maximized;
- else if (windowState == FormWindowState.Maximized)
- windowState = FormWindowState.Normal;
- }
-
private void btnSettings_Click(object sender, EventArgs e)
{
wm.StartInfobox95("INFO", "This feature has not been implemented yet. Stay tuned! -Jason", Properties.Resources.Win95Info);
@@ -107,7 +99,7 @@ namespace TimeHACK.OS.Win95.Win95Apps
{
if (e.KeyData == Keys.Return)
{
- /// Temporary CMD redirect
+ // Temporary CMD redirect
Process p = new Process();
p.StartInfo.UseShellExecute = false;
@@ -115,17 +107,18 @@ namespace TimeHACK.OS.Win95.Win95Apps
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WorkingDirectory = startupDir;
p.StartInfo.FileName = "cmd.exe";
- p.StartInfo.Arguments = $"/C {cmdPrompt.Lines[cmdPrompt.GetLineFromCharIndex(currentLine)].Substring(prefix.Length)}";
+ p.StartInfo.Arguments = $"/C {cmdPrompt.Lines[currentLine].Substring(prefix.Length)}";
p.Start();
- string output = p.StandardOutput.ReadToEnd();
- p.WaitForExit();
+ output = p.StandardOutput.ReadToEnd();
cmdPrompt.Focus();
- cmdPrompt.AppendText($"\n{output}");
+ cmdPrompt.AppendText($"\n{output}"); // Append the command output
+
+ int numLines = output.Split('\n').Length; // Get the number of lines from the command output
+ currentLine = currentLine + 2 + numLines; // Set the current line to equals the previous line plus 2 plus the number of lines from the command
- currentLine++;
- cmdPrompt.AppendText($"\n{prefix}");
+ cmdPrompt.AppendText($"\n{prefix}"); // Append the text to the RichTextBox
}
}
}