better infoboxes

This commit is contained in:
lempamo 2017-07-30 00:10:22 -04:00
parent 71ccea956d
commit 077fef3baf
24 changed files with 272 additions and 103 deletions

View file

@ -199,6 +199,51 @@ public static System.Drawing.Bitmap Win95Info {
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
public static System.IO.UnmanagedMemoryStream Win95PlusDangerousCreaturesAsterisk {
get {
return ResourceManager.GetStream("Win95PlusDangerousCreaturesAsterisk", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
public static System.IO.UnmanagedMemoryStream Win95PlusDangerousCreaturesCritStop {
get {
return ResourceManager.GetStream("Win95PlusDangerousCreaturesCritStop", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
public static System.IO.UnmanagedMemoryStream Win95PlusDangerousCreaturesExclamation {
get {
return ResourceManager.GetStream("Win95PlusDangerousCreaturesExclamation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
public static System.IO.UnmanagedMemoryStream Win95PlusDangerousCreaturesProgError {
get {
return ResourceManager.GetStream("Win95PlusDangerousCreaturesProgError", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
public static System.IO.UnmanagedMemoryStream Win95PlusDangerousCreaturesQuestion {
get {
return ResourceManager.GetStream("Win95PlusDangerousCreaturesQuestion", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
@ -246,6 +291,16 @@ public static System.Drawing.Bitmap Win95PlusInsideComputerWallpaper {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Win95Question {
get {
object obj = ResourceManager.GetObject("Win95Question", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>

View file

@ -208,4 +208,22 @@
<data name="Win95PlusInsideComputerWallpaper" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Win95PlusInsideComputerWallpaper.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Win95PlusDangerousCreaturesAsterisk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Win95PlusDangerousCreaturesAsterisk.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Win95PlusDangerousCreaturesCritStop" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Win95PlusDangerousCreaturesCritStop.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Win95PlusDangerousCreaturesExclamation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Win95PlusDangerousCreaturesExclamation.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Win95PlusDangerousCreaturesProgError" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Win95PlusDangerousCreaturesProgError.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Win95PlusDangerousCreaturesQuestion" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Win95PlusDangerousCreaturesQuestion.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="Win95Question" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\WinClassic\Window\Win95Question.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

View file

@ -153,6 +153,7 @@ public static void NewGame()
public static void CheckFiles()
{
Directory.CreateDirectory(GameDirectory);
Directory.CreateDirectory(DataDirectory);
Directory.CreateDirectory(AllProfilesDirectory);
Directory.CreateDirectory(ProfileDirectory);
Directory.CreateDirectory(ProfileFileSystemDirectory);

View file

@ -29,10 +29,12 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
this.programContent = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.infoText = new System.Windows.Forms.Label();
this.ok = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.programContent.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
@ -41,22 +43,51 @@ private void InitializeComponent()
// programContent
//
this.programContent.BackColor = System.Drawing.Color.Silver;
this.programContent.Controls.Add(this.button1);
this.programContent.Controls.Add(this.button3);
this.programContent.Controls.Add(this.pictureBox1);
this.programContent.Controls.Add(this.panel1);
this.programContent.Controls.Add(this.ok);
this.programContent.Controls.Add(this.button2);
this.programContent.Dock = System.Windows.Forms.DockStyle.Fill;
this.programContent.Location = new System.Drawing.Point(0, 0);
this.programContent.Name = "programContent";
this.programContent.Size = new System.Drawing.Size(421, 164);
this.programContent.Size = new System.Drawing.Size(413, 138);
this.programContent.TabIndex = 10;
this.programContent.Tag = "gnoreFormOnTaskbar";
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button1.Location = new System.Drawing.Point(150, 104);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(80, 23);
this.button1.TabIndex = 5;
this.button1.Text = "Yes";
this.button1.UseVisualStyleBackColor = true;
//
// button3
//
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button3.Location = new System.Drawing.Point(323, 104);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(80, 23);
this.button3.TabIndex = 4;
this.button3.Text = "Cancel";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// pictureBox1
//
this.pictureBox1.ErrorImage = null;
this.pictureBox1.Image = global::TimeHACK.Engine.Properties.Resources.Win95Warning;
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(8, 33);
this.pictureBox1.Location = new System.Drawing.Point(15, 16);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 3;
@ -65,34 +96,33 @@ private void InitializeComponent()
// panel1
//
this.panel1.Controls.Add(this.infoText);
this.panel1.Location = new System.Drawing.Point(57, 33);
this.panel1.Location = new System.Drawing.Point(62, 16);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(337, 96);
this.panel1.Size = new System.Drawing.Size(341, 82);
this.panel1.TabIndex = 2;
//
// infoText
//
this.infoText.AutoSize = true;
this.infoText.Dock = System.Windows.Forms.DockStyle.Fill;
this.infoText.Location = new System.Drawing.Point(0, 0);
this.infoText.Name = "infoText";
this.infoText.Size = new System.Drawing.Size(35, 13);
this.infoText.Size = new System.Drawing.Size(341, 82);
this.infoText.TabIndex = 0;
this.infoText.Text = "label1";
//
// ok
// button2
//
this.ok.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ok.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.ok.Location = new System.Drawing.Point(169, 135);
this.ok.Name = "ok";
this.ok.Size = new System.Drawing.Size(83, 23);
this.ok.TabIndex = 1;
this.ok.Text = "OK";
this.ok.UseVisualStyleBackColor = true;
this.ok.Click += new System.EventHandler(this.ok_Click);
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button2.Location = new System.Drawing.Point(236, 104);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(80, 23);
this.button2.TabIndex = 1;
this.button2.Text = "No";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Infobox95
//
@ -100,11 +130,10 @@ private void InitializeComponent()
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.programContent);
this.Name = "Infobox95";
this.Size = new System.Drawing.Size(421, 164);
this.Size = new System.Drawing.Size(413, 138);
this.programContent.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
@ -115,6 +144,8 @@ private void InitializeComponent()
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel panel1;
public System.Windows.Forms.Label infoText;
private System.Windows.Forms.Button ok;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button1;
}
}

View file

@ -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
}
}

View file

@ -15,6 +15,7 @@ public class Theme
public Stream asteriskSound { get; set; }
public Stream critStopSound { get; set; }
public Stream exclamationSound { get; set; }
public Stream progErrorSound { get; set; }
public Stream questionSound { get; set; }
@ -32,6 +33,7 @@ public Default95Theme()
asteriskSound = Properties.Resources.CHORD;
critStopSound = Properties.Resources.CHORD;
exclamationSound = Properties.Resources.CHORD;
progErrorSound = Properties.Resources.CHORD;
questionSound = Properties.Resources.CHORD;
@ -44,11 +46,12 @@ public class Default98Theme : Theme
{
public Default98Theme()
{
startSound = Properties.Resources.Win95Start;
stopSound = Properties.Resources.Win95Stop;
startSound = Properties.Resources.Win98Start;
stopSound = Properties.Resources.Win98Stop;
asteriskSound = Properties.Resources.CHORD;
critStopSound = Properties.Resources.CHORD;
exclamationSound = Properties.Resources.CHORD;
progErrorSound = Properties.Resources.CHORD;
questionSound = Properties.Resources.CHORD;
@ -64,6 +67,12 @@ public DangerousCreaturesTheme()
startSound = Properties.Resources.Win95PlusDangerousCreaturesStart;
stopSound = Properties.Resources.Win95PlusDangerousCreaturesStart;
asteriskSound = Properties.Resources.Win95PlusDangerousCreaturesAsterisk;
critStopSound = Properties.Resources.Win95PlusDangerousCreaturesCritStop;
exclamationSound = Properties.Resources.Win95PlusDangerousCreaturesExclamation;
progErrorSound = Properties.Resources.Win95PlusDangerousCreaturesProgError;
questionSound = Properties.Resources.Win95PlusDangerousCreaturesQuestion;
defaultWallpaper = Properties.Resources.Win95PlusDangerousCreaturesWallpaper;
themeName = "dangeranimals";
}

View file

@ -118,6 +118,11 @@
<None Include="Resources\Win95PlusInsideComputerWallpaper.jpg" />
<None Include="Resources\Win95PlusInsideComputerStop.wav" />
<None Include="Resources\Win95PlusInsideComputerStart.wav" />
<None Include="Resources\Win95PlusDangerousCreaturesAsterisk.wav" />
<None Include="Resources\Win95PlusDangerousCreaturesCritStop.wav" />
<None Include="Resources\Win95PlusDangerousCreaturesExclamation.wav" />
<None Include="Resources\Win95PlusDangerousCreaturesProgError.wav" />
<None Include="Resources\Win95PlusDangerousCreaturesQuestion.wav" />
<Content Include="Resources\WinClassic\Window\BottomLeft.png" />
<Content Include="Resources\WinClassic\Window\BottomRight.png" />
<Content Include="Resources\WinClassic\Window\BottomSide.png" />
@ -130,6 +135,7 @@
<None Include="Resources\WinClassic\Window\Win95Info.png" />
<None Include="Resources\WinClassic\Window\Win95Warning.png" />
<None Include="Resources\WinClassic\Window\Win95Error.png" />
<None Include="Resources\WinClassic\Window\Win95Question.png" />
<Content Include="Resources\WinClassic\Window\WinClassicClose.png" />
<Content Include="Resources\WinClassic\Window\WinClassicMax.png" />
<Content Include="Resources\WinClassic\Window\WinClassicMin.png" />

View file

@ -72,13 +72,13 @@ public WinClassic StartWin95(UserControl content, string title, Image icon, bool
return app;
}
public WinClassic StartInfobox95(string title, string text, Image erroricon)
public WinClassic StartInfobox95(string title, string text, InfoboxType type, InfoboxButtons btns)
{
Infobox95 app = new Infobox95();
pfc.AddFontFile(SaveSystem.GameDirectory + "\\Data\\LeviWindows.ttf");
Infobox95 app = new Infobox95(type, btns);
app.infoText.Text = text;
app.infoText.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0)));
SoundPlayer sp = new SoundPlayer(Properties.Resources.CHORD);
sp.Play();
return StartWin95(app, title, null, false, false);
}

View file

@ -817,6 +817,7 @@ private void InitializeComponent()
this.PrintersToolStripMenuItem.Name = "PrintersToolStripMenuItem";
this.PrintersToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.PrintersToolStripMenuItem.Text = "Printers";
this.PrintersToolStripMenuItem.Click += new System.EventHandler(infoboxTestToolStripMenuItem_Click);
//
// TaskbarToolStripMenuItem
//

View file

@ -175,7 +175,7 @@ private void ShutdownToolStripMenuItem_Click(object sender, EventArgs e)
// Give Year Code - NYI
private void taskbartime_Click(object sender, EventArgs e)
{
//TODO: Set Up Save System
}
// Set the Clock
@ -256,7 +256,7 @@ private void installerTestToolStripMenuItem_Click(object sender, EventArgs e)
private void InternetExplorerToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", Properties.Resources.Win95Warning); return; }
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; }
ie = wm.StartWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
@ -276,7 +276,7 @@ private void desktopicons_DoubleClick(object sender, EventArgs e)
{
if (objListViewItem.Text == "Internet Explorer")
{
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", Properties.Resources.Win95Warning); return; }
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; }
ie = wm.StartWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
@ -301,13 +301,13 @@ private void desktopicons_DoubleClick(object sender, EventArgs e)
}
else if (objListViewItem.Text == "Set Up The Microsoft Network") {
wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", Properties.Resources.Win95Info);
wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", InfoboxType.Info, InfoboxButtons.OK);
} else if (objListViewItem.Text == "Outlook Express") {
wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
//wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
}
else if (objListViewItem.Text == "Inbox")
{
wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
//wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
}
else
{
@ -340,7 +340,7 @@ private void desktopicons_DoubleClick(object sender, EventArgs e)
private void infoboxTestToolStripMenuItem_Click(object sender, EventArgs e)
{
WinClassic app = wm.StartInfobox95("AShifter's Infobox", "This is the very first TimeHACK Infobox. It's really easy to call, too! \n Just use wm.startInfobox95(string title, string text, Image erroricon)!", Properties.Resources.Win95Info);
WinClassic app = wm.StartInfobox95("AShifter's Infobox", "This is the very first TimeHACK Infobox. It's really easy to call, too! \nJust use wm.startInfobox95(string title, string text, InfoboxType type, InfoboxButtons btns)!", InfoboxType.Info, InfoboxButtons.OK);
app.BringToFront();
startmenu.Hide();
@ -514,7 +514,7 @@ private void FolderToolStripMenuItem_Click(object sender, EventArgs e)
{
if (Directory.Exists(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Folder")))
{
wm.StartInfobox95("Windows Explorer", "A folder called New Folder already exists - please rename it.", Properties.Resources.Win95Error);
wm.StartInfobox95("Windows Explorer", "A folder called New Folder already exists - please rename it.", InfoboxType.Error, InfoboxButtons.OK);
}
else
{
@ -527,7 +527,7 @@ private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
{
if (File.Exists(Path.Combine(ProfileWindowsDirectory, "Desktop", "New Text Document.txt")))
{
wm.StartInfobox95("Windows Explorer", "A folder called New Text Document already exists - please rename it.", Properties.Resources.Win95Error);
wm.StartInfobox95("Windows Explorer", "A folder called New Text Document already exists - please rename it.", InfoboxType.Error, InfoboxButtons.OK);
}
else
{
@ -562,11 +562,11 @@ private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
}
else
{
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", Properties.Resources.Win95Error);
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", InfoboxType.Error, InfoboxButtons.OK);
}
}
} else {
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", Properties.Resources.Win95Error);
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", InfoboxType.Error, InfoboxButtons.OK);
}
}
}

View file

@ -58,10 +58,10 @@ private void WebChat1998_Load(object sender, EventArgs e)
}
private void Button1_Click(object sender, EventArgs e)
{
if (txtscreenname.Text == "") { wm.StartInfobox95("Invalid Username", "Your username cannot be blank.", Properties.Resources.Win95Warning); return; }
if (txtscreenname.Text.Length > 12) { wm.StartInfobox95("Invalid Username", "Your username needs to be less than 12 characters.", Properties.Resources.Win95Warning); return; }
if (txtscreenname.Text.Contains(" ")) { wm.StartInfobox95("Invalid Username", "Your username cannot contain spaces.", Properties.Resources.Win95Warning); return; }
if (txtscreenname.Text == "SkyHigh" | txtscreenname.Text == "rain49" | txtscreenname.Text == "12padams") { wm.StartInfobox95("Invalid Username", "That username is already taken.", Properties.Resources.Win95Warning); return; }
if (txtscreenname.Text == "") { wm.StartInfobox95("Invalid Username", "Your username cannot be blank.", InfoboxType.Warning, InfoboxButtons.OK); return; }
if (txtscreenname.Text.Length > 12) { wm.StartInfobox95("Invalid Username", "Your username needs to be less than 12 characters.", InfoboxType.Warning, InfoboxButtons.OK); return; }
if (txtscreenname.Text.Contains(" ")) { wm.StartInfobox95("Invalid Username", "Your username cannot contain spaces.", InfoboxType.Warning, InfoboxButtons.OK); return; }
if (txtscreenname.Text == "SkyHigh" | txtscreenname.Text == "rain49" | txtscreenname.Text == "12padams") { wm.StartInfobox95("Invalid Username", "That username is already taken.", InfoboxType.Warning, InfoboxButtons.OK); return; }
ParentForm.AcceptButton = button2;
TitleScreen.username = txtscreenname.Text;
login.Hide();

View file

@ -160,7 +160,7 @@ void RefreshAll() {
}
}
} catch (Exception ex) {
wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info);
//wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info); add illegal operation dialog here later
((Form)this.TopLevelControl).Close();
}
}
@ -216,7 +216,7 @@ public void OpenFile(string fileDir)
break;
case 12:
OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir));
OpenApplication(FileDialogBoxManager.ReadTextFile(fileDir), fileDir);
break;
}
} catch {
@ -224,7 +224,7 @@ public void OpenFile(string fileDir)
}
void OpenApplication(string appname)
void OpenApplication(string appname, string path)
{
switch (appname.ToLower())
{
@ -251,7 +251,7 @@ void OpenApplication(string appname)
break;
case "ie":
if (TitleScreen.frm95.ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", Properties.Resources.Win95Warning); return; }
if (TitleScreen.frm95.ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; }
TitleScreen.frm95.ie = wm.StartWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
Program.AddTaskbarItem(TitleScreen.frm95.ie, TitleScreen.frm95.ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
TitleScreen.frm95.ie.BringToFront();
@ -275,12 +275,11 @@ void OpenApplication(string appname)
break;
case "iebrokeninstaller":
wm.StartInfobox95("Internet Explorer Installation", "Installation Failed: The INF file was not found", Properties.Resources.Win95Error);
wm.StartInfobox95("Internet Explorer Installer", "Installation Failed: The INF file was not found", InfoboxType.Error, InfoboxButtons.OK);
break;
case "addressbook":
wm.StartInfobox95("Win32 Error", "This is not a valid Win32 Application.", Properties.Resources.Win95Error);
default:
wm.StartInfobox95(path.Replace(ProfileMyComputerDirectory, "C:"), $"{path.Replace(ProfileMyComputerDirectory, "C:")} is not a valid Win32 application.", InfoboxType.Error, InfoboxButtons.OK);
break;
}
}
@ -650,7 +649,8 @@ private void FolderToolStripMenuItem_Click(object sender, EventArgs e)
{
if (File.Exists(CurrentDirectory + "\\New Folder"))
{
wm.StartInfobox95("Windows Explorer", "This directory already exists", Properties.Resources.Win95Info);
//wm.StartInfobox95("Windows Explorer", "This directory already exists", Properties.Resources.Win95Info);
//TODO: add making "New Folder (2)"
}
else
{
@ -681,7 +681,7 @@ private void Button1_Click(object sender, EventArgs e)
{
if (txtSave.Text == "")
{
wm.StartInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
@ -710,7 +710,7 @@ private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!FileOrDirectoryExists(Path.Combine(CurrentDirectory, mainView.FocusedItem.Text)))
{
wm.StartInfobox95("Windows Explorer", "This directory doesn't exist", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "This directory doesn't exist", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
@ -765,19 +765,19 @@ private void mainView_AfterLabelEdit(object sender, LabelEditEventArgs e)
setText = e.Label;
if (setText == "")
{
wm.StartInfobox95("Windows Explorer", "Please enter a new directory name", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "Please enter a new directory name", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
if (Directory.Exists(setText))
{
wm.StartInfobox95("Windows Explorer", "That directory already exists.", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "That directory already exists.", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
if (File.Exists(setText))
{
wm.StartInfobox95("Windows Explorer", "That file already exists.", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "That file already exists.", InfoboxType.Info, InfoboxButtons.OK);
}
else
{

View file

@ -86,7 +86,7 @@ private void btnCopy_Click(object sender, EventArgs e)
if (cmdPrompt.SelectedText.Length > 0)
Clipboard.SetText(cmdPrompt.SelectedText); // Set the clipboard text to the selection of the RichTextBox
else
wm.StartInfobox95("ERROR", "You need to select something to copy.", Properties.Resources.Win95Error); // Display an error message if the length is 0
wm.StartInfobox95("ERROR", "You need to select something to copy.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK); // Display an error message if the length is 0
}
private void btnPaste_Click(object sender, EventArgs e)
@ -94,12 +94,12 @@ private void btnPaste_Click(object sender, EventArgs e)
if (Clipboard.GetText() != "")
Write(Clipboard.GetText()); // Write the contents of the Clipboard text in the RichTextBox
else
wm.StartInfobox95("ERROR", "You need to have something in your clipboard to paste.", Properties.Resources.Win95Error); // Display an error message if the clipboard is null/empty
wm.StartInfobox95("ERROR", "You need to have something in your clipboard to paste.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK); // Display an error message if the clipboard is null/empty
}
private void btnSettings_Click(object sender, EventArgs e)
{
wm.StartInfobox95("INFO", "This feature has not been implemented yet. Stay tuned! -Jason", Properties.Resources.Win95Info);
wm.StartInfobox95("INFO", "This feature has not been implemented yet. Stay tuned! -Jason", Engine.Template.InfoboxType.Info, Engine.Template.InfoboxButtons.OK);
//TODO: Well, add the settings...
}

View file

@ -61,7 +61,7 @@ public WinClassicWordPad()
this.aboutWordpadToolStripMenuItem.Click += (sender, args) => wm.StartAboutBox95("Wordpad", "Microsoft Wordpad", Properties.Resources.Win95IconWordpad);
this.btnNew.Click += (sender, args) => mainText.Text = "";
this.newToolStripMenuItem.Click += (sender, args) => mainText.Text = "";
this.sendToolStripMenuItem.Click += (sender, args) => wm.StartInfobox95("Wordpad", "An error occured opening send option.", null);
this.sendToolStripMenuItem.Click += (sender, args) => wm.StartInfobox95("Wordpad", "An error occured opening send option.", Engine.Template.InfoboxType.Error, Engine.Template.InfoboxButtons.OK);
this.bulletStyleToolStripMenuItem.Click += (sender, args) => mainText.SelectionBullet = bulletStyleToolStripMenuItem.Checked;
this.comboFont.SelectedIndexChanged += (sender, args) => SetSelectedTextFont(comboFont.Text);
this.comboSize.SelectedIndexChanged += (sender, args) => SetSelectedTextSize(comboSize.Text);

View file

@ -158,7 +158,7 @@ private void ShutdownToolStripMenuItem_Click(object sender, EventArgs e)
// Give Year Code - NYI
private void taskbartime_Click(object sender, EventArgs e)
{
//TODO: Set Up Save System
}
// Set the Clock
@ -241,7 +241,7 @@ private void installerTestToolStripMenuItem_Click(object sender, EventArgs e)
private void InternetExplorerToolStripMenuItem_Click(object sender, EventArgs e)
{
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", Properties.Resources.Win95Warning); return; }
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; }
ie = wm.StartWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
@ -261,7 +261,7 @@ private void desktopicons_DoubleClick(object sender, EventArgs e)
{
if (objListViewItem.Text == "Internet Explorer")
{
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", Properties.Resources.Win95Warning); return; }
if (ie != null) { wm.StartInfobox95("Error Opening Internet Explorer", "An instance of Internet Explorer 4 is already open.", InfoboxType.Warning, InfoboxButtons.OK); return; }
ie = wm.StartWin95(new WinClassicIE4(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
@ -287,15 +287,15 @@ private void desktopicons_DoubleClick(object sender, EventArgs e)
}
else if (objListViewItem.Text == "Set Up The Microsoft Network")
{
wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", Properties.Resources.Win95Info);
wm.StartInfobox95("Microsoft Network", "The Microsoft Network is already set up!", InfoboxType.Info, InfoboxButtons.OK);
}
else if (objListViewItem.Text == "Outlook Express")
{
wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
//wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
}
else if (objListViewItem.Text == "Inbox")
{
wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
//wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
}
else
{
@ -328,7 +328,7 @@ private void desktopicons_DoubleClick(object sender, EventArgs e)
private void infoboxTestToolStripMenuItem_Click(object sender, EventArgs e)
{
WinClassic app = wm.StartInfobox95("AShifter's Infobox", "This is the very first TimeHACK Infobox. It's really easy to call, too! \n Just use wm.startInfobox95(string title, string text, Image erroricon)!", Properties.Resources.Win95Info);
WinClassic app = wm.StartInfobox95("AShifter's Infobox", "This is the very first TimeHACK Infobox. It's really easy to call, too! \n Just use wm.startInfobox95(string title, string text, InfoboxType type, InfoboxButtons btns)!", InfoboxType.Info, InfoboxButtons.OK);
app.BringToFront();
startmenu.Hide();
@ -560,13 +560,13 @@ private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
}
else
{
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", Properties.Resources.Win95Error);
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", InfoboxType.Error, InfoboxButtons.OK);
}
}
}
else
{
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", Properties.Resources.Win95Error);
wm.StartInfobox95("Windows Explorer", "This object cannot be deleted.", InfoboxType.Error, InfoboxButtons.OK);
}
}
}

View file

@ -133,7 +133,7 @@ void NewFolder()
}
else
{
wm.StartInfobox95("Address Book - New Folder", "You must enter a folder name!", Properties.Resources.Win95Error);
wm.StartInfobox95("Address Book - New Folder", "You must enter a folder name!", InfoboxType.Error, InfoboxButtons.OK);
}
}
}

View file

@ -195,7 +195,7 @@ void RefreshAll() {
}
}
} catch (Exception ex) {
wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info);
//wm.StartInfobox95("Exploring - C:", "Error with the file explorer \n" + ex.Message, Properties.Resources.Win95Info); add illegal operation dialog here later
((Form)this.TopLevelControl).Close();
}
}
@ -287,7 +287,7 @@ void OpenApplication(string appname)
break;
case "iebrokeninstaller":
wm.StartInfobox95("Internet Explorer Installation", "Installation Failed: The INF file was not found", Properties.Resources.Win95Error);
wm.StartInfobox95("Internet Explorer Installer", "Installation Failed: The INF file was not found", InfoboxType.Error, InfoboxButtons.OK);
break;
case "addressbook":
@ -674,7 +674,7 @@ void GoToDir(string dir)
private void FolderToolStripMenuItem_Click(object sender, EventArgs e)
{
if (File.Exists(CurrentDirectory + "\\New Folder")) {
wm.StartInfobox95("Windows Explorer", "This directory already exists", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "This directory already exists", InfoboxType.Info, InfoboxButtons.OK);
} else {
Directory.CreateDirectory(Path.Combine(CurrentDirectory, "New Folder"));
SaveDirectoryInfo(CurrentDirectory, "New Folder", false, "New Folder", true);
@ -703,7 +703,7 @@ private void Button1_Click(object sender, EventArgs e)
{
if (txtSave.Text == "")
{
wm.StartInfobox95("Windows Explorer", "Please enter a filename", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "Please enter a filename", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
@ -732,7 +732,7 @@ private void DeleteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (!FileOrDirectoryExists(mainView.FocusedItem.ImageKey))
{
wm.StartInfobox95("Windows Explorer", "This directory doesn't exist", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "This directory doesn't exist", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
@ -785,19 +785,19 @@ private void mainView_AfterLabelEdit(object sender, LabelEditEventArgs e)
setText = e.Label;
if (setText == "")
{
wm.StartInfobox95("Windows Explorer", "Please enter a new directory name", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "Please enter a new directory name", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
if (Directory.Exists(setText))
{
wm.StartInfobox95("Windows Explorer", "That directory already exists.", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "That directory already exists.", InfoboxType.Info, InfoboxButtons.OK);
}
else
{
if (File.Exists(setText))
{
wm.StartInfobox95("Windows Explorer", "That file already exists.", Properties.Resources.Win95Info);
wm.StartInfobox95("Windows Explorer", "That file already exists.", InfoboxType.Info, InfoboxButtons.OK);
}
else
{

View file

@ -22,10 +22,7 @@ public partial class TitleScreen : Form
public static Windows98 frm98;
public static string username;
public static string progress = "95";
public static DirectoryInfo thfolder;
public static DirectoryInfo datafolder;
public static DirectoryInfo profilefolder;
public static NewGameDialog newGameBox;
public static LoadGameDialog loadGameBox;
@ -138,31 +135,20 @@ private void VM_WidthHeight_KeyPress(object sender, KeyPressEventArgs e)
// When the TitleScreen Loads
private void TitleScreen_Load(object sender, EventArgs e)
{
if (!Directory.Exists(GameDirectory))
Directory.CreateDirectory(GameDirectory);
thfolder = new DirectoryInfo(GameDirectory);
string Data = Path.Combine(thfolder.FullName, "Data");
if (!Directory.Exists(Data))
Directory.CreateDirectory(Data);
string Profiles = Path.Combine(thfolder.FullName, "Profiles");
if (!Directory.Exists(Profiles))
Directory.CreateDirectory(Profiles);
Resources.google.Save(Path.Combine(Data, "google.jpg"));
profilefolder = Directory.CreateDirectory(Path.Combine(thfolder.FullName, "\\Profiles"));
Directory.CreateDirectory(GameDirectory);
Directory.CreateDirectory(DataDirectory);
Directory.CreateDirectory(AllProfilesDirectory);
Resources.google.Save(Path.Combine(DataDirectory, "google.jpg"));
// Set GameVersion
gameversion.Text = "Alpha 1.0.3";
// Initialize Font
File.WriteAllBytes(Data + "\\LeviWindows.ttf", Resources.LeviWindows);
File.WriteAllBytes(Data + "\\windows_command_prompt.ttf", Resources.windows_command_prompt);
pfc.AddFontFile(Data + "\\LeviWindows.ttf");
pfc.AddFontFile(Data + "\\windows_command_prompt.ttf");
File.WriteAllBytes(DataDirectory + "\\LeviWindows.ttf", Resources.LeviWindows);
File.WriteAllBytes(DataDirectory + "\\windows_command_prompt.ttf", Resources.windows_command_prompt);
pfc.AddFontFile(DataDirectory + "\\LeviWindows.ttf");
pfc.AddFontFile(DataDirectory + "\\windows_command_prompt.ttf");
gameversion.Font = new Font(pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, (0));
ProgramsToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
DocumentsToolStripMenuItem.Font = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));