mirror of
https://github.com/HistacomUnity/Histacom2-old.git
synced 2025-01-22 09:02:01 -05:00
7f5d0c3915
Error Blaster is updated with a new type: "Memory Leak." After the messageGen timer interval hits 300, the PC BSODs. Start Runner is also in there, however it is not functional due to unknown reasons.
97 lines
2.9 KiB
C#
97 lines
2.9 KiB
C#
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();
|
|
this.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
|
|
this.programContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
|
|
|
|
switch (type)
|
|
{
|
|
case InfoboxType.Info:
|
|
pictureBox1.Image = Properties.Resources.Win95Info;
|
|
SoundPlayer spa = new SoundPlayer(SaveSystem.currentTheme.asteriskSound);
|
|
spa.Play();
|
|
spa.Stream.Position = 0;
|
|
|
|
break;
|
|
case InfoboxType.Question:
|
|
pictureBox1.Image = Properties.Resources.Win95Question;
|
|
SoundPlayer spq = new SoundPlayer(SaveSystem.currentTheme.questionSound);
|
|
spq.Play();
|
|
spq.Stream.Position = 0;
|
|
break;
|
|
case InfoboxType.Warning:
|
|
pictureBox1.Image = Properties.Resources.Win95Warning;
|
|
SoundPlayer spw = new SoundPlayer(SaveSystem.currentTheme.exclamationSound);
|
|
spw.Play();
|
|
spw.Stream.Position = 0;
|
|
break;
|
|
case InfoboxType.Error:
|
|
pictureBox1.Image = Properties.Resources.Win95Error;
|
|
SoundPlayer spe = new SoundPlayer(SaveSystem.currentTheme.critStopSound);
|
|
spe.Play();
|
|
spe.Stream.Position = 0;
|
|
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();
|
|
}
|
|
|
|
private void programContent_Paint(object sender, PaintEventArgs e)
|
|
{
|
|
this.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
|
|
this.programContent.BackColor = SaveSystem.currentTheme.threeDObjectsColor;
|
|
}
|
|
}
|
|
|
|
public enum InfoboxType
|
|
{
|
|
Info,
|
|
Question,
|
|
Warning,
|
|
Error
|
|
}
|
|
|
|
public enum InfoboxButtons
|
|
{
|
|
OK,
|
|
OKCancel,
|
|
YesNo,
|
|
YesNoCancel,
|
|
AbortRetryFail
|
|
}
|
|
}
|