diff options
| author | lempamo <[email protected]> | 2017-07-02 03:09:14 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-07-02 03:09:14 +0000 |
| commit | b8f49e9a20a43a72fe6895741f5fe7207151eb95 (patch) | |
| tree | e533069e097f4da27a73ef5409f44af4b07a92a0 | |
| parent | 19ca07404ca7decbec3215b5522554a4f7077879 (diff) | |
| parent | 82af186d5140e878f6b49bc101112550d36bc78a (diff) | |
| download | histacom2-b8f49e9a20a43a72fe6895741f5fe7207151eb95.tar.gz histacom2-b8f49e9a20a43a72fe6895741f5fe7207151eb95.tar.bz2 histacom2-b8f49e9a20a43a72fe6895741f5fe7207151eb95.zip | |
Merge pull request #104 from lempamo/master
paintbrush
| -rw-r--r-- | TimeHACK.Engine/Paintbrush.cs | 23 | ||||
| -rw-r--r-- | TimeHACK.Engine/TimeHACK.Engine.csproj | 1 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.Designer.cs | 2 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95.cs | 13 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs | 4 | ||||
| -rw-r--r-- | TimeHACK.Main/OS/Win98/Win98.Designer.cs | 1 | ||||
| -rw-r--r-- | TimeHACK.Main/Program.cs | 6 | ||||
| -rw-r--r-- | TimeHACK.Main/TitleScreen.Designer.cs | 4 | ||||
| -rw-r--r-- | TimeHACK.Main/TitleScreen.cs | 10 |
9 files changed, 36 insertions, 28 deletions
diff --git a/TimeHACK.Engine/Paintbrush.cs b/TimeHACK.Engine/Paintbrush.cs new file mode 100644 index 0000000..b343100 --- /dev/null +++ b/TimeHACK.Engine/Paintbrush.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace TimeHACK.Engine +{ + public class Paintbrush + { + + public static void paintClassicBorders(object sender, PaintEventArgs e, int borderwidth) + { + ControlPaint.DrawBorder(e.Graphics, ((Control)sender).ClientRectangle, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset, + SystemColors.ControlLightLight, borderwidth, ButtonBorderStyle.Outset); + } + } +} diff --git a/TimeHACK.Engine/TimeHACK.Engine.csproj b/TimeHACK.Engine/TimeHACK.Engine.csproj index 7ee8e6e..6a2dba4 100644 --- a/TimeHACK.Engine/TimeHACK.Engine.csproj +++ b/TimeHACK.Engine/TimeHACK.Engine.csproj @@ -49,6 +49,7 @@ <None Include="packages.config" /> <None Include="Resources\WinClassic\Window\pjBg6mKP.bin" /> <Compile Include="FileDialogBoxManager.cs" /> + <Compile Include="Paintbrush.cs" /> <Compile Include="SaveSystem.cs" /> <Compile Include="TaskBarController.cs" /> <Compile Include="Template\Win9XBSOD.cs"> diff --git a/TimeHACK.Main/OS/Win95/Win95.Designer.cs b/TimeHACK.Main/OS/Win95/Win95.Designer.cs index 5a35e3d..f963251 100644 --- a/TimeHACK.Main/OS/Win95/Win95.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95.Designer.cs @@ -223,7 +223,7 @@ namespace TimeHACK.OS.Win95 this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(174, 300); this.startmenu.TabIndex = 3; - this.startmenu.Paint += new System.Windows.Forms.PaintEventHandler(this.startmenu_Paint); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/OS/Win95/Win95.cs b/TimeHACK.Main/OS/Win95/Win95.cs index bd706cb..a991a00 100644 --- a/TimeHACK.Main/OS/Win95/Win95.cs +++ b/TimeHACK.Main/OS/Win95/Win95.cs @@ -16,7 +16,6 @@ namespace TimeHACK.OS.Win95 public partial class Windows95 : Form
{
private SoundPlayer startsound;
- private SoundPlayer stopsound;
public WindowManager wm = new WindowManager();
public List<WinClassic> nonimportantapps = new List<WinClassic>();
@@ -88,22 +87,12 @@ namespace TimeHACK.OS.Win95 #region StartMenu
- // Paint StartMenu
- private void startmenu_Paint(object sender, PaintEventArgs e)
- {
- // Paint the StartMenu
- ControlPaint.DrawBorder(e.Graphics, startmenu.ClientRectangle,
- SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset,
- SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset,
- SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset,
- SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset);
- }
-
// StartButton Click
private void startbutton_Click(object sender, EventArgs e)
{
startmenu.Show();
startmenu.BringToFront();
+ if (taskbar.Visible) taskbar.BringToFront();
}
// Shutdown button
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs b/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs index cd94306..050e1e3 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/WebChat1998.Designer.cs @@ -193,6 +193,8 @@ // // button1 // + this.button1.BackColor = System.Drawing.Color.Silver; + this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.Location = new System.Drawing.Point(331, 208); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(151, 23); @@ -200,6 +202,7 @@ this.button1.Text = "Login"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.Button1_Click); + this.button1.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // txtscreenname // @@ -236,6 +239,7 @@ this.button2.Text = "Speak"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.Button2_Click); + this.button2.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // button3 // diff --git a/TimeHACK.Main/OS/Win98/Win98.Designer.cs b/TimeHACK.Main/OS/Win98/Win98.Designer.cs index 72f6e10..d1f66dd 100644 --- a/TimeHACK.Main/OS/Win98/Win98.Designer.cs +++ b/TimeHACK.Main/OS/Win98/Win98.Designer.cs @@ -177,6 +177,7 @@ this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(174, 300); this.startmenu.TabIndex = 4; + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/Program.cs b/TimeHACK.Main/Program.cs index 72a7291..8411ae8 100644 --- a/TimeHACK.Main/Program.cs +++ b/TimeHACK.Main/Program.cs @@ -80,12 +80,12 @@ namespace TimeHACK public static void ShutdownApplication(System.IO.UnmanagedMemoryStream audio) { - + System.Threading.Thread.Sleep(500); System.IO.Stream audioPlay = audio; stopsound = new System.Media.SoundPlayer(audioPlay); - stopsound.Play(); + stopsound.PlaySync(); - System.Threading.Thread.Sleep(1500); + System.Threading.Thread.Sleep(500); Application.Exit(); } diff --git a/TimeHACK.Main/TitleScreen.Designer.cs b/TimeHACK.Main/TitleScreen.Designer.cs index 774f7aa..950dfb8 100644 --- a/TimeHACK.Main/TitleScreen.Designer.cs +++ b/TimeHACK.Main/TitleScreen.Designer.cs @@ -184,7 +184,7 @@ this.gameversion.AutoSize = true; this.gameversion.BackColor = System.Drawing.Color.Transparent; this.gameversion.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.gameversion.Location = new System.Drawing.Point(25, 8); + this.gameversion.Location = new System.Drawing.Point(25, 6); this.gameversion.Name = "gameversion"; this.gameversion.Size = new System.Drawing.Size(78, 13); this.gameversion.TabIndex = 0; @@ -213,7 +213,7 @@ this.startmenu.Name = "startmenu"; this.startmenu.Size = new System.Drawing.Size(165, 187); this.startmenu.TabIndex = 11; - this.startmenu.Paint += new System.Windows.Forms.PaintEventHandler(this.startmenu_Paint); + this.startmenu.Paint += (sender, args) => Engine.Paintbrush.paintClassicBorders(sender, args, 2); // // startmenuitems // diff --git a/TimeHACK.Main/TitleScreen.cs b/TimeHACK.Main/TitleScreen.cs index d23c1d3..54b680f 100644 --- a/TimeHACK.Main/TitleScreen.cs +++ b/TimeHACK.Main/TitleScreen.cs @@ -48,16 +48,6 @@ namespace TimeHACK InitializeComponent(); } - private void startmenu_Paint(object sender, PaintEventArgs e) - { - // Paint the StartMenu - ControlPaint.DrawBorder(e.Graphics, startmenu.ClientRectangle, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset, - SystemColors.ControlLightLight, 2, ButtonBorderStyle.Outset); - } - public void StartGame() { //TODO: You may want to handle story stuff to decide what OS to boot here. |
