...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"));
FileSystemFolderInfo toRead = JsonConvert.DeserializeObject<FileSystemFolderInfo>(directoryFileInfo);
if (returnYesIfProtected == true)
if (returnYesIfProtected)
{
if (toRead.IsProtected == true)
if (toRead.IsProtected)
{
return "yes";
}

View file

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

View file

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

View file

@ -45,7 +45,7 @@ public static extern int SendMessage(IntPtr hWnd,
private void Programtopbar_drag(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left && max == false)
if (e.Button == MouseButtons.Left && !max)
{
ReleaseCapture();
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)
{
if (max == false)
if (!max)
{
this.right.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)
{
if (e.Button == MouseButtons.Left && max == false)
if (e.Button == MouseButtons.Left && !max)
{
ReleaseCapture();
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 dropDownShown;
public override string Text
{
get
{
return textBox1.Text;
}
set
{
textBox1.Text = value;
}
}
public static Color textboxcolor = Color.Black;
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 _darkBack = Color.Silver;
public override string Text
{
get
{
return textBox1.Text;
}
set
{
textBox1.Text = value;
}
}
public ClassicTextBox()
{
InitializeComponent();

View file

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

View file

@ -99,17 +99,22 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e)
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
if (CurrentFilePath == "")
{
// We aren't in a file right now
SaveAs();
} else {
}
else
{
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 @@ void SaveAs()
{
ActivateSaveFileDialog(".txt");
string selectedPath = Program.OpenFileExplorerAsDialogAndReturnGivenPath();
DeactivateFileDialog();
if (selectedPath != "")
{

View file

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

View file

@ -108,7 +108,7 @@ private void Click(object sender, EventArgs e)
this.Open();
}
}
if (_game.ftime == true && !Minded)
if (_game.ftime && !Minded)
{
_game.ftime = false;
_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)
{
if (_game.win == true)
if (_game.win)
{
button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperWin;
switch (level)

View file

@ -74,7 +74,7 @@ public static async void ContinueObjective()
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;

View file

@ -53,13 +53,13 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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);

View file

@ -109,14 +109,14 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e)
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 @@ string ReadDataFile(string reqDirectory, bool returnYesIfProtected = false) {
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,18 +717,14 @@ private void btnSave_Click(object sender, EventArgs e)
{
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
{
@ -740,7 +736,6 @@ private void btnSave_Click(object sender, EventArgs e)
((Form)this.TopLevelControl).Close();
}
}
}
catch { }
}
@ -1041,5 +1036,10 @@ private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
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)
{
try
{
Point objDrawingPoint = ftpFiles.PointToClient(Cursor.Position);
ListViewItem objListViewItem = new ListViewItem();
@ -116,6 +118,7 @@ private void ftpItems_Click(object sender, EventArgs e)
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)

View file

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

View file

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

View file

@ -52,9 +52,12 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
//
// 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
// btnCanc
//
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);
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);
//
// Label1
// cmbType
//
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:";
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 void InitializeComponent()
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;
}
}

View file

@ -102,17 +102,17 @@ void WinClassicWindowsExplorer_Load(object sender, EventArgs e)
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 @@ string ReadDataFile(string reqDirectory, bool returnYesIfProtected = false) {
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 @@ void mainView_DoubleClick(object sender, EventArgs e)
}
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,31 +734,18 @@ private void Button1_Click(object sender, EventArgs e)
{
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 OpenFile = true;
if (OpenFile == true)
{
if (txtSave.Text == "")
{
wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK);
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);
}
if (new FileInfo(Path.Combine(CurrentDirectory, txtSave.Text)).Extension == onlyViewExtension) Program.WindowsExplorerReturnPath = Path.Combine(CurrentDirectory, txtSave.Text);
FileDialogBoxManager.IsInOpenDialog = false;
FileDialogBoxManager.IsInSaveDialog = false;
@ -766,9 +753,7 @@ private void Button1_Click(object sender, EventArgs e)
((Form)this.TopLevelControl).Close();
}
}
} catch {
}
catch { }
}
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)
{
if (FoldersToolStripMenuItem.Checked == true)
if (FoldersToolStripMenuItem.Checked)
{
FoldersToolStripMenuItem.Checked = false;
pnlFolders.Hide();
@ -973,7 +958,7 @@ private void mainView_SelectedIndexChanged(object sender, EventArgs e)
}
}
if (recognized == true)
if (recognized)
{
// TODO:
} else {
@ -1137,5 +1122,36 @@ private void SellectAllCtrlAToolStripMenuItem_Click(object sender, EventArgs e)
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)))
{
sidebar.Hide();
if (OnceRemoveHeight == false)
if (!OnceRemoveHeight)
{
this.Height -= 28;
OnceRemoveHeight = true;
@ -49,7 +49,7 @@ public bool PreFilterMessage(ref Message m)
} else
{
sidebar.Show();
if (OnceAddHeight == false)
if (!OnceAddHeight)
{
this.Height += 28;
OnceAddHeight = true;
@ -95,7 +95,7 @@ private void button2_Click(object sender, EventArgs e)
{
try
{
if (!RequestingNewName == false)
if (!RequestingNewName)
{
if (textBox1.Text == "")
{

View file

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

View file

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

View file

@ -69,7 +69,7 @@ public void StartGame()
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 @@ public void StartGame()
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 @@ public void StartGame()
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 @@ private void NewGame_Click(object sender, EventArgs e)
newGameBox = new NewGameDialog();
newGameBox.ShowDialog();
if (newGameBox.Successful == true)
if (newGameBox.Successful)
{
NewGame();
StartGame();
@ -232,7 +232,7 @@ private void LoadGame_Click(object sender, EventArgs e)
loadGameBox = new LoadGameDialog();
loadGameBox.ShowDialog();
if (loadGameBox.successful == true)
if (loadGameBox.successful)
{
LoadSave();
SetTheme();
@ -262,7 +262,7 @@ private void gameversion_MouseLeave(object sender, EventArgs e)
private void startbutton_Click(object sender, EventArgs e)
{
if (DevMode == true)
if (DevMode)
{
DevMode = false;
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)
{
// Check for VM mode
if (vm_mode.Checked == true)
if (vm_mode.Checked)
{
VM_Width.Visible = true;
VM_Height.Visible = true;