diff options
| author | Alex-TIMEHACK <[email protected]> | 2017-11-04 09:43:02 +0000 |
|---|---|---|
| committer | Alex-TIMEHACK <[email protected]> | 2017-11-04 09:43:02 +0000 |
| commit | 6ab1468786f1e865e9ff408d32149f9c9620d844 (patch) | |
| tree | 45bac91aba019027213bdd37bac9f43c0a93853e /Histacom2 | |
| parent | 2a473d05a34afe51cf0f5340cbdd48ad4e771657 (diff) | |
| download | histacom2-6ab1468786f1e865e9ff408d32149f9c9620d844.tar.gz histacom2-6ab1468786f1e865e9ff408d32149f9c9620d844.tar.bz2 histacom2-6ab1468786f1e865e9ff408d32149f9c9620d844.zip | |
Fix bugs
...and get rid of all == false and == true
Diffstat (limited to 'Histacom2')
| -rw-r--r-- | Histacom2/GlobalPrograms/WinClassicNotepad.cs | 20 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95.cs | 2 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs | 2 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs | 2 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs | 2 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs | 49 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs | 32 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs | 113 | ||||
| -rw-r--r-- | Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs | 1 | ||||
| -rw-r--r-- | Histacom2/OS/Win98/Win98.cs | 2 | ||||
| -rw-r--r-- | Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs | 135 | ||||
| -rw-r--r-- | Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs | 82 | ||||
| -rw-r--r-- | Histacom2/SaveDialogs/LoadGameProfileItem.cs | 6 | ||||
| -rw-r--r-- | Histacom2/SaveDialogs/NewGameDialog.cs | 4 | ||||
| -rw-r--r-- | Histacom2/SaveDialogs/SaveFileTroubleShooter.cs | 2 | ||||
| -rw-r--r-- | Histacom2/TitleScreen.cs | 14 |
16 files changed, 277 insertions, 191 deletions
diff --git a/Histacom2/GlobalPrograms/WinClassicNotepad.cs b/Histacom2/GlobalPrograms/WinClassicNotepad.cs index 1a58d8e..de838e0 100644 --- a/Histacom2/GlobalPrograms/WinClassicNotepad.cs +++ b/Histacom2/GlobalPrograms/WinClassicNotepad.cs @@ -100,16 +100,21 @@ namespace Histacom2.GlobalPrograms private void saveToolStripMenuItem_Click(object sender, EventArgs e) { - if (CurrentFilePath == "") + try { - // We aren't in a file right now + if (CurrentFilePath == "") + { + // We aren't in a file right now - SaveAs(); - } else { + SaveAs(); + } + else + { - File.Delete(CurrentFilePath); - SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); - } + File.Delete(CurrentFilePath); + SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); + } + } catch { } // This try catch loop was added due the game crashing if the desktop is updating the same time the notepad is saving... which I got! } void SaveAs() @@ -118,6 +123,7 @@ namespace Histacom2.GlobalPrograms { ActivateSaveFileDialog(".txt"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); if (selectedPath != "") { diff --git a/Histacom2/OS/Win95/Win95.cs b/Histacom2/OS/Win95/Win95.cs index e330ea0..2a26b91 100644 --- a/Histacom2/OS/Win95/Win95.cs +++ b/Histacom2/OS/Win95/Win95.cs @@ -114,7 +114,7 @@ namespace Histacom2.OS.Win95 this.BringToFront(); //Check if it is the first time - if (CurrentSave.FTime95 == false) + if (!CurrentSave.FTime95) { CurrentSave.FTime95 = true; SaveGame(); diff --git a/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs b/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs index 4f80240..2ebb319 100644 --- a/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs +++ b/Histacom2/OS/Win95/Win95Apps/MineSweeper/Square.cs @@ -108,7 +108,7 @@ namespace Histacom2.OS.Win95.Win95Apps.MineSweeper this.Open(); } } - if (_game.ftime == true && !Minded) + if (_game.ftime && !Minded) { _game.ftime = false; _game._timer = new Timer(); diff --git a/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs b/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs index 2a03c7e..958e8a0 100644 --- a/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs +++ b/Histacom2/OS/Win95/Win95Apps/MineSweeper/WinClassicMinesweeper.cs @@ -129,7 +129,7 @@ namespace Histacom2.OS.Win95.Win95Apps private void timer1_Tick(object sender, EventArgs e) { - if (_game.win == true) + if (_game.win) { button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperWin; switch (level) diff --git a/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs b/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs index 41f7c35..7cf9dd4 100644 --- a/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs +++ b/Histacom2/OS/Win95/Win95Apps/Story/Hack1.cs @@ -74,7 +74,7 @@ namespace Histacom2.OS.Win95.Win95Apps.Story public static void CheckIfSoundFinished(Object sender, EventArgs e) { - if (soundThread.IsAlive == false) + if (!soundThread.IsAlive) { // Continue from where we were System.Windows.Forms.Timer trm = sender as System.Windows.Forms.Timer; diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs index 2a96033..a4bd611 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.Designer.cs @@ -53,13 +53,13 @@ this.toprightcorner = new System.Windows.Forms.Panel(); this.topleftcorner = new System.Windows.Forms.Panel(); this.pnlSave = new System.Windows.Forms.Panel(); + this.refresh = new System.Windows.Forms.Timer(this.components); + this.btnCanc = new Histacom2.Engine.UI.ClassicButton(); this.cmbType = new Histacom2.Engine.UI.ClassicDropDown(); this.txtSave = new Histacom2.Engine.UI.ClassicTextBox(); this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel(); this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel(); this.btnSave = new Histacom2.Engine.UI.ClassicButton(); - this.refresh = new System.Windows.Forms.Timer(this.components); - this.btnCanc = new Histacom2.Engine.UI.ClassicButton(); this.program.SuspendLayout(); this.MenuStrip1.SuspendLayout(); this.pnlSave.SuspendLayout(); @@ -276,8 +276,33 @@ this.pnlSave.TabIndex = 18; this.pnlSave.Visible = false; // + // refresh + // + this.refresh.Interval = 15000; + this.refresh.Tick += new System.EventHandler(this.refresh_Tick); + // + // btnCanc + // + this.btnCanc.AdaptBackColorWithTheme = true; + this.btnCanc.AdaptFontWithTheme = true; + this.btnCanc.AdaptForeColorWithTheme = true; + this.btnCanc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCanc.BackColor = System.Drawing.Color.Silver; + this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnCanc.ForeColor = System.Drawing.Color.Black; + this.btnCanc.Location = new System.Drawing.Point(611, 27); + this.btnCanc.Name = "btnCanc"; + this.btnCanc.Size = new System.Drawing.Size(75, 25); + this.btnCanc.TabIndex = 24; + this.btnCanc.Text = "Cancel"; + this.btnCanc.Click += new System.EventHandler(this.btnCanc_Click); + // // cmbType // + this.cmbType.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.cmbType.BackColor = System.Drawing.Color.White; this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.cmbType.Location = new System.Drawing.Point(56, 31); @@ -333,26 +358,6 @@ this.btnSave.Text = "Save"; this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // - // refresh - // - this.refresh.Interval = 15000; - this.refresh.Tick += new System.EventHandler(this.refresh_Tick); - // - // btnCanc - // - this.btnCanc.AdaptBackColorWithTheme = true; - this.btnCanc.AdaptFontWithTheme = true; - this.btnCanc.AdaptForeColorWithTheme = true; - this.btnCanc.BackColor = System.Drawing.Color.Silver; - this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; - this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); - this.btnCanc.ForeColor = System.Drawing.Color.Black; - this.btnCanc.Location = new System.Drawing.Point(611, 27); - this.btnCanc.Name = "btnCanc"; - this.btnCanc.Size = new System.Drawing.Size(75, 25); - this.btnCanc.TabIndex = 24; - this.btnCanc.Text = "Cancel"; - // // Win95WindowsExplorer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs index f118542..0f221af 100644 --- a/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs +++ b/Histacom2/OS/Win95/Win95Apps/Win95WindowsExplorer.cs @@ -109,14 +109,14 @@ namespace Histacom2.OS.Win95.Win95Apps IsFileSaveDialog = true; } - if (IsFileOpenDialog == true) + if (IsFileOpenDialog) { pnlSave.Show(); btnSave.Text = "Open"; } else { - if (IsFileSaveDialog == true) + if (IsFileSaveDialog) { pnlSave.Show(); btnSave.Text = "Save"; @@ -133,9 +133,9 @@ namespace Histacom2.OS.Win95.Win95Apps FileSystemFolderInfo toRead = new FileSystemFolderInfo(); toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo); - if (returnYesIfProtected == true) + if (returnYesIfProtected) { - if (toRead.IsProtected == true) return "yes"; + if (toRead.IsProtected) return "yes"; } else return toRead.Label; return Val; @@ -717,28 +717,23 @@ namespace Histacom2.OS.Win95.Win95Apps { try { - bool OpenFile = false; if (mainView.FocusedItem != null) { if (mainView.FocusedItem.Tag.ToString() == "") { // If it isn't a file GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); } - else OpenFile = true; // If it is a file + else txtSave.Text = mainView.FocusedItem.Tag.ToString(); } - else OpenFile = true; - if (OpenFile == true) + if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); + else { - if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); - else - { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - ((Form)this.TopLevelControl).Close(); - } + ((Form)this.TopLevelControl).Close(); } } catch { } @@ -1041,5 +1036,10 @@ namespace Histacom2.OS.Win95.Win95Apps RefreshTreeNode(); } + + private void btnCanc_Click(object sender, EventArgs e) + { + ((Form)this.TopLevelControl).Close(); + } } } diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs index 1a0836b..55a4ee2 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicFTPClient.cs @@ -58,64 +58,67 @@ namespace Histacom2.OS.Win95.Win95Apps private void ftpItems_Click(object sender, EventArgs e) { - Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position); - ListViewItem objListViewItem = new ListViewItem(); - if (objDrawingPoint != null) + try { - objListViewItem = ftpFiles.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y); - if (objListViewItem.Text == "/software/") + Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position); + ListViewItem objListViewItem = new ListViewItem(); + if (objDrawingPoint != null) { - ftpFiles.Clear(); - ListViewItem listViewItem1 = new ListViewItem(new string[] { "/downloads/" }, 0, Color.Black, Color.Empty, null); - ListViewItem listViewItem2 = new ListViewItem(new string[] { "skindows.html" }, 1, Color.Black, Color.Empty, null); - ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2 }); - } - else if (objListViewItem.Text == "/downloads/") - { - ftpFiles.Clear(); - ListViewItem listViewItem1 = new ListViewItem(new string[] { "/totallynotthetimedistorter/" }, 0, Color.Black, Color.Empty, null); - ListViewItem listViewItem2 = new ListViewItem(new string[] { "FTP Client Setup.exe" }, 2, Color.Black, Color.Empty, null); - ListViewItem listViewItem3 = new ListViewItem(new string[] { "Web Chat Setup.exe" }, 2, Color.Black, Color.Empty, null); - ListViewItem listViewItem4 = new ListViewItem(new string[] { "Guess The Number V1 Setup.exe" }, 2, Color.Black, Color.Empty, null); - ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4 }); - } - else if (objListViewItem.Text == "/totallynotthetimedistorter/") - { - ftpFiles.Clear(); - ListViewItem listViewItem1 = new ListViewItem(new string[] { "Time Distorter Setup.exe" }, 2, Color.Black, Color.Empty, null); - ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1 }); - } - else if (objListViewItem.Text == "FTP Client Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: FTP Client"; - } - else if (objListViewItem.Text == "Web Chat Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: Web Chat 1998"; - opendownload.amountToDL = 35; - } - else if (objListViewItem.Text == "Time Distorter Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: Time Distorter 0.1"; - } - else if (objListViewItem.Text == "Guess The Number V1 Setup.exe") - { - WinClassicDownloader opendownload = new WinClassicDownloader(); - WindowManager wm = new WindowManager(); - wm.Init(opendownload, "Downloader", null, false, true); - opendownload.appName.Text = "Downloading: Guess The Number V1"; - opendownload.amountToDL = 16; + objListViewItem = ftpFiles.GetItemAt(objDrawingPoint.X, objDrawingPoint.Y); + if (objListViewItem.Text == "/software/") + { + ftpFiles.Clear(); + ListViewItem listViewItem1 = new ListViewItem(new string[] { "/downloads/" }, 0, Color.Black, Color.Empty, null); + ListViewItem listViewItem2 = new ListViewItem(new string[] { "skindows.html" }, 1, Color.Black, Color.Empty, null); + ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2 }); + } + else if (objListViewItem.Text == "/downloads/") + { + ftpFiles.Clear(); + ListViewItem listViewItem1 = new ListViewItem(new string[] { "/totallynotthetimedistorter/" }, 0, Color.Black, Color.Empty, null); + ListViewItem listViewItem2 = new ListViewItem(new string[] { "FTP Client Setup.exe" }, 2, Color.Black, Color.Empty, null); + ListViewItem listViewItem3 = new ListViewItem(new string[] { "Web Chat Setup.exe" }, 2, Color.Black, Color.Empty, null); + ListViewItem listViewItem4 = new ListViewItem(new string[] { "Guess The Number V1 Setup.exe" }, 2, Color.Black, Color.Empty, null); + ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4 }); + } + else if (objListViewItem.Text == "/totallynotthetimedistorter/") + { + ftpFiles.Clear(); + ListViewItem listViewItem1 = new ListViewItem(new string[] { "Time Distorter Setup.exe" }, 2, Color.Black, Color.Empty, null); + ftpFiles.Items.AddRange(new ListViewItem[] { listViewItem1 }); + } + else if (objListViewItem.Text == "FTP Client Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: FTP Client"; + } + else if (objListViewItem.Text == "Web Chat Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: Web Chat 1998"; + opendownload.amountToDL = 35; + } + else if (objListViewItem.Text == "Time Distorter Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: Time Distorter 0.1"; + } + else if (objListViewItem.Text == "Guess The Number V1 Setup.exe") + { + WinClassicDownloader opendownload = new WinClassicDownloader(); + WindowManager wm = new WindowManager(); + wm.Init(opendownload, "Downloader", null, false, true); + opendownload.appName.Text = "Downloading: Guess The Number V1"; + opendownload.amountToDL = 16; + } } - } + } catch { } // Try catch due to if you have more then one item selected the game crashing. } private void btnCancel_Click(object sender, EventArgs e) diff --git a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs index 91d9368..381f5ee 100644 --- a/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs +++ b/Histacom2/OS/Win95/Win95Apps/WinClassicWordPad.cs @@ -225,6 +225,7 @@ namespace Histacom2.OS.Win95.Win95Apps { ActivateSaveFileDialog(".rtf"); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); + DeactivateFileDialog(); if (selectedPath != "") { diff --git a/Histacom2/OS/Win98/Win98.cs b/Histacom2/OS/Win98/Win98.cs index e10904e..efaa31b 100644 --- a/Histacom2/OS/Win98/Win98.cs +++ b/Histacom2/OS/Win98/Win98.cs @@ -116,7 +116,7 @@ namespace Histacom2.OS.Win98 this.BringToFront(); //Check if it is the first time - if (CurrentSave.FTime98 == false) + if (!CurrentSave.FTime98) { CurrentSave.FTime98 = true; SaveGame(); diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs index af2570c..f88d451 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.Designer.cs @@ -52,9 +52,12 @@ this.bottomleftcorner = new System.Windows.Forms.Panel(); this.topleftcorner = new System.Windows.Forms.Panel(); this.pnlSave = new System.Windows.Forms.Panel(); - this.Button1 = new System.Windows.Forms.Button(); - this.Label1 = new System.Windows.Forms.Label(); - this.txtSave = new System.Windows.Forms.TextBox(); + this.btnCanc = new Histacom2.Engine.UI.ClassicButton(); + this.cmbType = new Histacom2.Engine.UI.ClassicDropDown(); + this.txtSave = new Histacom2.Engine.UI.ClassicTextBox(); + this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel(); + this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel(); + this.btnSave = new Histacom2.Engine.UI.ClassicButton(); this.MenuStrip1 = new System.Windows.Forms.MenuStrip(); this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -112,7 +115,7 @@ this.mainView.Dock = System.Windows.Forms.DockStyle.Fill; this.mainView.Location = new System.Drawing.Point(396, 24); this.mainView.Name = "mainView"; - this.mainView.Size = new System.Drawing.Size(308, 458); + this.mainView.Size = new System.Drawing.Size(308, 439); this.mainView.TabIndex = 10; this.mainView.UseCompatibleStateImageBehavior = false; this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit); @@ -130,7 +133,7 @@ this.pnlInfo.Dock = System.Windows.Forms.DockStyle.Left; this.pnlInfo.Location = new System.Drawing.Point(196, 24); this.pnlInfo.Name = "pnlInfo"; - this.pnlInfo.Size = new System.Drawing.Size(200, 458); + this.pnlInfo.Size = new System.Drawing.Size(200, 439); this.pnlInfo.TabIndex = 19; // // pictureBox1 @@ -165,7 +168,7 @@ this.pnlInfoContent.Controls.Add(this.txtInfoTip); this.pnlInfoContent.Location = new System.Drawing.Point(0, 95); this.pnlInfoContent.Name = "pnlInfoContent"; - this.pnlInfoContent.Size = new System.Drawing.Size(199, 362); + this.pnlInfoContent.Size = new System.Drawing.Size(199, 343); this.pnlInfoContent.TabIndex = 22; // // InfoDesc @@ -245,7 +248,7 @@ this.pnlFolders.Dock = System.Windows.Forms.DockStyle.Left; this.pnlFolders.Location = new System.Drawing.Point(0, 24); this.pnlFolders.Name = "pnlFolders"; - this.pnlFolders.Size = new System.Drawing.Size(196, 458); + this.pnlFolders.Size = new System.Drawing.Size(196, 439); this.pnlFolders.TabIndex = 0; // // diskView @@ -253,7 +256,7 @@ this.diskView.Dock = System.Windows.Forms.DockStyle.Fill; this.diskView.Location = new System.Drawing.Point(0, 22); this.diskView.Name = "diskView"; - this.diskView.Size = new System.Drawing.Size(196, 436); + this.diskView.Size = new System.Drawing.Size(196, 417); this.diskView.TabIndex = 13; this.diskView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.diskView_AfterSelect); // @@ -325,45 +328,95 @@ // // pnlSave // - this.pnlSave.Controls.Add(this.Button1); - this.pnlSave.Controls.Add(this.Label1); + this.pnlSave.Controls.Add(this.btnCanc); + this.pnlSave.Controls.Add(this.cmbType); this.pnlSave.Controls.Add(this.txtSave); + this.pnlSave.Controls.Add(this.classicLabel2); + this.pnlSave.Controls.Add(this.classicLabel1); + this.pnlSave.Controls.Add(this.btnSave); this.pnlSave.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pnlSave.Location = new System.Drawing.Point(0, 482); + this.pnlSave.Location = new System.Drawing.Point(0, 463); this.pnlSave.Name = "pnlSave"; - this.pnlSave.Size = new System.Drawing.Size(704, 35); + this.pnlSave.Size = new System.Drawing.Size(704, 54); this.pnlSave.TabIndex = 18; this.pnlSave.Visible = false; // - // Button1 - // - this.Button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.Button1.Location = new System.Drawing.Point(626, 3); - this.Button1.Name = "Button1"; - this.Button1.Size = new System.Drawing.Size(75, 23); - this.Button1.TabIndex = 17; - this.Button1.Text = "Save"; - this.Button1.UseVisualStyleBackColor = true; - this.Button1.Click += new System.EventHandler(this.Button1_Click); - // - // Label1 - // - this.Label1.AutoSize = true; - this.Label1.Location = new System.Drawing.Point(3, 6); - this.Label1.Name = "Label1"; - this.Label1.Size = new System.Drawing.Size(57, 13); - this.Label1.TabIndex = 16; - this.Label1.Text = "File Name:"; + // btnCanc + // + this.btnCanc.AdaptBackColorWithTheme = true; + this.btnCanc.AdaptFontWithTheme = true; + this.btnCanc.AdaptForeColorWithTheme = true; + this.btnCanc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnCanc.BackColor = System.Drawing.Color.Silver; + this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnCanc.ForeColor = System.Drawing.Color.Black; + this.btnCanc.Location = new System.Drawing.Point(619, 28); + this.btnCanc.Name = "btnCanc"; + this.btnCanc.Size = new System.Drawing.Size(75, 25); + this.btnCanc.TabIndex = 30; + this.btnCanc.Text = "Cancel"; + this.btnCanc.Click += new System.EventHandler(this.btnCanc_Click); + // + // cmbType + // + this.cmbType.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.cmbType.BackColor = System.Drawing.Color.White; + this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.cmbType.Location = new System.Drawing.Point(64, 32); + this.cmbType.Name = "cmbType"; + this.cmbType.Size = new System.Drawing.Size(549, 20); + this.cmbType.TabIndex = 29; + this.cmbType.UseSystemPasswordChar = false; // // txtSave // - this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.txtSave.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.txtSave.Location = new System.Drawing.Point(60, 3); + this.txtSave.BackColor = System.Drawing.Color.White; + this.txtSave.Location = new System.Drawing.Point(64, 7); this.txtSave.Name = "txtSave"; - this.txtSave.Size = new System.Drawing.Size(560, 20); - this.txtSave.TabIndex = 15; + this.txtSave.Size = new System.Drawing.Size(549, 20); + this.txtSave.TabIndex = 28; + this.txtSave.UseSystemPasswordChar = false; + // + // classicLabel2 + // + this.classicLabel2.DropShadow = false; + this.classicLabel2.Location = new System.Drawing.Point(11, 33); + this.classicLabel2.Name = "classicLabel2"; + this.classicLabel2.Size = new System.Drawing.Size(64, 13); + this.classicLabel2.TabIndex = 26; + this.classicLabel2.Text = "File type:"; + // + // classicLabel1 + // + this.classicLabel1.DropShadow = false; + this.classicLabel1.Location = new System.Drawing.Point(11, 7); + this.classicLabel1.Name = "classicLabel1"; + this.classicLabel1.Size = new System.Drawing.Size(64, 13); + this.classicLabel1.TabIndex = 27; + this.classicLabel1.Text = "File name:"; + // + // btnSave + // + this.btnSave.AdaptBackColorWithTheme = true; + this.btnSave.AdaptFontWithTheme = true; + this.btnSave.AdaptForeColorWithTheme = true; + this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnSave.BackColor = System.Drawing.Color.Silver; + this.btnSave.DialogResult = System.Windows.Forms.DialogResult.None; + this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); + this.btnSave.ForeColor = System.Drawing.Color.Black; + this.btnSave.Location = new System.Drawing.Point(619, 2); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(75, 25); + this.btnSave.TabIndex = 25; + this.btnSave.Text = "Save"; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // MenuStrip1 // @@ -553,7 +606,6 @@ this.pnlFoldersTop.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.btnFolderClose)).EndInit(); this.pnlSave.ResumeLayout(false); - this.pnlSave.PerformLayout(); this.MenuStrip1.ResumeLayout(false); this.MenuStrip1.PerformLayout(); this.ResumeLayout(false); @@ -590,9 +642,6 @@ internal System.Windows.Forms.Panel topleftcorner; internal System.Windows.Forms.ListView mainView; internal System.Windows.Forms.Panel pnlSave; - internal System.Windows.Forms.Button Button1; - internal System.Windows.Forms.Label Label1; - internal System.Windows.Forms.TextBox txtSave; private System.Windows.Forms.Panel pnlInfo; private System.Windows.Forms.Panel pnlFolders; private System.Windows.Forms.Panel pnlFoldersTop; @@ -609,5 +658,11 @@ private System.Windows.Forms.Label txtInfoDescName; private System.Windows.Forms.Label txtInfoDescSize; private System.Windows.Forms.Timer refresh; + private Engine.UI.ClassicButton btnCanc; + private Engine.UI.ClassicDropDown cmbType; + private Engine.UI.ClassicTextBox txtSave; + private Engine.UI.ClassicLabel classicLabel2; + private Engine.UI.ClassicLabel classicLabel1; + private Engine.UI.ClassicButton btnSave; } } diff --git a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs index f261cb2..5cc075e 100644 --- a/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs +++ b/Histacom2/OS/Win98/Win98Apps/WinClassicWindowsExplorer.cs @@ -102,17 +102,17 @@ namespace Histacom2.OS.Win95.Win95Apps IsFileSaveDialog = true; } - if (IsFileOpenDialog == true) + if (IsFileOpenDialog) { pnlSave.Show(); - Button1.Text = "Open"; + btnSave.Text = "Open"; } else { - if (IsFileSaveDialog == true) + if (IsFileSaveDialog) { pnlSave.Show(); - Button1.Text = "Save"; + btnSave.Text = "Save"; } } @@ -139,9 +139,9 @@ namespace Histacom2.OS.Win95.Win95Apps FileSystemFolderInfo toRead = new FileSystemFolderInfo(); toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo); - if (returnYesIfProtected == true) + if (returnYesIfProtected) { - if (toRead.IsProtected == true) + if (toRead.IsProtected) { return "yes"; } @@ -655,7 +655,7 @@ namespace Histacom2.OS.Win95.Win95Apps } else { // If it is a file - if (IsFileOpenDialog == true || IsFileSaveDialog == true) + if (IsFileOpenDialog || IsFileSaveDialog) { if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) { @@ -734,41 +734,26 @@ namespace Histacom2.OS.Win95.Win95Apps { try { - bool OpenFile = false; if (mainView.FocusedItem != null) { - if ((string)mainView.FocusedItem.Tag == "") + if (mainView.FocusedItem.Tag.ToString() == "") { // If it isn't a file GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); } - else OpenFile = true; // If it is a file + else txtSave.Text = mainView.FocusedItem.Tag.ToString(); } - else OpenFile = true; - if (OpenFile == true) + if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); + else { - if (txtSave.Text == "") - { - wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); - } - else - { - if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) - { - - Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); - - } + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; - FileDialogBoxManager.IsInOpenDialog = false; - FileDialogBoxManager.IsInSaveDialog = false; - - ((Form)this.TopLevelControl).Close(); - } + ((Form)this.TopLevelControl).Close(); } - } catch { - } + catch { } } private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) @@ -929,7 +914,7 @@ namespace Histacom2.OS.Win95.Win95Apps private void FoldersToolStripMenuItem_Click(object sender, EventArgs e) { - if (FoldersToolStripMenuItem.Checked == true) + if (FoldersToolStripMenuItem.Checked) { FoldersToolStripMenuItem.Checked = false; pnlFolders.Hide(); @@ -973,7 +958,7 @@ namespace Histacom2.OS.Win95.Win95Apps } } - if (recognized == true) + if (recognized) { // TODO: } else { @@ -1137,5 +1122,36 @@ namespace Histacom2.OS.Win95.Win95Apps item.Selected = true; } } + + private void btnCanc_Click(object sender, EventArgs e) + { + ((Form)this.TopLevelControl).Close(); + } + + private void btnSave_Click(object sender, EventArgs e) + { + try + { + if (mainView.FocusedItem != null) + { + if (mainView.FocusedItem.Tag.ToString() == "") + { // If it isn't a file + GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); + } + else txtSave.Text = mainView.FocusedItem.Tag.ToString(); + } + if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK); + else + { + if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text); + + FileDialogBoxManager.IsInOpenDialog = false; + FileDialogBoxManager.IsInSaveDialog = false; + + ((Form)this.TopLevelControl).Close(); + } + } + catch { } + } } } diff --git a/Histacom2/SaveDialogs/LoadGameProfileItem.cs b/Histacom2/SaveDialogs/LoadGameProfileItem.cs index bdc0b7c..646601b 100644 --- a/Histacom2/SaveDialogs/LoadGameProfileItem.cs +++ b/Histacom2/SaveDialogs/LoadGameProfileItem.cs @@ -37,7 +37,7 @@ namespace Histacom2 if (!ClientRectangle.Contains(PointToClient(Control.MousePosition))) { sidebar.Hide(); - if (OnceRemoveHeight == false) + if (!OnceRemoveHeight) { this.Height -= 28; OnceRemoveHeight = true; @@ -49,7 +49,7 @@ namespace Histacom2 } else { sidebar.Show(); - if (OnceAddHeight == false) + if (!OnceAddHeight) { this.Height += 28; OnceAddHeight = true; @@ -95,7 +95,7 @@ namespace Histacom2 { try { - if (!RequestingNewName == false) + if (!RequestingNewName) { if (textBox1.Text == "") { diff --git a/Histacom2/SaveDialogs/NewGameDialog.cs b/Histacom2/SaveDialogs/NewGameDialog.cs index eb8d44f..e3ecd00 100644 --- a/Histacom2/SaveDialogs/NewGameDialog.cs +++ b/Histacom2/SaveDialogs/NewGameDialog.cs @@ -46,7 +46,7 @@ namespace Histacom2 if (!(txtProfName.Text.Length > 20)) { ProfileName = txtProfName.Text; - if (DevMode == true) + if (DevMode) { if (Directory.Exists(ProfileDirectory)) { @@ -84,7 +84,7 @@ namespace Histacom2 private void NewGameDialog_Load(object sender, EventArgs e) { - if (DevMode == true) + if (DevMode) { btnDevMode.Show(); } diff --git a/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs b/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs index eceff04..3283ca1 100644 --- a/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs +++ b/Histacom2/SaveDialogs/SaveFileTroubleShooter.cs @@ -193,7 +193,7 @@ namespace Histacom2.SaveDialogs { pnlResolved.Visible = true; label1.Hide(); - if (successful == true) + if (successful) { label2.Text = "The issue has been resolved."; diff --git a/Histacom2/TitleScreen.cs b/Histacom2/TitleScreen.cs index 4e3ab01..d39ba45 100644 --- a/Histacom2/TitleScreen.cs +++ b/Histacom2/TitleScreen.cs @@ -69,7 +69,7 @@ namespace Histacom2 frm95.TopMost = true; frm95.FormBorderStyle = FormBorderStyle.None; frm95.WindowState = FormWindowState.Maximized; - //if (vm_mode.Checked == true) + //if (vm_mode.Checked) //{ // frm95.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text)); // frm95.FormBorderStyle = FormBorderStyle.Fixed3D; @@ -83,7 +83,7 @@ namespace Histacom2 frm98.TopMost = true; frm98.FormBorderStyle = FormBorderStyle.None; frm98.WindowState = FormWindowState.Maximized; - //if (vm_mode.Checked == true) + //if (vm_mode.Checked) //{ // frm98.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text)); // frm98.FormBorderStyle = FormBorderStyle.Fixed3D; @@ -97,7 +97,7 @@ namespace Histacom2 frmBadXP.TopMost = true; frmBadXP.FormBorderStyle = FormBorderStyle.None; frmBadXP.WindowState = FormWindowState.Maximized; - //if (vm_mode.Checked == true) + //if (vm_mode.Checked) //{ // frm98.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text)); // frm98.FormBorderStyle = FormBorderStyle.Fixed3D; @@ -178,7 +178,7 @@ namespace Histacom2 newGameBox = new NewGameDialog(); newGameBox.ShowDialog(); - if (newGameBox.Successful == true) + if (newGameBox.Successful) { NewGame(); StartGame(); @@ -232,7 +232,7 @@ namespace Histacom2 loadGameBox = new LoadGameDialog(); loadGameBox.ShowDialog(); - if (loadGameBox.successful == true) + if (loadGameBox.successful) { LoadSave(); SetTheme(); @@ -262,7 +262,7 @@ namespace Histacom2 private void startbutton_Click(object sender, EventArgs e) { - if (DevMode == true) + if (DevMode) { DevMode = false; gameversion.Text = "Developer Mode Deactivated"; @@ -296,7 +296,7 @@ namespace Histacom2 private void vm_mode_CheckStateChanged(object sender, EventArgs e) { // Check for VM mode - if (vm_mode.Checked == true) + if (vm_mode.Checked) { VM_Width.Visible = true; VM_Height.Visible = true; |
