From 3306d36ecbc024775972e5cf7971b2a7a70671d0 Mon Sep 17 00:00:00 2001 From: lempamo Date: Wed, 23 Aug 2017 13:38:40 -0400 Subject: Renaming the game! --- Histacom2.Engine/Template/Infobox95.cs | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Histacom2.Engine/Template/Infobox95.cs (limited to 'Histacom2.Engine/Template/Infobox95.cs') diff --git a/Histacom2.Engine/Template/Infobox95.cs b/Histacom2.Engine/Template/Infobox95.cs new file mode 100644 index 0000000..f0ed0db --- /dev/null +++ b/Histacom2.Engine/Template/Infobox95.cs @@ -0,0 +1,87 @@ +using System; +using System.Drawing; +using System.Media; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace Histacom2.Engine.Template +{ + public partial class Infobox95 : UserControl + { + int btnStatus = 0; + + public Infobox95(InfoboxType type, InfoboxButtons btns) + { + InitializeComponent(); + button1.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); + button2.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); + button3.Paint += (sender, args) => Paintbrush.PaintClassicBorders(sender, args, 2); + + switch (type) + { + case InfoboxType.Info: + pictureBox1.Image = Properties.Resources.Win95Info; + SoundPlayer spa = new SoundPlayer(SaveSystem.currentTheme.asteriskSound); + spa.Play(); + break; + case InfoboxType.Question: + pictureBox1.Image = Properties.Resources.Win95Question; + SoundPlayer spq = new SoundPlayer(SaveSystem.currentTheme.questionSound); + spq.Play(); + break; + case InfoboxType.Warning: + pictureBox1.Image = Properties.Resources.Win95Warning; + SoundPlayer spw = new SoundPlayer(SaveSystem.currentTheme.exclamationSound); + spw.Play(); + break; + case InfoboxType.Error: + pictureBox1.Image = Properties.Resources.Win95Error; + SoundPlayer spe = new SoundPlayer(SaveSystem.currentTheme.critStopSound); + spe.Play(); + break; + } + + btnStatus = (int)btns; + switch (btns) + { + case InfoboxButtons.OK: + button1.Text = "OK"; + button2.Hide(); + button3.Hide(); + break; + } + } + + private void button2_Click(object sender, EventArgs e) + { + this.ParentForm.Close(); + } + + private void button3_Click(object sender, EventArgs e) + { + + } + + private void button1_Click(object sender, EventArgs e) + { + if (btnStatus == 0) this.ParentForm.Close(); + } + } + + public enum InfoboxType + { + Info, + Question, + Warning, + Error + } + + public enum InfoboxButtons + { + OK, + OKCancel, + YesNo, + YesNoCancel, + AbortRetryFail + } +} -- cgit v1.2.3