-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update json settings logic, splash window and names format
- Loading branch information
Showing
14 changed files
with
169 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
using Utils; | ||
|
||
namespace MemoryNumbers; | ||
|
||
partial class FrmMain | ||
{ | ||
private void Exit_Click(object sender, EventArgs e) | ||
{ | ||
Close(); | ||
} | ||
|
||
private async void Start_Click(object sender, EventArgs e) | ||
{ | ||
// Commute visibility of the strip buttons | ||
this.toolStripMain_Start.Enabled = false; | ||
this.toolStripMain_Settings.Enabled = false; | ||
this.toolStripMain_Stats.Checked = false; | ||
this.toolStripMain_Stats.Enabled = false; | ||
|
||
// Show the board | ||
this.tabGame.SelectedIndex = 0; | ||
|
||
// Always reset before starting a new game | ||
_game.ReSet(); | ||
|
||
// Show the score in the status bar | ||
this.toolStripStatusLabel_Secuence.Text = _game.CurrentScore.ToString(); | ||
this.toolStripStatusLabel_Secuence.Invalidate(); | ||
|
||
if (_game.Start()) | ||
{ | ||
board1.Visible = true; | ||
if (await board1.Start(_game.GetSequence, _game.TimeTotal) == false) | ||
{ | ||
Stop_Click(null, null); | ||
using (new CenterWinDialog(this)) | ||
MessageBox.Show("Could not place the buttons on the screen.\nPlease, try reducing the 'numbers ratio' paremeter in\nthe Settings (between 0.25 - 0.30).", "Error placing numbers", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
else | ||
{ | ||
using (new CenterWinDialog(this)) | ||
MessageBox.Show("Could not start the game.\nUnexpected error.", "Error StartClick", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
|
||
} | ||
|
||
private void Stop_Click(object sender, EventArgs e) | ||
{ | ||
board1.ClearBoard(); | ||
this.toolStripStatusLabel_Secuence.Text = ""; | ||
this.toolStripStatusLabel_Secuence.Invalidate(); | ||
|
||
// Commute visibility of the strip buttons | ||
this.toolStripMain_Start.Enabled = true; | ||
this.toolStripMain_Settings.Enabled = true; | ||
this.toolStripMain_Stats.Enabled = true; | ||
|
||
// Update the charts | ||
ChartStatsNumbers_Update(); | ||
ChartStatsTime_Update(); | ||
} | ||
|
||
private void Sound_CheckedChanged(object sender, EventArgs e) | ||
{ | ||
this.board1.PlaySounds = !toolStripMain_Sound.Checked; | ||
} | ||
|
||
private void Stats_CheckedChanged(object sender, EventArgs e) | ||
{ | ||
this.tabGame.SelectedIndex = toolStripMain_Stats.Checked ? 1 : 0; | ||
} | ||
|
||
private void Settings_Click(object sender, EventArgs e) | ||
{ | ||
FrmSettings form = new(_settings); | ||
form.ShowDialog(this); | ||
if (form.DialogResult == DialogResult.OK) | ||
{ | ||
_settings = form.Settings; | ||
ApplySettingsJSON(); | ||
} | ||
} | ||
|
||
private void About_Click(object sender, EventArgs e) | ||
{ | ||
FrmAbout form = new(); | ||
form.ShowDialog(this); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
namespace MemoryNumbers; | ||
|
||
partial class frmAbout : Form | ||
partial class FrmAbout : Form | ||
{ | ||
|
||
#region Descriptores de acceso de atributos de ensamblado | ||
|
@@ -23,7 +23,7 @@ public string AssemblyTitle | |
return titleAttribute.Title; | ||
} | ||
} | ||
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); | ||
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location); | ||
} | ||
} | ||
|
||
|
@@ -89,7 +89,7 @@ public string AssemblyCompany | |
|
||
#endregion | ||
|
||
public frmAbout() | ||
public FrmAbout() | ||
{ | ||
InitializeComponent(); | ||
// this.Text = String.Format("About {0}", AssemblyTitle); | ||
|
@@ -107,7 +107,7 @@ public frmAbout() | |
if (System.IO.File.Exists(path + @"\images\[email protected]")) this.logoPictureBox.Image = new Bitmap(path + @"\images\[email protected]"); | ||
} | ||
|
||
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] | ||
//[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] | ||
protected override void WndProc(ref Message m) | ||
{ | ||
const int WM_PARENTNOTIFY = 0x210; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.