aboutsummaryrefslogtreecommitdiff
path: root/Histacom2/OS/Win95/Win95.cs
diff options
context:
space:
mode:
authorAlex-TIMEHACK <[email protected]>2017-09-23 17:25:22 +0100
committerAlex-TIMEHACK <[email protected]>2017-09-23 17:25:22 +0100
commit350e749bb9eab16efe753f9b8fd703b52a97f808 (patch)
tree9c90ec1a8148d66d9ff8605710a992e5e14a6b7e /Histacom2/OS/Win95/Win95.cs
parent84ef033af262343febc3f84471233e18bc6b502e (diff)
parent1ee3e00f8f0ee879fce4edf7d1ba9889335bc826 (diff)
downloadhistacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.gz
histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.tar.bz2
histacom2-350e749bb9eab16efe753f9b8fd703b52a97f808.zip
Merge branch 'master' of https://github.com/Histacom2-Devs/Histacom2
Diffstat (limited to 'Histacom2/OS/Win95/Win95.cs')
-rw-r--r--Histacom2/OS/Win95/Win95.cs133
1 files changed, 94 insertions, 39 deletions
diff --git a/Histacom2/OS/Win95/Win95.cs b/Histacom2/OS/Win95/Win95.cs
index 8d2e466..38129ab 100644
--- a/Histacom2/OS/Win95/Win95.cs
+++ b/Histacom2/OS/Win95/Win95.cs
@@ -10,6 +10,10 @@ using Histacom2.Engine.Template.Taskbars;
using Histacom2.OS.Win95.Win95Apps;
using Histacom2.OS.Win95.Win95Apps.Story;
using static Histacom2.Engine.SaveSystem;
+using Histacom2.OS.Win95.Win95Apps._12padamViruses;
+using Histacom2.OS.Win95.Win95Apps._12padamsViruses;
+using Histacom2.GlobalPrograms;
+
namespace Histacom2.OS.Win95
{
public partial class Windows95 : Form
@@ -37,7 +41,7 @@ namespace Histacom2.OS.Win95
public Windows95()
{
InitializeComponent();
- startmenu.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
+ //startmenu.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
ProgramsToolStripMenuItem.DropDown.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
AccessoriesToolStripMenuItem.DropDown.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
CommunicationsToolStripMenuItem.DropDown.Paint += (sender, args) => Engine.Paintbrush.PaintClassicBorders(sender, args, 2);
@@ -76,9 +80,6 @@ namespace Histacom2.OS.Win95
private void Desktop_Load(object sender, EventArgs e)
{
if (currentTheme.defaultWallpaper != null) desktopicons.BackgroundImage = new Bitmap(currentTheme.defaultWallpaper, Width, Height);
- //Start Menu Color - Commented until it works reliably
- //startmenuitems.Renderer = new MyRenderer();
- //ProgramsToolStripMenuItem.DropDown.Renderer = new MyRenderer();
// Make Font Mandatory
fontLoad();
@@ -117,7 +118,7 @@ namespace Histacom2.OS.Win95
{
CurrentSave.FTime95 = true;
SaveGame();
- welcome = wm.StartWin95(new WinClassicWelcome(), "Welcome", null, false, false, resize: false);
+ welcome = wm.Init(new WinClassicWelcome(), "Welcome", null, false, false, resize: false);
AddTaskBarItem(welcome, welcome.Tag.ToString(), "Welcome", null);
nonimportantapps.Add(welcome);
@@ -161,8 +162,8 @@ namespace Histacom2.OS.Win95
private void startbutton_Click(object sender, EventArgs e)
{
startmenu.Show();
- startmenu.BringToFront();
if (taskbar.Visible) taskbar.BringToFront();
+ startmenu.BringToFront();
}
// Shutdown button
@@ -224,7 +225,7 @@ namespace Histacom2.OS.Win95
private void NotePadToolStripMenuItem_Click(object sender, EventArgs e)
{
WinClassicNotepad wp = new WinClassicNotepad();
- WinClassic app = wm.StartWin95(wp, "Notepad", Properties.Resources.Win95IconNotepad, true, true);
+ WinClassic app = wm.Init(wp, "Notepad", Properties.Resources.Win95IconNotepad, true, true);
AddTaskBarItem(app, app.Tag.ToString(), "Notepad", Properties.Resources.Win95IconNotepad);
nonimportantapps.Add(app);
@@ -237,7 +238,7 @@ namespace Histacom2.OS.Win95
private void downloaderTestToolStripMenuItem_Click(object sender, EventArgs e)
{
WinClassicDownloader opendownload = new WinClassicDownloader();
- WinClassic app = wm.StartWin95(opendownload, "Downloader", null, false, true, resize: false);
+ WinClassic app = wm.Init(opendownload, "Downloader", null, false, true, resize: false);
opendownload.appName.Text = "Downloading: Survive The Day";
AddTaskBarItem(app, app.Tag.ToString(), "Downloader", null);
@@ -249,7 +250,7 @@ namespace Histacom2.OS.Win95
private void installerTestToolStripMenuItem_Click(object sender, EventArgs e)
{
Win95Installer openinstaller = new Win95Installer("Testing");
- WinClassic app = wm.StartWin95(openinstaller, "Installer", null, false, true, resize: false);
+ WinClassic app = wm.Init(openinstaller, "Installer", null, false, true, resize: false);
AddTaskBarItem(app, app.Tag.ToString(), "Installer", null);
@@ -260,7 +261,7 @@ namespace Histacom2.OS.Win95
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.", InfoboxType.Warning, InfoboxButtons.OK); return; }
- ie = wm.StartWin95(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
+ ie = wm.Init(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing);
@@ -280,7 +281,7 @@ namespace Histacom2.OS.Win95
if (objListViewItem.Text == "Internet Explorer")
{
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 WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
+ ie = wm.Init(new WinClassicIE3(), "Internet Explorer 4", Properties.Resources.Win95IconIE4, true, true);
AddTaskBarItem(ie, ie.Tag.ToString(), "Internet Explorer 4", Properties.Resources.Win95IconIE4);
ie.BringToFront();
ie.FormClosing += new FormClosingEventHandler(InternetExplorer4_Closing);
@@ -288,7 +289,7 @@ namespace Histacom2.OS.Win95
}
else if (objListViewItem.Text == "My Computer") // TODO: Implement slightly limited explorer (with no treeview and a new window each time ya go into a dir)
{
- WinClassic app = wm.StartWin95(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
+ WinClassic app = wm.Init(new Win95WindowsExplorer(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer);
app.BringToFront();
startmenu.Hide();
@@ -312,6 +313,11 @@ namespace Histacom2.OS.Win95
{
//wm.StartInfobox95("Win32 Application", "That is not a valid Win32 Application.", Properties.Resources.Win95Error);
}
+ else if (objListViewItem.Text == "Online Services")
+ {
+ wm.StartInfobox95("Caught it!", "If you were to run this, the game would crash!\nLuckily, it won't crash this time!", InfoboxType.Error, InfoboxButtons.OK);
+ }
+
else
{
// It is an actual file on the disk
@@ -324,7 +330,7 @@ namespace Histacom2.OS.Win95
{
we.CurrentDirectory = objListViewItem.Tag.ToString();
- WinClassic app = wm.StartWin95(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
+ WinClassic app = wm.Init(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer);
app.BringToFront();
startmenu.Hide();
@@ -350,7 +356,7 @@ namespace Histacom2.OS.Win95
}
private void WebChatToolStripMenuItem_Click(object sender, EventArgs e)
{
- webchat = wm.StartWin95(new WebChat1998(), "Web Chat 1998", null, true, true);
+ webchat = wm.Init(new WebChat1998(), "Web Chat 1998", null, true, true);
AddTaskBarItem(webchat, webchat.Tag.ToString(), "Web Chat 1998", null);
@@ -369,7 +375,7 @@ namespace Histacom2.OS.Win95
private void WordPadToolStripMenuItem_Click(object sender, EventArgs e)
{
WinClassicWordPad wp = new WinClassicWordPad();
- WinClassic app = wm.StartWin95(wp, "Wordpad", Properties.Resources.Win95WordpadIcon2, true, true);
+ WinClassic app = wm.Init(wp, "Wordpad", Properties.Resources.Win95WordpadIcon2, true, true);
AddTaskBarItem(app, app.Tag.ToString(), "Wordpad", Properties.Resources.Win95WordpadIcon2);
nonimportantapps.Add(app);
@@ -410,7 +416,7 @@ namespace Histacom2.OS.Win95
FileDialogBoxManager.IsInOpenDialog = false;
FileDialogBoxManager.IsInSaveDialog = false;
Win95WindowsExplorer we = new Win95WindowsExplorer();
- WinClassic app = wm.StartWin95(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
+ WinClassic app = wm.Init(we, "Windows Explorer", Properties.Resources.WinClassicFileExplorer, true, true);
AddTaskBarItem(app, app.Tag.ToString(), "Windows Explorer", Properties.Resources.WinClassicFileExplorer);
nonimportantapps.Add(app);
@@ -429,7 +435,7 @@ namespace Histacom2.OS.Win95
private void temp_for_std(object sender, EventArgs e)
{
Win2K.Win2KApps.SurviveTheDay std = new Win2K.Win2KApps.SurviveTheDay();
- WinClassic app = wm.StartWin95(std, "Survive The Day", null, false, false);
+ WinClassic app = wm.Init(std, "Survive The Day", null, false, false);
AddTaskBarItem(app, app.Tag.ToString(), "Survive The Day", null);
nonimportantapps.Add(app);
@@ -443,7 +449,7 @@ namespace Histacom2.OS.Win95
private void MSDOSPromptToolStripMenuItem1_Click (object sender, EventArgs e)
{
WinClassicTerminal msdos = new WinClassicTerminal(false);
- WinClassic app = wm.StartWin95(msdos, "MS-DOS Prompt", Properties.Resources.MSDOSPromptToolStripMenuItem1_Image, true, true, false);
+ WinClassic app = wm.Init(msdos, "MS-DOS Prompt", Properties.Resources.MSDOSPromptToolStripMenuItem1_Image, true, true, false);
AddTaskBarItem(app, app.Tag.ToString(), "MS-DOS Prompt", Properties.Resources.MSDOSPromptToolStripMenuItem1_Image);
app.BringToFront();
@@ -453,7 +459,7 @@ namespace Histacom2.OS.Win95
private void PropertiesToolStripMenuItem1_Click(object sender, EventArgs e)
{
WinClassicThemePanel theme = new WinClassicThemePanel();
- WinClassic app = wm.StartWin95(theme, "Themes", null, false, true, false, resize: false);
+ WinClassic app = wm.Init(theme, "Themes", null, false, true, false, resize: false);
AddTaskBarItem(app, app.Tag.ToString(), "Themes", null);
app.BringToFront();
@@ -463,14 +469,14 @@ namespace Histacom2.OS.Win95
private void TimeDistorterToolStripMenuItem_Click(object sender, EventArgs e)
{
distort = new WinClassicTimeDistorter("1998", "1999", 150, Hack2.StartObjective);
- WinClassic app = wm.StartWin95(distort, "Time Distorter", null, false, true);
+ WinClassic app = wm.Init(distort, "Time Distorter", null, false, true);
AddTaskBarItem(app, app.Tag.ToString(), "Time Distorter", null);
app.BringToFront();
startmenu.Hide();
}
private void FTPClientToolStripMenuItem_Click(object sender, EventArgs e)
{
- WinClassic app = wm.StartWin95(new WinClassicFTPClient(), "FTP Client", null, true, true);
+ WinClassic app = wm.Init(new WinClassicFTPClient(), "FTP Client", null, true, true);
AddTaskBarItem(app, app.Tag.ToString(), "FTP Client", null);
app.BringToFront();
@@ -479,7 +485,7 @@ namespace Histacom2.OS.Win95
private void CalculatorToolStripMenuItem_Click(object sender, EventArgs e)
{
- WinClassic app = wm.StartWin95(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, false, false, resize: false);
+ WinClassic app = wm.Init(new WinClassicCalculator(), "Calculator", Properties.Resources.WinClassicCalc, false, false, resize: false);
AddTaskBarItem(app, app.Tag.ToString(), "Calculator", Properties.Resources.WinClassicCalc);
nonimportantapps.Add(app);
@@ -569,7 +575,7 @@ namespace Histacom2.OS.Win95
private void MinsweeperToolStripMenuItem_Click(object sender, EventArgs e)
{
- WinClassic app = wm.StartWin95(new WinClassicMinesweeper(), "Minesweeper", Properties.Resources.WinClassicMinesweeper, false, false, false, false);
+ WinClassic app = wm.Init(new WinClassicMinesweeper(), "Minesweeper", Properties.Resources.WinClassicMinesweeper, false, false, false, false);
AddTaskBarItem(app, app.Tag.ToString(), "Minesweeper", Properties.Resources.WinClassicMinesweeper);
nonimportantapps.Add(app);
@@ -596,7 +602,7 @@ namespace Histacom2.OS.Win95
private void GuessTheNumberToolStripMenuItem_Click(object sender, EventArgs e)
{
- WinClassic app = wm.StartWin95(new GuessTheNumber(), "Guess The Number", Properties.Resources.WinClassicGTNIcon, false, false, false, false);
+ WinClassic app = wm.Init(new GuessTheNumber(), "Guess The Number", Properties.Resources.WinClassicGTNIcon, false, false, false, false);
AddTaskBarItem(app, app.Tag.ToString(), "Guess The Number", Properties.Resources.WinClassicGTNIcon);
nonimportantapps.Add(app);
@@ -606,29 +612,78 @@ namespace Histacom2.OS.Win95
app.BringToFront();
startmenu.Hide();
}
- }
- public class MyRenderer : ToolStripProfessionalRenderer
- {
- public MyRenderer() : base(new MyColors()) { }
- }
- public class MyColors : ProfessionalColorTable
- {
- public override Color MenuItemSelectedGradientBegin
+ private void taskbar_Paint(object sender, PaintEventArgs e)
+ {
+ var gfx = e.Graphics;
+ gfx.Clear(currentTheme.threeDObjectsColor);
+
+ var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor);
+
+ gfx.DrawLine(new Pen(_lightBack), 0, 1, taskbar.Width, 1);
+ }
+
+ private void clockPanel_Paint(object sender, PaintEventArgs e)
+ {
+ var gfx = e.Graphics;
+ gfx.Clear(currentTheme.threeDObjectsColor);
+
+ var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor);
+ var _darkBack = Paintbrush.GetDarkFromColor(currentTheme.threeDObjectsColor);
+
+ gfx.DrawLine(new Pen(_lightBack), 0, 1, clockPanel.Width, 1);
+ gfx.DrawLine(new Pen(_darkBack), 0, 24, 0, 4);
+ gfx.DrawLine(new Pen(_darkBack), 61, 4, 0, 4);
+ gfx.DrawLine(new Pen(_lightBack), 62, 4, 62, 25);
+ gfx.DrawLine(new Pen(_lightBack), 0, 25, 62, 25);
+ }
+
+ private void startmenuitems_Paint(object sender, PaintEventArgs e)
{
- get { return Color.Navy; }
+ var gfx = e.Graphics;
+ gfx.Clear(currentTheme.threeDObjectsColor);
}
- public override Color MenuItemSelectedGradientEnd
+
+ private void startmenu_Paint(object sender, PaintEventArgs e)
{
- get { return Color.Navy; }
+ var gfx = e.Graphics;
+ gfx.Clear(currentTheme.threeDObjectsColor);
+
+ var _lightBack = Paintbrush.GetLightFromColor(currentTheme.threeDObjectsColor);
+ var _darkBack = Paintbrush.GetDarkFromColor(currentTheme.threeDObjectsColor);
+
+ gfx.DrawLine(Pens.Black, 0, startmenu.Height - 1, startmenu.Width - 1, startmenu.Height - 1);
+ gfx.DrawLine(Pens.Black, startmenu.Width - 1, startmenu.Height - 1, startmenu.Width - 1, 0);
+ gfx.DrawLine(new Pen(_darkBack), 1, startmenu.Height - 2, startmenu.Width - 2, startmenu.Height - 2);
+ gfx.DrawLine(new Pen(_darkBack), startmenu.Width - 2, 1, startmenu.Width - 2, startmenu.Height - 2);
+ gfx.DrawLine(new Pen(_lightBack), 1, startmenu.Height - 3, 1, 1);
+ gfx.DrawLine(new Pen(_lightBack), startmenu.Width - 3, 1, 1, 1);
}
- public override Color MenuItemPressedGradientBegin
+
+ private void ErrorBlasterToolStripMenuItem_Click(object sender, EventArgs e)
{
- get { return Color.Navy; }
+ WinClassic app = wm.Init(new ErrorBlaster95(), "Welcome to Error Blaster 95!", null, false, false, false, false);
+ AddTaskBarItem(app, app.Tag.ToString(), "Welcome to Error Blaster 95!", null);
+
+ nonimportantapps.Add(app);
+ nonimportantapps[nonimportantapps.Count - 1].BringToFront();
+ nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing);
+
+ app.BringToFront();
+ startmenu.Hide();
}
- public override Color MenuItemPressedGradientEnd
+
+ private void FilesOrFoldersToolStripMenuItem_Click(object sender, EventArgs e)
{
- get { return Color.Navy; }
+ WinClassic app = wm.Init(new StartRunner95(), "Welcome to Start Runner 95!", null, false, false, false, false);
+ AddTaskBarItem(app, app.Tag.ToString(), "Welcome to Start Runner 95!", null);
+
+ nonimportantapps.Add(app);
+ nonimportantapps[nonimportantapps.Count - 1].BringToFront();
+ nonimportantapps[nonimportantapps.Count - 1].FormClosing += new FormClosingEventHandler(NonImportantApp_Closing);
+
+ app.BringToFront();
+ startmenu.Hide();
}
}
}