diff --git a/PuzzlePlayer/BlackJack.cs b/PuzzlePlayer/BlackJack.cs new file mode 100644 index 0000000000000000000000000000000000000000..9600bfd2daa676742575759ee93eb5cd796bef61 --- /dev/null +++ b/PuzzlePlayer/BlackJack.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace PuzzlePlayer_Namespace +{ + internal class BlackJack : Form + { + public BlackJack() + { + Paint += BlackJack_Paint; + Size = new Size(500, 400); + } + + private void BlackJack_Paint(object sender, System.Windows.Forms.PaintEventArgs e) + { + Graphics g = e.Graphics; + string s = "CRAZY BLACKJACK READY TO GO GAMBLING??"; + Point p = new Point(0,0); + + Image img = Image.FromFile("../../..//Resources/bj.jpg"); + + g.DrawImage(img,new Point(0,0)); + + g.DrawString(s, SettingForm.mainFont, Brushes.Red, p); + } + } +} diff --git a/PuzzlePlayer/PuzzlePlayer.cs b/PuzzlePlayer/PuzzlePlayer.cs index 309616690bfed65c8debd91294298045c562ad38..4c663b459708220e7aae0c1d7d2a48065d415009 100644 --- a/PuzzlePlayer/PuzzlePlayer.cs +++ b/PuzzlePlayer/PuzzlePlayer.cs @@ -10,14 +10,14 @@ namespace PuzzlePlayer_Namespace { internal static void Main(string[] args) { - Application.Run(new MainForm()); //nnew PuzzleForm(new Maze()) + Application.Run(new MainForm()); } } internal class MainForm : Form { List<PuzzleForm> puzzleForms = new List<PuzzleForm>(); - + BlackJack bj; public MainForm() { SetUpPuzzleForms(); @@ -154,12 +154,50 @@ namespace PuzzlePlayer_Namespace this.MinimumSize = new Size(button.Width + 56, button.Height + 83); } } + // add BlackJackbutton + buttonsPanel.Controls.Add(SetUpBlackJackButton()); + this.Controls.Add(menuStrip); this.Controls.Add(buttonsPanel); menuStrip.Items.Add(menuSettings); menuStrip.BringToFront(); } + + RoundedButton SetUpBlackJackButton() + { + RoundedButton blackJackButton = new RoundedButton(); + bj = new BlackJack(); + blackJackButton.Text = "BlackJack"; + blackJackButton.Margin = new Padding(10); + blackJackButton.Height = 345; + blackJackButton.Width = 345; + blackJackButton.Image = Image.FromFile("../../..//Resources/bj.jpg"); + blackJackButton.FlatStyle = FlatStyle.Flat; + blackJackButton.Font = SettingForm.mainFont; + blackJackButton.Click += (object o, EventArgs e) => { + this.Hide(); + + bj.FormClosed += (object o, FormClosedEventArgs fcea) => + { + this.BackColor = SettingForm.primaryColor; + this.ForeColor = SettingForm.tertiaryColor; + + foreach (Control control in this.Controls) + { + SettingForm.UpdateSettings(control); + } + + this.Show(); + bj = new BlackJack(); //cheeky dw + }; + bj.Show(); + + }; + return blackJackButton; + } } + + } diff --git a/PuzzlePlayer/PuzzlePlayer.csproj.user b/PuzzlePlayer/PuzzlePlayer.csproj.user index dfd866b260ac6e27afb88adc82aa59c2a1d77174..028d9f73b869302c8bce61d8918ec075864c5880 100644 --- a/PuzzlePlayer/PuzzlePlayer.csproj.user +++ b/PuzzlePlayer/PuzzlePlayer.csproj.user @@ -2,6 +2,9 @@ <Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup /> <ItemGroup> + <Compile Update="BlackJack.cs"> + <SubType>Form</SubType> + </Compile> <Compile Update="PuzzleForm.cs"> <SubType>Form</SubType> </Compile> diff --git a/PuzzlePlayer/Resources/bj.jpg b/PuzzlePlayer/Resources/bj.jpg new file mode 100644 index 0000000000000000000000000000000000000000..239d07ecac80bb6837d05831baa106b571d72452 Binary files /dev/null and b/PuzzlePlayer/Resources/bj.jpg differ