mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-01-22 17:22:14 +00:00
0.1.1 was released - time to update the repo.
This commit is contained in:
parent
c43d82eebd
commit
ef09525b70
19 changed files with 260 additions and 2865 deletions
|
@ -83,7 +83,7 @@ public class API
|
|||
/// to test new features or to bring in lots of codepoints. This is why
|
||||
/// Developer mode should ALWAYS be off in non-dev releases, to prevent cheating.
|
||||
/// </summary>
|
||||
public static bool DeveloperMode = true;
|
||||
public static bool DeveloperMode = false;
|
||||
|
||||
/// <summary>
|
||||
/// If this is true, only certain applications will open and only
|
||||
|
@ -1120,9 +1120,16 @@ public static void RollForm(Form formToRoll)
|
|||
/// </summary>
|
||||
public static void UpdateWindows()
|
||||
{
|
||||
foreach (WindowBorder brdr in BordersToUpdate)
|
||||
try
|
||||
{
|
||||
brdr.setupall();
|
||||
foreach (WindowBorder brdr in BordersToUpdate)
|
||||
{
|
||||
brdr.setupall();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
|
||||
namespace ShiftOS
|
||||
{
|
||||
|
@ -48,10 +49,18 @@ public Image Icon
|
|||
public string LuaAction = "open_program(\"shiftorium\")";
|
||||
private void Icon_Click(object sender, EventArgs e)
|
||||
{
|
||||
var li = new LuaInterpreter();
|
||||
li.mod(LuaAction);
|
||||
lbiconname.BackColor = Color.White;
|
||||
t.Start();
|
||||
if (File.Exists(Paths.Desktop + IconName))
|
||||
{
|
||||
var fs = new File_Skimmer();
|
||||
fs.OpenFile(Paths.Desktop + IconName);
|
||||
}
|
||||
else
|
||||
{
|
||||
var li = new LuaInterpreter();
|
||||
li.mod(LuaAction);
|
||||
lbiconname.BackColor = Color.White;
|
||||
t.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public Timer t = new Timer();
|
||||
|
|
385
source/WindowsFormsApplication1/Dodge.Designer.vb
generated
385
source/WindowsFormsApplication1/Dodge.Designer.vb
generated
|
@ -1,385 +0,0 @@
|
|||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class Dodge
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Dodge))
|
||||
Me.pgbottom = New System.Windows.Forms.Panel()
|
||||
Me.minimizebutton = New System.Windows.Forms.Panel()
|
||||
Me.rollupbutton = New System.Windows.Forms.Panel()
|
||||
Me.pgbottomrcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgright = New System.Windows.Forms.Panel()
|
||||
Me.closebutton = New System.Windows.Forms.Panel()
|
||||
Me.lbtitletext = New System.Windows.Forms.Label()
|
||||
Me.pgtoplcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgtoprcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgbottomlcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgcontents = New System.Windows.Forms.Panel()
|
||||
Me.player = New System.Windows.Forms.PictureBox()
|
||||
Me.QuitButton = New System.Windows.Forms.PictureBox()
|
||||
Me.BeginButton = New System.Windows.Forms.PictureBox()
|
||||
Me.DescriptionLabel = New System.Windows.Forms.Label()
|
||||
Me.object_small2 = New System.Windows.Forms.PictureBox()
|
||||
Me.object_mid2 = New System.Windows.Forms.PictureBox()
|
||||
Me.object_large = New System.Windows.Forms.PictureBox()
|
||||
Me.object_small = New System.Windows.Forms.PictureBox()
|
||||
Me.object_mid = New System.Windows.Forms.PictureBox()
|
||||
Me.scorelabel = New System.Windows.Forms.Label()
|
||||
Me.PicBonus = New System.Windows.Forms.PictureBox()
|
||||
Me.pgleft = New System.Windows.Forms.Panel()
|
||||
Me.titlebar = New System.Windows.Forms.Panel()
|
||||
Me.pnlicon = New System.Windows.Forms.PictureBox()
|
||||
Me.clock = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.pgright.SuspendLayout()
|
||||
Me.pgcontents.SuspendLayout()
|
||||
CType(Me.player, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.QuitButton, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.BeginButton, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.object_small2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.object_mid2, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.object_large, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.object_small, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.object_mid, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
CType(Me.PicBonus, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.pgleft.SuspendLayout()
|
||||
Me.titlebar.SuspendLayout()
|
||||
CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'pgbottom
|
||||
'
|
||||
Me.pgbottom.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgbottom.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottom.Location = New System.Drawing.Point(2, 565)
|
||||
Me.pgbottom.Name = "pgbottom"
|
||||
Me.pgbottom.Size = New System.Drawing.Size(593, 2)
|
||||
Me.pgbottom.TabIndex = 23
|
||||
'
|
||||
'minimizebutton
|
||||
'
|
||||
Me.minimizebutton.BackColor = System.Drawing.Color.Black
|
||||
Me.minimizebutton.Location = New System.Drawing.Point(246, 5)
|
||||
Me.minimizebutton.Name = "minimizebutton"
|
||||
Me.minimizebutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.minimizebutton.TabIndex = 24
|
||||
'
|
||||
'rollupbutton
|
||||
'
|
||||
Me.rollupbutton.BackColor = System.Drawing.Color.Black
|
||||
Me.rollupbutton.Location = New System.Drawing.Point(274, 3)
|
||||
Me.rollupbutton.Name = "rollupbutton"
|
||||
Me.rollupbutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.rollupbutton.TabIndex = 22
|
||||
'
|
||||
'pgbottomrcorner
|
||||
'
|
||||
Me.pgbottomrcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgbottomrcorner.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottomrcorner.Location = New System.Drawing.Point(0, 535)
|
||||
Me.pgbottomrcorner.Name = "pgbottomrcorner"
|
||||
Me.pgbottomrcorner.Size = New System.Drawing.Size(2, 2)
|
||||
Me.pgbottomrcorner.TabIndex = 15
|
||||
'
|
||||
'pgright
|
||||
'
|
||||
Me.pgright.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgright.Controls.Add(Me.pgbottomrcorner)
|
||||
Me.pgright.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.pgright.Location = New System.Drawing.Point(595, 30)
|
||||
Me.pgright.Name = "pgright"
|
||||
Me.pgright.Size = New System.Drawing.Size(2, 537)
|
||||
Me.pgright.TabIndex = 22
|
||||
'
|
||||
'closebutton
|
||||
'
|
||||
Me.closebutton.BackColor = System.Drawing.Color.Black
|
||||
Me.closebutton.Location = New System.Drawing.Point(302, 3)
|
||||
Me.closebutton.Name = "closebutton"
|
||||
Me.closebutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.closebutton.TabIndex = 20
|
||||
'
|
||||
'lbtitletext
|
||||
'
|
||||
Me.lbtitletext.AutoSize = True
|
||||
Me.lbtitletext.BackColor = System.Drawing.Color.Transparent
|
||||
Me.lbtitletext.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lbtitletext.Location = New System.Drawing.Point(26, 7)
|
||||
Me.lbtitletext.Name = "lbtitletext"
|
||||
Me.lbtitletext.Size = New System.Drawing.Size(57, 18)
|
||||
Me.lbtitletext.TabIndex = 19
|
||||
Me.lbtitletext.Text = "Dodge"
|
||||
'
|
||||
'pgtoplcorner
|
||||
'
|
||||
Me.pgtoplcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgtoplcorner.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.pgtoplcorner.Location = New System.Drawing.Point(0, 0)
|
||||
Me.pgtoplcorner.Name = "pgtoplcorner"
|
||||
Me.pgtoplcorner.Size = New System.Drawing.Size(2, 30)
|
||||
Me.pgtoplcorner.TabIndex = 17
|
||||
'
|
||||
'pgtoprcorner
|
||||
'
|
||||
Me.pgtoprcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgtoprcorner.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.pgtoprcorner.Location = New System.Drawing.Point(595, 0)
|
||||
Me.pgtoprcorner.Name = "pgtoprcorner"
|
||||
Me.pgtoprcorner.Size = New System.Drawing.Size(2, 30)
|
||||
Me.pgtoprcorner.TabIndex = 16
|
||||
'
|
||||
'pgbottomlcorner
|
||||
'
|
||||
Me.pgbottomlcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgbottomlcorner.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottomlcorner.Location = New System.Drawing.Point(0, 535)
|
||||
Me.pgbottomlcorner.Name = "pgbottomlcorner"
|
||||
Me.pgbottomlcorner.Size = New System.Drawing.Size(2, 2)
|
||||
Me.pgbottomlcorner.TabIndex = 14
|
||||
'
|
||||
'pgcontents
|
||||
'
|
||||
Me.pgcontents.BackColor = System.Drawing.Color.White
|
||||
Me.pgcontents.Controls.Add(Me.player)
|
||||
Me.pgcontents.Controls.Add(Me.QuitButton)
|
||||
Me.pgcontents.Controls.Add(Me.BeginButton)
|
||||
Me.pgcontents.Controls.Add(Me.DescriptionLabel)
|
||||
Me.pgcontents.Controls.Add(Me.object_small2)
|
||||
Me.pgcontents.Controls.Add(Me.object_mid2)
|
||||
Me.pgcontents.Controls.Add(Me.object_large)
|
||||
Me.pgcontents.Controls.Add(Me.object_small)
|
||||
Me.pgcontents.Controls.Add(Me.object_mid)
|
||||
Me.pgcontents.Controls.Add(Me.scorelabel)
|
||||
Me.pgcontents.Controls.Add(Me.PicBonus)
|
||||
Me.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.pgcontents.Location = New System.Drawing.Point(2, 30)
|
||||
Me.pgcontents.Name = "pgcontents"
|
||||
Me.pgcontents.Size = New System.Drawing.Size(593, 535)
|
||||
Me.pgcontents.TabIndex = 20
|
||||
'
|
||||
'player
|
||||
'
|
||||
Me.player.BackColor = System.Drawing.Color.Transparent
|
||||
Me.player.Image = CType(resources.GetObject("player.Image"), System.Drawing.Image)
|
||||
Me.player.Location = New System.Drawing.Point(192, 445)
|
||||
Me.player.Name = "player"
|
||||
Me.player.Size = New System.Drawing.Size(32, 32)
|
||||
Me.player.TabIndex = 18
|
||||
Me.player.TabStop = False
|
||||
'
|
||||
'QuitButton
|
||||
'
|
||||
Me.QuitButton.Image = CType(resources.GetObject("QuitButton.Image"), System.Drawing.Image)
|
||||
Me.QuitButton.Location = New System.Drawing.Point(216, 424)
|
||||
Me.QuitButton.Name = "QuitButton"
|
||||
Me.QuitButton.Size = New System.Drawing.Size(200, 50)
|
||||
Me.QuitButton.TabIndex = 12
|
||||
Me.QuitButton.TabStop = False
|
||||
'
|
||||
'BeginButton
|
||||
'
|
||||
Me.BeginButton.Image = CType(resources.GetObject("BeginButton.Image"), System.Drawing.Image)
|
||||
Me.BeginButton.Location = New System.Drawing.Point(3, 424)
|
||||
Me.BeginButton.Name = "BeginButton"
|
||||
Me.BeginButton.Size = New System.Drawing.Size(200, 50)
|
||||
Me.BeginButton.TabIndex = 11
|
||||
Me.BeginButton.TabStop = False
|
||||
'
|
||||
'DescriptionLabel
|
||||
'
|
||||
Me.DescriptionLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.DescriptionLabel.Location = New System.Drawing.Point(3, 3)
|
||||
Me.DescriptionLabel.Name = "DescriptionLabel"
|
||||
Me.DescriptionLabel.Size = New System.Drawing.Size(413, 409)
|
||||
Me.DescriptionLabel.TabIndex = 10
|
||||
Me.DescriptionLabel.Text = "Placeholder"
|
||||
'
|
||||
'object_small2
|
||||
'
|
||||
Me.object_small2.Image = CType(resources.GetObject("object_small2.Image"), System.Drawing.Image)
|
||||
Me.object_small2.Location = New System.Drawing.Point(75, 43)
|
||||
Me.object_small2.Name = "object_small2"
|
||||
Me.object_small2.Size = New System.Drawing.Size(75, 20)
|
||||
Me.object_small2.TabIndex = 17
|
||||
Me.object_small2.TabStop = False
|
||||
'
|
||||
'object_mid2
|
||||
'
|
||||
Me.object_mid2.Image = CType(resources.GetObject("object_mid2.Image"), System.Drawing.Image)
|
||||
Me.object_mid2.Location = New System.Drawing.Point(279, 134)
|
||||
Me.object_mid2.Name = "object_mid2"
|
||||
Me.object_mid2.Size = New System.Drawing.Size(125, 20)
|
||||
Me.object_mid2.TabIndex = 16
|
||||
Me.object_mid2.TabStop = False
|
||||
'
|
||||
'object_large
|
||||
'
|
||||
Me.object_large.Image = CType(resources.GetObject("object_large.Image"), System.Drawing.Image)
|
||||
Me.object_large.Location = New System.Drawing.Point(49, 208)
|
||||
Me.object_large.Name = "object_large"
|
||||
Me.object_large.Size = New System.Drawing.Size(175, 20)
|
||||
Me.object_large.TabIndex = 15
|
||||
Me.object_large.TabStop = False
|
||||
'
|
||||
'object_small
|
||||
'
|
||||
Me.object_small.Image = CType(resources.GetObject("object_small.Image"), System.Drawing.Image)
|
||||
Me.object_small.Location = New System.Drawing.Point(290, 294)
|
||||
Me.object_small.Name = "object_small"
|
||||
Me.object_small.Size = New System.Drawing.Size(75, 20)
|
||||
Me.object_small.TabIndex = 13
|
||||
Me.object_small.TabStop = False
|
||||
'
|
||||
'object_mid
|
||||
'
|
||||
Me.object_mid.Image = CType(resources.GetObject("object_mid.Image"), System.Drawing.Image)
|
||||
Me.object_mid.Location = New System.Drawing.Point(58, 371)
|
||||
Me.object_mid.Name = "object_mid"
|
||||
Me.object_mid.Size = New System.Drawing.Size(125, 20)
|
||||
Me.object_mid.TabIndex = 14
|
||||
Me.object_mid.TabStop = False
|
||||
'
|
||||
'scorelabel
|
||||
'
|
||||
Me.scorelabel.AutoSize = True
|
||||
Me.scorelabel.BackColor = System.Drawing.Color.Transparent
|
||||
Me.scorelabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 36.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.scorelabel.Location = New System.Drawing.Point(3, 4)
|
||||
Me.scorelabel.Name = "scorelabel"
|
||||
Me.scorelabel.Size = New System.Drawing.Size(51, 55)
|
||||
Me.scorelabel.TabIndex = 19
|
||||
Me.scorelabel.Text = "0"
|
||||
'
|
||||
'PicBonus
|
||||
'
|
||||
Me.PicBonus.Image = CType(resources.GetObject("PicBonus.Image"), System.Drawing.Image)
|
||||
Me.PicBonus.Location = New System.Drawing.Point(187, 84)
|
||||
Me.PicBonus.Name = "PicBonus"
|
||||
Me.PicBonus.Size = New System.Drawing.Size(16, 11)
|
||||
Me.PicBonus.TabIndex = 20
|
||||
Me.PicBonus.TabStop = False
|
||||
Me.PicBonus.Visible = False
|
||||
'
|
||||
'pgleft
|
||||
'
|
||||
Me.pgleft.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgleft.Controls.Add(Me.pgbottomlcorner)
|
||||
Me.pgleft.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.pgleft.Location = New System.Drawing.Point(0, 30)
|
||||
Me.pgleft.Name = "pgleft"
|
||||
Me.pgleft.Size = New System.Drawing.Size(2, 537)
|
||||
Me.pgleft.TabIndex = 21
|
||||
'
|
||||
'titlebar
|
||||
'
|
||||
Me.titlebar.BackColor = System.Drawing.Color.Gray
|
||||
Me.titlebar.Controls.Add(Me.minimizebutton)
|
||||
Me.titlebar.Controls.Add(Me.pnlicon)
|
||||
Me.titlebar.Controls.Add(Me.rollupbutton)
|
||||
Me.titlebar.Controls.Add(Me.closebutton)
|
||||
Me.titlebar.Controls.Add(Me.lbtitletext)
|
||||
Me.titlebar.Controls.Add(Me.pgtoplcorner)
|
||||
Me.titlebar.Controls.Add(Me.pgtoprcorner)
|
||||
Me.titlebar.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.titlebar.ForeColor = System.Drawing.Color.White
|
||||
Me.titlebar.Location = New System.Drawing.Point(0, 0)
|
||||
Me.titlebar.Name = "titlebar"
|
||||
Me.titlebar.Size = New System.Drawing.Size(597, 30)
|
||||
Me.titlebar.TabIndex = 19
|
||||
'
|
||||
'pnlicon
|
||||
'
|
||||
Me.pnlicon.BackColor = System.Drawing.Color.Transparent
|
||||
Me.pnlicon.Image = Global.ShiftOS.My.Resources.Resources.iconTextPad
|
||||
Me.pnlicon.Location = New System.Drawing.Point(8, 8)
|
||||
Me.pnlicon.Name = "pnlicon"
|
||||
Me.pnlicon.Size = New System.Drawing.Size(16, 16)
|
||||
Me.pnlicon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
|
||||
Me.pnlicon.TabIndex = 24
|
||||
Me.pnlicon.TabStop = False
|
||||
Me.pnlicon.Visible = False
|
||||
'
|
||||
'clock
|
||||
'
|
||||
Me.clock.Interval = 20
|
||||
'
|
||||
'Dodge
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(597, 567)
|
||||
Me.Controls.Add(Me.pgcontents)
|
||||
Me.Controls.Add(Me.pgbottom)
|
||||
Me.Controls.Add(Me.pgright)
|
||||
Me.Controls.Add(Me.pgleft)
|
||||
Me.Controls.Add(Me.titlebar)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
|
||||
Me.MaximizeBox = False
|
||||
Me.Name = "Dodge"
|
||||
Me.Text = "Dodge"
|
||||
Me.TopMost = True
|
||||
Me.pgright.ResumeLayout(False)
|
||||
Me.pgcontents.ResumeLayout(False)
|
||||
Me.pgcontents.PerformLayout()
|
||||
CType(Me.player, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.QuitButton, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.BeginButton, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.object_small2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.object_mid2, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.object_large, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.object_small, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.object_mid, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
CType(Me.PicBonus, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.pgleft.ResumeLayout(False)
|
||||
Me.titlebar.ResumeLayout(False)
|
||||
Me.titlebar.PerformLayout()
|
||||
CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents pgbottom As System.Windows.Forms.Panel
|
||||
Friend WithEvents minimizebutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents pnlicon As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents rollupbutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottomrcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgright As System.Windows.Forms.Panel
|
||||
Friend WithEvents closebutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents lbtitletext As System.Windows.Forms.Label
|
||||
Friend WithEvents pgtoplcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgtoprcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottomlcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgcontents As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgleft As System.Windows.Forms.Panel
|
||||
Friend WithEvents titlebar As System.Windows.Forms.Panel
|
||||
Friend WithEvents player As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents QuitButton As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents BeginButton As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents DescriptionLabel As System.Windows.Forms.Label
|
||||
Friend WithEvents object_small2 As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents object_mid2 As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents object_large As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents object_small As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents object_mid As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents scorelabel As System.Windows.Forms.Label
|
||||
Friend WithEvents clock As System.Windows.Forms.Timer
|
||||
Friend WithEvents PicBonus As System.Windows.Forms.PictureBox
|
||||
End Class
|
|
@ -1,548 +0,0 @@
|
|||
Public Class Dodge
|
||||
Public rolldownsize As Integer
|
||||
Public oldbordersize As Integer
|
||||
Public oldtitlebarheight As Integer
|
||||
Public justopened As Boolean = False
|
||||
Public needtorollback As Boolean = False
|
||||
Public minimumsizewidth As Integer = 453 'replace with minimum size
|
||||
Public minimumsizeheight As Integer = 522 'replace with minimum size
|
||||
|
||||
Dim speed As Decimal 'the speed the game runs at
|
||||
Dim score As Integer 'the score/code points the player gets
|
||||
Dim usingkeys As Boolean = False 'user can use mouse or keyboard, mouse by default, chnages to true if key pressed
|
||||
Dim time As Decimal = 0 'Records the time spent playing, used for codepoints formula
|
||||
Dim bonusesfound As Integer 'Number or bonus play collects
|
||||
Dim keyboardinput As Integer = 0 'for smooth keyboard gameplay, 1=left, 2=right, 0=none
|
||||
|
||||
Private Sub Template_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
justopened = True
|
||||
Me.Left = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2
|
||||
Me.Top = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2
|
||||
setupall()
|
||||
If ShiftOSDesktop.DodgeCorrupted Then Me.Close() : infobox.showinfo("The Plague.", Me.Name & "has been corrupted by The Plague.")
|
||||
|
||||
ShiftOSDesktop.pnlpanelbuttondodge.SendToBack() 'modfiy to proper name
|
||||
ShiftOSDesktop.setuppanelbuttons()
|
||||
ShiftOSDesktop.setpanelbuttonappearnce(ShiftOSDesktop.pnlpanelbuttondodge, ShiftOSDesktop.tbdodgeicon, ShiftOSDesktop.tbdodgetext, True) 'modify to proper name
|
||||
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen + 1
|
||||
End Sub
|
||||
|
||||
Public Sub setupall()
|
||||
setuptitlebar()
|
||||
setupborders()
|
||||
setskin()
|
||||
End Sub
|
||||
|
||||
Private Sub ShiftOSDesktop_keydown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
|
||||
'Make terminal appear
|
||||
If e.KeyCode = Keys.T AndAlso e.Control Then
|
||||
Terminal.Show()
|
||||
Terminal.Visible = True
|
||||
Terminal.BringToFront()
|
||||
End If
|
||||
|
||||
'Movable Windows
|
||||
If ShiftOSDesktop.boughtmovablewindows = True Then
|
||||
If e.KeyCode = Keys.A AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X - ShiftOSDesktop.movablewindownumber, Me.Location.Y)
|
||||
End If
|
||||
If e.KeyCode = Keys.D AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X + ShiftOSDesktop.movablewindownumber, Me.Location.Y)
|
||||
End If
|
||||
If e.KeyCode = Keys.W AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X, Me.Location.Y - ShiftOSDesktop.movablewindownumber)
|
||||
End If
|
||||
If e.KeyCode = Keys.S AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X, Me.Location.Y + ShiftOSDesktop.movablewindownumber)
|
||||
End If
|
||||
ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User moved " & Me.Name & " to " & Me.Location.ToString & " with " & e.KeyCode.ToString & Environment.NewLine
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub titlebar_MouseDown(sender As Object, e As MouseEventArgs) Handles titlebar.MouseDown, lbtitletext.MouseDown, pnlicon.MouseDown, pgtoplcorner.MouseDown, pgtoprcorner.MouseDown
|
||||
' Handle Draggable Windows
|
||||
If ShiftOSDesktop.boughtdraggablewindows = True Then
|
||||
If e.Button = MouseButtons.Left Then
|
||||
titlebar.Capture = False
|
||||
lbtitletext.Capture = False
|
||||
pnlicon.Capture = False
|
||||
pgtoplcorner.Capture = False
|
||||
pgtoprcorner.Capture = False
|
||||
Const WM_NCLBUTTONDOWN As Integer = &HA1S
|
||||
Const HTCAPTION As Integer = 2
|
||||
Dim msg As Message = _
|
||||
Message.Create(Me.Handle, WM_NCLBUTTONDOWN, _
|
||||
New IntPtr(HTCAPTION), IntPtr.Zero)
|
||||
Me.DefWndProc(msg)
|
||||
End If
|
||||
ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User dragged " & Me.Name & " to " & Me.Location.ToString & Environment.NewLine
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub setupborders()
|
||||
If ShiftOSDesktop.boughtwindowborders = False Then
|
||||
pgleft.Hide()
|
||||
pgbottom.Hide()
|
||||
pgright.Hide()
|
||||
Me.Size = New Size(Me.Width - pgleft.Width - pgright.Width, Me.Height - pgbottom.Height)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_Click(sender As Object, e As EventArgs) Handles closebutton.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseEnter(sender As Object, e As EventArgs) Handles closebutton.MouseEnter, closebutton.MouseUp
|
||||
closebutton.BackgroundImage = Skins.closebtnhover
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseLeave(sender As Object, e As EventArgs) Handles closebutton.MouseLeave
|
||||
closebutton.BackgroundImage = Skins.closebtn
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseDown(sender As Object, e As EventArgs) Handles closebutton.MouseDown
|
||||
closebutton.BackgroundImage = Skins.closebtnclick
|
||||
End Sub
|
||||
|
||||
Private Sub minimizebutton_Click(sender As Object, e As EventArgs) Handles minimizebutton.Click
|
||||
ShiftOSDesktop.minimizeprogram(Me, False)
|
||||
End Sub
|
||||
|
||||
'Private Sub titlebar_MouseEnter(sender As Object, e As EventArgs) Handles titlebar.MouseEnter, titlebar.MouseUp, lbtitletext.MouseEnter, pnlicon.MouseEnter, closebutton.MouseEnter, rollupbutton.MouseEnter
|
||||
' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(1)
|
||||
'End Sub
|
||||
|
||||
'Private Sub titlebar_MouseLeave(sender As Object, e As EventArgs) Handles titlebar.MouseLeave, lbtitletext.MouseLeave, pnlicon.MouseLeave, closebutton.MouseLeave, rollupbutton.MouseLeave
|
||||
' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(0)
|
||||
'End Sub
|
||||
|
||||
Private Sub rollupbutton_Click(sender As Object, e As EventArgs) Handles rollupbutton.Click
|
||||
rollupanddown()
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseEnter(sender As Object, e As EventArgs) Handles rollupbutton.MouseEnter, rollupbutton.MouseUp
|
||||
rollupbutton.BackgroundImage = Skins.rollbtnhover
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseLeave(sender As Object, e As EventArgs) Handles rollupbutton.MouseLeave
|
||||
rollupbutton.BackgroundImage = Skins.rollbtn
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseDown(sender As Object, e As EventArgs) Handles rollupbutton.MouseDown
|
||||
rollupbutton.BackgroundImage = Skins.rollbtnclick
|
||||
End Sub
|
||||
|
||||
Public Sub setuptitlebar()
|
||||
|
||||
If Me.Height = Me.titlebar.Height Then pgleft.Show() : pgbottom.Show() : pgright.Show() : Me.Height = rolldownsize : needtorollback = True
|
||||
pgleft.Width = Skins.borderwidth
|
||||
pgright.Width = Skins.borderwidth
|
||||
pgbottom.Height = Skins.borderwidth
|
||||
titlebar.Height = Skins.titlebarheight
|
||||
|
||||
If justopened = True Then
|
||||
Me.Size = New Size(420, 510) 'put the default size of your window here
|
||||
Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
|
||||
Me.Size = New Size(Me.Width + Skins.borderwidth + Skins.borderwidth, Me.Height + Skins.borderwidth)
|
||||
oldbordersize = Skins.borderwidth
|
||||
oldtitlebarheight = Skins.titlebarheight
|
||||
justopened = False
|
||||
Else
|
||||
If Me.Visible = True Then
|
||||
Me.Size = New Size(Me.Width - (2 * oldbordersize) + (2 * Skins.borderwidth), (Me.Height - oldtitlebarheight - oldbordersize) + Skins.titlebarheight + Skins.borderwidth)
|
||||
oldbordersize = Skins.borderwidth
|
||||
oldtitlebarheight = Skins.titlebarheight
|
||||
If needtorollback = True Then Me.Height = titlebar.Height : pgleft.Hide() : pgbottom.Hide() : pgright.Hide()
|
||||
End If
|
||||
End If
|
||||
|
||||
If Skins.enablecorners = True Then
|
||||
pgtoplcorner.Show()
|
||||
pgtoprcorner.Show()
|
||||
pgtoprcorner.Width = Skins.titlebarcornerwidth
|
||||
pgtoplcorner.Width = Skins.titlebarcornerwidth
|
||||
Else
|
||||
pgtoplcorner.Hide()
|
||||
pgtoprcorner.Hide()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughttitlebar = False Then
|
||||
titlebar.Hide()
|
||||
Me.Size = New Size(Me.Width, Me.Size.Height - titlebar.Height)
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughttitletext = False Then
|
||||
lbtitletext.Hide()
|
||||
Else
|
||||
lbtitletext.Font = New Font(Skins.titletextfontfamily, Skins.titletextfontsize, Skins.titletextfontstyle, GraphicsUnit.Point)
|
||||
lbtitletext.Text = ShiftOSDesktop.dodgename 'Remember to change to name of program!!!!
|
||||
lbtitletext.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtclosebutton = False Then
|
||||
closebutton.Hide()
|
||||
Else
|
||||
closebutton.BackColor = Skins.closebtncolour
|
||||
closebutton.Size = Skins.closebtnsize
|
||||
closebutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtrollupbutton = False Then
|
||||
rollupbutton.Hide()
|
||||
Else
|
||||
rollupbutton.BackColor = Skins.rollbtncolour
|
||||
rollupbutton.Size = Skins.rollbtnsize
|
||||
rollupbutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtminimizebutton = False Then
|
||||
minimizebutton.Hide()
|
||||
Else
|
||||
minimizebutton.BackColor = Skins.minbtncolour
|
||||
minimizebutton.Size = Skins.minbtnsize
|
||||
minimizebutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtwindowborders = True Then
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
Else
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
End If
|
||||
|
||||
'Change when Icon skinning complete
|
||||
If ShiftOSDesktop.boughtshiftneticon = True Then ' Change to program's icon
|
||||
pnlicon.Visible = True
|
||||
pnlicon.Location = New Point(ShiftOSDesktop.titlebariconside, ShiftOSDesktop.titlebaricontop)
|
||||
pnlicon.Size = New Size(ShiftOSDesktop.titlebariconsize, ShiftOSDesktop.titlebariconsize)
|
||||
pnlicon.Image = ShiftOSDesktop.dodgeicontitlebar 'Replace with the correct icon for the program.
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub rollupanddown()
|
||||
If Me.Height = Me.titlebar.Height Then
|
||||
pgleft.Show()
|
||||
pgbottom.Show()
|
||||
pgright.Show()
|
||||
Me.Height = rolldownsize
|
||||
Me.MinimumSize = New Size(minimumsizewidth, minimumsizeheight)
|
||||
Else
|
||||
Me.MinimumSize = New Size(0, 0)
|
||||
pgleft.Hide()
|
||||
pgbottom.Hide()
|
||||
pgright.Hide()
|
||||
rolldownsize = Me.Height
|
||||
Me.Height = Me.titlebar.Height
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub resettitlebar()
|
||||
If ShiftOSDesktop.boughtwindowborders = True Then
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
Else
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub pullside_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
Me.Width = Cursor.Position.X - Me.Location.X
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub pullbottom_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
Me.Height = Cursor.Position.Y - Me.Location.Y
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub pullbs_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
|
||||
Me.Width = Cursor.Position.X - Me.Location.X
|
||||
Me.Height = Cursor.Position.Y - Me.Location.Y
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub RightCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeWE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bottomCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottom.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeNS
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CornerCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottomrcorner.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeNWSE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SizeCursoroff_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseLeave, pgbottom.MouseLeave, pgbottomrcorner.MouseLeave
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.Default
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub setskin()
|
||||
'disposals
|
||||
closebutton.BackgroundImage = Nothing
|
||||
titlebar.BackgroundImage = Nothing
|
||||
rollupbutton.BackgroundImage = Nothing
|
||||
pgtoplcorner.BackgroundImage = Nothing
|
||||
pgtoprcorner.BackgroundImage = Nothing
|
||||
minimizebutton.BackgroundImage = Nothing
|
||||
'apply new skin
|
||||
If Skins.closebtn Is Nothing Then closebutton.BackColor = Skins.closebtncolour Else closebutton.BackgroundImage = Skins.closebtn
|
||||
closebutton.BackgroundImageLayout = Skins.closebtnlayout
|
||||
If Skins.titlebar Is Nothing Then titlebar.BackColor = Skins.titlebarcolour Else titlebar.BackgroundImage = Skins.titlebar
|
||||
titlebar.BackgroundImageLayout = Skins.titlebarlayout
|
||||
If Skins.rollbtn Is Nothing Then rollupbutton.BackColor = Skins.rollbtncolour Else rollupbutton.BackgroundImage = Skins.rollbtn
|
||||
rollupbutton.BackgroundImageLayout = Skins.rollbtnlayout
|
||||
If Skins.leftcorner Is Nothing Then pgtoplcorner.BackColor = Skins.leftcornercolour Else pgtoplcorner.BackgroundImage = Skins.leftcorner
|
||||
pgtoplcorner.BackgroundImageLayout = Skins.leftcornerlayout
|
||||
If Skins.rightcorner Is Nothing Then pgtoprcorner.BackColor = Skins.rightcornercolour Else pgtoprcorner.BackgroundImage = Skins.rightcorner
|
||||
pgtoprcorner.BackgroundImageLayout = Skins.rightcornerlayout
|
||||
If Skins.minbtn Is Nothing Then minimizebutton.BackColor = Skins.minbtncolour Else minimizebutton.BackgroundImage = Skins.minbtn
|
||||
minimizebutton.BackgroundImageLayout = Skins.minbtnlayout
|
||||
If Skins.borderleft Is Nothing Then pgleft.BackColor = Skins.borderleftcolour Else pgleft.BackgroundImage = Skins.borderleft
|
||||
pgleft.BackgroundImageLayout = Skins.borderleftlayout
|
||||
If Skins.borderright Is Nothing Then pgright.BackColor = Skins.borderrightcolour Else pgright.BackgroundImage = Skins.borderright
|
||||
pgleft.BackgroundImageLayout = Skins.borderrightlayout
|
||||
If Skins.borderbottom Is Nothing Then pgbottom.BackColor = Skins.borderbottomcolour Else pgbottom.BackgroundImage = Skins.borderbottom
|
||||
pgbottom.BackgroundImageLayout = Skins.borderbottomlayout
|
||||
If enablebordercorners = True Then
|
||||
If Skins.bottomleftcorner Is Nothing Then pgbottomlcorner.BackColor = Skins.bottomleftcornercolour Else pgbottomlcorner.BackgroundImage = Skins.bottomleftcorner
|
||||
pgbottomlcorner.BackgroundImageLayout = Skins.bottomleftcornerlayout
|
||||
If Skins.bottomrightcorner Is Nothing Then pgbottomrcorner.BackColor = Skins.bottomrightcornercolour Else pgbottomrcorner.BackgroundImage = Skins.bottomrightcorner
|
||||
pgbottomrcorner.BackgroundImageLayout = Skins.bottomrightcornerlayout
|
||||
Else
|
||||
pgbottomlcorner.BackColor = Skins.borderrightcolour
|
||||
pgbottomrcorner.BackColor = Skins.borderrightcolour
|
||||
pgbottomlcorner.BackgroundImage = Nothing
|
||||
pgbottomrcorner.BackgroundImage = Nothing
|
||||
End If
|
||||
|
||||
'set bottom border corner size
|
||||
pgbottomlcorner.Size = New Size(Skins.borderwidth, Skins.borderwidth)
|
||||
pgbottomrcorner.Size = New Size(Skins.borderwidth, Skins.borderwidth)
|
||||
pgbottomlcorner.Location = New Point(0, Me.Height - Skins.borderwidth)
|
||||
pgbottomrcorner.Location = New Point(Me.Width, Me.Height - Skins.borderwidth)
|
||||
|
||||
Me.TransparencyKey = ShiftOSDesktop.globaltransparencycolour
|
||||
End Sub
|
||||
|
||||
Private Sub Clock_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen - 1
|
||||
Me.Hide()
|
||||
ShiftOSDesktop.setuppanelbuttons()
|
||||
End Sub
|
||||
|
||||
'end of general setup
|
||||
|
||||
Private Sub QuitButton_Click(sender As Object, e As EventArgs) Handles QuitButton.Click 'When quit clicked
|
||||
Me.Close() 'quits the game (In case user donsn't have close button)
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
|
||||
keyboardinput = 0
|
||||
End Sub
|
||||
|
||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
player.Visible = False ' hide player and score until game starts
|
||||
scorelabel.Visible = False
|
||||
DescriptionLabel.Text = "Welcome to Dodge. Dodge is a simple arcade game with one objective: survive the falling objects! Use the arrow or mouse to move the player and avoid as many objects as you can. The longer you survive, the more code point you will be rewarded with. Beware, it gets harder..." ' set the description text
|
||||
|
||||
'to impliment skinning, simply set the picturebox to the new skinned image.
|
||||
'For example:
|
||||
'player.Image = Image.FromFile("PATH TO SKINNED IMAGE")
|
||||
End Sub
|
||||
|
||||
Private Sub BeginButton_Click(sender As Object, e As EventArgs) Handles BeginButton.Click 'When begin click
|
||||
|
||||
'Hide buttons
|
||||
BeginButton.Visible = False
|
||||
QuitButton.Visible = False
|
||||
DescriptionLabel.Visible = False
|
||||
|
||||
player.Visible = True ' show the player
|
||||
speed = 2 ' controls speed of game, will increase as game progresses
|
||||
scorelabel.Visible = True ' show score label
|
||||
bonusesfound = 0
|
||||
|
||||
'Make sure all objects are in the correct position
|
||||
object_small.Location = New Point((Math.Ceiling(Rnd() * 453)), 300)
|
||||
object_small2.Location = New Point((Math.Ceiling(Rnd() * 453)), 49)
|
||||
object_mid.Location = New Point((Math.Ceiling(Rnd() * 453)), 377)
|
||||
object_mid2.Location = New Point((Math.Ceiling(Rnd() * 453)), 140)
|
||||
object_large.Location = New Point((Math.Ceiling(Rnd() * 453)), 214)
|
||||
PicBonus.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
|
||||
'Reset time
|
||||
time = 0
|
||||
|
||||
usingkeys = False
|
||||
|
||||
System.Threading.Thread.Sleep(100) ' slight delay before game starts (in milliseconds)
|
||||
|
||||
main() ' start the main game sub
|
||||
|
||||
'sig() 'infobox sigs - COMMENT THIS OUT
|
||||
End Sub
|
||||
|
||||
Public Sub Form1_keydown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
|
||||
Select Case e.KeyCode
|
||||
Case Keys.Right ' detect right key press
|
||||
usingkeys = True ' turn off mouse control
|
||||
keyboardinput = 2
|
||||
Case Keys.Left
|
||||
usingkeys = True
|
||||
keyboardinput = 1
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub main()
|
||||
clock.Start() 'the timer restart this sub every tick, making an endless loop between them.
|
||||
|
||||
'score system
|
||||
scorelabel.Text = score
|
||||
score = (speed / 10) + (time / 20) + bonusesfound
|
||||
|
||||
'Speed increase
|
||||
speed = speed + (speed * 0.001)
|
||||
|
||||
'increase time
|
||||
time = time + 0.05 'loops every 0.05 seconds so time increases by 1 every second (have I done the maths correctly?)
|
||||
|
||||
'Make objects fall
|
||||
object_large.Location = New Point(object_large.Location.X, object_large.Location.Y + speed)
|
||||
object_mid.Location = New Point(object_mid.Location.X, object_mid.Location.Y + speed)
|
||||
object_mid2.Location = New Point(object_mid2.Location.X, object_mid2.Location.Y + speed)
|
||||
object_small.Location = New Point(object_small.Location.X, object_small.Location.Y + speed)
|
||||
object_small2.Location = New Point(object_small2.Location.X, object_small2.Location.Y + speed)
|
||||
|
||||
'mouse controls
|
||||
If usingkeys = False Then ' tests if mouse control is enabled
|
||||
player.Location = New Point(MousePosition.X - Me.Location.X - (player.Size.Width / 2) - 5, player.Location.Y) 'sets the x location to that of the mouse
|
||||
End If
|
||||
|
||||
'keyboard controls
|
||||
If usingkeys = True Then
|
||||
If keyboardinput = 1 Then
|
||||
player.Location = New Point(player.Location.X - (speed * 4), player.Location.Y)
|
||||
End If
|
||||
If keyboardinput = 2 Then
|
||||
player.Location = New Point(player.Location.X + (speed * 4), player.Location.Y) ' move right
|
||||
End If
|
||||
End If
|
||||
|
||||
'move object back to the top of the screen
|
||||
If object_small.Location.Y > 522 Then
|
||||
object_small.Location = New Point((Math.Ceiling(Rnd() * 453)), -20) 'picks a random number between 0 and 453 (window width) and sets the x position to this value. uses -20 for y as it is above the top of window
|
||||
End If
|
||||
If object_small2.Location.Y > 522 Then
|
||||
object_small2.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
End If
|
||||
If object_mid.Location.Y > 522 Then
|
||||
object_mid.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
End If
|
||||
If object_mid2.Location.Y > 522 Then
|
||||
object_mid2.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
End If
|
||||
If object_large.Location.Y > 522 Then
|
||||
object_large.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
End If
|
||||
|
||||
'Makes sure the player is on the screen (Anti-cheating)
|
||||
If player.Location.X > 375 Then
|
||||
player.Location = New Point(385, player.Location.Y)
|
||||
End If
|
||||
If player.Location.X < 0 Then
|
||||
player.Location = New Point(0, player.Location.Y)
|
||||
End If
|
||||
|
||||
'Bonus
|
||||
If PicBonus.Visible = False Then
|
||||
Dim ran As Integer = Math.Ceiling(Rnd() * 300) 'random 1 in 500 chance
|
||||
If ran = 1 Then
|
||||
PicBonus.Visible = True
|
||||
End If
|
||||
Else
|
||||
PicBonus.Location = New Point(PicBonus.Location.X, PicBonus.Location.Y + speed)
|
||||
If PicBonus.Location.Y > 522 Then
|
||||
PicBonus.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
PicBonus.Visible = False
|
||||
End If
|
||||
End If
|
||||
|
||||
'check collisions
|
||||
If player.Bounds.IntersectsWith(object_mid.Bounds) Or player.Bounds.IntersectsWith(object_mid2.Bounds) Or player.Bounds.IntersectsWith(object_large.Bounds) Or player.Bounds.IntersectsWith(object_small.Bounds) Or player.Bounds.IntersectsWith(object_small2.Bounds) Then
|
||||
clock.Stop() 'breaks loop
|
||||
System.Threading.Thread.Sleep(333) 'delay for a third of a second
|
||||
player.Visible = False 'hide game
|
||||
DescriptionLabel.Text = "Sorry, you just lost the game, however, you earnt a total of " & score & " code points. To earn more code points, press the begin button now. To exit, press the quit button" ' change the description to the die message
|
||||
ShiftOSDesktop.codepoints = ShiftOSDesktop.codepoints + score
|
||||
DescriptionLabel.Visible = True 'show non-game elements
|
||||
BeginButton.Visible = True
|
||||
QuitButton.Visible = True
|
||||
scorelabel.Visible = False
|
||||
End If
|
||||
If player.Bounds.IntersectsWith(PicBonus.Bounds) Then
|
||||
PicBonus.Visible = False
|
||||
bonusesfound = bonusesfound + 1
|
||||
PicBonus.Location = New Point((Math.Ceiling(Rnd() * 453)), -20)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub clock_Tick(sender As Object, e As EventArgs) Handles clock.Tick
|
||||
main() 'repeat the main sub (endless loop)
|
||||
End Sub
|
||||
|
||||
Private Sub sig()
|
||||
infobox.title = "FLAG"
|
||||
infobox.textinfo = "There is no foul on the play, the punt was blocked."
|
||||
infobox.Show()
|
||||
End Sub
|
||||
End Class
|
237
source/WindowsFormsApplication1/FloatyBird.Designer.vb
generated
237
source/WindowsFormsApplication1/FloatyBird.Designer.vb
generated
|
@ -1,237 +0,0 @@
|
|||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class FloatyBird
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.pgleft = New System.Windows.Forms.Panel()
|
||||
Me.pgbottomlcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgright = New System.Windows.Forms.Panel()
|
||||
Me.pgbottomrcorner = New System.Windows.Forms.Panel()
|
||||
Me.titlebar = New System.Windows.Forms.Panel()
|
||||
Me.minimizebutton = New System.Windows.Forms.Panel()
|
||||
Me.pnlicon = New System.Windows.Forms.PictureBox()
|
||||
Me.rollupbutton = New System.Windows.Forms.Panel()
|
||||
Me.closebutton = New System.Windows.Forms.Panel()
|
||||
Me.lbtitletext = New System.Windows.Forms.Label()
|
||||
Me.pgtoplcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgtoprcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgbottom = New System.Windows.Forms.Panel()
|
||||
Me.pgcontents = New System.Windows.Forms.Panel()
|
||||
Me.pullbs = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.pullbottom = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.pullside = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.pgleft.SuspendLayout()
|
||||
Me.pgright.SuspendLayout()
|
||||
Me.titlebar.SuspendLayout()
|
||||
CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'pgleft
|
||||
'
|
||||
Me.pgleft.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgleft.Controls.Add(Me.pgbottomlcorner)
|
||||
Me.pgleft.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.pgleft.Location = New System.Drawing.Point(0, 30)
|
||||
Me.pgleft.Name = "pgleft"
|
||||
Me.pgleft.Size = New System.Drawing.Size(2, 313)
|
||||
Me.pgleft.TabIndex = 16
|
||||
'
|
||||
'pgbottomlcorner
|
||||
'
|
||||
Me.pgbottomlcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgbottomlcorner.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottomlcorner.Location = New System.Drawing.Point(0, 311)
|
||||
Me.pgbottomlcorner.Name = "pgbottomlcorner"
|
||||
Me.pgbottomlcorner.Size = New System.Drawing.Size(2, 2)
|
||||
Me.pgbottomlcorner.TabIndex = 14
|
||||
'
|
||||
'pgright
|
||||
'
|
||||
Me.pgright.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgright.Controls.Add(Me.pgbottomrcorner)
|
||||
Me.pgright.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.pgright.Location = New System.Drawing.Point(807, 30)
|
||||
Me.pgright.Name = "pgright"
|
||||
Me.pgright.Size = New System.Drawing.Size(2, 313)
|
||||
Me.pgright.TabIndex = 17
|
||||
'
|
||||
'pgbottomrcorner
|
||||
'
|
||||
Me.pgbottomrcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgbottomrcorner.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottomrcorner.Location = New System.Drawing.Point(0, 311)
|
||||
Me.pgbottomrcorner.Name = "pgbottomrcorner"
|
||||
Me.pgbottomrcorner.Size = New System.Drawing.Size(2, 2)
|
||||
Me.pgbottomrcorner.TabIndex = 15
|
||||
'
|
||||
'titlebar
|
||||
'
|
||||
Me.titlebar.BackColor = System.Drawing.Color.Gray
|
||||
Me.titlebar.Controls.Add(Me.minimizebutton)
|
||||
Me.titlebar.Controls.Add(Me.pnlicon)
|
||||
Me.titlebar.Controls.Add(Me.rollupbutton)
|
||||
Me.titlebar.Controls.Add(Me.closebutton)
|
||||
Me.titlebar.Controls.Add(Me.lbtitletext)
|
||||
Me.titlebar.Controls.Add(Me.pgtoplcorner)
|
||||
Me.titlebar.Controls.Add(Me.pgtoprcorner)
|
||||
Me.titlebar.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.titlebar.ForeColor = System.Drawing.Color.White
|
||||
Me.titlebar.Location = New System.Drawing.Point(0, 0)
|
||||
Me.titlebar.Name = "titlebar"
|
||||
Me.titlebar.Size = New System.Drawing.Size(809, 30)
|
||||
Me.titlebar.TabIndex = 14
|
||||
'
|
||||
'minimizebutton
|
||||
'
|
||||
Me.minimizebutton.BackColor = System.Drawing.Color.Black
|
||||
Me.minimizebutton.Location = New System.Drawing.Point(246, 5)
|
||||
Me.minimizebutton.Name = "minimizebutton"
|
||||
Me.minimizebutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.minimizebutton.TabIndex = 24
|
||||
'
|
||||
'pnlicon
|
||||
'
|
||||
Me.pnlicon.BackColor = System.Drawing.Color.Transparent
|
||||
Me.pnlicon.Image = Global.ShiftOS.My.Resources.Resources.iconTextPad
|
||||
Me.pnlicon.Location = New System.Drawing.Point(8, 8)
|
||||
Me.pnlicon.Name = "pnlicon"
|
||||
Me.pnlicon.Size = New System.Drawing.Size(16, 16)
|
||||
Me.pnlicon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
|
||||
Me.pnlicon.TabIndex = 24
|
||||
Me.pnlicon.TabStop = False
|
||||
Me.pnlicon.Visible = False
|
||||
'
|
||||
'rollupbutton
|
||||
'
|
||||
Me.rollupbutton.BackColor = System.Drawing.Color.Black
|
||||
Me.rollupbutton.Location = New System.Drawing.Point(274, 3)
|
||||
Me.rollupbutton.Name = "rollupbutton"
|
||||
Me.rollupbutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.rollupbutton.TabIndex = 22
|
||||
'
|
||||
'closebutton
|
||||
'
|
||||
Me.closebutton.BackColor = System.Drawing.Color.Black
|
||||
Me.closebutton.Location = New System.Drawing.Point(302, 3)
|
||||
Me.closebutton.Name = "closebutton"
|
||||
Me.closebutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.closebutton.TabIndex = 20
|
||||
'
|
||||
'lbtitletext
|
||||
'
|
||||
Me.lbtitletext.AutoSize = True
|
||||
Me.lbtitletext.BackColor = System.Drawing.Color.Transparent
|
||||
Me.lbtitletext.Font = New System.Drawing.Font("Felix Titling", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lbtitletext.Location = New System.Drawing.Point(26, 7)
|
||||
Me.lbtitletext.Name = "lbtitletext"
|
||||
Me.lbtitletext.Size = New System.Drawing.Size(89, 18)
|
||||
Me.lbtitletext.TabIndex = 19
|
||||
Me.lbtitletext.Text = "Template"
|
||||
'
|
||||
'pgtoplcorner
|
||||
'
|
||||
Me.pgtoplcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgtoplcorner.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.pgtoplcorner.Location = New System.Drawing.Point(0, 0)
|
||||
Me.pgtoplcorner.Name = "pgtoplcorner"
|
||||
Me.pgtoplcorner.Size = New System.Drawing.Size(2, 30)
|
||||
Me.pgtoplcorner.TabIndex = 17
|
||||
'
|
||||
'pgtoprcorner
|
||||
'
|
||||
Me.pgtoprcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgtoprcorner.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.pgtoprcorner.Location = New System.Drawing.Point(807, 0)
|
||||
Me.pgtoprcorner.Name = "pgtoprcorner"
|
||||
Me.pgtoprcorner.Size = New System.Drawing.Size(2, 30)
|
||||
Me.pgtoprcorner.TabIndex = 16
|
||||
'
|
||||
'pgbottom
|
||||
'
|
||||
Me.pgbottom.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgbottom.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottom.Location = New System.Drawing.Point(2, 341)
|
||||
Me.pgbottom.Name = "pgbottom"
|
||||
Me.pgbottom.Size = New System.Drawing.Size(805, 2)
|
||||
Me.pgbottom.TabIndex = 18
|
||||
'
|
||||
'pgcontents
|
||||
'
|
||||
Me.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.pgcontents.Location = New System.Drawing.Point(2, 30)
|
||||
Me.pgcontents.Name = "pgcontents"
|
||||
Me.pgcontents.Size = New System.Drawing.Size(805, 311)
|
||||
Me.pgcontents.TabIndex = 15
|
||||
'
|
||||
'pullbs
|
||||
'
|
||||
Me.pullbs.Interval = 1
|
||||
'
|
||||
'pullbottom
|
||||
'
|
||||
Me.pullbottom.Interval = 1
|
||||
'
|
||||
'pullside
|
||||
'
|
||||
Me.pullside.Interval = 1
|
||||
'
|
||||
'FloatyBird
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(809, 343)
|
||||
Me.Controls.Add(Me.pgcontents)
|
||||
Me.Controls.Add(Me.pgbottom)
|
||||
Me.Controls.Add(Me.pgright)
|
||||
Me.Controls.Add(Me.pgleft)
|
||||
Me.Controls.Add(Me.titlebar)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
|
||||
Me.Name = "FloatyBird"
|
||||
Me.Text = "template"
|
||||
Me.TopMost = True
|
||||
Me.pgleft.ResumeLayout(False)
|
||||
Me.pgright.ResumeLayout(False)
|
||||
Me.titlebar.ResumeLayout(False)
|
||||
Me.titlebar.PerformLayout()
|
||||
CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents pgleft As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottomlcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgright As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottomrcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents titlebar As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgtoplcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgtoprcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottom As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgcontents As System.Windows.Forms.Panel
|
||||
Friend WithEvents lbtitletext As System.Windows.Forms.Label
|
||||
Friend WithEvents closebutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents rollupbutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents pnlicon As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents minimizebutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents pullbs As System.Windows.Forms.Timer
|
||||
Friend WithEvents pullbottom As System.Windows.Forms.Timer
|
||||
Friend WithEvents pullside As System.Windows.Forms.Timer
|
||||
End Class
|
|
@ -1,415 +0,0 @@
|
|||
Public Class FloatyBird
|
||||
#Region "Template Code"
|
||||
Public rolldownsize As Integer
|
||||
Public oldbordersize As Integer
|
||||
Public oldtitlebarheight As Integer
|
||||
Public justopened As Boolean = False
|
||||
Public needtorollback As Boolean = False
|
||||
Public minimumsizewidth As Integer = 0 'replace with minimum size
|
||||
Public minimumsizeheight As Integer = 0 'replace with minimum size
|
||||
|
||||
Private Sub Template_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
justopened = True
|
||||
Me.Left = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2
|
||||
Me.Top = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2
|
||||
setupall()
|
||||
|
||||
ShiftOSDesktop.pnlpanelbuttondodge.SendToBack() 'CHANGE NAME
|
||||
ShiftOSDesktop.setuppanelbuttons()
|
||||
ShiftOSDesktop.setpanelbuttonappearnce(ShiftOSDesktop.pnlpanelbuttondodge, ShiftOSDesktop.tbdodgeicon, ShiftOSDesktop.tbdodgetext, True) 'modify to proper name
|
||||
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen + 1
|
||||
End Sub
|
||||
|
||||
Public Sub setupall()
|
||||
setuptitlebar()
|
||||
setupborders()
|
||||
setskin()
|
||||
End Sub
|
||||
|
||||
Private Sub ShiftOSDesktop_keydown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
|
||||
'Make terminal appear
|
||||
If e.KeyCode = Keys.T AndAlso e.Control Then
|
||||
Terminal.Show()
|
||||
Terminal.Visible = True
|
||||
Terminal.BringToFront()
|
||||
End If
|
||||
|
||||
'Movable Windows
|
||||
If ShiftOSDesktop.boughtmovablewindows = True Then
|
||||
If e.KeyCode = Keys.A AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X - ShiftOSDesktop.movablewindownumber, Me.Location.Y)
|
||||
End If
|
||||
If e.KeyCode = Keys.D AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X + ShiftOSDesktop.movablewindownumber, Me.Location.Y)
|
||||
End If
|
||||
If e.KeyCode = Keys.W AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X, Me.Location.Y - ShiftOSDesktop.movablewindownumber)
|
||||
End If
|
||||
If e.KeyCode = Keys.S AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X, Me.Location.Y + ShiftOSDesktop.movablewindownumber)
|
||||
End If
|
||||
ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User moved " & Me.Name & " to " & Me.Location.ToString & " with " & e.KeyCode.ToString & Environment.NewLine
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub titlebar_MouseDown(sender As Object, e As MouseEventArgs) Handles titlebar.MouseDown, lbtitletext.MouseDown, pnlicon.MouseDown, pgtoplcorner.MouseDown, pgtoprcorner.MouseDown
|
||||
' Handle Draggable Windows
|
||||
If ShiftOSDesktop.boughtdraggablewindows = True Then
|
||||
If e.Button = MouseButtons.Left Then
|
||||
titlebar.Capture = False
|
||||
lbtitletext.Capture = False
|
||||
pnlicon.Capture = False
|
||||
pgtoplcorner.Capture = False
|
||||
pgtoprcorner.Capture = False
|
||||
Const WM_NCLBUTTONDOWN As Integer = &HA1S
|
||||
Const HTCAPTION As Integer = 2
|
||||
Dim msg As Message = _
|
||||
Message.Create(Me.Handle, WM_NCLBUTTONDOWN, _
|
||||
New IntPtr(HTCAPTION), IntPtr.Zero)
|
||||
Me.DefWndProc(msg)
|
||||
End If
|
||||
ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User dragged " & Me.Name & " to " & Me.Location.ToString & Environment.NewLine
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub setupborders()
|
||||
If ShiftOSDesktop.boughtwindowborders = False Then
|
||||
pgleft.Hide()
|
||||
pgbottom.Hide()
|
||||
pgright.Hide()
|
||||
Me.Size = New Size(Me.Width - pgleft.Width - pgright.Width, Me.Height - pgbottom.Height)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_Click(sender As Object, e As EventArgs) Handles closebutton.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseEnter(sender As Object, e As EventArgs) Handles closebutton.MouseEnter, closebutton.MouseUp
|
||||
closebutton.BackgroundImage = Skins.closebtnhover
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseLeave(sender As Object, e As EventArgs) Handles closebutton.MouseLeave
|
||||
closebutton.BackgroundImage = Skins.closebtn
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseDown(sender As Object, e As EventArgs) Handles closebutton.MouseDown
|
||||
closebutton.BackgroundImage = Skins.closebtnclick
|
||||
End Sub
|
||||
|
||||
Private Sub minimizebutton_Click(sender As Object, e As EventArgs) Handles minimizebutton.Click
|
||||
ShiftOSDesktop.minimizeprogram(Me, False)
|
||||
End Sub
|
||||
|
||||
'Old skinning system - No idea what this does
|
||||
''Private Sub titlebar_MouseEnter(sender As Object, e As EventArgs) Handles titlebar.MouseEnter, titlebar.MouseUp, lbtitletext.MouseEnter, pnlicon.MouseEnter, closebutton.MouseEnter, rollupbutton.MouseEnter
|
||||
'' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(1)
|
||||
''End Sub
|
||||
|
||||
'Private Sub titlebar_MouseLeave(sender As Object, e As EventArgs) Handles titlebar.MouseLeave, lbtitletext.MouseLeave, pnlicon.MouseLeave, closebutton.MouseLeave, rollupbutton.MouseLeave
|
||||
' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(0)
|
||||
'End Sub
|
||||
|
||||
Private Sub rollupbutton_Click(sender As Object, e As EventArgs) Handles rollupbutton.Click
|
||||
rollupanddown()
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseEnter(sender As Object, e As EventArgs) Handles rollupbutton.MouseEnter, rollupbutton.MouseUp
|
||||
rollupbutton.BackgroundImage = Skins.rollbtnhover
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseLeave(sender As Object, e As EventArgs) Handles rollupbutton.MouseLeave
|
||||
rollupbutton.BackgroundImage = Skins.rollbtn
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseDown(sender As Object, e As EventArgs) Handles rollupbutton.MouseDown
|
||||
rollupbutton.BackgroundImage = Skins.rollbtnclick
|
||||
End Sub
|
||||
|
||||
Public Sub setuptitlebar()
|
||||
|
||||
setupborders()
|
||||
|
||||
If Me.Height = Me.titlebar.Height Then pgleft.Show() : pgbottom.Show() : pgright.Show() : Me.Height = rolldownsize : needtorollback = True
|
||||
pgleft.Width = Skins.borderwidth
|
||||
pgright.Width = Skins.borderwidth
|
||||
pgbottom.Height = Skins.borderwidth
|
||||
titlebar.Height = Skins.titlebarheight
|
||||
|
||||
' fixes growing issue
|
||||
If justopened = False Then
|
||||
Me.Size = New Size(Me.Width, Me.Height - (Skins.titlebarheight / 2))
|
||||
End If
|
||||
|
||||
If justopened = True Then
|
||||
Me.Size = New Size(420, 510) 'put the default size of your window here
|
||||
Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
|
||||
Me.Size = New Size(Me.Width + Skins.borderwidth + Skins.borderwidth, Me.Height + Skins.borderwidth)
|
||||
oldbordersize = Skins.borderwidth
|
||||
oldtitlebarheight = Skins.titlebarheight
|
||||
justopened = False
|
||||
Else
|
||||
If Me.Visible = True Then
|
||||
'Me.Hide()
|
||||
Me.Size = New Size(Me.Width - (2 * oldbordersize) + (2 * Skins.borderwidth), (Me.Height - oldtitlebarheight - oldbordersize) + Skins.titlebarheight + Skins.borderwidth)
|
||||
'Me.Size = New Size(Me.Width - oldbordersize - oldbordersize, Me.Height - oldbordersize) 'Just put a little algebra in the first size setting and comment out the mess
|
||||
oldbordersize = Skins.borderwidth
|
||||
oldtitlebarheight = Skins.titlebarheight
|
||||
'Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
|
||||
'Me.Size = New Size(Me.Width + Skins. borderwidth + Skins. borderwidth, Me.Height + Skins. borderwidth)
|
||||
'rolldownsize = Me.Height
|
||||
If needtorollback = True Then Me.Height = titlebar.Height : pgleft.Hide() : pgbottom.Hide() : pgright.Hide()
|
||||
'Me.Show()
|
||||
End If
|
||||
End If
|
||||
|
||||
If Skins.enablecorners = True Then
|
||||
pgtoplcorner.Show()
|
||||
pgtoprcorner.Show()
|
||||
pgtoprcorner.Width = Skins.titlebarcornerwidth
|
||||
pgtoplcorner.Width = Skins.titlebarcornerwidth
|
||||
Else
|
||||
pgtoplcorner.Hide()
|
||||
pgtoprcorner.Hide()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughttitlebar = False Then
|
||||
titlebar.Hide()
|
||||
Me.Size = New Size(Me.Width, Me.Size.Height - titlebar.Height)
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughttitletext = False Then
|
||||
lbtitletext.Hide()
|
||||
Else
|
||||
lbtitletext.Font = New Font(Skins.titletextfontfamily, Skins.titletextfontsize, Skins.titletextfontstyle, GraphicsUnit.Point)
|
||||
lbtitletext.Text = ShiftOSDesktop.dodgename 'Remember to change to name of program!!!!
|
||||
lbtitletext.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtclosebutton = False Then
|
||||
closebutton.Hide()
|
||||
Else
|
||||
closebutton.BackColor = Skins.closebtncolour
|
||||
closebutton.Size = Skins.closebtnsize
|
||||
closebutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtrollupbutton = False Then
|
||||
rollupbutton.Hide()
|
||||
Else
|
||||
rollupbutton.BackColor = Skins.rollbtncolour
|
||||
rollupbutton.Size = Skins.rollbtnsize
|
||||
rollupbutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtminimizebutton = False Then
|
||||
minimizebutton.Hide()
|
||||
Else
|
||||
minimizebutton.BackColor = Skins.minbtncolour
|
||||
minimizebutton.Size = Skins.minbtnsize
|
||||
minimizebutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtwindowborders = True Then
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
Else
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
End If
|
||||
|
||||
'Change when Icon skinning complete
|
||||
If ShiftOSDesktop.boughtknowledgeinputicon = True Then ' Change to program's icon
|
||||
pnlicon.Visible = True
|
||||
pnlicon.Location = New Point(Skins.titleiconfromside, Skins.titleiconfromtop)
|
||||
pnlicon.Size = New Size(ShiftOSDesktop.titlebariconsize, ShiftOSDesktop.titlebariconsize)
|
||||
pnlicon.Image = ShiftOSDesktop.dodgeicontitlebar 'Replace with the correct icon for the program.
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub rollupanddown()
|
||||
If Me.Height = Me.titlebar.Height Then
|
||||
pgleft.Show()
|
||||
pgbottom.Show()
|
||||
pgright.Show()
|
||||
Me.Height = rolldownsize
|
||||
Me.MinimumSize = New Size(minimumsizewidth, minimumsizeheight)
|
||||
Else
|
||||
Me.MinimumSize = New Size(0, 0)
|
||||
pgleft.Hide()
|
||||
pgbottom.Hide()
|
||||
pgright.Hide()
|
||||
rolldownsize = Me.Height
|
||||
Me.Height = Me.titlebar.Height
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub resettitlebar()
|
||||
If ShiftOSDesktop.boughtwindowborders = True Then
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
Else
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub pullside_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullside.Tick
|
||||
Me.Width = Cursor.Position.X - Me.Location.X
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub pullbottom_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullbottom.Tick
|
||||
Me.Height = Cursor.Position.Y - Me.Location.Y
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub pullbs_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles pullbs.Tick
|
||||
Me.Width = Cursor.Position.X - Me.Location.X
|
||||
Me.Height = Cursor.Position.Y - Me.Location.Y
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
'delete this for non-resizable windows
|
||||
Private Sub Rightpull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgright.MouseDown
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullside.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RightCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeWE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bottomCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottom.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeNS
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CornerCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottomrcorner.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeNWSE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SizeCursoroff_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseLeave, pgbottom.MouseLeave, pgbottomrcorner.MouseLeave
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.Default
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub rightpull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgright.MouseUp
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullside.Stop()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bottompull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottom.MouseDown
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbottom.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub buttompull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottom.MouseUp
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbottom.Stop()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bspull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottomrcorner.MouseDown
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbs.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bspull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottomrcorner.MouseUp
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbs.Stop()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub setskin()
|
||||
'disposals
|
||||
closebutton.BackgroundImage = Nothing
|
||||
titlebar.BackgroundImage = Nothing
|
||||
rollupbutton.BackgroundImage = Nothing
|
||||
pgtoplcorner.BackgroundImage = Nothing
|
||||
pgtoprcorner.BackgroundImage = Nothing
|
||||
minimizebutton.BackgroundImage = Nothing
|
||||
'apply new skin
|
||||
If Skins.closebtn Is Nothing Then closebutton.BackColor = Skins.closebtncolour Else closebutton.BackgroundImage = Skins.closebtn
|
||||
closebutton.BackgroundImageLayout = Skins.closebtnlayout
|
||||
If Skins.titlebar Is Nothing Then titlebar.BackColor = Skins.titlebarcolour Else titlebar.BackgroundImage = Skins.titlebar
|
||||
titlebar.BackgroundImageLayout = Skins.titlebarlayout
|
||||
If Skins.rollbtn Is Nothing Then rollupbutton.BackColor = Skins.rollbtncolour Else rollupbutton.BackgroundImage = Skins.rollbtn
|
||||
rollupbutton.BackgroundImageLayout = Skins.rollbtnlayout
|
||||
If Skins.leftcorner Is Nothing Then pgtoplcorner.BackColor = Skins.leftcornercolour Else pgtoplcorner.BackgroundImage = Skins.leftcorner
|
||||
pgtoplcorner.BackgroundImageLayout = Skins.leftcornerlayout
|
||||
If Skins.rightcorner Is Nothing Then pgtoprcorner.BackColor = Skins.rightcornercolour Else pgtoprcorner.BackgroundImage = Skins.rightcorner
|
||||
pgtoprcorner.BackgroundImageLayout = Skins.rightcornerlayout
|
||||
If Skins.minbtn Is Nothing Then minimizebutton.BackColor = Skins.minbtncolour Else minimizebutton.BackgroundImage = Skins.minbtn
|
||||
minimizebutton.BackgroundImageLayout = Skins.minbtnlayout
|
||||
|
||||
'remove background colour when image is present
|
||||
'If closebutton.BackgroundImage Is Nothing Then Else closebutton.BackColor = Color.Transparent
|
||||
'If titlebar.BackgroundImage Is Nothing Then Else titlebar.BackColor = Color.Transparent
|
||||
'If rollupbutton.BackgroundImage Is Nothing Then Else rollupbutton.BackColor = Color.Transparent
|
||||
'If pgtoplcorner.BackgroundImage Is Nothing Then Else pgtoplcorner.BackColor = Color.Transparent
|
||||
'If pgtoprcorner.BackgroundImage Is Nothing Then Else pgtoprcorner.BackColor = Color.Transparent
|
||||
'If minimizebutton.BackgroundImage Is Nothing Then Else minimizebutton.BackColor = Color.Transparent
|
||||
|
||||
Me.TransparencyKey = ShiftOSDesktop.globaltransparencycolour
|
||||
End Sub
|
||||
|
||||
Private Sub Clock_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen - 1
|
||||
Me.Hide()
|
||||
ShiftOSDesktop.setuppanelbuttons()
|
||||
End Sub
|
||||
|
||||
'end of general setup
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
End Class
|
102
source/WindowsFormsApplication1/HackUI.Designer.cs
generated
102
source/WindowsFormsApplication1/HackUI.Designer.cs
generated
|
@ -36,11 +36,10 @@ private void InitializeComponent()
|
|||
this.lbenemystats = new System.Windows.Forms.Label();
|
||||
this.txtyourconsole = new System.Windows.Forms.TextBox();
|
||||
this.pnlyou = new System.Windows.Forms.Panel();
|
||||
this.btnnext = new System.Windows.Forms.Button();
|
||||
this.lbtutorial = new System.Windows.Forms.Label();
|
||||
this.lbcompromised = new System.Windows.Forms.Label();
|
||||
this.lbstats = new System.Windows.Forms.Label();
|
||||
this.txtenemyconsole = new System.Windows.Forms.TextBox();
|
||||
this.btnnext = new System.Windows.Forms.Button();
|
||||
this.pnlbuy = new System.Windows.Forms.Panel();
|
||||
this.txthostname = new System.Windows.Forms.TextBox();
|
||||
this.lbhostname = new System.Windows.Forms.Label();
|
||||
|
@ -69,6 +68,8 @@ private void InitializeComponent()
|
|||
this.btntogglemusic = new System.Windows.Forms.Button();
|
||||
this.lbsong = new System.Windows.Forms.Label();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.pnltutorial = new System.Windows.Forms.Panel();
|
||||
this.lbtutorial = new System.Windows.Forms.Label();
|
||||
this.tmrplayerhealthdetect = new System.Windows.Forms.Timer(this.components);
|
||||
this.tmrenemyhealthdetect = new System.Windows.Forms.Timer(this.components);
|
||||
this.tmrredraw = new System.Windows.Forms.Timer(this.components);
|
||||
|
@ -80,6 +81,7 @@ private void InitializeComponent()
|
|||
this.pnlpcinfo.SuspendLayout();
|
||||
this.flcontrols.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.pnltutorial.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tbui
|
||||
|
@ -98,7 +100,7 @@ private void InitializeComponent()
|
|||
this.tbui.RowCount = 2;
|
||||
this.tbui.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tbui.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tbui.Size = new System.Drawing.Size(1339, 742);
|
||||
this.tbui.Size = new System.Drawing.Size(1339, 710);
|
||||
this.tbui.TabIndex = 0;
|
||||
//
|
||||
// pnlenemy
|
||||
|
@ -109,9 +111,9 @@ private void InitializeComponent()
|
|||
this.pnlenemy.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlenemy.Font = new System.Drawing.Font("Lucida Console", 8.25F);
|
||||
this.pnlenemy.ForeColor = System.Drawing.Color.White;
|
||||
this.pnlenemy.Location = new System.Drawing.Point(673, 374);
|
||||
this.pnlenemy.Location = new System.Drawing.Point(673, 358);
|
||||
this.pnlenemy.Name = "pnlenemy";
|
||||
this.pnlenemy.Size = new System.Drawing.Size(662, 364);
|
||||
this.pnlenemy.Size = new System.Drawing.Size(662, 348);
|
||||
this.pnlenemy.TabIndex = 4;
|
||||
//
|
||||
// lbenemycompromised
|
||||
|
@ -139,18 +141,16 @@ private void InitializeComponent()
|
|||
this.txtyourconsole.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.txtyourconsole.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtyourconsole.ForeColor = System.Drawing.Color.LightGreen;
|
||||
this.txtyourconsole.Location = new System.Drawing.Point(4, 374);
|
||||
this.txtyourconsole.Location = new System.Drawing.Point(4, 358);
|
||||
this.txtyourconsole.Multiline = true;
|
||||
this.txtyourconsole.Name = "txtyourconsole";
|
||||
this.txtyourconsole.Size = new System.Drawing.Size(662, 364);
|
||||
this.txtyourconsole.Size = new System.Drawing.Size(662, 348);
|
||||
this.txtyourconsole.TabIndex = 3;
|
||||
this.txtyourconsole.Text = "PLAYER CONSOLE";
|
||||
//
|
||||
// pnlyou
|
||||
//
|
||||
this.pnlyou.BackColor = System.Drawing.Color.Black;
|
||||
this.pnlyou.Controls.Add(this.btnnext);
|
||||
this.pnlyou.Controls.Add(this.lbtutorial);
|
||||
this.pnlyou.Controls.Add(this.lbcompromised);
|
||||
this.pnlyou.Controls.Add(this.lbstats);
|
||||
this.pnlyou.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
|
@ -158,36 +158,10 @@ private void InitializeComponent()
|
|||
this.pnlyou.ForeColor = System.Drawing.Color.White;
|
||||
this.pnlyou.Location = new System.Drawing.Point(4, 4);
|
||||
this.pnlyou.Name = "pnlyou";
|
||||
this.pnlyou.Size = new System.Drawing.Size(662, 363);
|
||||
this.pnlyou.Size = new System.Drawing.Size(662, 347);
|
||||
this.pnlyou.TabIndex = 1;
|
||||
this.pnlyou.MouseDown += new System.Windows.Forms.MouseEventHandler(this.playfield_MouseDown);
|
||||
//
|
||||
// btnnext
|
||||
//
|
||||
this.btnnext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnnext.AutoSize = true;
|
||||
this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnnext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnnext.Location = new System.Drawing.Point(581, 102);
|
||||
this.btnnext.Name = "btnnext";
|
||||
this.btnnext.Size = new System.Drawing.Size(66, 23);
|
||||
this.btnnext.TabIndex = 9;
|
||||
this.btnnext.Text = "Next >>";
|
||||
this.btnnext.UseVisualStyleBackColor = true;
|
||||
this.btnnext.Visible = false;
|
||||
this.btnnext.TextChanged += new System.EventHandler(this.btnnext_Click);
|
||||
//
|
||||
// lbtutorial
|
||||
//
|
||||
this.lbtutorial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lbtutorial.Location = new System.Drawing.Point(280, 13);
|
||||
this.lbtutorial.Name = "lbtutorial";
|
||||
this.lbtutorial.Size = new System.Drawing.Size(367, 86);
|
||||
this.lbtutorial.TabIndex = 8;
|
||||
this.lbtutorial.Text = resources.GetString("lbtutorial.Text");
|
||||
this.lbtutorial.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
this.lbtutorial.Visible = false;
|
||||
//
|
||||
// lbcompromised
|
||||
//
|
||||
this.lbcompromised.AutoSize = true;
|
||||
|
@ -216,10 +190,25 @@ private void InitializeComponent()
|
|||
this.txtenemyconsole.Location = new System.Drawing.Point(673, 4);
|
||||
this.txtenemyconsole.Multiline = true;
|
||||
this.txtenemyconsole.Name = "txtenemyconsole";
|
||||
this.txtenemyconsole.Size = new System.Drawing.Size(662, 363);
|
||||
this.txtenemyconsole.Size = new System.Drawing.Size(662, 347);
|
||||
this.txtenemyconsole.TabIndex = 2;
|
||||
this.txtenemyconsole.Text = "ENEMY CONSOLE";
|
||||
//
|
||||
// btnnext
|
||||
//
|
||||
this.btnnext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnnext.AutoSize = true;
|
||||
this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnnext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.btnnext.Location = new System.Drawing.Point(294, 161);
|
||||
this.btnnext.Name = "btnnext";
|
||||
this.btnnext.Size = new System.Drawing.Size(66, 23);
|
||||
this.btnnext.TabIndex = 9;
|
||||
this.btnnext.Text = "Next >>";
|
||||
this.btnnext.UseVisualStyleBackColor = true;
|
||||
this.btnnext.Visible = false;
|
||||
this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
|
||||
//
|
||||
// pnlbuy
|
||||
//
|
||||
this.pnlbuy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
|
@ -231,7 +220,7 @@ private void InitializeComponent()
|
|||
this.pnlbuy.Controls.Add(this.cmbbuyable);
|
||||
this.pnlbuy.Controls.Add(this.label4);
|
||||
this.pnlbuy.Controls.Add(this.btndonebuying);
|
||||
this.pnlbuy.Location = new System.Drawing.Point(7, 437);
|
||||
this.pnlbuy.Location = new System.Drawing.Point(7, 405);
|
||||
this.pnlbuy.Name = "pnlbuy";
|
||||
this.pnlbuy.Size = new System.Drawing.Size(382, 299);
|
||||
this.pnlbuy.TabIndex = 6;
|
||||
|
@ -328,7 +317,7 @@ private void InitializeComponent()
|
|||
this.pnldefensemanager.Controls.Add(this.cmbmodules);
|
||||
this.pnldefensemanager.Controls.Add(this.label1);
|
||||
this.pnldefensemanager.Controls.Add(this.button1);
|
||||
this.pnldefensemanager.Location = new System.Drawing.Point(395, 456);
|
||||
this.pnldefensemanager.Location = new System.Drawing.Point(395, 424);
|
||||
this.pnldefensemanager.Name = "pnldefensemanager";
|
||||
this.pnldefensemanager.Size = new System.Drawing.Size(382, 280);
|
||||
this.pnldefensemanager.TabIndex = 5;
|
||||
|
@ -400,7 +389,7 @@ private void InitializeComponent()
|
|||
this.pnlpcinfo.Controls.Add(this.lbpcinfo);
|
||||
this.pnlpcinfo.Controls.Add(this.lbmoduletitle);
|
||||
this.pnlpcinfo.Controls.Add(this.btncloseinfo);
|
||||
this.pnlpcinfo.Location = new System.Drawing.Point(783, 456);
|
||||
this.pnlpcinfo.Location = new System.Drawing.Point(783, 424);
|
||||
this.pnlpcinfo.Name = "pnlpcinfo";
|
||||
this.pnlpcinfo.Size = new System.Drawing.Size(382, 280);
|
||||
this.pnlpcinfo.TabIndex = 7;
|
||||
|
@ -480,7 +469,7 @@ private void InitializeComponent()
|
|||
this.flcontrols.Controls.Add(this.btntogglemusic);
|
||||
this.flcontrols.Controls.Add(this.lbsong);
|
||||
this.flcontrols.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.flcontrols.Location = new System.Drawing.Point(0, 742);
|
||||
this.flcontrols.Location = new System.Drawing.Point(0, 710);
|
||||
this.flcontrols.Name = "flcontrols";
|
||||
this.flcontrols.Size = new System.Drawing.Size(1339, 31);
|
||||
this.flcontrols.TabIndex = 4;
|
||||
|
@ -531,6 +520,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.pnltutorial);
|
||||
this.panel2.Controls.Add(this.pnlbuy);
|
||||
this.panel2.Controls.Add(this.pnlpcinfo);
|
||||
this.panel2.Controls.Add(this.pnldefensemanager);
|
||||
|
@ -539,9 +529,30 @@ private void InitializeComponent()
|
|||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(1339, 773);
|
||||
this.panel2.Size = new System.Drawing.Size(1339, 741);
|
||||
this.panel2.TabIndex = 1;
|
||||
//
|
||||
// pnltutorial
|
||||
//
|
||||
this.pnltutorial.Controls.Add(this.btnnext);
|
||||
this.pnltutorial.Controls.Add(this.lbtutorial);
|
||||
this.pnltutorial.Location = new System.Drawing.Point(174, 161);
|
||||
this.pnltutorial.Name = "pnltutorial";
|
||||
this.pnltutorial.Size = new System.Drawing.Size(363, 187);
|
||||
this.pnltutorial.TabIndex = 10;
|
||||
this.pnltutorial.Visible = false;
|
||||
//
|
||||
// lbtutorial
|
||||
//
|
||||
this.lbtutorial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lbtutorial.Location = new System.Drawing.Point(-2, 50);
|
||||
this.lbtutorial.Name = "lbtutorial";
|
||||
this.lbtutorial.Size = new System.Drawing.Size(367, 86);
|
||||
this.lbtutorial.TabIndex = 9;
|
||||
this.lbtutorial.Text = resources.GetString("lbtutorial.Text");
|
||||
this.lbtutorial.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lbtutorial.Visible = false;
|
||||
//
|
||||
// tmrplayerhealthdetect
|
||||
//
|
||||
this.tmrplayerhealthdetect.Tick += new System.EventHandler(this.tmrplayerhealthdetect_Tick);
|
||||
|
@ -559,7 +570,7 @@ private void InitializeComponent()
|
|||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 11F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.Black;
|
||||
this.ClientSize = new System.Drawing.Size(1339, 773);
|
||||
this.ClientSize = new System.Drawing.Size(1339, 741);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Font = new System.Drawing.Font("Lucida Console", 8.25F);
|
||||
this.ForeColor = System.Drawing.Color.LightGreen;
|
||||
|
@ -583,6 +594,8 @@ private void InitializeComponent()
|
|||
this.flcontrols.ResumeLayout(false);
|
||||
this.flcontrols.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.pnltutorial.ResumeLayout(false);
|
||||
this.pnltutorial.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -607,7 +620,6 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.Button btnnext;
|
||||
private System.Windows.Forms.Label lbtutorial;
|
||||
private System.Windows.Forms.Panel pnlpcinfo;
|
||||
private System.Windows.Forms.Label lbtargets;
|
||||
private System.Windows.Forms.Button btnpoweroff;
|
||||
|
@ -631,5 +643,7 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.Label lbcodepoints;
|
||||
private System.Windows.Forms.Button btntogglemusic;
|
||||
private System.Windows.Forms.Label lbsong;
|
||||
private System.Windows.Forms.Panel pnltutorial;
|
||||
private System.Windows.Forms.Label lbtutorial;
|
||||
}
|
||||
}
|
|
@ -37,7 +37,9 @@ public HackUI(EnemyHacker enemy)
|
|||
private void LoadPlayerScreen()
|
||||
{
|
||||
AntiVirusBounds = new List<Rectangle>();
|
||||
TutorialNetwork.Add(new Module(SystemType.Core, 1, "localhost"));
|
||||
var tc = new Module(SystemType.Core, 1, "localhost");
|
||||
tc.HP = 100;
|
||||
TutorialNetwork.Add(tc);
|
||||
foreach (var m in GetMyNet())
|
||||
{
|
||||
if (m.Type == SystemType.Core)
|
||||
|
@ -90,6 +92,12 @@ private void VisualizePlayerNetwork()
|
|||
|
||||
private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if(ThisPlayerPC != null)
|
||||
{
|
||||
ThisPlayerPC.Left = (pnlyou.Width - ThisPlayerPC.Width) / 2;
|
||||
ThisPlayerPC.Top = (pnlyou.Height - ThisPlayerPC.Height) / 2;
|
||||
|
||||
}
|
||||
var rnd = new Random();
|
||||
int chance = 0;
|
||||
foreach (var pc in AllPlayerComputers)
|
||||
|
@ -131,9 +139,16 @@ private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
|
|||
{
|
||||
TotalPlayerHP = health;
|
||||
}
|
||||
decimal percent = (health / TotalPlayerHP) * 100;
|
||||
lbstats.Text = $"System Health: {percent}%";
|
||||
if (ThisPlayerPC.HP <= 0)
|
||||
try
|
||||
{
|
||||
decimal percent = (health / TotalPlayerHP) * 100;
|
||||
lbstats.Text = $"System Health: {percent}%";
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
if (ThisPlayerPC.HP <= 0)
|
||||
{
|
||||
API.CreateInfoboxSession("System compromised.", "The enemy hacker has overthrown your defenses and compromised your system. You will need to wait an hour before you can start another hack battle.", infobox.InfoboxMode.Info);
|
||||
Hacking.Failure = true;
|
||||
|
@ -147,17 +162,22 @@ private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
|
|||
|
||||
private void this_Closing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
arc.Dispose();
|
||||
if (UserRequestedClose == false)
|
||||
{
|
||||
arc.Dispose();
|
||||
Computer[] pcs = { };
|
||||
AllPlayerComputers.CopyTo(pcs);
|
||||
foreach(var pc in pcs)
|
||||
{
|
||||
pc.Dispose();
|
||||
}
|
||||
tmrplayerhealthdetect.Stop();
|
||||
Hacking.RepairTimer.Start(); //Now the player can repair.
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Cancel = true;
|
||||
API.CreateInfoboxSession("Can't retreat now.", "You started this battle, and made it this far. Finish what you started. Don't run away.", infobox.InfoboxMode.Info);
|
||||
}
|
||||
Hacking.RepairTimer.Start(); //Now the player can repair.
|
||||
}
|
||||
|
||||
public Computer SelectedPlayerComputer = null;
|
||||
|
@ -789,30 +809,33 @@ public void SetupTutorialUI(int p)
|
|||
{
|
||||
TutorialProgress = p;
|
||||
lbtutorial.Show();
|
||||
pnltutorial.Show();
|
||||
pnltutorial.Left = (this.Width - pnltutorial.Width) / 2;
|
||||
pnltutorial.Top = (this.Height - pnltutorial.Height) / 2;
|
||||
switch (p)
|
||||
{
|
||||
case 0:
|
||||
lbtutorial.Text = "Welcome to the Hacker Battle tutorial. This guide will teach you the fundamentals and basics of taking part in a Hacker Battle. When you're done here, you'll have all you need for a very basic network.";
|
||||
lbtutorial.Text = "Welcome to the Hacker Battle tutorial. This guide will teach you the fundamentals and basics of taking part in a Hacker Battle. When you're done here, you'll be able to start up a network and start dominating others' networks.";
|
||||
btnaddmodule.Hide();
|
||||
btnnext.Show();
|
||||
break;
|
||||
case 1:
|
||||
lbtutorial.Text = "When a battle commenses, you will see two windows. The one on the left, is your network. You can view information about all computers on the network, buy new systems, upgrade them and deploy them.";
|
||||
lbtutorial.Text = "Let's go over the user interface. It's quite simple, actually. There are 4 different displays on your screen. One for your network, one for your console, and same for the enemy.";
|
||||
break;
|
||||
case 2:
|
||||
lbtutorial.Text = "On the right is the enemy's network. This window will show you the strength (HP) of all enemy systems, and will allow you to target specific systems to take down.";
|
||||
lbtutorial.Text = "On the left side is your console and playfield. Your console will log all the actions that happen on your network. Your Playfield is a visual representation of your network. Each square represents a different module. Most of your actions will take place in the Playfield.";
|
||||
break;
|
||||
case 3:
|
||||
lbtutorial.Text = "On the top-left corner of both windows is the network health indicator. It will display a percentage of the entire network health.";
|
||||
lbtutorial.Text = "On the right is the enemy's console and playfield. Both playfields will show the HP (health) of each module, and the total network HP.";
|
||||
break;
|
||||
case 4:
|
||||
lbtutorial.Text = "If the enemy's total network health hits 0%, or his core's strength hits 0%, you win.";
|
||||
break;
|
||||
case 5:
|
||||
lbtutorial.Text = "However, if the same happens to you, you will lose the battle.";
|
||||
lbtutorial.Text = "However, if the same happens to you, you will lose the battle, and won't be able to fight back until your Core heals.";
|
||||
break;
|
||||
case 6:
|
||||
lbtutorial.Text = "You can click on your Core to view information about it.";
|
||||
lbtutorial.Text = "Each network has one core. It is represented by the square in the centre of the playfield. Click on your Core to view information about it.";
|
||||
btnnext.Hide();
|
||||
break;
|
||||
case 7:
|
||||
|
@ -841,16 +864,19 @@ public void SetupTutorialUI(int p)
|
|||
btnnext.Hide();
|
||||
break;
|
||||
case 13:
|
||||
btnbuy.Hide();
|
||||
lbtutorial.Text = "You can select a module from the list of hostnames. Only modules that are not powered on will display in the menu.";
|
||||
btnnext.Show();
|
||||
BuyableModules = new List<FutureModule>();
|
||||
BuyableModules.Add(new FutureModule("Antivirus", 0, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
|
||||
break;
|
||||
case 14:
|
||||
btnbuy.Show();
|
||||
lbtutorial.Text = "In this demonstration, you have no other modules to deploy. You will need to buy some modules to get started. Click [Buy New Module] to continue.";
|
||||
btnnext.Hide();
|
||||
break;
|
||||
case 15:
|
||||
cmbbuyable.Enabled = false;
|
||||
lbtutorial.Text = "Let's go over the user interface, shall we? At the top is a list of all possible module types.";
|
||||
btnnext.Show();
|
||||
btndonebuying.Hide();
|
||||
|
@ -865,6 +891,7 @@ public void SetupTutorialUI(int p)
|
|||
lbmoduleinfo.Show();
|
||||
break;
|
||||
case 17:
|
||||
cmbbuyable.Enabled = true;
|
||||
lbtutorial.Text = "We need an Antivirus module, so go ahead and select it from the menu.";
|
||||
btnnext.Hide();
|
||||
break;
|
||||
|
@ -923,6 +950,8 @@ public void SetupTutorialUI(int p)
|
|||
lbtutorial.Text = "Some modules do not work on a target-based system. Some may work using an area-of-effect system (like an Antivirus), and some may target the entire enemy network.";
|
||||
break;
|
||||
case 32:
|
||||
pnltutorial.Left = this.Width - pnltutorial.Width;
|
||||
pnltutorial.Top = this.Height - flcontrols.Height - pnltutorial.Height;
|
||||
lbtutorial.Text = "We have reset both your Cores' health. Go ahead and finish off the enemy Core using your newfound skills.";
|
||||
ThisPlayerPC.HP = 100;
|
||||
ThisEnemyPC.HP = 100;
|
||||
|
@ -932,6 +961,7 @@ public void SetupTutorialUI(int p)
|
|||
BuyableModules.Add(new FutureModule("Turret", 0, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
|
||||
break;
|
||||
default:
|
||||
btnnext.Show();
|
||||
lbtutorial.Text = "This concludes the Hacker Battle tutorial. Happy hunting, soldier. Just kidding. Stay safe.";
|
||||
btnnext.Text = "Close";
|
||||
break;
|
||||
|
@ -1249,7 +1279,39 @@ private void tmrenemyhealthdetect_Tick(object sender, EventArgs e)
|
|||
}
|
||||
else
|
||||
{
|
||||
API.CreateInfoboxSession("You won.", "You have successfully overthrown the enemy network.", infobox.InfoboxMode.Info);
|
||||
string message = "You have successfully beaten the enemy hacker.";
|
||||
if (ThisEnemyHacker.IsLeader == false)
|
||||
{
|
||||
switch(rnd.Next(0, 5))
|
||||
{
|
||||
case 1:
|
||||
API.AddCodepoints(1000);
|
||||
message = "You have beaten the enemy. You have earned some precious Codepoints for your effort!";
|
||||
break;
|
||||
case 2:
|
||||
message = "You have beaten the enemy. As a reward, all Shiftorium Upgrades cost half-price.";
|
||||
Hacking.GiveHack(Hack.PriceDrop);
|
||||
break;
|
||||
case 3:
|
||||
message = "You have beaten the enemy. As a reward, applications will now pay out more Codepoints than usual.";
|
||||
Hacking.GiveHack(Hack.PayoutIncrease);
|
||||
break;
|
||||
case 4:
|
||||
message = "The enemy has recognized your skill and has decided to become a friend. You can now hire them for free as a partner during a system hack.";
|
||||
//befriend the enemy.
|
||||
var skill = ThisEnemyHacker.FriendSkill;
|
||||
var speed = ThisEnemyHacker.FriendSpeed;
|
||||
var desc = ThisEnemyHacker.FriendDesc;
|
||||
var name = ThisEnemyHacker.Name;
|
||||
Hacking.AddCharacter(new Character(name, desc, skill, speed, 0));
|
||||
break;
|
||||
default:
|
||||
message = "You have successfully beaten the enemy hacker.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
API.CreateInfoboxSession("You won.", message, infobox.InfoboxMode.Info);
|
||||
|
||||
UserRequestedClose = false;
|
||||
var h = OnWin;
|
||||
if(h != null)
|
||||
|
@ -1317,5 +1379,7 @@ private void button2_Click(object sender, EventArgs e)
|
|||
{
|
||||
arc.Pause();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -117,15 +117,6 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="lbtutorial.Text" xml:space="preserve">
|
||||
<value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
|
||||
|
||||
Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
|
||||
|
||||
To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
|
||||
|
||||
If you would like to buy a new module, click 'Buy new module'.</value>
|
||||
</data>
|
||||
<data name="lbmoduleinfo.Text" xml:space="preserve">
|
||||
<value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
|
||||
|
||||
|
@ -151,6 +142,15 @@ Some modules have a range of effect. For example, an Antivirus will only heal mo
|
|||
|
||||
To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
|
||||
|
||||
If you would like to buy a new module, click 'Buy new module'.</value>
|
||||
</data>
|
||||
<data name="lbtutorial.Text" xml:space="preserve">
|
||||
<value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
|
||||
|
||||
Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
|
||||
|
||||
To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
|
||||
|
||||
If you would like to buy a new module, click 'Buy new module'.</value>
|
||||
</data>
|
||||
<metadata name="tmrplayerhealthdetect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
|
|
@ -437,7 +437,7 @@ public static void StartHack(int cid, string upgrade)
|
|||
public static void StartBattleTutorial()
|
||||
{
|
||||
var e = new EnemyHacker("Tutorial", "Tutorial hacker", "Tutorial hacker", 0, 0, "easy");
|
||||
var y = new Hacking_YourHealth(e);
|
||||
var y = new HackUI(e);
|
||||
y.IsTutorial = true;
|
||||
API.CreateForm(y, "You", Properties.Resources.iconTerminal);
|
||||
}
|
||||
|
@ -486,6 +486,7 @@ public static void GetCharacters()
|
|||
else
|
||||
{
|
||||
var c = new Module(SystemType.Core, 1, "localhost");
|
||||
c.HP = 100; //bugfix: core not appearing during battle on new save
|
||||
c.X = 0;
|
||||
c.Y = 0;
|
||||
MyNetwork.Add(c);
|
||||
|
|
|
@ -45,7 +45,6 @@ public void SetupUI()
|
|||
{
|
||||
if (API.Upgrades["networkbrowser"] == false)
|
||||
{
|
||||
API.CreateInfoboxSession(Hacker_Alliance.Name, Hacker_Alliance.Topic, infobox.InfoboxMode.Info);
|
||||
lbrooms.Items.Add(Hacker_Alliance.Name);
|
||||
}
|
||||
}));
|
||||
|
|
|
@ -561,10 +561,6 @@
|
|||
<ItemGroup>
|
||||
<None Include="bin\Debug\Newtonsoft.Json.dll" />
|
||||
<None Include="bin\Debug\NetSockets.dll" />
|
||||
<Content Include="Dodge.Designer.vb" />
|
||||
<Content Include="Dodge.vb" />
|
||||
<Content Include="FloatyBird.Designer.vb" />
|
||||
<Content Include="FloatyBird.vb" />
|
||||
<Content Include="Labyrinth.designer.vb" />
|
||||
<Content Include="Labyrinth.vb" />
|
||||
<Compile Include="Paths.cs" />
|
||||
|
@ -943,8 +939,6 @@
|
|||
<None Include="Resources\Hacker_JonathanRivard.txt" />
|
||||
<None Include="Resources\iconColourPicker.fw.png" />
|
||||
<None Include="Resources\AustinWalkerCompletionStory.txt" />
|
||||
<Content Include="Snakey.Designer.vb" />
|
||||
<Content Include="Snakey.vb" />
|
||||
<Compile Include="ShiftOSDesktop.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
|
|
@ -1199,6 +1199,7 @@ private void InitializeComponent()
|
|||
this.TextDocumentToolStripMenuItem.Name = "TextDocumentToolStripMenuItem";
|
||||
this.TextDocumentToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
||||
this.TextDocumentToolStripMenuItem.Text = "Text Document";
|
||||
this.TextDocumentToolStripMenuItem.Click += new System.EventHandler(this.TextDocumentToolStripMenuItem_Click);
|
||||
//
|
||||
// NewSkin
|
||||
//
|
||||
|
@ -1211,16 +1212,19 @@ private void InitializeComponent()
|
|||
//
|
||||
this.WebpageToolStripMenuItem.Name = "WebpageToolStripMenuItem";
|
||||
this.WebpageToolStripMenuItem.Size = new System.Drawing.Size(152, 6);
|
||||
this.WebpageToolStripMenuItem.Visible = false;
|
||||
//
|
||||
// ShortcutToolStripMenuItem
|
||||
//
|
||||
this.ShortcutToolStripMenuItem.Name = "ShortcutToolStripMenuItem";
|
||||
this.ShortcutToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
||||
this.ShortcutToolStripMenuItem.Text = "Shortcut";
|
||||
this.ShortcutToolStripMenuItem.Visible = false;
|
||||
//
|
||||
// scriptToolStripMenuItem
|
||||
//
|
||||
this.scriptToolStripMenuItem.Name = "scriptToolStripMenuItem";
|
||||
this.scriptToolStripMenuItem.ShowShortcutKeys = false;
|
||||
this.scriptToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
||||
this.scriptToolStripMenuItem.Text = "Script";
|
||||
this.scriptToolStripMenuItem.Click += new System.EventHandler(this.scriptToolStripMenuItem_Click);
|
||||
|
|
|
@ -58,7 +58,7 @@ public void EndGame_AttachEvents()
|
|||
API.LimitedMode = false;
|
||||
SetupDesktop();
|
||||
API.CloseEverything();
|
||||
switch(FinalMission.EndGameHandler.CurrentChoice)
|
||||
switch (FinalMission.EndGameHandler.CurrentChoice)
|
||||
{
|
||||
case Choice.SideWithDevX:
|
||||
var t = new System.Windows.Forms.Timer();
|
||||
|
@ -96,9 +96,9 @@ private void ShiftOSDesktop_Load(object sender, EventArgs e)
|
|||
}
|
||||
else if (ea.KeyCode == Keys.D && ea.Control)
|
||||
{
|
||||
if(API.DeveloperMode == true)
|
||||
if (API.DeveloperMode == true)
|
||||
{
|
||||
if(ShowDebug == true)
|
||||
if (ShowDebug == true)
|
||||
{
|
||||
ShowDebug = false;
|
||||
}
|
||||
|
@ -118,13 +118,13 @@ private void ShiftOSDesktop_Load(object sender, EventArgs e)
|
|||
clocktick.Interval = 2;
|
||||
clocktick.Tick += (object s, EventArgs a) =>
|
||||
{
|
||||
if(API.Upgrades["hacking"])
|
||||
if (API.Upgrades["hacking"])
|
||||
{
|
||||
if (API.Upgrades["hackerbattles"] == false)
|
||||
{
|
||||
var rnd = new Random();
|
||||
int c = rnd.Next(1, 1000);
|
||||
if(c == 500)
|
||||
if (c == 500)
|
||||
{
|
||||
var t = new Terminal();
|
||||
API.CreateForm(t, API.LoadedNames.TerminalName, Properties.Resources.iconTerminal);
|
||||
|
@ -148,7 +148,7 @@ private void ShiftOSDesktop_Load(object sender, EventArgs e)
|
|||
lblog.Location = new Point(this.Width - lblog.Width - 5, 4);
|
||||
break;
|
||||
}
|
||||
if(File.Exists(Paths.SystemDir + "_Log.txt"))
|
||||
if (File.Exists(Paths.SystemDir + "_Log.txt"))
|
||||
{
|
||||
lblog.Text = File.ReadAllText(Paths.SystemDir + "_Log.txt");
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ private void ShiftOSDesktop_Load(object sender, EventArgs e)
|
|||
lbldebug.Hide();
|
||||
lblog.Hide();
|
||||
}
|
||||
if(Viruses.InfectedWith("seized"))
|
||||
if (Viruses.InfectedWith("seized"))
|
||||
{
|
||||
Random rnd = new Random();
|
||||
int r = rnd.Next(0, 255);
|
||||
|
@ -196,7 +196,7 @@ private void ShiftOSDesktop_Load(object sender, EventArgs e)
|
|||
};
|
||||
clocktick.Start();
|
||||
|
||||
if(API.Upgrades["trmfiles"] == true)
|
||||
if (API.Upgrades["trmfiles"] == true)
|
||||
{
|
||||
if (File.Exists(Paths.SystemDir + "AutoStart.trm"))
|
||||
{
|
||||
|
@ -256,34 +256,36 @@ public void SetupDesktop()
|
|||
Clock.ContextMenuStrip = null;
|
||||
PanelButtonHolder.ContextMenuStrip = null;
|
||||
}
|
||||
foreach(var dp in DesktopPanels)
|
||||
{
|
||||
if(API.Upgrades["advanceddesktop"])
|
||||
if (DesktopPanels != null) {
|
||||
foreach (var dp in DesktopPanels)
|
||||
{
|
||||
dp.ContextMenuStrip = cbdpanel;
|
||||
}
|
||||
else
|
||||
{
|
||||
dp.ContextMenuStrip = cbdpanel;
|
||||
if (API.Upgrades["advanceddesktop"])
|
||||
{
|
||||
dp.ContextMenuStrip = cbdpanel;
|
||||
}
|
||||
else
|
||||
{
|
||||
dp.ContextMenuStrip = cbdpanel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupWidgets()
|
||||
{
|
||||
foreach(var w in API.CurrentSkin.Widgets)
|
||||
foreach (var w in API.CurrentSkin.Widgets)
|
||||
{
|
||||
foreach(var dp in DesktopPanels)
|
||||
foreach (var dp in DesktopPanels)
|
||||
{
|
||||
var t = (Skinning.DesktopPanel)dp.Tag;
|
||||
if(t.Position == w.Panel)
|
||||
if (t.Position == w.Panel)
|
||||
{
|
||||
SetupWidget(dp, w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetupWidget(Panel p, Skinning.DesktopWidget w)
|
||||
{
|
||||
if(WidgetsToMaintain != null)
|
||||
|
@ -623,6 +625,11 @@ public void SetupPanels(List<Skinning.DesktopPanel> lst)
|
|||
|
||||
public void SetupAppLauncher()
|
||||
{
|
||||
NewToolStripMenuItem.Visible = API.Upgrades["fsnewfolder"];
|
||||
ArtpadPictureToolStripMenuItem.Visible = /*API.Upgrades["artpadsave"]*/false; // not yet implemented
|
||||
TextDocumentToolStripMenuItem.Visible = API.Upgrades["textpadsave"];
|
||||
NewSkin.Visible = API.Upgrades["skinning"];
|
||||
scriptToolStripMenuItem.Visible = /*API.Upgrades["shiftnet"]*/false; //not yet implemented
|
||||
API.GetAppLauncherItems();
|
||||
if (API.Upgrades["applaunchermenu"] == true)
|
||||
{
|
||||
|
@ -1105,9 +1112,13 @@ private void NewSkin_Click(object sender, EventArgs e)
|
|||
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
|
||||
{
|
||||
var res = API.GetInfoboxResult();
|
||||
if(!File.Exists(Paths.Desktop + res))
|
||||
if (res != "Cancelled")
|
||||
{
|
||||
Skinning.Utilities.saveskintofile(Paths.Desktop + res);
|
||||
if (!File.Exists(Paths.Desktop + res + ".skn"))
|
||||
{
|
||||
Skinning.Utilities.saveskintofile(Paths.Desktop + res + ".skn");
|
||||
SetupDesktopIcons();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1187,6 +1198,27 @@ private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
|
|||
var dp = (Skinning.DesktopPanel)SelectedObject.Tag;
|
||||
API.CreateForm(new PanelManager(dp), "Panel Options", API.GetIcon("PanelOptions"));
|
||||
}
|
||||
|
||||
private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
API.CreateInfoboxSession("New Text Document", "Please type a name for your document.", infobox.InfoboxMode.TextEntry);
|
||||
API.InfoboxSession.FormClosing += (o, a) =>
|
||||
{
|
||||
var res = API.GetInfoboxResult();
|
||||
if(res != "Cancelled")
|
||||
{
|
||||
if(!File.Exists(Paths.Desktop + res + ".txt"))
|
||||
{
|
||||
File.WriteAllText(Paths.Desktop + res + ".txt", "");
|
||||
SetupDesktopIcons();
|
||||
}
|
||||
else
|
||||
{
|
||||
API.CreateInfoboxSession("File exists!", "The file name you entered already exists.", infobox.InfoboxMode.Info);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class DesktopIconManager
|
||||
|
|
|
@ -120,6 +120,9 @@
|
|||
<metadata name="desktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="desktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="clocktick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>164, 17</value>
|
||||
</metadata>
|
||||
|
|
294
source/WindowsFormsApplication1/Snakey.Designer.vb
generated
294
source/WindowsFormsApplication1/Snakey.Designer.vb
generated
|
@ -1,294 +0,0 @@
|
|||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class Snakey
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form overrides dispose to clean up the component list.
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Required by the Windows Form Designer
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'NOTE: The following procedure is required by the Windows Form Designer
|
||||
'It can be modified using the Windows Form Designer.
|
||||
'Do not modify it using the code editor.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.pnlicon = New System.Windows.Forms.PictureBox()
|
||||
Me.pgbottom = New System.Windows.Forms.Panel()
|
||||
Me.pullside = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.pullbs = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.closebutton = New System.Windows.Forms.Panel()
|
||||
Me.lbtitletext = New System.Windows.Forms.Label()
|
||||
Me.pgtoplcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgtoprcorner = New System.Windows.Forms.Panel()
|
||||
Me.length = New System.Windows.Forms.Label()
|
||||
Me.speed = New System.Windows.Forms.Label()
|
||||
Me.rollupbutton = New System.Windows.Forms.Panel()
|
||||
Me.score = New System.Windows.Forms.Label()
|
||||
Me.pullbottom = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.minimizebutton = New System.Windows.Forms.Panel()
|
||||
Me.pgleft = New System.Windows.Forms.Panel()
|
||||
Me.pgbottomlcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgbottomrcorner = New System.Windows.Forms.Panel()
|
||||
Me.pgright = New System.Windows.Forms.Panel()
|
||||
Me.tmr = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.pgcontents = New System.Windows.Forms.Panel()
|
||||
Me.titlebar = New System.Windows.Forms.Panel()
|
||||
CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.pgleft.SuspendLayout()
|
||||
Me.pgright.SuspendLayout()
|
||||
Me.pgcontents.SuspendLayout()
|
||||
Me.titlebar.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'pnlicon
|
||||
'
|
||||
Me.pnlicon.BackColor = System.Drawing.Color.Transparent
|
||||
Me.pnlicon.Image = Global.ShiftOS.My.Resources.Resources.iconTextPad
|
||||
Me.pnlicon.Location = New System.Drawing.Point(8, 8)
|
||||
Me.pnlicon.Name = "pnlicon"
|
||||
Me.pnlicon.Size = New System.Drawing.Size(16, 16)
|
||||
Me.pnlicon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
|
||||
Me.pnlicon.TabIndex = 24
|
||||
Me.pnlicon.TabStop = False
|
||||
Me.pnlicon.Visible = False
|
||||
'
|
||||
'pgbottom
|
||||
'
|
||||
Me.pgbottom.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgbottom.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottom.Location = New System.Drawing.Point(2, 505)
|
||||
Me.pgbottom.Name = "pgbottom"
|
||||
Me.pgbottom.Size = New System.Drawing.Size(669, 2)
|
||||
Me.pgbottom.TabIndex = 33
|
||||
'
|
||||
'pullside
|
||||
'
|
||||
Me.pullside.Interval = 1
|
||||
'
|
||||
'pullbs
|
||||
'
|
||||
Me.pullbs.Interval = 1
|
||||
'
|
||||
'closebutton
|
||||
'
|
||||
Me.closebutton.BackColor = System.Drawing.Color.Black
|
||||
Me.closebutton.Location = New System.Drawing.Point(302, 3)
|
||||
Me.closebutton.Name = "closebutton"
|
||||
Me.closebutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.closebutton.TabIndex = 20
|
||||
'
|
||||
'lbtitletext
|
||||
'
|
||||
Me.lbtitletext.AutoSize = True
|
||||
Me.lbtitletext.BackColor = System.Drawing.Color.Transparent
|
||||
Me.lbtitletext.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lbtitletext.Location = New System.Drawing.Point(26, 7)
|
||||
Me.lbtitletext.Name = "lbtitletext"
|
||||
Me.lbtitletext.Size = New System.Drawing.Size(63, 18)
|
||||
Me.lbtitletext.TabIndex = 19
|
||||
Me.lbtitletext.Text = "Snakey"
|
||||
'
|
||||
'pgtoplcorner
|
||||
'
|
||||
Me.pgtoplcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgtoplcorner.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.pgtoplcorner.Location = New System.Drawing.Point(0, 0)
|
||||
Me.pgtoplcorner.Name = "pgtoplcorner"
|
||||
Me.pgtoplcorner.Size = New System.Drawing.Size(2, 30)
|
||||
Me.pgtoplcorner.TabIndex = 17
|
||||
'
|
||||
'pgtoprcorner
|
||||
'
|
||||
Me.pgtoprcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgtoprcorner.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.pgtoprcorner.Location = New System.Drawing.Point(671, 0)
|
||||
Me.pgtoprcorner.Name = "pgtoprcorner"
|
||||
Me.pgtoprcorner.Size = New System.Drawing.Size(2, 30)
|
||||
Me.pgtoprcorner.TabIndex = 16
|
||||
'
|
||||
'length
|
||||
'
|
||||
Me.length.AutoSize = True
|
||||
Me.length.BackColor = System.Drawing.Color.Transparent
|
||||
Me.length.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(238, Byte))
|
||||
Me.length.ForeColor = System.Drawing.Color.White
|
||||
Me.length.Location = New System.Drawing.Point(574, 15)
|
||||
Me.length.Name = "length"
|
||||
Me.length.Size = New System.Drawing.Size(76, 20)
|
||||
Me.length.TabIndex = 13
|
||||
Me.length.Text = "Length: 5"
|
||||
'
|
||||
'speed
|
||||
'
|
||||
Me.speed.AutoSize = True
|
||||
Me.speed.BackColor = System.Drawing.Color.Transparent
|
||||
Me.speed.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(238, Byte))
|
||||
Me.speed.ForeColor = System.Drawing.Color.White
|
||||
Me.speed.Location = New System.Drawing.Point(288, 15)
|
||||
Me.speed.Name = "speed"
|
||||
Me.speed.Size = New System.Drawing.Size(73, 20)
|
||||
Me.speed.TabIndex = 12
|
||||
Me.speed.Text = "Speed: 1"
|
||||
'
|
||||
'rollupbutton
|
||||
'
|
||||
Me.rollupbutton.BackColor = System.Drawing.Color.Black
|
||||
Me.rollupbutton.Location = New System.Drawing.Point(274, 3)
|
||||
Me.rollupbutton.Name = "rollupbutton"
|
||||
Me.rollupbutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.rollupbutton.TabIndex = 22
|
||||
'
|
||||
'score
|
||||
'
|
||||
Me.score.AutoSize = True
|
||||
Me.score.BackColor = System.Drawing.Color.Transparent
|
||||
Me.score.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(238, Byte))
|
||||
Me.score.ForeColor = System.Drawing.Color.White
|
||||
Me.score.Location = New System.Drawing.Point(25, 15)
|
||||
Me.score.Name = "score"
|
||||
Me.score.Size = New System.Drawing.Size(100, 20)
|
||||
Me.score.TabIndex = 11
|
||||
Me.score.Text = "Total Points: "
|
||||
'
|
||||
'pullbottom
|
||||
'
|
||||
Me.pullbottom.Interval = 1
|
||||
'
|
||||
'minimizebutton
|
||||
'
|
||||
Me.minimizebutton.BackColor = System.Drawing.Color.Black
|
||||
Me.minimizebutton.Location = New System.Drawing.Point(246, 5)
|
||||
Me.minimizebutton.Name = "minimizebutton"
|
||||
Me.minimizebutton.Size = New System.Drawing.Size(22, 22)
|
||||
Me.minimizebutton.TabIndex = 24
|
||||
'
|
||||
'pgleft
|
||||
'
|
||||
Me.pgleft.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgleft.Controls.Add(Me.pgbottomlcorner)
|
||||
Me.pgleft.Dock = System.Windows.Forms.DockStyle.Left
|
||||
Me.pgleft.Location = New System.Drawing.Point(0, 30)
|
||||
Me.pgleft.Name = "pgleft"
|
||||
Me.pgleft.Size = New System.Drawing.Size(2, 477)
|
||||
Me.pgleft.TabIndex = 31
|
||||
'
|
||||
'pgbottomlcorner
|
||||
'
|
||||
Me.pgbottomlcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgbottomlcorner.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottomlcorner.Location = New System.Drawing.Point(0, 475)
|
||||
Me.pgbottomlcorner.Name = "pgbottomlcorner"
|
||||
Me.pgbottomlcorner.Size = New System.Drawing.Size(2, 2)
|
||||
Me.pgbottomlcorner.TabIndex = 14
|
||||
'
|
||||
'pgbottomrcorner
|
||||
'
|
||||
Me.pgbottomrcorner.BackColor = System.Drawing.Color.Red
|
||||
Me.pgbottomrcorner.Dock = System.Windows.Forms.DockStyle.Bottom
|
||||
Me.pgbottomrcorner.Location = New System.Drawing.Point(0, 475)
|
||||
Me.pgbottomrcorner.Name = "pgbottomrcorner"
|
||||
Me.pgbottomrcorner.Size = New System.Drawing.Size(2, 2)
|
||||
Me.pgbottomrcorner.TabIndex = 15
|
||||
'
|
||||
'pgright
|
||||
'
|
||||
Me.pgright.BackColor = System.Drawing.Color.Gray
|
||||
Me.pgright.Controls.Add(Me.pgbottomrcorner)
|
||||
Me.pgright.Dock = System.Windows.Forms.DockStyle.Right
|
||||
Me.pgright.Location = New System.Drawing.Point(671, 30)
|
||||
Me.pgright.Name = "pgright"
|
||||
Me.pgright.Size = New System.Drawing.Size(2, 477)
|
||||
Me.pgright.TabIndex = 32
|
||||
'
|
||||
'tmr
|
||||
'
|
||||
Me.tmr.Enabled = True
|
||||
Me.tmr.Interval = 50
|
||||
'
|
||||
'pgcontents
|
||||
'
|
||||
Me.pgcontents.BackColor = System.Drawing.Color.Black
|
||||
Me.pgcontents.Controls.Add(Me.length)
|
||||
Me.pgcontents.Controls.Add(Me.speed)
|
||||
Me.pgcontents.Controls.Add(Me.score)
|
||||
Me.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.pgcontents.Location = New System.Drawing.Point(0, 30)
|
||||
Me.pgcontents.Name = "pgcontents"
|
||||
Me.pgcontents.Size = New System.Drawing.Size(673, 477)
|
||||
Me.pgcontents.TabIndex = 30
|
||||
'
|
||||
'titlebar
|
||||
'
|
||||
Me.titlebar.BackColor = System.Drawing.Color.Gray
|
||||
Me.titlebar.Controls.Add(Me.minimizebutton)
|
||||
Me.titlebar.Controls.Add(Me.pnlicon)
|
||||
Me.titlebar.Controls.Add(Me.rollupbutton)
|
||||
Me.titlebar.Controls.Add(Me.closebutton)
|
||||
Me.titlebar.Controls.Add(Me.lbtitletext)
|
||||
Me.titlebar.Controls.Add(Me.pgtoplcorner)
|
||||
Me.titlebar.Controls.Add(Me.pgtoprcorner)
|
||||
Me.titlebar.Dock = System.Windows.Forms.DockStyle.Top
|
||||
Me.titlebar.ForeColor = System.Drawing.Color.White
|
||||
Me.titlebar.Location = New System.Drawing.Point(0, 0)
|
||||
Me.titlebar.Name = "titlebar"
|
||||
Me.titlebar.Size = New System.Drawing.Size(673, 30)
|
||||
Me.titlebar.TabIndex = 29
|
||||
'
|
||||
'Snakey
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(673, 507)
|
||||
Me.Controls.Add(Me.pgbottom)
|
||||
Me.Controls.Add(Me.pgleft)
|
||||
Me.Controls.Add(Me.pgright)
|
||||
Me.Controls.Add(Me.pgcontents)
|
||||
Me.Controls.Add(Me.titlebar)
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
|
||||
Me.MaximumSize = New System.Drawing.Size(673, 507)
|
||||
Me.MinimumSize = New System.Drawing.Size(673, 507)
|
||||
Me.Name = "Snakey"
|
||||
Me.Text = "Snakey"
|
||||
CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.pgleft.ResumeLayout(False)
|
||||
Me.pgright.ResumeLayout(False)
|
||||
Me.pgcontents.ResumeLayout(False)
|
||||
Me.pgcontents.PerformLayout()
|
||||
Me.titlebar.ResumeLayout(False)
|
||||
Me.titlebar.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents pnlicon As System.Windows.Forms.PictureBox
|
||||
Friend WithEvents pgbottom As System.Windows.Forms.Panel
|
||||
Friend WithEvents pullside As System.Windows.Forms.Timer
|
||||
Friend WithEvents pullbs As System.Windows.Forms.Timer
|
||||
Friend WithEvents closebutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents lbtitletext As System.Windows.Forms.Label
|
||||
Friend WithEvents pgtoplcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgtoprcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents length As System.Windows.Forms.Label
|
||||
Friend WithEvents speed As System.Windows.Forms.Label
|
||||
Friend WithEvents rollupbutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents score As System.Windows.Forms.Label
|
||||
Friend WithEvents pullbottom As System.Windows.Forms.Timer
|
||||
Friend WithEvents minimizebutton As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgleft As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottomlcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgbottomrcorner As System.Windows.Forms.Panel
|
||||
Friend WithEvents pgright As System.Windows.Forms.Panel
|
||||
Friend WithEvents tmr As System.Windows.Forms.Timer
|
||||
Friend WithEvents pgcontents As System.Windows.Forms.Panel
|
||||
Friend WithEvents titlebar As System.Windows.Forms.Panel
|
||||
End Class
|
|
@ -1,707 +0,0 @@
|
|||
Imports System.Drawing.Drawing2D
|
||||
|
||||
Public Class Snakey
|
||||
|
||||
Public rolldownsize As Integer
|
||||
Public oldbordersize As Integer
|
||||
Public oldtitlebarheight As Integer
|
||||
Public justopened As Boolean = False
|
||||
Public needtorollback As Boolean = False
|
||||
Public minimumsizewidth As Integer = 673 'replace with minimum size
|
||||
Public minimumsizeheight As Integer = 507 'replace with minimum size
|
||||
|
||||
#Region "Template Code"
|
||||
|
||||
Private Sub Template_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
justopened = True
|
||||
Me.Left = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2
|
||||
Me.Top = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2
|
||||
setupall()
|
||||
|
||||
ShiftOSDesktop.pnlpanelbuttondodge.SendToBack() 'CHANGE NAME
|
||||
ShiftOSDesktop.setuppanelbuttons()
|
||||
ShiftOSDesktop.setpanelbuttonappearnce(ShiftOSDesktop.pnlpanelbuttondodge, ShiftOSDesktop.tbdodgeicon, ShiftOSDesktop.tbdodgetext, True) 'modify to proper name
|
||||
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen + 1
|
||||
End Sub
|
||||
|
||||
Public Sub setupall()
|
||||
setuptitlebar()
|
||||
setupborders()
|
||||
setskin()
|
||||
End Sub
|
||||
|
||||
Private Sub ShiftOSDesktop_keydown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
|
||||
'Make terminal appear
|
||||
If e.KeyCode = Keys.T AndAlso e.Control Then
|
||||
Terminal.Show()
|
||||
Terminal.Visible = True
|
||||
Terminal.BringToFront()
|
||||
End If
|
||||
|
||||
'Movable Windows
|
||||
If ShiftOSDesktop.boughtmovablewindows = True Then
|
||||
If e.KeyCode = Keys.A AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X - ShiftOSDesktop.movablewindownumber, Me.Location.Y)
|
||||
End If
|
||||
If e.KeyCode = Keys.D AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X + ShiftOSDesktop.movablewindownumber, Me.Location.Y)
|
||||
End If
|
||||
If e.KeyCode = Keys.W AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X, Me.Location.Y - ShiftOSDesktop.movablewindownumber)
|
||||
End If
|
||||
If e.KeyCode = Keys.S AndAlso e.Control Then
|
||||
e.Handled = True
|
||||
Me.Location = New Point(Me.Location.X, Me.Location.Y + ShiftOSDesktop.movablewindownumber)
|
||||
End If
|
||||
ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User moved " & Me.Name & " to " & Me.Location.ToString & " with " & e.KeyCode.ToString & Environment.NewLine
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub titlebar_MouseDown(sender As Object, e As MouseEventArgs) Handles titlebar.MouseDown, lbtitletext.MouseDown, pnlicon.MouseDown, pgtoplcorner.MouseDown, pgtoprcorner.MouseDown
|
||||
' Handle Draggable Windows
|
||||
If ShiftOSDesktop.boughtdraggablewindows = True Then
|
||||
If e.Button = MouseButtons.Left Then
|
||||
titlebar.Capture = False
|
||||
lbtitletext.Capture = False
|
||||
pnlicon.Capture = False
|
||||
pgtoplcorner.Capture = False
|
||||
pgtoprcorner.Capture = False
|
||||
Const WM_NCLBUTTONDOWN As Integer = &HA1S
|
||||
Const HTCAPTION As Integer = 2
|
||||
Dim msg As Message = _
|
||||
Message.Create(Me.Handle, WM_NCLBUTTONDOWN, _
|
||||
New IntPtr(HTCAPTION), IntPtr.Zero)
|
||||
Me.DefWndProc(msg)
|
||||
End If
|
||||
ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User dragged " & Me.Name & " to " & Me.Location.ToString & Environment.NewLine
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub setupborders()
|
||||
If ShiftOSDesktop.boughtwindowborders = False Then
|
||||
pgleft.Hide()
|
||||
pgbottom.Hide()
|
||||
pgright.Hide()
|
||||
Me.Size = New Size(Me.Width - pgleft.Width - pgright.Width, Me.Height - pgbottom.Height)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_Click(sender As Object, e As EventArgs) Handles closebutton.Click
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseEnter(sender As Object, e As EventArgs) Handles closebutton.MouseEnter, closebutton.MouseUp
|
||||
closebutton.BackgroundImage = Skins.closebtnhover
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseLeave(sender As Object, e As EventArgs) Handles closebutton.MouseLeave
|
||||
closebutton.BackgroundImage = Skins.closebtn
|
||||
End Sub
|
||||
|
||||
Private Sub closebutton_MouseDown(sender As Object, e As EventArgs) Handles closebutton.MouseDown
|
||||
closebutton.BackgroundImage = Skins.closebtnclick
|
||||
End Sub
|
||||
|
||||
Private Sub minimizebutton_Click(sender As Object, e As EventArgs) Handles minimizebutton.Click
|
||||
ShiftOSDesktop.minimizeprogram(Me, False)
|
||||
End Sub
|
||||
|
||||
'Old skinning system - No idea what this does
|
||||
''Private Sub titlebar_MouseEnter(sender As Object, e As EventArgs) Handles titlebar.MouseEnter, titlebar.MouseUp, lbtitletext.MouseEnter, pnlicon.MouseEnter, closebutton.MouseEnter, rollupbutton.MouseEnter
|
||||
'' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(1)
|
||||
''End Sub
|
||||
|
||||
'Private Sub titlebar_MouseLeave(sender As Object, e As EventArgs) Handles titlebar.MouseLeave, lbtitletext.MouseLeave, pnlicon.MouseLeave, closebutton.MouseLeave, rollupbutton.MouseLeave
|
||||
' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(0)
|
||||
'End Sub
|
||||
|
||||
Private Sub rollupbutton_Click(sender As Object, e As EventArgs) Handles rollupbutton.Click
|
||||
rollupanddown()
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseEnter(sender As Object, e As EventArgs) Handles rollupbutton.MouseEnter, rollupbutton.MouseUp
|
||||
rollupbutton.BackgroundImage = Skins.rollbtnhover
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseLeave(sender As Object, e As EventArgs) Handles rollupbutton.MouseLeave
|
||||
rollupbutton.BackgroundImage = Skins.rollbtn
|
||||
End Sub
|
||||
|
||||
Private Sub rollupbutton_MouseDown(sender As Object, e As EventArgs) Handles rollupbutton.MouseDown
|
||||
rollupbutton.BackgroundImage = Skins.rollbtnclick
|
||||
End Sub
|
||||
|
||||
Public Sub setuptitlebar()
|
||||
|
||||
setupborders()
|
||||
|
||||
If Me.Height = Me.titlebar.Height Then pgleft.Show() : pgbottom.Show() : pgright.Show() : Me.Height = rolldownsize : needtorollback = True
|
||||
pgleft.Width = Skins.borderwidth
|
||||
pgright.Width = Skins.borderwidth
|
||||
pgbottom.Height = Skins.borderwidth
|
||||
titlebar.Height = Skins.titlebarheight
|
||||
|
||||
' fixes growing issue
|
||||
If justopened = False Then
|
||||
Me.Size = New Size(Me.Width, Me.Height - (Skins.titlebarheight / 2))
|
||||
End If
|
||||
|
||||
If justopened = True Then
|
||||
Me.Size = New Size(673, 507) 'put the default size of your window here
|
||||
Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
|
||||
Me.Size = New Size(Me.Width + Skins.borderwidth + Skins.borderwidth, Me.Height + Skins.borderwidth)
|
||||
oldbordersize = Skins.borderwidth
|
||||
oldtitlebarheight = Skins.titlebarheight
|
||||
justopened = False
|
||||
Else
|
||||
If Me.Visible = True Then
|
||||
'Me.Hide()
|
||||
Me.Size = New Size(Me.Width - (2 * oldbordersize) + (2 * Skins.borderwidth), (Me.Height - oldtitlebarheight - oldbordersize) + Skins.titlebarheight + Skins.borderwidth)
|
||||
'Me.Size = New Size(Me.Width - oldbordersize - oldbordersize, Me.Height - oldbordersize) 'Just put a little algebra in the first size setting and comment out the mess
|
||||
oldbordersize = Skins.borderwidth
|
||||
oldtitlebarheight = Skins.titlebarheight
|
||||
'Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
|
||||
'Me.Size = New Size(Me.Width + Skins. borderwidth + Skins. borderwidth, Me.Height + Skins. borderwidth)
|
||||
'rolldownsize = Me.Height
|
||||
If needtorollback = True Then Me.Height = titlebar.Height : pgleft.Hide() : pgbottom.Hide() : pgright.Hide()
|
||||
'Me.Show()
|
||||
End If
|
||||
End If
|
||||
|
||||
If Skins.enablecorners = True Then
|
||||
pgtoplcorner.Show()
|
||||
pgtoprcorner.Show()
|
||||
pgtoprcorner.Width = Skins.titlebarcornerwidth
|
||||
pgtoplcorner.Width = Skins.titlebarcornerwidth
|
||||
Else
|
||||
pgtoplcorner.Hide()
|
||||
pgtoprcorner.Hide()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughttitlebar = False Then
|
||||
titlebar.Hide()
|
||||
Me.Size = New Size(Me.Width, Me.Size.Height - titlebar.Height)
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughttitletext = False Then
|
||||
lbtitletext.Hide()
|
||||
Else
|
||||
lbtitletext.Font = New Font(Skins.titletextfontfamily, Skins.titletextfontsize, Skins.titletextfontstyle, GraphicsUnit.Point)
|
||||
lbtitletext.Text = ShiftOSDesktop.snakeyname 'Remember to change to name of program!!!!
|
||||
lbtitletext.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtclosebutton = False Then
|
||||
closebutton.Hide()
|
||||
Else
|
||||
closebutton.BackColor = Skins.closebtncolour
|
||||
closebutton.Size = Skins.closebtnsize
|
||||
closebutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtrollupbutton = False Then
|
||||
rollupbutton.Hide()
|
||||
Else
|
||||
rollupbutton.BackColor = Skins.rollbtncolour
|
||||
rollupbutton.Size = Skins.rollbtnsize
|
||||
rollupbutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtminimizebutton = False Then
|
||||
minimizebutton.Hide()
|
||||
Else
|
||||
minimizebutton.BackColor = Skins.minbtncolour
|
||||
minimizebutton.Size = Skins.minbtnsize
|
||||
minimizebutton.Show()
|
||||
End If
|
||||
|
||||
If ShiftOSDesktop.boughtwindowborders = True Then
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
Else
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
End If
|
||||
|
||||
'Change when Icon skinning complete
|
||||
If ShiftOSDesktop.boughtknowledgeinputicon = True Then ' Change to program's icon
|
||||
pnlicon.Visible = True
|
||||
pnlicon.Location = New Point(Skins.titleiconfromside, Skins.titleiconfromtop)
|
||||
pnlicon.Size = New Size(ShiftOSDesktop.titlebariconsize, ShiftOSDesktop.titlebariconsize)
|
||||
pnlicon.Image = ShiftOSDesktop.snakeyicontitlebar 'Replace with the correct icon for the program.
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub rollupanddown()
|
||||
If Me.Height = Me.titlebar.Height Then
|
||||
pgleft.Show()
|
||||
pgbottom.Show()
|
||||
pgright.Show()
|
||||
Me.Height = rolldownsize
|
||||
Me.MinimumSize = New Size(minimumsizewidth, minimumsizeheight)
|
||||
Else
|
||||
Me.MinimumSize = New Size(0, 0)
|
||||
pgleft.Hide()
|
||||
pgbottom.Hide()
|
||||
pgright.Hide()
|
||||
rolldownsize = Me.Height
|
||||
Me.Height = Me.titlebar.Height
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub resettitlebar()
|
||||
If ShiftOSDesktop.boughtwindowborders = True Then
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
Else
|
||||
closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
|
||||
rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
|
||||
minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
|
||||
Select Case Skins.titletextpos
|
||||
Case "Left"
|
||||
lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
|
||||
Case "Centre"
|
||||
lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
|
||||
End Select
|
||||
lbtitletext.ForeColor = Skins.titletextcolour
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub pullside_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullside.Tick
|
||||
Me.Width = Cursor.Position.X - Me.Location.X
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub pullbottom_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullbottom.Tick
|
||||
Me.Height = Cursor.Position.Y - Me.Location.Y
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
Private Sub pullbs_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles pullbs.Tick
|
||||
Me.Width = Cursor.Position.X - Me.Location.X
|
||||
Me.Height = Cursor.Position.Y - Me.Location.Y
|
||||
resettitlebar()
|
||||
End Sub
|
||||
|
||||
'delete this for non-resizable windows
|
||||
Private Sub Rightpull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgright.MouseDown
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullside.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub RightCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeWE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bottomCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottom.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeNS
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CornerCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottomrcorner.MouseEnter
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.SizeNWSE
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub SizeCursoroff_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseLeave, pgbottom.MouseLeave, pgbottomrcorner.MouseLeave
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
Cursor = Cursors.Default
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub rightpull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgright.MouseUp
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullside.Stop()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bottompull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottom.MouseDown
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbottom.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub buttompull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottom.MouseUp
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbottom.Stop()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bspull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottomrcorner.MouseDown
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbs.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bspull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottomrcorner.MouseUp
|
||||
If ShiftOSDesktop.boughtresizablewindows = True Then
|
||||
pullbs.Stop()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub setskin()
|
||||
'disposals
|
||||
closebutton.BackgroundImage = Nothing
|
||||
titlebar.BackgroundImage = Nothing
|
||||
rollupbutton.BackgroundImage = Nothing
|
||||
pgtoplcorner.BackgroundImage = Nothing
|
||||
pgtoprcorner.BackgroundImage = Nothing
|
||||
minimizebutton.BackgroundImage = Nothing
|
||||
'apply new skin
|
||||
If Skins.closebtn Is Nothing Then closebutton.BackColor = Skins.closebtncolour Else closebutton.BackgroundImage = Skins.closebtn
|
||||
closebutton.BackgroundImageLayout = Skins.closebtnlayout
|
||||
If Skins.titlebar Is Nothing Then titlebar.BackColor = Skins.titlebarcolour Else titlebar.BackgroundImage = Skins.titlebar
|
||||
titlebar.BackgroundImageLayout = Skins.titlebarlayout
|
||||
If Skins.rollbtn Is Nothing Then rollupbutton.BackColor = Skins.rollbtncolour Else rollupbutton.BackgroundImage = Skins.rollbtn
|
||||
rollupbutton.BackgroundImageLayout = Skins.rollbtnlayout
|
||||
If Skins.leftcorner Is Nothing Then pgtoplcorner.BackColor = Skins.leftcornercolour Else pgtoplcorner.BackgroundImage = Skins.leftcorner
|
||||
pgtoplcorner.BackgroundImageLayout = Skins.leftcornerlayout
|
||||
If Skins.rightcorner Is Nothing Then pgtoprcorner.BackColor = Skins.rightcornercolour Else pgtoprcorner.BackgroundImage = Skins.rightcorner
|
||||
pgtoprcorner.BackgroundImageLayout = Skins.rightcornerlayout
|
||||
If Skins.minbtn Is Nothing Then minimizebutton.BackColor = Skins.minbtncolour Else minimizebutton.BackgroundImage = Skins.minbtn
|
||||
minimizebutton.BackgroundImageLayout = Skins.minbtnlayout
|
||||
If Skins.borderleft Is Nothing Then pgleft.BackColor = Skins.borderleftcolour Else pgleft.BackgroundImage = Skins.borderleft
|
||||
pgleft.BackgroundImageLayout = Skins.borderleftlayout
|
||||
If Skins.borderright Is Nothing Then pgright.BackColor = Skins.borderrightcolour Else pgright.BackgroundImage = Skins.borderright
|
||||
pgleft.BackgroundImageLayout = Skins.borderrightlayout
|
||||
If Skins.borderbottom Is Nothing Then pgbottom.BackColor = Skins.borderbottomcolour Else pgbottom.BackgroundImage = Skins.borderbottom
|
||||
pgbottom.BackgroundImageLayout = Skins.borderbottomlayout
|
||||
If Skins.bottomleftcorner Is Nothing Then pgbottomlcorner.BackColor = Skins.bottomleftcornercolour Else pgbottomlcorner.BackgroundImage = Skins.bottomleftcorner
|
||||
pgbottomlcorner.BackgroundImageLayout = Skins.bottomleftcornerlayout
|
||||
If Skins.bottomrightcorner Is Nothing Then pgbottomrcorner.BackColor = Skins.bottomrightcornercolour Else pgbottomrcorner.BackgroundImage = Skins.bottomrightcorner
|
||||
pgbottomrcorner.BackgroundImageLayout = Skins.bottomrightcornerlayout
|
||||
|
||||
Me.TransparencyKey = ShiftOSDesktop.globaltransparencycolour
|
||||
End Sub
|
||||
|
||||
Private Sub Clock_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||
ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen - 1
|
||||
Me.Hide()
|
||||
ShiftOSDesktop.setuppanelbuttons()
|
||||
End Sub
|
||||
|
||||
'end of general setup
|
||||
#End Region
|
||||
|
||||
Private Structure structSnake
|
||||
Dim rect As Rectangle
|
||||
Dim x As Integer
|
||||
Dim y As Integer
|
||||
|
||||
End Structure
|
||||
|
||||
Private Enum Direction
|
||||
Rightward
|
||||
Downward
|
||||
Leftward
|
||||
Upward
|
||||
End Enum
|
||||
|
||||
Private Const INITIAL_SNAKE_RECT_COUNT As Integer = 5
|
||||
Private Const COLUMN_COUNT As Integer = 65
|
||||
Private Const ROW_COUNT As Integer = 47
|
||||
|
||||
Private curRecCount As Integer
|
||||
Private rects(,) As Rectangle
|
||||
Private isSnakePart(,) As Boolean
|
||||
Private snake As Collection
|
||||
Private snakeBrush As Brush = New SolidBrush(Color.FromArgb(255, 255, 255))
|
||||
Private backBrush As Brush = New SolidBrush(Color.FromArgb(1, 1, 1))
|
||||
Private tokenBrush As Brush = New SolidBrush(Color.FromArgb(255, 255, 255))
|
||||
Private curDirection As Direction
|
||||
Private buffer As Bitmap
|
||||
Private columnCount As Integer
|
||||
Private rowCount As Integer
|
||||
Private snakePoints As Integer
|
||||
Private snakeSpeed As Double
|
||||
Private snakeLength As Integer
|
||||
Private token As Rectangle
|
||||
|
||||
Private Function xyToRectIndex(ByVal X As Integer, ByVal Y As Integer) As Integer
|
||||
Return (Y * (columnCount)) + X
|
||||
End Function
|
||||
|
||||
Private Sub rectIndexToXY(ByVal Index As Integer, ByRef X As Integer, ByRef Y As Integer)
|
||||
X = Index Mod (columnCount)
|
||||
Y = Index \ (columnCount)
|
||||
End Sub
|
||||
|
||||
Private Sub initSnake()
|
||||
|
||||
Dim x As Integer
|
||||
Dim y As Integer
|
||||
Dim i As Integer
|
||||
Dim index As Integer
|
||||
Dim sSnake As structSnake
|
||||
snake = New Collection
|
||||
|
||||
x = ((columnCount) - 10) \ 2
|
||||
y = ((rowCount) - 6) \ 2
|
||||
|
||||
Dim snakePosition As Point = New Point(x, y)
|
||||
index = xyToRectIndex(x, y)
|
||||
|
||||
For i = 1 To INITIAL_SNAKE_RECT_COUNT
|
||||
rectIndexToXY(index + (i - 1), x, y)
|
||||
sSnake.rect = rects(x, y)
|
||||
sSnake.x = x
|
||||
sSnake.y = y
|
||||
snake.Add(sSnake)
|
||||
Next
|
||||
|
||||
snakeLength = INITIAL_SNAKE_RECT_COUNT
|
||||
snakeSpeed = 1
|
||||
length.Text = "Length: " & CStr(snakeLength)
|
||||
speed.Text = "Speed: " & CStr(snakeSpeed)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub selectRectangles()
|
||||
|
||||
Dim g As Graphics = Graphics.FromImage(My.Resources.snakeyback)
|
||||
Dim i As Integer
|
||||
Dim sSnake As structSnake
|
||||
|
||||
For i = 1 To INITIAL_SNAKE_RECT_COUNT
|
||||
sSnake = snake(i)
|
||||
g.FillRectangle(snakeBrush, sSnake.rect)
|
||||
isSnakePart(sSnake.x, sSnake.y) = True
|
||||
Next
|
||||
|
||||
buffer = New Bitmap(My.Resources.snakeyback)
|
||||
|
||||
g.Dispose()
|
||||
Refresh()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub initRectangles()
|
||||
|
||||
Dim i As Integer
|
||||
Dim j As Integer
|
||||
|
||||
columnCount = COLUMN_COUNT
|
||||
rowCount = ROW_COUNT
|
||||
|
||||
ReDim rects(columnCount, rowCount)
|
||||
ReDim isSnakePart(columnCount, rowCount)
|
||||
|
||||
For j = 0 To rowCount
|
||||
For i = 0 To columnCount
|
||||
rects(i, j) = New Rectangle((i * 10) + 1, (j * 10) + 1, 9, 9)
|
||||
isSnakePart(i, j) = False
|
||||
Next
|
||||
Next
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub initialize()
|
||||
|
||||
curRecCount = INITIAL_SNAKE_RECT_COUNT
|
||||
curDirection = Direction.Leftward
|
||||
snakePoints = 0
|
||||
initRectangles()
|
||||
initSnake()
|
||||
selectRectangles()
|
||||
setToken()
|
||||
setPoints()
|
||||
tmr.Interval = 50
|
||||
tmr.Enabled = True
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub setPoints()
|
||||
score.Text = "Total Points: " & CStr(snakePoints)
|
||||
End Sub
|
||||
|
||||
Private Sub setToken()
|
||||
|
||||
Randomize()
|
||||
Dim x As Integer
|
||||
Dim y As Integer
|
||||
Dim g As Graphics = Graphics.FromImage(buffer)
|
||||
|
||||
x = CInt(Rnd() * columnCount)
|
||||
Do While x > columnCount Or isSnakePart(x, y) = True
|
||||
x = CInt(Rnd() * columnCount)
|
||||
Loop
|
||||
|
||||
y = CInt(Rnd() * rowCount)
|
||||
Do While y > rowCount Or isSnakePart(x, y) = True
|
||||
y = CInt(Rnd() * rowCount)
|
||||
Loop
|
||||
|
||||
token = rects(x, y)
|
||||
|
||||
g.FillEllipse(tokenBrush, token)
|
||||
Refresh()
|
||||
g.Dispose()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub main_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
initialize()
|
||||
End Sub
|
||||
|
||||
Private Sub main_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
|
||||
|
||||
Select Case e.KeyCode
|
||||
Case Keys.Down
|
||||
If Not (curDirection = Direction.Downward Or curDirection = Direction.Upward) Then
|
||||
curDirection = Direction.Downward
|
||||
End If
|
||||
Case Keys.Left
|
||||
If Not (curDirection = Direction.Leftward Or curDirection = Direction.Rightward) Then
|
||||
curDirection = Direction.Leftward
|
||||
End If
|
||||
Case Keys.Right
|
||||
If Not (curDirection = Direction.Rightward Or curDirection = Direction.Leftward) Then
|
||||
curDirection = Direction.Rightward
|
||||
End If
|
||||
Case Keys.Up
|
||||
If Not (curDirection = Direction.Upward Or curDirection = Direction.Downward) Then
|
||||
curDirection = Direction.Upward
|
||||
End If
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub moveSnake()
|
||||
|
||||
Dim sSnake As structSnake
|
||||
Dim x As Integer
|
||||
Dim y As Integer
|
||||
Dim rect As Rectangle = New Rectangle()
|
||||
Dim g As Graphics = Graphics.FromImage(buffer)
|
||||
|
||||
tmr.Enabled = False
|
||||
sSnake = snake(snake.Count)
|
||||
g.FillRectangle(backBrush, sSnake.rect)
|
||||
snake.Remove(snake.Count)
|
||||
isSnakePart(sSnake.x, sSnake.y) = False
|
||||
sSnake = snake.Item(1)
|
||||
|
||||
x = sSnake.x
|
||||
y = sSnake.y
|
||||
|
||||
Select Case curDirection
|
||||
Case Direction.Downward
|
||||
y = y + 1
|
||||
If y > rowCount Then y = 0
|
||||
Case Direction.Leftward
|
||||
x = x - 1
|
||||
If x < 0 Then x = columnCount
|
||||
Case Direction.Rightward
|
||||
x = x + 1
|
||||
If x > columnCount Then x = 0
|
||||
Case Direction.Upward
|
||||
y = y - 1
|
||||
If y < 0 Then y = rowCount
|
||||
End Select
|
||||
|
||||
If isSnakePart(x, y) = True Then
|
||||
tmr.Enabled = False
|
||||
|
||||
If MessageBox.Show("You lost! You got a total of " & snakePoints & " codepoints. ", "Snake", MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = Windows.Forms.DialogResult.Yes Then
|
||||
initialize()
|
||||
Exit Sub
|
||||
Else
|
||||
End
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
rect = rects(x, y)
|
||||
|
||||
sSnake.x = x
|
||||
sSnake.y = y
|
||||
sSnake.rect = rect
|
||||
isSnakePart(x, y) = True
|
||||
|
||||
g.FillRectangle(snakeBrush, sSnake.rect)
|
||||
Me.BackgroundImage = buffer
|
||||
snake.Add(sSnake, , 1)
|
||||
|
||||
If rects(x, y).Equals(CObj(token)) Then
|
||||
|
||||
snakePoints += 1
|
||||
setPoints()
|
||||
|
||||
If snakePoints Mod 5 = 0 Then
|
||||
sSnake = snake.Item(snake.Count)
|
||||
Select Case curDirection
|
||||
Case Direction.Downward
|
||||
sSnake.y -= 1
|
||||
Case (Direction.Leftward)
|
||||
sSnake.x += 1
|
||||
Case Direction.Rightward
|
||||
sSnake.x -= 1
|
||||
Case Direction.Upward
|
||||
sSnake.y += 1
|
||||
End Select
|
||||
|
||||
sSnake.rect = rects(sSnake.x, sSnake.y)
|
||||
g.FillRectangle(snakeBrush, sSnake.rect)
|
||||
Me.BackgroundImage = buffer
|
||||
snake.Add(sSnake, , , snake.Count)
|
||||
snakeLength = snake.Count
|
||||
|
||||
tmr.Interval -= 1
|
||||
If tmr.Interval < 0 Then tmr.Interval = 1
|
||||
|
||||
snakeSpeed = 1 + (50 - tmr.Interval)
|
||||
length.Text = "Length: " & CStr(snakeLength)
|
||||
speed.Text = "Speed: " & CStr(snakeSpeed)
|
||||
|
||||
End If
|
||||
|
||||
setToken()
|
||||
|
||||
End If
|
||||
|
||||
Refresh()
|
||||
|
||||
tmr.Enabled = True
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub tmr_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||
moveSnake()
|
||||
Application.DoEvents()
|
||||
End Sub
|
||||
End Class
|
|
@ -385,84 +385,30 @@ private void txtterm_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e
|
|||
{
|
||||
if (Hacking == false)
|
||||
{
|
||||
if (ki_running == false)
|
||||
ReadCommand();
|
||||
if (command != "")
|
||||
{
|
||||
ReadCommand();
|
||||
if (command != "")
|
||||
{
|
||||
DoCommand();
|
||||
}
|
||||
DoCommand();
|
||||
}
|
||||
|
||||
if (command == "clear")
|
||||
if (command == "clear")
|
||||
{
|
||||
txtterm.Text = txtterm.Text + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
|
||||
txtterm.Select(txtterm.Text.Length, 0);
|
||||
}
|
||||
else if (command == "lua")
|
||||
{
|
||||
if (Lua_API.UseLuaAPI == false)
|
||||
{
|
||||
txtterm.Text = txtterm.Text + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
|
||||
txtterm.Select(txtterm.Text.Length, 0);
|
||||
|
||||
}
|
||||
else if(command == "lua")
|
||||
{
|
||||
if(Lua_API.UseLuaAPI == false)
|
||||
{
|
||||
txtterm.Text = txtterm.Text + Environment.NewLine + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
|
||||
txtterm.Select(txtterm.Text.Length, 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
txtterm.Text = txtterm.Text + Environment.NewLine + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
|
||||
txtterm.Select(txtterm.Text.Length, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ki_mode)
|
||||
{
|
||||
case "category":
|
||||
try
|
||||
{
|
||||
int cmdint = Convert.ToInt16(txtterm.Lines[txtterm.Lines.Length - 1].ToLower().Replace("> ", ""));
|
||||
ki_choosetopic(cmdint);
|
||||
WriteLine("> ");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string cmdstr = txtterm.Lines[txtterm.Lines.Length - 1].ToLower().Replace("> ", "");
|
||||
if (cmdstr == "exit")
|
||||
{
|
||||
ki_stop();
|
||||
WriteLine(API.CurrentSave.username + "@" + API.CurrentSave.osname + " $> ");
|
||||
}
|
||||
else
|
||||
{
|
||||
//SATAN IS HERE because the player didn't choose a number. Just kidding. It's just a placeholder.
|
||||
ki_choosetopic(666);
|
||||
WriteLine("> ");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "guessing":
|
||||
string cmd = txtterm.Lines[txtterm.Lines.Length - 1].ToLower().Replace("> ", "");
|
||||
if (cmd == "exit")
|
||||
{
|
||||
ki_stop();
|
||||
WriteLine(API.CurrentSave.username + "@" + API.CurrentSave.osname + " $> ");
|
||||
}
|
||||
else if (cmd == "clear")
|
||||
{
|
||||
txtterm.Text = "";
|
||||
WriteLine("You have guessed " + ki_guessesThisSession.ToString() + " of a possible " + API.KnowledgeInputData.GetLengthOfPossible().ToString() + " guesses.");
|
||||
WriteLine("> ");
|
||||
}
|
||||
else
|
||||
{
|
||||
ki_guess(cmd);
|
||||
WriteLine("You have guessed " + ki_guessesThisSession.ToString() + " of a possible " + API.KnowledgeInputData.GetLengthOfPossible().ToString() + " guesses.");
|
||||
WriteLine("> ");
|
||||
}
|
||||
break;
|
||||
}
|
||||
txtterm.Select(txtterm.TextLength, 0);
|
||||
txtterm.Text = txtterm.Text + Environment.NewLine + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
|
||||
txtterm.Select(txtterm.Text.Length, 0);
|
||||
}
|
||||
|
||||
trackpos = 0;
|
||||
}
|
||||
else
|
||||
|
@ -1479,6 +1425,9 @@ public void DoCommand()
|
|||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "htutorial":
|
||||
ShiftOS.Hacking.StartBattleTutorial();
|
||||
break;
|
||||
case "fake_buy":
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
|
@ -1584,16 +1533,6 @@ public void DoCommand()
|
|||
}
|
||||
else { wrongcommand(); }
|
||||
break;
|
||||
case "htutorial":
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
ShiftOS.Hacking.StartBattleTutorial();
|
||||
}
|
||||
else
|
||||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "make":
|
||||
try
|
||||
{
|
||||
|
@ -1650,15 +1589,8 @@ public void DoCommand()
|
|||
}
|
||||
break;
|
||||
case "netgen":
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
WriteLine("Starting netgen...");
|
||||
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wrongcommand();
|
||||
}
|
||||
WriteLine("Starting netgen...");
|
||||
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
|
||||
break;
|
||||
case "lua":
|
||||
if(API.DeveloperMode == true)
|
||||
|
@ -2421,88 +2353,6 @@ private void wrongcommand()
|
|||
txtterm.Text = txtterm.Text + Environment.NewLine + "Command not recognized - Type 'help' for a list of commands!" + Environment.NewLine;
|
||||
}
|
||||
|
||||
private void ki_stop()
|
||||
{
|
||||
ki_running = false;
|
||||
WriteLine("Bye.");
|
||||
API.KnowledgeInputData.SaveGuesses();
|
||||
}
|
||||
|
||||
private void ki_listtopics()
|
||||
{
|
||||
WriteLine("Categories:" + Environment.NewLine);
|
||||
WriteLine("1: Animals");
|
||||
}
|
||||
|
||||
private bool ki_running = false;
|
||||
private string ki_mode = "category";
|
||||
private int ki_guessesThisSession = 0;
|
||||
|
||||
public void StartKnowledgeInput()
|
||||
{
|
||||
ki_running = true;
|
||||
ki_mode = "category";
|
||||
WriteLine("Welcome to Knowledge Input!");
|
||||
ki_listtopics();
|
||||
WriteLine("> ");
|
||||
}
|
||||
|
||||
private void ki_choosetopic(int topic_number)
|
||||
{
|
||||
switch(topic_number)
|
||||
{
|
||||
case 1:
|
||||
API.KnowledgeInputData.Category = "Animals";
|
||||
API.KnowledgeInputData.RegisterDictionaries();
|
||||
ki_mode = "guessing";
|
||||
ki_guessesThisSession = API.KnowledgeInputData.GetRightGuesses();
|
||||
WriteLine("You have picked option #" + topic_number.ToString());
|
||||
break;
|
||||
default:
|
||||
WriteLine("knowledge_input: Not a valid choice!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void ki_guess(string guess)
|
||||
{
|
||||
switch (API.KnowledgeInputData.Guess(guess)) {
|
||||
case "success":
|
||||
WriteLine("Right!");
|
||||
if(ki_guessesThisSession < API.KnowledgeInputData.GetLengthOfPossible())
|
||||
{
|
||||
ki_guessesThisSession += 1;
|
||||
if((ki_guessesThisSession % 10) == 0)
|
||||
{
|
||||
WriteLine("You have earned " + ki_guessesThisSession.ToString() + " Codepoints.");
|
||||
API.AddCodepoints(ki_guessesThisSession);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("You have guessed all the possible answers for this category. Therefore, you have been awarded 10000 CP.");
|
||||
API.AddCodepoints(10000);
|
||||
}
|
||||
break;
|
||||
case "already_guessed":
|
||||
WriteLine("Already guessed!");
|
||||
break;
|
||||
default:
|
||||
if (guess.ToLower() == "jonathan ladouceur")
|
||||
{
|
||||
API.CreateInfoboxSession("Terminal", "Terminal has performed a terrorist operation and must be taken out back and shot. Reason: NOT OK.", infobox.InfoboxMode.Info);
|
||||
//insert story here
|
||||
this.Close();
|
||||
API.RemoveCodepoints(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("Not a valid guess!");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool Hacking = false;
|
||||
|
||||
private Control objToWriteTo = null;
|
||||
|
@ -2781,7 +2631,7 @@ private void tmrshutdown_Tick(object sender, EventArgs e)
|
|||
|
||||
public void WriteLine(string text)
|
||||
{
|
||||
txtterm.Invoke(new Action(() =>
|
||||
API.CurrentSession.Invoke(new Action(() =>
|
||||
{
|
||||
if (txtterm.Text.Length > 0)
|
||||
{
|
||||
|
|
|
@ -449,7 +449,7 @@ public static void LoadPanels()
|
|||
{
|
||||
foreach(var pnl in loadedSkin.DesktopPanels)
|
||||
{
|
||||
string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.Position + loadedSkin.DesktopPanels.IndexOf(pnl).ToString();
|
||||
string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.ImagePath;
|
||||
if (File.Exists(dpath))
|
||||
{
|
||||
pnl.BackgroundImage = Image.FromFile(dpath);
|
||||
|
@ -469,16 +469,18 @@ public static void SavePanels()
|
|||
}
|
||||
foreach (var pnl in loadedSkin.DesktopPanels)
|
||||
{
|
||||
string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.Position + loadedSkin.DesktopPanels.IndexOf(pnl).ToString();
|
||||
if (pnl.BackgroundImage != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
pnl.ImagePath = pnl.Position + loadedSkin.DesktopPanels.IndexOf(pnl).ToString();
|
||||
string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.ImagePath;
|
||||
pnl.BackgroundImage.Save(dpath);
|
||||
pnl.BackgroundImage = null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
pnl.ImagePath = null;
|
||||
pnl.BackgroundImage = null;
|
||||
}
|
||||
}
|
||||
|
@ -561,7 +563,7 @@ public static void loadskin()
|
|||
{
|
||||
if(Directory.Exists(Paths.LoadedSkin))
|
||||
{
|
||||
//try {
|
||||
try {
|
||||
string rawData = File.ReadAllText(Paths.LoadedSkin + "data.json");
|
||||
loadedSkin = JsonConvert.DeserializeObject<Skin>(rawData);
|
||||
if (File.Exists(Paths.LoadedSkin + "panels.json"))
|
||||
|
@ -572,7 +574,7 @@ public static void loadskin()
|
|||
}
|
||||
loadimages();
|
||||
LoadEmbeddedNamePack();
|
||||
/*}
|
||||
}
|
||||
catch
|
||||
{
|
||||
//No skin to load.
|
||||
|
@ -580,7 +582,7 @@ public static void loadskin()
|
|||
loadedskin_images = new Images();
|
||||
saveskin();
|
||||
|
||||
}*/
|
||||
}
|
||||
} else
|
||||
{
|
||||
loadedSkin = new Skin();
|
||||
|
@ -598,6 +600,8 @@ public static void loadsknfile(string filepath)
|
|||
try
|
||||
{
|
||||
//Extract the .SKN
|
||||
loadedSkin = new Skin();
|
||||
loadedskin_images = new Images();
|
||||
API.ExtractFile(filepath, Paths.LoadedSkin, true);
|
||||
//OK, so the skin's been extracted.
|
||||
//Now, let's load in the skin data.
|
||||
|
|
Loading…
Reference in a new issue