aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/MainMenu
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-06-10 10:17:10 -0400
committerMichael <[email protected]>2017-06-10 10:17:15 -0400
commitc40d071d58859e25b3781299b949b91caa0548fe (patch)
treed26956e6a06336af403e05cfe0ace0e50ff1b6ea /ShiftOS.WinForms/MainMenu
parent7dd109719be8a9e8b52655665f490f4f7956df80 (diff)
downloadshiftos_thereturn-c40d071d58859e25b3781299b949b91caa0548fe.tar.gz
shiftos_thereturn-c40d071d58859e25b3781299b949b91caa0548fe.tar.bz2
shiftos_thereturn-c40d071d58859e25b3781299b949b91caa0548fe.zip
main menu system + sandbox mode
Diffstat (limited to 'ShiftOS.WinForms/MainMenu')
-rw-r--r--ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs147
-rw-r--r--ShiftOS.WinForms/MainMenu/MainMenu.cs100
-rw-r--r--ShiftOS.WinForms/MainMenu/MainMenu.resx120
3 files changed, 367 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs
new file mode 100644
index 0000000..62db46d
--- /dev/null
+++ b/ShiftOS.WinForms/MainMenu/MainMenu.Designer.cs
@@ -0,0 +1,147 @@
+namespace ShiftOS.WinForms.MainMenu
+{
+ partial class MainMenu
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.flmenu = new System.Windows.Forms.FlowLayoutPanel();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
+ this.button3 = new System.Windows.Forms.Button();
+ this.button4 = new System.Windows.Forms.Button();
+ this.button5 = new System.Windows.Forms.Button();
+ this.lbticker = new System.Windows.Forms.Label();
+ this.flmenu.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // flmenu
+ //
+ this.flmenu.AutoSize = true;
+ this.flmenu.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.flmenu.Controls.Add(this.button1);
+ this.flmenu.Controls.Add(this.button2);
+ this.flmenu.Controls.Add(this.button3);
+ this.flmenu.Controls.Add(this.button4);
+ this.flmenu.Controls.Add(this.button5);
+ this.flmenu.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
+ this.flmenu.Location = new System.Drawing.Point(46, 218);
+ this.flmenu.Name = "flmenu";
+ this.flmenu.Size = new System.Drawing.Size(187, 145);
+ this.flmenu.TabIndex = 0;
+ //
+ // button1
+ //
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button1.Location = new System.Drawing.Point(3, 3);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(181, 23);
+ this.button1.TabIndex = 0;
+ this.button1.Text = "Campaign";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button2.Location = new System.Drawing.Point(3, 32);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(181, 23);
+ this.button2.TabIndex = 1;
+ this.button2.Text = "Sandbox";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
+ //
+ // button3
+ //
+ this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button3.Location = new System.Drawing.Point(3, 61);
+ this.button3.Name = "button3";
+ this.button3.Size = new System.Drawing.Size(181, 23);
+ this.button3.TabIndex = 2;
+ this.button3.Text = "Settings";
+ this.button3.UseVisualStyleBackColor = true;
+ //
+ // button4
+ //
+ this.button4.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button4.Location = new System.Drawing.Point(3, 90);
+ this.button4.Name = "button4";
+ this.button4.Size = new System.Drawing.Size(181, 23);
+ this.button4.TabIndex = 3;
+ this.button4.Text = "About";
+ this.button4.UseVisualStyleBackColor = true;
+ //
+ // button5
+ //
+ this.button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button5.Location = new System.Drawing.Point(3, 119);
+ this.button5.Name = "button5";
+ this.button5.Size = new System.Drawing.Size(181, 23);
+ this.button5.TabIndex = 4;
+ this.button5.Text = "Exit";
+ this.button5.UseVisualStyleBackColor = true;
+ this.button5.Click += new System.EventHandler(this.button5_Click);
+ //
+ // lbticker
+ //
+ this.lbticker.AutoSize = true;
+ this.lbticker.Location = new System.Drawing.Point(29, 515);
+ this.lbticker.Name = "lbticker";
+ this.lbticker.Size = new System.Drawing.Size(93, 13);
+ this.lbticker.TabIndex = 1;
+ this.lbticker.Tag = "header3";
+ this.lbticker.Text = "This is a tickerbar.";
+ //
+ // MainMenu
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.Black;
+ this.ClientSize = new System.Drawing.Size(1161, 566);
+ this.Controls.Add(this.lbticker);
+ this.Controls.Add(this.flmenu);
+ this.ForeColor = System.Drawing.Color.White;
+ this.Name = "MainMenu";
+ this.Text = "MainMenu";
+ this.Load += new System.EventHandler(this.MainMenu_Load);
+ this.flmenu.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.FlowLayoutPanel flmenu;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
+ private System.Windows.Forms.Button button3;
+ private System.Windows.Forms.Button button4;
+ private System.Windows.Forms.Button button5;
+ private System.Windows.Forms.Label lbticker;
+ }
+} \ No newline at end of file
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.cs b/ShiftOS.WinForms/MainMenu/MainMenu.cs
new file mode 100644
index 0000000..20cd4ec
--- /dev/null
+++ b/ShiftOS.WinForms/MainMenu/MainMenu.cs
@@ -0,0 +1,100 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.Engine;
+using ShiftOS.WinForms.Tools;
+
+namespace ShiftOS.WinForms.MainMenu
+{
+ public partial class MainMenu : Form
+ {
+ public MainMenu(IDesktop desk)
+ {
+ InitializeComponent();
+ (desk as WinformsDesktop).ParentMenu = this;
+
+ var tickermove = new Timer();
+ var tickerreset = new Timer();
+ tickermove.Tick += (o, a) =>
+ {
+ if(lbticker.Left <= (0 - lbticker.Width))
+ {
+ tickermove.Stop();
+ tickerreset.Start();
+ }
+ else
+ {
+ lbticker.Top = (this.ClientSize.Height - (lbticker.Height * 2));
+ lbticker.Left -= 2;
+ }
+ };
+ tickerreset.Tick += (o, a) =>
+ {
+ lbticker.Visible = false;
+ lbticker.Text = GetTickerMessage();
+ lbticker.Left = this.Width;
+ lbticker.Visible = true;
+ tickerreset.Stop();
+ tickermove.Start();
+ };
+
+ tickermove.Interval = 1;
+ tickerreset.Interval = 1000;
+
+ flmenu.CenterParent();
+
+ tickerreset.Start();
+ }
+
+ private void MainMenu_Load(object sender, EventArgs e)
+ {
+ Tools.ControlManager.SetupControls(this);
+
+ }
+
+ private Random rnd = new Random();
+
+ private string GetTickerMessage()
+ {
+ switch (rnd.Next(0, 10))
+ {
+ case 0:
+ return "Did you know that you can skin this very menu? Just goes to show how much you can shift it your way.";
+ case 1:
+ return "Want to pick up a few skins or mods from the community? Head on over to http://getshiftos.ml/Skins!";
+ case 2:
+ return "Sandbox mode is a special version of ShiftOS that allows you to use the operating system without having to deal with Codepoints, the Shiftorium or having to play through the storyline. Handy...";
+ case 3:
+ return "ArtPad not good enough? You can use an external image editor to create ShiftOS skin textures. Just save your files to the Shared Directory and they'll be imported into ShiftOS on the 1:/ drive.";
+ case 4:
+ return "Terminal too weird for ya? You can use the Format Editor to generate your own Terminal command parser. No coding knowledge needed!";
+ case 5:
+ return "Contests are a good way to earn heaps of Codepoints. Head on over to http://getshiftos.ml/Contests for info on current community contests.";
+ default:
+ return "Good God. We don't know what to put here.";
+ }
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ Desktop.CurrentDesktop.Show();
+ }
+
+ private void button5_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ (Desktop.CurrentDesktop as WinformsDesktop).IsSandbox = true;
+ Desktop.CurrentDesktop.Show();
+ }
+ }
+}
diff --git a/ShiftOS.WinForms/MainMenu/MainMenu.resx b/ShiftOS.WinForms/MainMenu/MainMenu.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.WinForms/MainMenu/MainMenu.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file