...and get rid of all == false and == true
This commit is contained in:
Alex-TIMEHACK 2017-11-04 09:43:02 +00:00
parent 2a473d05a3
commit 6ab1468786
24 changed files with 318 additions and 201 deletions

View file

@ -17,9 +17,9 @@ public static string ReadDataFile(string reqDirectory, bool returnYesIfProtected
string directoryFileInfo = File.ReadAllText(Path.Combine(reqDirectory, "_data.info")); string directoryFileInfo = File.ReadAllText(Path.Combine(reqDirectory, "_data.info"));
FileSystemFolderInfo toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo); FileSystemFolderInfo toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo);
if (returnYesIfProtected == true) if (returnYesIfProtected)
{ {
if (toRead.IsProtected == true) if (toRead.IsProtected)
{ {
return "yes"; return "yes";
} }

View file

@ -28,6 +28,13 @@ public static void ActivateSaveFileDialog(string ExtensionToView)
OnlyViewExtension = ExtensionToView; OnlyViewExtension = ExtensionToView;
} }
public static void DeactivateFileDialog()
{
IsInOpenDialog = false;
IsInSaveDialog = false;
OnlyViewExtension = "";
}
public static string ReadTextFile(string path) public static string ReadTextFile(string path)
{ {
try try

View file

@ -127,7 +127,7 @@ public static void NewGame()
{ {
var save = new Save(); var save = new Save();
save.ExperiencedStories = new List<string>(); save.ExperiencedStories = new List<string>();
if (DevMode == true) if (DevMode)
{ {
if (ProfileName == "xpbad") if (ProfileName == "xpbad")
{ {
@ -373,7 +373,7 @@ public static void SaveDirectoryInfo(string parent, string dirname, bool isProte
info.SubDirs = new List<THDirInfo>(256); info.SubDirs = new List<THDirInfo>(256);
info.ByteSize = 0; info.ByteSize = 0;
if (updateParent == true) if (updateParent)
{ {
if ((parent != ProfileDirectory)) if ((parent != ProfileDirectory))
{ {

View file

@ -45,7 +45,7 @@ public static extern int SendMessage(IntPtr hWnd,
private void Programtopbar_drag(object sender, MouseEventArgs e) private void Programtopbar_drag(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Left && max == false) if (e.Button == MouseButtons.Left && !max)
{ {
ReleaseCapture(); ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
@ -306,7 +306,7 @@ private void bottomrightcorner_Paint(object sender, PaintEventArgs e)
private void maximizebutton_Click(object sender, EventArgs e) private void maximizebutton_Click(object sender, EventArgs e)
{ {
if (max == false) if (!max)
{ {
this.right.Hide(); this.right.Hide();
this.left.Hide(); this.left.Hide();

View file

@ -51,7 +51,7 @@ private void closebutton_Click(object sender, EventArgs e)
private void top_MouseDown(object sender, MouseEventArgs e) private void top_MouseDown(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Left && max == false) if (e.Button == MouseButtons.Left && !max)
{ {
ReleaseCapture(); ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);

View file

@ -17,6 +17,18 @@ public partial class ClassicDropDown : UserControl
public bool UseSystemPasswordChar { get; set; } public bool UseSystemPasswordChar { get; set; }
public bool dropDownShown; public bool dropDownShown;
public override string Text
{
get
{
return textBox1.Text;
}
set
{
textBox1.Text = value;
}
}
public static Color textboxcolor = Color.Black; public static Color textboxcolor = Color.Black;
public static Color _lightBack = Color.Silver; public static Color _lightBack = Color.Silver;

View file

@ -19,6 +19,18 @@ public partial class ClassicTextBox : UserControl
public static Color _lightBack = Color.Silver; public static Color _lightBack = Color.Silver;
public static Color _darkBack = Color.Silver; public static Color _darkBack = Color.Silver;
public override string Text
{
get
{
return textBox1.Text;
}
set
{
textBox1.Text = value;
}
}
public ClassicTextBox() public ClassicTextBox()
{ {
InitializeComponent(); InitializeComponent();

View file

@ -67,14 +67,14 @@ public WinClassic Init(UserControl content, string title, Image icon, bool MaxBu
else app.programIcon.Image = icon; else app.programIcon.Image = icon;
// Check if Max button is enabled and set proper X for Min button // Check if Max button is enabled and set proper X for Min button
if (MaxButton == false) if (!MaxButton)
{ {
app.maximizebutton.Visible = false; app.maximizebutton.Visible = false;
app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y); app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y);
} }
// Check if Min button is enabled // Check if Min button is enabled
if (MinButton == false) if (!MinButton)
{ {
app.minimizebutton.Visible = false; app.minimizebutton.Visible = false;
app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y); app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y);
@ -102,7 +102,7 @@ public WinClassic Init(UserControl content, string title, Image icon, bool MaxBu
// Show the app // Show the app
app.TopMost = true; app.TopMost = true;
if (ShowApplicationAsDialog == false) { app.Show(); } else { app.ShowDialog(); } if (!ShowApplicationAsDialog) { app.Show(); } else { app.ShowDialog(); }
return app; return app;
} }
@ -134,14 +134,14 @@ public WinXP InitXP(UserControl content, string title, Image icon, bool MaxButto
else app.programIcon.Image = icon; else app.programIcon.Image = icon;
// Check if Max button is enabled and set proper X for Min button // Check if Max button is enabled and set proper X for Min button
if (MaxButton == false) if (!MaxButton)
{ {
app.maximizebutton.Visible = false; app.maximizebutton.Visible = false;
app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y); app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y);
} }
// Check if Min button is enabled // Check if Min button is enabled
if (MinButton == false) if (!MinButton)
{ {
app.minimizebutton.Visible = false; app.minimizebutton.Visible = false;
app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y); app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y);
@ -165,7 +165,7 @@ public WinXP InitXP(UserControl content, string title, Image icon, bool MaxButto
// Show the app // Show the app
app.TopMost = true; app.TopMost = true;
if (ShowApplicationAsDialog == false) { app.Show(); } else { app.ShowDialog(); } if (!ShowApplicationAsDialog) { app.Show(); } else { app.ShowDialog(); }
return app; return app;
} }

View file

@ -99,17 +99,22 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e)
} }
private void saveToolStripMenuItem_Click(object sender, EventArgs e) private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{ {
if (CurrentFilePath == "") if (CurrentFilePath == "")
{ {
// We aren't in a file right now // We aren't in a file right now
SaveAs(); SaveAs();
} else { }
else
{
File.Delete(CurrentFilePath); File.Delete(CurrentFilePath);
SaveSystem.CreateWindowsFile(new FileInfo(CurrentFilePath).Directory.FullName, CurrentFilePath.Split('\\').Last(), mainText.Text, 12, mainText.Text.Length); 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() void SaveAs()
@ -118,6 +123,7 @@ void SaveAs()
{ {
ActivateSaveFileDialog(".txt"); ActivateSaveFileDialog(".txt");
string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath();
DeactivateFileDialog();
if (selectedPath != "") if (selectedPath != "")
{ {

View file

@ -114,7 +114,7 @@ private void Desktop_Load(object sender, EventArgs e)
this.BringToFront(); this.BringToFront();
//Check if it is the first time //Check if it is the first time
if (CurrentSave.FTime95 == false) if (!CurrentSave.FTime95)
{ {
CurrentSave.FTime95 = true; CurrentSave.FTime95 = true;
SaveGame(); SaveGame();

View file

@ -108,7 +108,7 @@ private void Click(object sender, EventArgs e)
this.Open(); this.Open();
} }
} }
if (_game.ftime == true && !Minded) if (_game.ftime && !Minded)
{ {
_game.ftime = false; _game.ftime = false;
_game._timer = new Timer(); _game._timer = new Timer();

View file

@ -129,7 +129,7 @@ private void bestTimesToolStripMenuItem_Click(object sender, EventArgs e)
private void timer1_Tick(object sender, EventArgs e) private void timer1_Tick(object sender, EventArgs e)
{ {
if (_game.win == true) if (_game.win)
{ {
button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperWin; button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperWin;
switch (level) switch (level)

View file

@ -74,7 +74,7 @@ public static async void ContinueObjective()
public static void CheckIfSoundFinished(Object sender, EventArgs e) public static void CheckIfSoundFinished(Object sender, EventArgs e)
{ {
if (soundThread.IsAlive == false) if (!soundThread.IsAlive)
{ {
// Continue from where we were // Continue from where we were
System.Windows.Forms.Timer trm = sender as System.Windows.Forms.Timer; System.Windows.Forms.Timer trm = sender as System.Windows.Forms.Timer;

View file

@ -53,13 +53,13 @@ private void InitializeComponent()
this.toprightcorner = new System.Windows.Forms.Panel(); this.toprightcorner = new System.Windows.Forms.Panel();
this.topleftcorner = new System.Windows.Forms.Panel(); this.topleftcorner = new System.Windows.Forms.Panel();
this.pnlSave = 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.cmbType = new Histacom2.Engine.UI.ClassicDropDown();
this.txtSave = new Histacom2.Engine.UI.ClassicTextBox(); this.txtSave = new Histacom2.Engine.UI.ClassicTextBox();
this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel(); this.classicLabel2 = new Histacom2.Engine.UI.ClassicLabel();
this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel(); this.classicLabel1 = new Histacom2.Engine.UI.ClassicLabel();
this.btnSave = new Histacom2.Engine.UI.ClassicButton(); 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.program.SuspendLayout();
this.MenuStrip1.SuspendLayout(); this.MenuStrip1.SuspendLayout();
this.pnlSave.SuspendLayout(); this.pnlSave.SuspendLayout();
@ -276,8 +276,33 @@ private void InitializeComponent()
this.pnlSave.TabIndex = 18; this.pnlSave.TabIndex = 18;
this.pnlSave.Visible = false; 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 // 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.BackColor = System.Drawing.Color.White;
this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.cmbType.Location = new System.Drawing.Point(56, 31); this.cmbType.Location = new System.Drawing.Point(56, 31);
@ -333,26 +358,6 @@ private void InitializeComponent()
this.btnSave.Text = "Save"; this.btnSave.Text = "Save";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click); 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 // Win95WindowsExplorer
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View file

@ -109,14 +109,14 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e)
IsFileSaveDialog = true; IsFileSaveDialog = true;
} }
if (IsFileOpenDialog == true) if (IsFileOpenDialog)
{ {
pnlSave.Show(); pnlSave.Show();
btnSave.Text = "Open"; btnSave.Text = "Open";
} }
else else
{ {
if (IsFileSaveDialog == true) if (IsFileSaveDialog)
{ {
pnlSave.Show(); pnlSave.Show();
btnSave.Text = "Save"; btnSave.Text = "Save";
@ -133,9 +133,9 @@ string ReadDataFile(string reqDirectory, bool returnYesIfProtected = false) {
FileSystemFolderInfo toRead = new FileSystemFolderInfo(); FileSystemFolderInfo toRead = new FileSystemFolderInfo();
toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo); 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; else return toRead.Label;
return Val; return Val;
@ -717,18 +717,14 @@ private void btnSave_Click(object sender, EventArgs e)
{ {
try try
{ {
bool OpenFile = false;
if (mainView.FocusedItem != null) if (mainView.FocusedItem != null)
{ {
if (mainView.FocusedItem.Tag.ToString() == "") if (mainView.FocusedItem.Tag.ToString() == "")
{ // If it isn't a file { // If it isn't a file
GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); 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); if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK);
else else
{ {
@ -740,7 +736,6 @@ private void btnSave_Click(object sender, EventArgs e)
((Form)this.TopLevelControl).Close(); ((Form)this.TopLevelControl).Close();
} }
} }
}
catch { } catch { }
} }
@ -1041,5 +1036,10 @@ private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
RefreshTreeNode(); RefreshTreeNode();
} }
private void btnCanc_Click(object sender, EventArgs e)
{
((Form)this.TopLevelControl).Close();
}
} }
} }

View file

@ -57,6 +57,8 @@ private void button1_Click(object sender, EventArgs e)
} }
private void ftpItems_Click(object sender, EventArgs e) private void ftpItems_Click(object sender, EventArgs e)
{
try
{ {
Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position); Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position);
ListViewItem objListViewItem = new ListViewItem(); ListViewItem objListViewItem = new ListViewItem();
@ -116,6 +118,7 @@ private void ftpItems_Click(object sender, EventArgs e)
opendownload.amountToDL = 16; 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) private void btnCancel_Click(object sender, EventArgs e)

View file

@ -225,6 +225,7 @@ void SaveAs()
{ {
ActivateSaveFileDialog(".rtf"); ActivateSaveFileDialog(".rtf");
string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath(); string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath();
DeactivateFileDialog();
if (selectedPath != "") if (selectedPath != "")
{ {

View file

@ -116,7 +116,7 @@ private void Desktop_Load(object sender, EventArgs e)
this.BringToFront(); this.BringToFront();
//Check if it is the first time //Check if it is the first time
if (CurrentSave.FTime98 == false) if (!CurrentSave.FTime98)
{ {
CurrentSave.FTime98 = true; CurrentSave.FTime98 = true;
SaveGame(); SaveGame();

View file

@ -52,9 +52,12 @@ private void InitializeComponent()
this.bottomleftcorner = new System.Windows.Forms.Panel(); this.bottomleftcorner = new System.Windows.Forms.Panel();
this.topleftcorner = new System.Windows.Forms.Panel(); this.topleftcorner = new System.Windows.Forms.Panel();
this.pnlSave = new System.Windows.Forms.Panel(); this.pnlSave = new System.Windows.Forms.Panel();
this.Button1 = new System.Windows.Forms.Button(); this.btnCanc = new Histacom2.Engine.UI.ClassicButton();
this.Label1 = new System.Windows.Forms.Label(); this.cmbType = new Histacom2.Engine.UI.ClassicDropDown();
this.txtSave = new System.Windows.Forms.TextBox(); 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.MenuStrip1 = new System.Windows.Forms.MenuStrip();
this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CreateShortcutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -112,7 +115,7 @@ private void InitializeComponent()
this.mainView.Dock = System.Windows.Forms.DockStyle.Fill; this.mainView.Dock = System.Windows.Forms.DockStyle.Fill;
this.mainView.Location = new System.Drawing.Point(396, 24); this.mainView.Location = new System.Drawing.Point(396, 24);
this.mainView.Name = "mainView"; 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.TabIndex = 10;
this.mainView.UseCompatibleStateImageBehavior = false; this.mainView.UseCompatibleStateImageBehavior = false;
this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit); this.mainView.AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this.mainView_AfterLabelEdit);
@ -130,7 +133,7 @@ private void InitializeComponent()
this.pnlInfo.Dock = System.Windows.Forms.DockStyle.Left; this.pnlInfo.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlInfo.Location = new System.Drawing.Point(196, 24); this.pnlInfo.Location = new System.Drawing.Point(196, 24);
this.pnlInfo.Name = "pnlInfo"; 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; this.pnlInfo.TabIndex = 19;
// //
// pictureBox1 // pictureBox1
@ -165,7 +168,7 @@ private void InitializeComponent()
this.pnlInfoContent.Controls.Add(this.txtInfoTip); this.pnlInfoContent.Controls.Add(this.txtInfoTip);
this.pnlInfoContent.Location = new System.Drawing.Point(0, 95); this.pnlInfoContent.Location = new System.Drawing.Point(0, 95);
this.pnlInfoContent.Name = "pnlInfoContent"; 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; this.pnlInfoContent.TabIndex = 22;
// //
// InfoDesc // InfoDesc
@ -245,7 +248,7 @@ private void InitializeComponent()
this.pnlFolders.Dock = System.Windows.Forms.DockStyle.Left; this.pnlFolders.Dock = System.Windows.Forms.DockStyle.Left;
this.pnlFolders.Location = new System.Drawing.Point(0, 24); this.pnlFolders.Location = new System.Drawing.Point(0, 24);
this.pnlFolders.Name = "pnlFolders"; 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; this.pnlFolders.TabIndex = 0;
// //
// diskView // diskView
@ -253,7 +256,7 @@ private void InitializeComponent()
this.diskView.Dock = System.Windows.Forms.DockStyle.Fill; this.diskView.Dock = System.Windows.Forms.DockStyle.Fill;
this.diskView.Location = new System.Drawing.Point(0, 22); this.diskView.Location = new System.Drawing.Point(0, 22);
this.diskView.Name = "diskView"; 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.TabIndex = 13;
this.diskView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.diskView_AfterSelect); this.diskView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.diskView_AfterSelect);
// //
@ -325,45 +328,95 @@ private void InitializeComponent()
// //
// pnlSave // pnlSave
// //
this.pnlSave.Controls.Add(this.Button1); this.pnlSave.Controls.Add(this.btnCanc);
this.pnlSave.Controls.Add(this.Label1); this.pnlSave.Controls.Add(this.cmbType);
this.pnlSave.Controls.Add(this.txtSave); 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.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.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.TabIndex = 18;
this.pnlSave.Visible = false; this.pnlSave.Visible = false;
// //
// Button1 // btnCanc
// //
this.Button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnCanc.AdaptBackColorWithTheme = true;
this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnCanc.AdaptFontWithTheme = true;
this.Button1.Location = new System.Drawing.Point(626, 3); this.btnCanc.AdaptForeColorWithTheme = true;
this.Button1.Name = "Button1"; this.btnCanc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.Button1.Size = new System.Drawing.Size(75, 23); this.btnCanc.BackColor = System.Drawing.Color.Silver;
this.Button1.TabIndex = 17; this.btnCanc.DialogResult = System.Windows.Forms.DialogResult.None;
this.Button1.Text = "Save"; this.btnCanc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.Button1.UseVisualStyleBackColor = true; this.btnCanc.ForeColor = System.Drawing.Color.Black;
this.Button1.Click += new System.EventHandler(this.Button1_Click); 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);
// //
// Label1 // cmbType
// //
this.Label1.AutoSize = true; this.cmbType.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.Label1.Location = new System.Drawing.Point(3, 6); | System.Windows.Forms.AnchorStyles.Left)
this.Label1.Name = "Label1"; | System.Windows.Forms.AnchorStyles.Right)));
this.Label1.Size = new System.Drawing.Size(57, 13); this.cmbType.BackColor = System.Drawing.Color.White;
this.Label1.TabIndex = 16; this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F);
this.Label1.Text = "File Name:"; 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 // 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))); | 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.Name = "txtSave";
this.txtSave.Size = new System.Drawing.Size(560, 20); this.txtSave.Size = new System.Drawing.Size(549, 20);
this.txtSave.TabIndex = 15; 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 // MenuStrip1
// //
@ -553,7 +606,6 @@ private void InitializeComponent()
this.pnlFoldersTop.PerformLayout(); this.pnlFoldersTop.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.btnFolderClose)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.btnFolderClose)).EndInit();
this.pnlSave.ResumeLayout(false); this.pnlSave.ResumeLayout(false);
this.pnlSave.PerformLayout();
this.MenuStrip1.ResumeLayout(false); this.MenuStrip1.ResumeLayout(false);
this.MenuStrip1.PerformLayout(); this.MenuStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
@ -590,9 +642,6 @@ private void InitializeComponent()
internal System.Windows.Forms.Panel topleftcorner; internal System.Windows.Forms.Panel topleftcorner;
internal System.Windows.Forms.ListView mainView; internal System.Windows.Forms.ListView mainView;
internal System.Windows.Forms.Panel pnlSave; 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 pnlInfo;
private System.Windows.Forms.Panel pnlFolders; private System.Windows.Forms.Panel pnlFolders;
private System.Windows.Forms.Panel pnlFoldersTop; private System.Windows.Forms.Panel pnlFoldersTop;
@ -609,5 +658,11 @@ private void InitializeComponent()
private System.Windows.Forms.Label txtInfoDescName; private System.Windows.Forms.Label txtInfoDescName;
private System.Windows.Forms.Label txtInfoDescSize; private System.Windows.Forms.Label txtInfoDescSize;
private System.Windows.Forms.Timer refresh; 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;
} }
} }

View file

@ -102,17 +102,17 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e)
IsFileSaveDialog = true; IsFileSaveDialog = true;
} }
if (IsFileOpenDialog == true) if (IsFileOpenDialog)
{ {
pnlSave.Show(); pnlSave.Show();
Button1.Text = "Open"; btnSave.Text = "Open";
} }
else else
{ {
if (IsFileSaveDialog == true) if (IsFileSaveDialog)
{ {
pnlSave.Show(); pnlSave.Show();
Button1.Text = "Save"; btnSave.Text = "Save";
} }
} }
@ -139,9 +139,9 @@ string ReadDataFile(string reqDirectory, bool returnYesIfProtected = false) {
FileSystemFolderInfo toRead = new FileSystemFolderInfo(); FileSystemFolderInfo toRead = new FileSystemFolderInfo();
toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo); toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo);
if (returnYesIfProtected == true) if (returnYesIfProtected)
{ {
if (toRead.IsProtected == true) if (toRead.IsProtected)
{ {
return "yes"; return "yes";
} }
@ -655,7 +655,7 @@ void mainView_DoubleClick(object sender, EventArgs e)
} }
else else
{ // If it is a file { // If it is a file
if (IsFileOpenDialog == true || IsFileSaveDialog == true) if (IsFileOpenDialog || IsFileSaveDialog)
{ {
if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension)
{ {
@ -734,31 +734,18 @@ private void Button1_Click(object sender, EventArgs e)
{ {
try try
{ {
bool OpenFile = false;
if (mainView.FocusedItem != null) if (mainView.FocusedItem != null)
{ {
if ((string)mainView.FocusedItem.Tag == "") if (mainView.FocusedItem.Tag.ToString() == "")
{ // If it isn't a file { // If it isn't a file
GoToDir(Path.Combine(CurrentDirectory, mainView.FocusedItem.Tag.ToString())); 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);
} }
if (txtSave.Text == "") wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK);
else else
{ {
if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text);
{
Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text);
}
FileDialogBoxManager.IsInOpenDialog = false; FileDialogBoxManager.IsInOpenDialog = false;
FileDialogBoxManager.IsInSaveDialog = false; FileDialogBoxManager.IsInSaveDialog = false;
@ -766,9 +753,7 @@ private void Button1_Click(object sender, EventArgs e)
((Form)this.TopLevelControl).Close(); ((Form)this.TopLevelControl).Close();
} }
} }
} catch { catch { }
}
} }
private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
@ -929,7 +914,7 @@ private void btnFolderClose_Click(object sender, EventArgs e)
private void FoldersToolStripMenuItem_Click(object sender, EventArgs e) private void FoldersToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (FoldersToolStripMenuItem.Checked == true) if (FoldersToolStripMenuItem.Checked)
{ {
FoldersToolStripMenuItem.Checked = false; FoldersToolStripMenuItem.Checked = false;
pnlFolders.Hide(); pnlFolders.Hide();
@ -973,7 +958,7 @@ private void mainView_SelectedIndexChanged(object sender, EventArgs e)
} }
} }
if (recognized == true) if (recognized)
{ {
// TODO: // TODO:
} else { } else {
@ -1137,5 +1122,36 @@ private void SellectAllCtrlAToolStripMenuItem_Click(object sender, EventArgs e)
item.Selected = true; 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 { }
}
} }
} }

View file

@ -37,7 +37,7 @@ public bool PreFilterMessage(ref Message m)
if (!ClientRectangle.Contains(PointToClient(Control.MousePosition))) if (!ClientRectangle.Contains(PointToClient(Control.MousePosition)))
{ {
sidebar.Hide(); sidebar.Hide();
if (OnceRemoveHeight == false) if (!OnceRemoveHeight)
{ {
this.Height -= 28; this.Height -= 28;
OnceRemoveHeight = true; OnceRemoveHeight = true;
@ -49,7 +49,7 @@ public bool PreFilterMessage(ref Message m)
} else } else
{ {
sidebar.Show(); sidebar.Show();
if (OnceAddHeight == false) if (!OnceAddHeight)
{ {
this.Height += 28; this.Height += 28;
OnceAddHeight = true; OnceAddHeight = true;
@ -95,7 +95,7 @@ private void button2_Click(object sender, EventArgs e)
{ {
try try
{ {
if (!RequestingNewName == false) if (!RequestingNewName)
{ {
if (textBox1.Text == "") if (textBox1.Text == "")
{ {

View file

@ -46,7 +46,7 @@ private void btnOk_Click(object sender, EventArgs e)
if (!(txtProfName.Text.Length > 20)) if (!(txtProfName.Text.Length > 20))
{ {
ProfileName = txtProfName.Text; ProfileName = txtProfName.Text;
if (DevMode == true) if (DevMode)
{ {
if (Directory.Exists(ProfileDirectory)) if (Directory.Exists(ProfileDirectory))
{ {
@ -84,7 +84,7 @@ private void btnOk_Click(object sender, EventArgs e)
private void NewGameDialog_Load(object sender, EventArgs e) private void NewGameDialog_Load(object sender, EventArgs e)
{ {
if (DevMode == true) if (DevMode)
{ {
btnDevMode.Show(); btnDevMode.Show();
} }

View file

@ -193,7 +193,7 @@ void EndScan(bool successful)
{ {
pnlResolved.Visible = true; pnlResolved.Visible = true;
label1.Hide(); label1.Hide();
if (successful == true) if (successful)
{ {
label2.Text = "The issue has been resolved."; label2.Text = "The issue has been resolved.";

View file

@ -69,7 +69,7 @@ public void StartGame()
frm95.TopMost = true; frm95.TopMost = true;
frm95.FormBorderStyle = FormBorderStyle.None; frm95.FormBorderStyle = FormBorderStyle.None;
frm95.WindowState = FormWindowState.Maximized; 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.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text));
// frm95.FormBorderStyle = FormBorderStyle.Fixed3D; // frm95.FormBorderStyle = FormBorderStyle.Fixed3D;
@ -83,7 +83,7 @@ public void StartGame()
frm98.TopMost = true; frm98.TopMost = true;
frm98.FormBorderStyle = FormBorderStyle.None; frm98.FormBorderStyle = FormBorderStyle.None;
frm98.WindowState = FormWindowState.Maximized; 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.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text));
// frm98.FormBorderStyle = FormBorderStyle.Fixed3D; // frm98.FormBorderStyle = FormBorderStyle.Fixed3D;
@ -97,7 +97,7 @@ public void StartGame()
frmBadXP.TopMost = true; frmBadXP.TopMost = true;
frmBadXP.FormBorderStyle = FormBorderStyle.None; frmBadXP.FormBorderStyle = FormBorderStyle.None;
frmBadXP.WindowState = FormWindowState.Maximized; 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.Size = new Size(Convert.ToInt32(VM_Width.Text), Convert.ToInt32(VM_Height.Text));
// frm98.FormBorderStyle = FormBorderStyle.Fixed3D; // frm98.FormBorderStyle = FormBorderStyle.Fixed3D;
@ -178,7 +178,7 @@ private void NewGame_Click(object sender, EventArgs e)
newGameBox = new NewGameDialog(); newGameBox = new NewGameDialog();
newGameBox.ShowDialog(); newGameBox.ShowDialog();
if (newGameBox.Successful == true) if (newGameBox.Successful)
{ {
NewGame(); NewGame();
StartGame(); StartGame();
@ -232,7 +232,7 @@ private void LoadGame_Click(object sender, EventArgs e)
loadGameBox = new LoadGameDialog(); loadGameBox = new LoadGameDialog();
loadGameBox.ShowDialog(); loadGameBox.ShowDialog();
if (loadGameBox.successful == true) if (loadGameBox.successful)
{ {
LoadSave(); LoadSave();
SetTheme(); SetTheme();
@ -262,7 +262,7 @@ private void gameversion_MouseLeave(object sender, EventArgs e)
private void startbutton_Click(object sender, EventArgs e) private void startbutton_Click(object sender, EventArgs e)
{ {
if (DevMode == true) if (DevMode)
{ {
DevMode = false; DevMode = false;
gameversion.Text = "Developer Mode Deactivated"; gameversion.Text = "Developer Mode Deactivated";
@ -296,7 +296,7 @@ private void achievementsToolStripMenuItem_Click(object sender, EventArgs e)
private void vm_mode_CheckStateChanged(object sender, EventArgs e) private void vm_mode_CheckStateChanged(object sender, EventArgs e)
{ {
// Check for VM mode // Check for VM mode
if (vm_mode.Checked == true) if (vm_mode.Checked)
{ {
VM_Width.Visible = true; VM_Width.Visible = true;
VM_Height.Visible = true; VM_Height.Visible = true;