diff options
| author | lempamo <[email protected]> | 2017-07-30 00:10:22 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-07-30 00:10:22 -0400 |
| commit | 077fef3baf82e23a4a03bb3c73d83f8d8103fdb9 (patch) | |
| tree | 7136fb69ca87b175aee39e6a04b4e998905f22a0 /TimeHACK.Engine/Template/Infobox95.cs | |
| parent | 71ccea956dc85e8b293dc8a30fbbf91b2709897f (diff) | |
| download | histacom2-077fef3baf82e23a4a03bb3c73d83f8d8103fdb9.tar.gz histacom2-077fef3baf82e23a4a03bb3c73d83f8d8103fdb9.tar.bz2 histacom2-077fef3baf82e23a4a03bb3c73d83f8d8103fdb9.zip | |
better infoboxes
Diffstat (limited to 'TimeHACK.Engine/Template/Infobox95.cs')
| -rw-r--r-- | TimeHACK.Engine/Template/Infobox95.cs | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/TimeHACK.Engine/Template/Infobox95.cs b/TimeHACK.Engine/Template/Infobox95.cs index e764e47..ea257b2 100644 --- a/TimeHACK.Engine/Template/Infobox95.cs +++ b/TimeHACK.Engine/Template/Infobox95.cs @@ -1,5 +1,6 @@ using System; using System.Drawing; +using System.Media; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -7,14 +8,75 @@ namespace TimeHACK.Engine.Template { public partial class Infobox95 : UserControl { - public Infobox95() + 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.Hide(); + button2.Hide(); + button3.Text = "OK"; + break; + } } - private void ok_Click(object sender, EventArgs e) + private void button2_Click(object sender, EventArgs e) { this.ParentForm.Close(); } + + private void button3_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 } } |
