aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS.WinForms/Applications')
-rw-r--r--ShiftOS.WinForms/Applications/About.Designer.cs10
-rw-r--r--ShiftOS.WinForms/Applications/About.cs71
-rw-r--r--ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs2
-rw-r--r--ShiftOS.WinForms/Applications/Chat.Designer.cs97
-rw-r--r--ShiftOS.WinForms/Applications/Chat.cs163
-rw-r--r--ShiftOS.WinForms/Applications/Chat.resx6
-rw-r--r--ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs12
-rw-r--r--ShiftOS.WinForms/Applications/FileSkimmer.cs64
-rw-r--r--ShiftOS.WinForms/Applications/GraphicPicker.Designer.cs45
-rw-r--r--ShiftOS.WinForms/Applications/GraphicPicker.cs9
-rw-r--r--ShiftOS.WinForms/Applications/IconManager.Designer.cs163
-rw-r--r--ShiftOS.WinForms/Applications/IconManager.cs244
-rw-r--r--ShiftOS.WinForms/Applications/IconManager.resx120
-rw-r--r--ShiftOS.WinForms/Applications/Installer.Designer.cs2
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.cs19
-rw-r--r--ShiftOS.WinForms/Applications/Pong.Designer.cs3
-rw-r--r--ShiftOS.WinForms/Applications/Pong.cs433
-rw-r--r--ShiftOS.WinForms/Applications/Pong.resx3
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLetters.cs4
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLotto.cs4
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.cs10
-rw-r--r--ShiftOS.WinForms/Applications/Shifter.cs689
-rw-r--r--ShiftOS.WinForms/Applications/Shiftnet.cs5
-rw-r--r--ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs128
-rw-r--r--ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs150
-rw-r--r--ShiftOS.WinForms/Applications/ShopItemCreator.cs4
-rw-r--r--ShiftOS.WinForms/Applications/Skin Loader.cs11
-rw-r--r--ShiftOS.WinForms/Applications/Terminal.cs323
-rw-r--r--ShiftOS.WinForms/Applications/TriPresent.Designer.cs312
-rw-r--r--ShiftOS.WinForms/Applications/TriPresent.cs91
-rw-r--r--ShiftOS.WinForms/Applications/TriPresent.resx123
-rw-r--r--ShiftOS.WinForms/Applications/TriSheet.Designer.cs65
-rw-r--r--ShiftOS.WinForms/Applications/TriSheet.cs22
-rw-r--r--ShiftOS.WinForms/Applications/TriSheet.resx120
-rw-r--r--ShiftOS.WinForms/Applications/TriWrite.Designer.cs197
-rw-r--r--ShiftOS.WinForms/Applications/TriWrite.cs122
-rw-r--r--ShiftOS.WinForms/Applications/TriWrite.resx108
-rw-r--r--ShiftOS.WinForms/Applications/UpdateManager.Designer.cs2
-rw-r--r--ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs2
-rw-r--r--ShiftOS.WinForms/Applications/WebBrowser.Designer.cs153
-rw-r--r--ShiftOS.WinForms/Applications/WebBrowser.cs97
-rw-r--r--ShiftOS.WinForms/Applications/WebBrowser.resx120
42 files changed, 3327 insertions, 1001 deletions
diff --git a/ShiftOS.WinForms/Applications/About.Designer.cs b/ShiftOS.WinForms/Applications/About.Designer.cs
index ab76eab..989d79b 100644
--- a/ShiftOS.WinForms/Applications/About.Designer.cs
+++ b/ShiftOS.WinForms/Applications/About.Designer.cs
@@ -55,7 +55,7 @@ namespace ShiftOS.WinForms.Applications
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.lbshiftit = new System.Windows.Forms.Label();
- this.lbaboutdesc = new System.Windows.Forms.Label();
+ this.lbaboutdesc = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
@@ -94,11 +94,11 @@ namespace ShiftOS.WinForms.Applications
this.lbaboutdesc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.lbaboutdesc.Location = new System.Drawing.Point(14, 126);
+ this.lbaboutdesc.Location = new System.Drawing.Point(23, 158);
+ this.lbaboutdesc.Multiline = true;
this.lbaboutdesc.Name = "lbaboutdesc";
- this.lbaboutdesc.Size = new System.Drawing.Size(498, 328);
+ this.lbaboutdesc.Size = new System.Drawing.Size(492, 302);
this.lbaboutdesc.TabIndex = 3;
- this.lbaboutdesc.Text = "label2";
//
// About
//
@@ -121,6 +121,6 @@ namespace ShiftOS.WinForms.Applications
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lbshiftit;
- private System.Windows.Forms.Label lbaboutdesc;
+ private System.Windows.Forms.TextBox lbaboutdesc;
}
}
diff --git a/ShiftOS.WinForms/Applications/About.cs b/ShiftOS.WinForms/Applications/About.cs
index f91e0cc..a27238d 100644
--- a/ShiftOS.WinForms/Applications/About.cs
+++ b/ShiftOS.WinForms/Applications/About.cs
@@ -53,18 +53,73 @@ namespace ShiftOS.WinForms.Applications
lbaboutdesc.Text = $@"ShiftOS
Copyright (c) 2015-{DateTime.Now.Year} Michael VanOverbeek and ShiftOS devs
-Engine version: Milestone 3, 1.0 Beta Series (Developer mode ON)
-Frontend version: 1.0 Beta 1.2
-Multi-user domain version: 1.0 Rolling-Release
-
-Music courtesy of Selulance. Listen to the Fractal Forest album here:
-https://www.youtube.com/watch?v=LB5jAYDL3VU&t=913s
+Engine version: Milestone 4, 1.0 Beta Series (Developer mode ON)
+Frontend version: 1.0 Beta 2.5
+Digital Society version: 1.0 Rolling-Release
+Project: Unite version: 1.0 Beta 1.7
Special thanks to Philip Adams, the original creator of ShiftOS for helping us grow our community of amazing Shifters by featuring us on the YouTube Millionaire series and advertising us throughout various other series ran by him.
Also, thanks to Rylan Arbour, Victor Tran and the other community moderators and administrators for helping us keep the community peaceful.
-Lastly, a huge special thanks to the community themselves - for testing, debugging, fixing, reporting bugs for, and enjoying our game even through its many failures, successes, revamps, etc. You guys are the reason we develop the game!";
+Lastly, a huge special thanks to the community themselves - for testing, debugging, fixing, reporting bugs for, and enjoying our game even through its many failures, successes, revamps, etc. You guys are the reason we develop the game!
+
+ === Licensing information
+
+ShiftOS is licensed under the MIT license.
+
+Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the ""Software""), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
+copies of the Software, and to permit persons to whom the Software is
+
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+ == Credit where credit is due
+
+ -- Development and staff team:
+ - Rylan Arbour (Lead community administrator)
+ - Victor Tran (Discord administrator)
+ - cjhannah (ShiftFS backend developer)
+ - AShifter (Project: Unite penetration tester)
+ - arencllc (ShiftLetters developer)
+ - Michael VanOverbeek (Lead developer, system administrator, the guy who wrote this text)
+ - fixylol, Nebble, TravisNC, Neptune (Community moderators)
+ - bandic00t_ (Skin Engine stresstesting)
+
+ -- System audio
+
+ - Default system event sounds (Infobox, Network Connecting, System Beeps) are from the original ShiftOS 0.0.x source code.
+ - Ambient music list courtesy of https://www.youtube.com/channel/UC56Qctnsu8wAyvzf4Yx6LIw (ArgoFox | Royalty Free Music)
+
+Tracklist:
+
+ Dylan Hardy - Strangely Unaffected
+Noxive - Home
+Dylan Hardy and Abraham Alberto - Slow Drift
+A Himitsu - Easier To Fade
+Noxive - Resilience
+Wanderflux - Visions
+Aerocity - Cold Weather Kids
+Aether - Wanderlust
+Aerocity - Love Lost
+
+
+Finally, special thanks to our Patreon supporters. Without you guys, our servers wouldn't be running, and you wouldn't be reading this.";
}
public string GetEngineVersion()
@@ -107,7 +162,7 @@ Lastly, a huge special thanks to the community themselves - for testing, debuggi
public bool OnUnload()
{
- return false;
+ return true;
}
public void OnUpgrade()
diff --git a/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs b/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs
index 6263ff7..d7f03a0 100644
--- a/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs
+++ b/ShiftOS.WinForms/Applications/AudioPlayer.Designer.cs
@@ -141,12 +141,10 @@ namespace ShiftOS.WinForms.Applications
//
// pgplaytime
//
- this.pgplaytime.BlockSize = 5;
this.pgplaytime.Location = new System.Drawing.Point(46, 3);
this.pgplaytime.Maximum = 100;
this.pgplaytime.Name = "pgplaytime";
this.pgplaytime.Size = new System.Drawing.Size(749, 23);
- this.pgplaytime.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.pgplaytime.TabIndex = 1;
this.pgplaytime.Tag = "keepbg";
this.pgplaytime.Text = "shiftedProgressBar1";
diff --git a/ShiftOS.WinForms/Applications/Chat.Designer.cs b/ShiftOS.WinForms/Applications/Chat.Designer.cs
index d4b7211..7bfa4dd 100644
--- a/ShiftOS.WinForms/Applications/Chat.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Chat.Designer.cs
@@ -54,6 +54,13 @@ namespace ShiftOS.WinForms.Applications
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Chat));
this.panel1 = new System.Windows.Forms.Panel();
+ this.pnlstart = new System.Windows.Forms.Panel();
+ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.txtchatid = new System.Windows.Forms.TextBox();
+ this.btnjoin = new System.Windows.Forms.Button();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label1 = new System.Windows.Forms.Label();
this.rtbchat = new System.Windows.Forms.RichTextBox();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.tschatid = new System.Windows.Forms.ToolStripLabel();
@@ -62,12 +69,15 @@ namespace ShiftOS.WinForms.Applications
this.txtuserinput = new System.Windows.Forms.ToolStripTextBox();
this.btnsend = new System.Windows.Forms.ToolStripButton();
this.panel1.SuspendLayout();
+ this.pnlstart.SuspendLayout();
+ this.flowLayoutPanel1.SuspendLayout();
this.toolStrip1.SuspendLayout();
this.tsbottombar.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
+ this.panel1.Controls.Add(this.pnlstart);
this.panel1.Controls.Add(this.rtbchat);
this.panel1.Controls.Add(this.toolStrip1);
this.panel1.Controls.Add(this.tsbottombar);
@@ -77,6 +87,82 @@ namespace ShiftOS.WinForms.Applications
this.panel1.Size = new System.Drawing.Size(633, 318);
this.panel1.TabIndex = 0;
//
+ // pnlstart
+ //
+ this.pnlstart.Controls.Add(this.flowLayoutPanel1);
+ this.pnlstart.Controls.Add(this.label3);
+ this.pnlstart.Controls.Add(this.label2);
+ this.pnlstart.Controls.Add(this.label1);
+ this.pnlstart.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlstart.Location = new System.Drawing.Point(0, 25);
+ this.pnlstart.Name = "pnlstart";
+ this.pnlstart.Size = new System.Drawing.Size(633, 268);
+ this.pnlstart.TabIndex = 4;
+ //
+ // flowLayoutPanel1
+ //
+ this.flowLayoutPanel1.AutoSize = true;
+ this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.flowLayoutPanel1.Controls.Add(this.txtchatid);
+ this.flowLayoutPanel1.Controls.Add(this.btnjoin);
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 118);
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(633, 29);
+ this.flowLayoutPanel1.TabIndex = 3;
+ //
+ // txtchatid
+ //
+ this.txtchatid.Location = new System.Drawing.Point(3, 3);
+ this.txtchatid.Name = "txtchatid";
+ this.txtchatid.Size = new System.Drawing.Size(192, 20);
+ this.txtchatid.TabIndex = 0;
+ //
+ // btnjoin
+ //
+ this.btnjoin.Location = new System.Drawing.Point(201, 3);
+ this.btnjoin.Name = "btnjoin";
+ this.btnjoin.Size = new System.Drawing.Size(75, 23);
+ this.btnjoin.TabIndex = 1;
+ this.btnjoin.Text = "Join";
+ this.btnjoin.UseVisualStyleBackColor = true;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Dock = System.Windows.Forms.DockStyle.Top;
+ this.label3.Location = new System.Drawing.Point(0, 85);
+ this.label3.Name = "label3";
+ this.label3.Padding = new System.Windows.Forms.Padding(10);
+ this.label3.Size = new System.Drawing.Size(79, 33);
+ this.label3.TabIndex = 2;
+ this.label3.Tag = "header3";
+ this.label3.Text = "Join a chat";
+ //
+ // label2
+ //
+ this.label2.Dock = System.Windows.Forms.DockStyle.Top;
+ this.label2.Location = new System.Drawing.Point(0, 33);
+ this.label2.Name = "label2";
+ this.label2.Padding = new System.Windows.Forms.Padding(10);
+ this.label2.Size = new System.Drawing.Size(633, 52);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "SimpleSRC is a simple chat program that utilises the ShiftOS Relay Chat protocol." +
+ " All you have to do is enter a chat code or system name, and SimpleSRC will try " +
+ "to initiate a chat for you.";
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Dock = System.Windows.Forms.DockStyle.Top;
+ this.label1.Location = new System.Drawing.Point(0, 0);
+ this.label1.Name = "label1";
+ this.label1.Padding = new System.Windows.Forms.Padding(10);
+ this.label1.Size = new System.Drawing.Size(143, 33);
+ this.label1.TabIndex = 0;
+ this.label1.Tag = "header1";
+ this.label1.Text = "Welcome to SimpleSRC!";
+ //
// rtbchat
//
this.rtbchat.Dock = System.Windows.Forms.DockStyle.Fill;
@@ -150,6 +236,10 @@ namespace ShiftOS.WinForms.Applications
this.Size = new System.Drawing.Size(633, 318);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
+ this.pnlstart.ResumeLayout(false);
+ this.pnlstart.PerformLayout();
+ this.flowLayoutPanel1.ResumeLayout(false);
+ this.flowLayoutPanel1.PerformLayout();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.tsbottombar.ResumeLayout(false);
@@ -168,5 +258,12 @@ namespace ShiftOS.WinForms.Applications
private System.Windows.Forms.ToolStrip tsbottombar;
private System.Windows.Forms.ToolStripTextBox txtuserinput;
private System.Windows.Forms.ToolStripButton btnsend;
+ private System.Windows.Forms.Panel pnlstart;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
+ private System.Windows.Forms.TextBox txtchatid;
+ private System.Windows.Forms.Button btnjoin;
}
}
diff --git a/ShiftOS.WinForms/Applications/Chat.cs b/ShiftOS.WinForms/Applications/Chat.cs
index caf8cd2..7a2de81 100644
--- a/ShiftOS.WinForms/Applications/Chat.cs
+++ b/ShiftOS.WinForms/Applications/Chat.cs
@@ -33,75 +33,27 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Newtonsoft.Json;
using ShiftOS.Engine;
+using System.Threading;
namespace ShiftOS.WinForms.Applications
{
[MultiplayerOnly]
+ [WinOpen("simplesrc")]
+ [Launcher("SimpleSRC Client", false, null, "Networking")]
+ [DefaultTitle("SimpleSRC Client")]
+ [AppscapeEntry("SimpleSRC", "A simple ShiftOS Relay Chat client that allows you to talk with other ShiftOS users from all over the world.", 300, 145, "file_skimmer", "Networking")]
public partial class Chat : UserControl, IShiftOSWindow
{
- public Chat(string chatId)
+ public Chat()
{
InitializeComponent();
- id = chatId;
- ServerManager.MessageReceived += (msg) =>
- {
- if (msg.Name == "chat_msgreceived")
- {
- try
- {
- this.Invoke(new Action(() =>
- {
- try
- {
- var args = JsonConvert.DeserializeObject<Dictionary<string, string>>(msg.Contents);
- var cmsg = new ShiftOS.Objects.ChatMessage(args["Username"] as string, args["SystemName"] as string, args["Message"] as string, args["Channel"] as string);
- if (id == cmsg.Channel)
- rtbchat.AppendText($"[{cmsg.Username}@{cmsg.SystemName}]: {cmsg.Message}{Environment.NewLine}");
- }
- catch (Exception ex)
- {
- rtbchat.AppendText($"[system@multiuserdomain] Exception thrown by client: {ex}");
- }
- }));
- }
- catch { }
- }
- else if(msg.Name == "chatlog")
- {
- try
- {
- this.Invoke(new Action(() =>
- {
- rtbchat.AppendText(msg.Contents);
- }));
- }
- catch { }
- }
- };
}
- public void SendMessage(string msg)
- {
- if (!string.IsNullOrWhiteSpace(msg))
- {
- rtbchat.AppendText($"[{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}] {msg}{Environment.NewLine}");
-
- ServerManager.SendMessage("chat_send", JsonConvert.SerializeObject(new ShiftOS.Objects.ChatMessage(SaveSystem.CurrentSave.Username, SaveSystem.CurrentSave.SystemName, msg, id)));
- }
- else
- {
- rtbchat.AppendText($"[sys@multiuserdomain] You can't send blank messages. (only you can see this)");
- }
- }
-
-
- private string id = "";
-
public void OnLoad()
{
- ServerManager.SendMessage("chat_getlog", JsonConvert.SerializeObject(new ShiftOS.Objects.ChatLogRequest(id, 50)));
-
- SendMessage("User has joined the chat.");
+ AllInstances.Add(this);
+ if (!string.IsNullOrWhiteSpace(ChatID))
+ pnlstart.SendToBack();
RefreshUserInput();
}
@@ -112,8 +64,8 @@ namespace ShiftOS.WinForms.Applications
public bool OnUnload()
{
- SendMessage("User has left the chat.");
- id = null;
+ AllInstances.Remove(this);
+ ChatID = null;
return true;
}
@@ -146,15 +98,102 @@ namespace ShiftOS.WinForms.Applications
{
rtbchat.SelectionStart = rtbchat.Text.Length;
rtbchat.ScrollToCaret();
- tschatid.Text = id;
- tsuserdata.Text = $"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}";
+ tschatid.Text = ChatID;
+ AppearanceManager.SetWindowTitle(this, tschatid.Text + " - SimpleSRC Client");
+ tsuserdata.Text = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}";
RefreshUserInput();
}
+ public static readonly List<Chat> AllInstances = new List<Chat>();
+
+ public static void SendMessage(string user, string destination, string msg)
+ {
+ foreach(var chat in AllInstances)
+ {
+ chat.PostMessage(user, destination, msg);
+ }
+ }
+
+ public string ChatID = "";
+
+ public void PostMessage(string user, string destination, string message)
+ {
+ if (ChatID == destination)
+ {
+ this.Invoke(new Action(() =>
+ {
+ rtbchat.SelectionFont = new Font(rtbchat.Font, FontStyle.Bold);
+ rtbchat.AppendText($"[{user}] ");
+ rtbchat.SelectionFont = rtbchat.Font;
+ rtbchat.AppendText(message);
+ rtbchat.AppendText(Environment.NewLine + Environment.NewLine);
+ }));
+ }
+ }
+
private void btnsend_Click(object sender, EventArgs e)
{
- SendMessage(txtuserinput.Text);
+ //Update ALL chat windows with this message if they're connected to this chat.
+ SendMessage($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}", ChatID, txtuserinput.Text);
txtuserinput.Text = "";
}
+
+ [Story("story_thefennfamily")]
+ public static void Story_TheFennFamily()
+ {
+ bool complete = false;
+ Infobox.Show("SimpleSRC", "A direct message has been sent to you on SimpleSRC from user \"maureenfenn@trisys\".", () =>
+ {
+ string ch = "maureenfenn@trisys";
+ var c = new Chat();
+ c.ChatID = ch;
+ AppearanceManager.SetupWindow(c);
+ string you = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}";
+
+ var t = new Thread(() =>
+ {
+ SendMessage(you, ch, "User has joined the chat.");
+ Thread.Sleep(2000);
+ SendMessage(ch, ch, "Hello, " + you + ". My name is Maureen. Maureen Fenn.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "I am the author of the various Tri applications you may see on Appscape.");
+ Thread.Sleep(2000);
+ SendMessage(ch, ch, "I need your help with something...");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "Firstly, a little backstory. There was a time in ShiftOS when none of us were connected.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "There wasn't a Digital Society, we didn't have chat applications or anything...");
+ Thread.Sleep(2000);
+ SendMessage(ch, ch, "All we had was the Shiftnet.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "However, in 2016, something happened called the \"connected revolution\". It was like, the invention of the Internet - it was huge for the world of ShiftOS.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "Before this, the only way you could earn Codepoints was through playing games in ShiftOS.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "I was the one who coded those games, and I would put them on a Shiftnet website that you can still access today, shiftnet/main/shiftgames.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "But when the Connected Revolution took place, things got difficult. My son, Nalyr Fenn, was born, and people stopped using my software and instead moved on to hacking eachother and stealing peoples' Codepoints.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "When Nalyr's sentience levels reached near human - i.e, he grew up, we decided to start TriOffice. It was a huge success, thanks to Aiden Nirh, the guy who runs Appscape.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "However... a few months ago he cut contact with us and we stopped receiving Codepoints from TriOffice.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "I'm running low - I can't afford to keep my system running much longer. You have to help!");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "Perhaps, you could breach Aiden's server and look for clues as to why he's against us? I'll reward you with the last Codepoints I have.");
+ Thread.Sleep(2500);
+ SendMessage(you, ch, "Alright, I'm in - but I don't know where to begin...");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "A little birdie tells me you know about the RTS exploits going around... Try using that on Aiden's server. You can find his systemname on Appscape under \"Contact Us.\" He has a mailserver on Appscape - and also has RTS on the same server.");
+ Thread.Sleep(2500);
+ SendMessage(ch, ch, "Good luck... My life depends on you!");
+ complete = true;
+ });
+ t.IsBackground = true;
+ t.Start();
+ });
+ while (!complete)
+ Thread.Sleep(10);
+ }
}
}
diff --git a/ShiftOS.WinForms/Applications/Chat.resx b/ShiftOS.WinForms/Applications/Chat.resx
index a7b2b93..e4a35ad 100644
--- a/ShiftOS.WinForms/Applications/Chat.resx
+++ b/ShiftOS.WinForms/Applications/Chat.resx
@@ -123,6 +123,12 @@
<metadata name="tsbottombar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>122, 17</value>
</metadata>
+ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <metadata name="tsbottombar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>122, 17</value>
+ </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnsend.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs
index ea9fcec..965e4eb 100644
--- a/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs
+++ b/ShiftOS.WinForms/Applications/FileSkimmer.Designer.cs
@@ -70,9 +70,9 @@ namespace ShiftOS.WinForms.Applications
// lvitems
//
this.lvitems.Dock = System.Windows.Forms.DockStyle.Fill;
- this.lvitems.Location = new System.Drawing.Point(0, 0);
+ this.lvitems.Location = new System.Drawing.Point(149, 0);
this.lvitems.Name = "lvitems";
- this.lvitems.Size = new System.Drawing.Size(634, 332);
+ this.lvitems.Size = new System.Drawing.Size(485, 332);
this.lvitems.TabIndex = 0;
this.lvitems.UseCompatibleStateImageBehavior = false;
this.lvitems.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lvitems_ItemSelectionChanged);
@@ -81,8 +81,8 @@ namespace ShiftOS.WinForms.Applications
//
// panel1
//
- this.panel1.Controls.Add(this.pinnedItems);
this.panel1.Controls.Add(this.lvitems);
+ this.panel1.Controls.Add(this.pinnedItems);
this.panel1.Controls.Add(this.lbcurrentfolder);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 24);
@@ -92,10 +92,12 @@ namespace ShiftOS.WinForms.Applications
//
// pinnedItems
//
- this.pinnedItems.Location = new System.Drawing.Point(437, 208);
+ this.pinnedItems.Dock = System.Windows.Forms.DockStyle.Left;
+ this.pinnedItems.Location = new System.Drawing.Point(0, 0);
this.pinnedItems.Name = "pinnedItems";
- this.pinnedItems.Size = new System.Drawing.Size(197, 124);
+ this.pinnedItems.Size = new System.Drawing.Size(149, 332);
this.pinnedItems.TabIndex = 3;
+ this.pinnedItems.Click += new System.EventHandler(this.pinnedItems_Click);
//
// lbcurrentfolder
//
diff --git a/ShiftOS.WinForms/Applications/FileSkimmer.cs b/ShiftOS.WinForms/Applications/FileSkimmer.cs
index c1ffd40..218e9e2 100644
--- a/ShiftOS.WinForms/Applications/FileSkimmer.cs
+++ b/ShiftOS.WinForms/Applications/FileSkimmer.cs
@@ -35,6 +35,7 @@ using System.Windows.Forms;
using static ShiftOS.Objects.ShiftFS.Utils;
using ShiftOS.Engine;
+using Newtonsoft.Json;
namespace ShiftOS.WinForms.Applications
{
@@ -128,8 +129,14 @@ namespace ShiftOS.WinForms.Applications
{
int amountsCalled = -1;
amountsCalled = amountsCalled + 1;
- pinnedItems.Nodes.Add(path);
- pinnedItems.Nodes[amountsCalled].Nodes.Add("test");
+ List<string> Pinned = new List<string>();
+ if(FileExists(Paths.GetPath("data") + "/pinned_items.dat"))
+ {
+ Pinned = JsonConvert.DeserializeObject<List<string>>(ReadAllText(Paths.GetPath("data") + "/pinned_items.dat"));
+ }
+ Pinned.Add(path);
+ WriteAllText(Paths.GetPath("data") + "/pinned_items.dat", JsonConvert.SerializeObject(Pinned));
+ ResetList();
}
public void ChangeDirectory(string path)
@@ -152,8 +159,40 @@ namespace ShiftOS.WinForms.Applications
}
}
+ public void PopulatePinned(TreeNode node, string[] items)
+ {
+ foreach(var dir in items)
+ {
+ var treenode = new TreeNode();
+ if (DirectoryExists(dir))
+ {
+ var dinf = GetDirectoryInfo(dir);
+ treenode.Text = dinf.Name;
+ }
+ else if (FileExists(dir))
+ {
+ var finf = GetFileInfo(dir);
+ treenode.Text = finf.Name;
+ }
+ treenode.Tag = dir;
+ node.Nodes.Add(treenode);
+ }
+ }
+
public void ResetList()
{
+ pinnedItems.Nodes.Clear();
+ List<string> Pinned = new List<string>();
+ if(FileExists(Paths.GetPath("data") + "/pinned_items.dat"))
+ {
+ Pinned = JsonConvert.DeserializeObject<List<string>>(ReadAllText(Paths.GetPath("data") + "/pinned_items.dat"));
+ }
+ var node = new TreeNode();
+ node.Text = "Pinned";
+ PopulatePinned(node, Pinned.ToArray());
+ pinnedItems.Nodes.Add(node);
+ node.ExpandAll();
+
if(lvitems.LargeImageList == null)
{
lvitems.LargeImageList = new ImageList();
@@ -437,5 +476,26 @@ namespace ShiftOS.WinForms.Applications
}
catch { }
}
+
+ private void pinnedItems_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ if (pinnedItems.SelectedNode != null)
+ {
+ string path = pinnedItems.SelectedNode.Tag.ToString();
+ if (DirectoryExists(path))
+ {
+ currentdir = path;
+ ResetList();
+ }
+ else if (FileExists(path))
+ {
+ FileSkimmerBackend.OpenFile(path);
+ }
+ }
+ }
+ catch { }
+ }
}
}
diff --git a/ShiftOS.WinForms/Applications/GraphicPicker.Designer.cs b/ShiftOS.WinForms/Applications/GraphicPicker.Designer.cs
index 988acbd..889c8aa 100644
--- a/ShiftOS.WinForms/Applications/GraphicPicker.Designer.cs
+++ b/ShiftOS.WinForms/Applications/GraphicPicker.Designer.cs
@@ -86,12 +86,12 @@ namespace ShiftOS.WinForms.Applications
this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgcontents.Location = new System.Drawing.Point(0, 0);
this.pgcontents.Name = "pgcontents";
- this.pgcontents.Size = new System.Drawing.Size(390, 383);
+ this.pgcontents.Size = new System.Drawing.Size(487, 383);
this.pgcontents.TabIndex = 20;
//
// btncancel
//
- this.btncancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+ this.btncancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btncancel.Location = new System.Drawing.Point(21, 335);
this.btncancel.Name = "btncancel";
this.btncancel.Size = new System.Drawing.Size(109, 32);
@@ -102,10 +102,11 @@ namespace ShiftOS.WinForms.Applications
//
// btnreset
//
- this.btnreset.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
+ this.btnreset.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.btnreset.Location = new System.Drawing.Point(136, 335);
this.btnreset.Name = "btnreset";
- this.btnreset.Size = new System.Drawing.Size(109, 32);
+ this.btnreset.Size = new System.Drawing.Size(206, 32);
this.btnreset.TabIndex = 22;
this.btnreset.Text = "Reset";
this.btnreset.UseVisualStyleBackColor = true;
@@ -113,8 +114,8 @@ namespace ShiftOS.WinForms.Applications
//
// btnapply
//
- this.btnapply.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
- this.btnapply.Location = new System.Drawing.Point(251, 335);
+ this.btnapply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnapply.Location = new System.Drawing.Point(348, 335);
this.btnapply.Name = "btnapply";
this.btnapply.Size = new System.Drawing.Size(118, 32);
this.btnapply.TabIndex = 21;
@@ -124,19 +125,21 @@ namespace ShiftOS.WinForms.Applications
//
// Label2
//
- this.Label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.Label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.Label2.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label2.Location = new System.Drawing.Point(125, 260);
this.Label2.Name = "Label2";
- this.Label2.Size = new System.Drawing.Size(163, 28);
+ this.Label2.Size = new System.Drawing.Size(260, 28);
this.Label2.TabIndex = 12;
+ this.Label2.Tag = "header3";
this.Label2.Text = "Idle";
this.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnidlebrowse
//
- this.btnidlebrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.btnidlebrowse.Location = new System.Drawing.Point(295, 260);
+ this.btnidlebrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnidlebrowse.Location = new System.Drawing.Point(392, 260);
this.btnidlebrowse.Name = "btnidlebrowse";
this.btnidlebrowse.Size = new System.Drawing.Size(73, 60);
this.btnidlebrowse.TabIndex = 10;
@@ -146,14 +149,15 @@ namespace ShiftOS.WinForms.Applications
//
// txtidlefile
//
- this.txtidlefile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.txtidlefile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.txtidlefile.BackColor = System.Drawing.Color.White;
this.txtidlefile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtidlefile.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtidlefile.Location = new System.Drawing.Point(125, 291);
this.txtidlefile.Multiline = true;
this.txtidlefile.Name = "txtidlefile";
- this.txtidlefile.Size = new System.Drawing.Size(163, 29);
+ this.txtidlefile.Size = new System.Drawing.Size(260, 29);
this.txtidlefile.TabIndex = 9;
this.txtidlefile.Text = "None";
this.txtidlefile.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
@@ -172,9 +176,10 @@ namespace ShiftOS.WinForms.Applications
//
// btnzoom
//
+ this.btnzoom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnzoom.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btnzoom.FlatAppearance.BorderSize = 0;
- this.btnzoom.Location = new System.Drawing.Point(286, 144);
+ this.btnzoom.Location = new System.Drawing.Point(383, 144);
this.btnzoom.Name = "btnzoom";
this.btnzoom.Size = new System.Drawing.Size(82, 65);
this.btnzoom.TabIndex = 7;
@@ -184,9 +189,10 @@ namespace ShiftOS.WinForms.Applications
//
// btnstretch
//
+ this.btnstretch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnstretch.FlatAppearance.BorderColor = System.Drawing.Color.Black;
this.btnstretch.FlatAppearance.BorderSize = 0;
- this.btnstretch.Location = new System.Drawing.Point(197, 144);
+ this.btnstretch.Location = new System.Drawing.Point(294, 144);
this.btnstretch.Name = "btnstretch";
this.btnstretch.Size = new System.Drawing.Size(82, 65);
this.btnstretch.TabIndex = 6;
@@ -228,6 +234,9 @@ namespace ShiftOS.WinForms.Applications
//
// picgraphic
//
+ this.picgraphic.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.picgraphic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.picgraphic.Location = new System.Drawing.Point(0, 0);
this.picgraphic.Name = "picgraphic";
@@ -237,11 +246,14 @@ namespace ShiftOS.WinForms.Applications
//
// lblobjecttoskin
//
+ this.lblobjecttoskin.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
this.lblobjecttoskin.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblobjecttoskin.Location = new System.Drawing.Point(19, 9);
this.lblobjecttoskin.Name = "lblobjecttoskin";
- this.lblobjecttoskin.Size = new System.Drawing.Size(350, 23);
+ this.lblobjecttoskin.Size = new System.Drawing.Size(447, 23);
this.lblobjecttoskin.TabIndex = 2;
+ this.lblobjecttoskin.Tag = "header1";
this.lblobjecttoskin.Text = "Close Button";
this.lblobjecttoskin.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
@@ -249,10 +261,9 @@ namespace ShiftOS.WinForms.Applications
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(390, 383);
this.Controls.Add(this.pgcontents);
this.Name = "GraphicPicker";
- this.Text = "{GRAPHIC_PICKER_NAME}";
+ this.Size = new System.Drawing.Size(487, 383);
this.Load += new System.EventHandler(this.Graphic_Picker_Load);
this.pgcontents.ResumeLayout(false);
this.pgcontents.PerformLayout();
diff --git a/ShiftOS.WinForms/Applications/GraphicPicker.cs b/ShiftOS.WinForms/Applications/GraphicPicker.cs
index 85f95bd..f299f0d 100644
--- a/ShiftOS.WinForms/Applications/GraphicPicker.cs
+++ b/ShiftOS.WinForms/Applications/GraphicPicker.cs
@@ -45,6 +45,12 @@ namespace ShiftOS.WinForms.Applications
{
InitializeComponent();
SelectedLayout = layout;
+ Image = old;
+ using(var ms = new System.IO.MemoryStream())
+ {
+ Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
+ ImageAsBinary = ms.ToArray();
+ }
Callback = cb;
lblobjecttoskin.Text = name;
@@ -123,10 +129,12 @@ namespace ShiftOS.WinForms.Applications
public void OnLoad()
{
+ Setup();
}
public void OnSkinLoad()
{
+ Setup();
}
public bool OnUnload()
@@ -136,6 +144,7 @@ namespace ShiftOS.WinForms.Applications
public void OnUpgrade()
{
+ Setup();
}
}
}
diff --git a/ShiftOS.WinForms/Applications/IconManager.Designer.cs b/ShiftOS.WinForms/Applications/IconManager.Designer.cs
new file mode 100644
index 0000000..25bcee4
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/IconManager.Designer.cs
@@ -0,0 +1,163 @@
+namespace ShiftOS.WinForms.Applications
+{
+ partial class IconManager
+ {
+ /// <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 Component 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.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.btnclose = new System.Windows.Forms.Button();
+ this.btnreset = new System.Windows.Forms.Button();
+ this.btnapply = new System.Windows.Forms.Button();
+ this.flbody = new System.Windows.Forms.FlowLayoutPanel();
+ this.lbcurrentpage = new System.Windows.Forms.Label();
+ this.btnprev = new System.Windows.Forms.Button();
+ this.btnnext = new System.Windows.Forms.Button();
+ this.flowLayoutPanel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // flowLayoutPanel1
+ //
+ this.flowLayoutPanel1.AutoSize = true;
+ this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.flowLayoutPanel1.Controls.Add(this.btnclose);
+ this.flowLayoutPanel1.Controls.Add(this.btnreset);
+ this.flowLayoutPanel1.Controls.Add(this.btnapply);
+ this.flowLayoutPanel1.Controls.Add(this.lbcurrentpage);
+ this.flowLayoutPanel1.Controls.Add(this.btnprev);
+ this.flowLayoutPanel1.Controls.Add(this.btnnext);
+ this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 416);
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+ this.flowLayoutPanel1.Size = new System.Drawing.Size(393, 29);
+ this.flowLayoutPanel1.TabIndex = 0;
+ //
+ // btnclose
+ //
+ this.btnclose.AutoSize = true;
+ this.btnclose.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnclose.Location = new System.Drawing.Point(3, 3);
+ this.btnclose.Name = "btnclose";
+ this.btnclose.Size = new System.Drawing.Size(43, 23);
+ this.btnclose.TabIndex = 0;
+ this.btnclose.Text = "Close";
+ this.btnclose.UseVisualStyleBackColor = true;
+ this.btnclose.Click += new System.EventHandler(this.btnclose_Click);
+ //
+ // btnreset
+ //
+ this.btnreset.AutoSize = true;
+ this.btnreset.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnreset.Location = new System.Drawing.Point(52, 3);
+ this.btnreset.Name = "btnreset";
+ this.btnreset.Size = new System.Drawing.Size(45, 23);
+ this.btnreset.TabIndex = 1;
+ this.btnreset.Text = "Reset";
+ this.btnreset.UseVisualStyleBackColor = true;
+ this.btnreset.Click += new System.EventHandler(this.btnreset_Click);
+ //
+ // btnapply
+ //
+ this.btnapply.AutoSize = true;
+ this.btnapply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnapply.Location = new System.Drawing.Point(103, 3);
+ this.btnapply.Name = "btnapply";
+ this.btnapply.Size = new System.Drawing.Size(43, 23);
+ this.btnapply.TabIndex = 2;
+ this.btnapply.Text = "Apply";
+ this.btnapply.UseVisualStyleBackColor = true;
+ this.btnapply.Click += new System.EventHandler(this.btnapply_Click);
+ //
+ // flbody
+ //
+ this.flbody.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.flbody.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
+ this.flbody.Location = new System.Drawing.Point(0, 0);
+ this.flbody.Name = "flbody";
+ this.flbody.Size = new System.Drawing.Size(393, 416);
+ this.flbody.TabIndex = 1;
+ this.flbody.WrapContents = false;
+ //
+ // lbcurrentpage
+ //
+ this.lbcurrentpage.AutoSize = true;
+ this.lbcurrentpage.Location = new System.Drawing.Point(152, 0);
+ this.lbcurrentpage.Name = "lbcurrentpage";
+ this.lbcurrentpage.Size = new System.Drawing.Size(71, 13);
+ this.lbcurrentpage.TabIndex = 3;
+ this.lbcurrentpage.Text = "Current page:";
+ //
+ // btnprev
+ //
+ this.btnprev.AutoSize = true;
+ this.btnprev.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnprev.Location = new System.Drawing.Point(229, 3);
+ this.btnprev.Name = "btnprev";
+ this.btnprev.Size = new System.Drawing.Size(51, 23);
+ this.btnprev.TabIndex = 4;
+ this.btnprev.Text = " < Prev";
+ this.btnprev.UseVisualStyleBackColor = true;
+ this.btnprev.Click += new System.EventHandler(this.btnprev_Click);
+ //
+ // btnnext
+ //
+ this.btnnext.AutoSize = true;
+ this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnnext.Location = new System.Drawing.Point(286, 3);
+ this.btnnext.Name = "btnnext";
+ this.btnnext.Size = new System.Drawing.Size(48, 23);
+ this.btnnext.TabIndex = 5;
+ this.btnnext.Text = "Next >";
+ this.btnnext.UseVisualStyleBackColor = true;
+ this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
+ //
+ // IconManager
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.flbody);
+ this.Controls.Add(this.flowLayoutPanel1);
+ this.Name = "IconManager";
+ this.Size = new System.Drawing.Size(393, 445);
+ this.flowLayoutPanel1.ResumeLayout(false);
+ this.flowLayoutPanel1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
+ private System.Windows.Forms.Button btnclose;
+ private System.Windows.Forms.Button btnreset;
+ private System.Windows.Forms.Button btnapply;
+ private System.Windows.Forms.FlowLayoutPanel flbody;
+ private System.Windows.Forms.Label lbcurrentpage;
+ private System.Windows.Forms.Button btnprev;
+ private System.Windows.Forms.Button btnnext;
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/IconManager.cs b/ShiftOS.WinForms/Applications/IconManager.cs
new file mode 100644
index 0000000..0c6e119
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/IconManager.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.Engine;
+using System.Reflection;
+using ShiftOS.WinForms.Tools;
+using Newtonsoft.Json;
+
+namespace ShiftOS.WinForms.Applications
+{
+ [RequiresUpgrade("icon_manager")]
+ [Launcher("Icon Manager", true, "al_icon_manager", "Customization")]
+ [DefaultTitle("Icon Manager")]
+ [DefaultIcon("iconIconManager")]
+ public partial class IconManager : UserControl, IShiftOSWindow
+ {
+ public IconManager()
+ {
+ InitializeComponent();
+ }
+
+ public void OnLoad()
+ {
+ LoadIconsFromEngine();
+ SetupUI();
+ }
+
+ public void OnSkinLoad()
+ {
+ LoadIconsFromEngine();
+ SetupUI();
+ }
+
+ public bool OnUnload()
+ {
+ Icons = null;
+ return true;
+ }
+
+ private Dictionary<string, byte[]> Icons = null;
+
+ private const int pageSize = 10;
+ private int currentPage = 0;
+ private int pageCount = 0;
+
+ public Image GetIcon(string id)
+ {
+ if (!Icons.ContainsKey(id))
+ Icons.Add(id, null);
+
+ if (Icons[id] == null)
+ {
+ var img = SkinEngine.GetDefaultIcon(id);
+ using (var mstr = new System.IO.MemoryStream())
+ {
+ img.Save(mstr, System.Drawing.Imaging.ImageFormat.Png);
+ Icons[id] = mstr.ToArray();
+ }
+ return img;
+ }
+ else
+ {
+ using (var sr = new System.IO.MemoryStream(Icons[id]))
+ {
+ return Image.FromStream(sr);
+ }
+ }
+ }
+
+ public void SetIcon(string key, byte[] raw)
+ {
+ if (!Icons.ContainsKey(key))
+ Icons.Add(key, raw);
+ Icons[key] = raw;
+ }
+
+ public void LoadIconsFromEngine()
+ {
+ //We have to serialize the engine icon list to JSON to break references with the data.
+ string json = JsonConvert.SerializeObject(SkinEngine.LoadedSkin.AppIcons);
+ //And deserialize to the local instance...essentially making a clone.
+ Icons = JsonConvert.DeserializeObject<Dictionary<string, byte[]>>(json);
+ }
+
+ public void SetupUI()
+ {
+ flbody.Controls.Clear(); //Clear the icon list.
+
+ List<Type> types = new List<Type>();
+
+ foreach(var exe in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
+ {
+ if(exe.ToLower().EndsWith(".exe") || exe.ToLower().EndsWith(".dll"))
+ {
+ try
+ {
+ var asm = Assembly.LoadFile(exe);
+
+ var typeList = asm.GetTypes().Where(x => x.GetCustomAttributes(false).FirstOrDefault(y => y is DefaultIconAttribute) != null);
+ types.AddRange(typeList);
+
+ }
+ catch { }
+ }
+ }
+
+ pageCount = types.ToArray().GetPageCount(pageSize);
+
+ foreach (var type in types.ToArray().GetItemsOnPage(currentPage, pageSize))
+ {
+ if (Shiftorium.UpgradeAttributesUnlocked(type))
+ {
+ var pnl = new Panel();
+ pnl.Height = 30;
+ pnl.Width = flbody.Width - 15;
+ flbody.Controls.Add(pnl);
+ pnl.Show();
+ var pic = new PictureBox();
+ pic.SizeMode = PictureBoxSizeMode.StretchImage;
+ pic.Size = new Size(24, 24);
+ pic.Image = GetIcon(type.Name);
+ pnl.Controls.Add(pic);
+ pic.Left = 5;
+ pic.Top = (pnl.Height - pic.Height) / 2;
+ pic.Show();
+ var lbl = new Label();
+ lbl.Tag = "header3";
+ lbl.AutoSize = true;
+ lbl.Text = NameChangerBackend.GetNameRaw(type);
+ ControlManager.SetupControl(lbl);
+ pnl.Controls.Add(lbl);
+ lbl.CenterParent();
+ lbl.Show();
+ var btn = new Button();
+ btn.Text = "Change...";
+ btn.AutoSize = true;
+ btn.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ pnl.Controls.Add(btn);
+ btn.Left = (pnl.Width - btn.Width) - 5;
+ btn.Top = (pnl.Height - btn.Height) / 2;
+ btn.Click += (o, a) =>
+ {
+ var gfp = new GraphicPicker(pic.Image, lbl.Text + " icon", ImageLayout.Stretch, (raw, img, layout) =>
+ {
+ pic.Image = img;
+ SetIcon(type.Name, raw);
+ });
+ AppearanceManager.SetupDialog(gfp);
+ };
+ btn.Show();
+ ControlManager.SetupControls(pnl);
+ }
+ }
+
+ btnnext.Visible = (currentPage < pageCount - 1);
+ btnprev.Visible = (currentPage > 0);
+
+ lbcurrentpage.Text = "Page " + (currentPage + 1).ToString() + " of " + pageCount.ToString();
+ }
+
+ public void OnUpgrade()
+ {
+ LoadIconsFromEngine();
+ SetupUI();
+ }
+
+ private void btnprev_Click(object sender, EventArgs e)
+ {
+ currentPage--;
+ SetupUI();
+ }
+
+ public void ResetToDefaults()
+ {
+ currentPage = 0;
+ foreach (var key in Icons.Keys)
+ {
+ var img = SkinEngine.GetDefaultIcon(key);
+ using(var ms = new System.IO.MemoryStream())
+ {
+ img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
+ Icons[key] = ms.ToArray();
+ }
+ }
+ SetupUI();
+ }
+
+ private void btnnext_Click(object sender, EventArgs e)
+ {
+ currentPage++;
+ SetupUI();
+ }
+
+ private void btnclose_Click(object sender, EventArgs e)
+ {
+ AppearanceManager.Close(this);
+ }
+
+ private void btnreset_Click(object sender, EventArgs e)
+ {
+ ResetToDefaults();
+ }
+
+ private void btnapply_Click(object sender, EventArgs e)
+ {
+ SkinEngine.LoadedSkin.AppIcons = Icons;
+ SkinEngine.SaveSkin();
+ SkinEngine.LoadSkin();
+ Infobox.Show("Icons applied!", "The new icons have been applied to ShiftOS successfully!");
+ }
+ }
+
+ public static class PaginationExtensions
+ {
+ public static int GetPageCount<T>(this IEnumerable<T> collection, int pageSize)
+ {
+ return (collection.Count() + pageSize - 1) / pageSize;
+ }
+
+ public static T[] GetItemsOnPage<T>(this T[] collection, int page, int pageSize)
+ {
+ List<T> obj = new List<T>();
+
+ for (int i = pageSize * page; i <= pageSize + (pageSize * page) && i < collection.Count(); i++)
+ {
+ try
+ {
+ obj.Add(collection[i]);
+ }
+ catch
+ {
+ }
+ }
+ return obj.ToArray();
+ }
+ }
+
+}
diff --git a/ShiftOS.WinForms/Applications/IconManager.resx b/ShiftOS.WinForms/Applications/IconManager.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/IconManager.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
diff --git a/ShiftOS.WinForms/Applications/Installer.Designer.cs b/ShiftOS.WinForms/Applications/Installer.Designer.cs
index 48f9146..b01986d 100644
--- a/ShiftOS.WinForms/Applications/Installer.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Installer.Designer.cs
@@ -118,12 +118,10 @@
//
this.pginstall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.pginstall.BlockSize = 5;
this.pginstall.Location = new System.Drawing.Point(17, 161);
this.pginstall.Maximum = 100;
this.pginstall.Name = "pginstall";
this.pginstall.Size = new System.Drawing.Size(414, 23);
- this.pginstall.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.pginstall.TabIndex = 2;
this.pginstall.Text = "shiftedProgressBar1";
this.pginstall.Value = 0;
diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
index b8ba5f3..97212e7 100644
--- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs
+++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
@@ -100,7 +100,7 @@ namespace ShiftOS.WinForms.Applications
{
ServerManager.SendMessage("shop_removeowned", JsonConvert.SerializeObject(new
{
- username = SaveSystem.CurrentSave.Username
+ username = SaveSystem.CurrentUser.Username
}));
ShowCreateShop();
}
@@ -274,9 +274,10 @@ namespace ShiftOS.WinForms.Applications
}
+ [Obsolete("MUD control center is dying! KILL IT!")]
public void OpenChat(string id)
{
- AppearanceManager.SetupWindow(new Chat(id));
+// AppearanceManager.SetupWindow(new Chat(id));
}
private Shop editingShop = null;
@@ -289,7 +290,7 @@ namespace ShiftOS.WinForms.Applications
creatingShop = true;
editingShop.Name = "My shop";
editingShop.Description = "My shop has lots of awesome items. You should buy from my shop.";
- editingShop.Owner = SaveSystem.CurrentSave.Username;
+ editingShop.Owner = SaveSystem.CurrentUser.Username;
editingShop.Items = new List<ShopItem>();
shop_editor.BringToFront();
PopulateShopEditor();
@@ -401,7 +402,7 @@ namespace ShiftOS.WinForms.Applications
lbprice.Text = $"Cost: {item.Cost} CP";
btnbuy.Show();
};
- if(shop.Owner == SaveSystem.CurrentSave.Username)
+ if(shop.Owner == SaveSystem.CurrentUser.Username)
{
btneditshop.Show();
}
@@ -559,7 +560,7 @@ namespace ShiftOS.WinForms.Applications
you_systemstatus.BringToFront();
- lblsysstatus.Text = $@"Username: {SaveSystem.CurrentSave.Username}
+ lblsysstatus.Text = $@"Username: {SaveSystem.CurrentUser.Username}
System name: {SaveSystem.CurrentSave.SystemName}
Codepoints: {SaveSystem.CurrentSave.Codepoints}
@@ -590,7 +591,7 @@ Current legions: {legionname}";
private void tsMemos_Click(object sender, EventArgs e)
{
ServerManager.SendMessage("get_memos_for_user", $@"{{
- username: ""{SaveSystem.CurrentSave.Username}""
+ username: ""{SaveSystem.CurrentUser.Username}""
}}");
you_memos.BringToFront();
}
@@ -811,7 +812,7 @@ Current legions: {legionname}";
{
ServerManager.SendMessage("user_shop_check", JsonConvert.SerializeObject(new
{
- username = SaveSystem.CurrentSave.Username
+ username = SaveSystem.CurrentUser.Username
}));
}
@@ -894,7 +895,7 @@ Current legions: {legionname}";
private void myShopToolStripMenuItem_Click(object sender, EventArgs e)
{
- ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentSave.Username);
+ ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentUser.Username);
}
private void btneditshop_Click(object sender, EventArgs e)
@@ -922,7 +923,7 @@ Current legions: {legionname}";
{
ServerManager.SendMessage("delete_save", JsonConvert.SerializeObject(new ClientSave
{
- Username = SaveSystem.CurrentSave.Username,
+ Username = SaveSystem.CurrentUser.Username,
Password = SaveSystem.CurrentSave.Password
}));
diff --git a/ShiftOS.WinForms/Applications/Pong.Designer.cs b/ShiftOS.WinForms/Applications/Pong.Designer.cs
index 0254e94..c5ea375 100644
--- a/ShiftOS.WinForms/Applications/Pong.Designer.cs
+++ b/ShiftOS.WinForms/Applications/Pong.Designer.cs
@@ -182,7 +182,6 @@ namespace ShiftOS.WinForms.Applications
this.pgcontents.Name = "pgcontents";
this.pgcontents.Size = new System.Drawing.Size(912, 504);
this.pgcontents.TabIndex = 20;
- this.pgcontents.Paint += new System.Windows.Forms.PaintEventHandler(this.pgcontents_Paint);
this.pgcontents.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pongMain_MouseMove);
//
// pnlmultiplayerhandshake
@@ -250,7 +249,6 @@ namespace ShiftOS.WinForms.Applications
this.Label6.TabIndex = 15;
this.Label6.Text = "{PONG_DESC}";
this.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- this.Label6.Click += new System.EventHandler(this.Label6_Click);
//
// btnstartgame
//
@@ -273,7 +271,6 @@ namespace ShiftOS.WinForms.Applications
this.Label8.Size = new System.Drawing.Size(280, 31);
this.Label8.TabIndex = 14;
this.Label8.Text = "{PONG_WELCOME}";
- this.Label8.Click += new System.EventHandler(this.Label8_Click);
//
// pnlhighscore
//
diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs
index d63f406..87f0306 100644
--- a/ShiftOS.WinForms/Applications/Pong.cs
+++ b/ShiftOS.WinForms/Applications/Pong.cs
@@ -58,13 +58,62 @@ namespace ShiftOS.WinForms.Applications
double incrementy = 0.2;
int levelxspeed = 3;
int levelyspeed = 3;
- int beatairewardtotal;
- int beataireward = 1;
- int[] levelrewards = new int[50];
- int totalreward;
+ ulong beatairewardtotal;
+ ulong beataireward = 1;
+ readonly uint[] levelrewards = {
+ 0,
+ 20,
+ 60,
+ 140,
+ 290,
+ 400,
+ 600,
+ 900,
+ 1200,
+ 1600,
+ 2000,
+ 2500,
+ 3000,
+ 4000,
+ 5000,
+ 6000,
+ 8000,
+ 10000,
+ 13000,
+ 16000,
+ 20000,
+ 25000,
+ 32000,
+ 40000,
+ 50000,
+ 60000,
+ 75000,
+ 90000,
+ 110000,
+ 140000,
+ 180000,
+ 220000,
+ 270000,
+ 320000,
+ 400000,
+ 500000,
+ 640000,
+ 800000,
+ 1000000,
+ 1500000,
+ 2000000};
+ ulong totalreward;
int countdown = 3;
+ int rwdmultiplier;
+ Thread soundThread;
- bool aiShouldIsbeEnabled = true;
+ bool aiShouldIsbeEnabled = true; // who named this variable? and were they having a stroke?
+
+ private void playsound(System.IO.Stream stream)
+ {
+ soundThread = new Thread((a) => ShiftOS.Engine.AudioManager.PlayStream((System.IO.Stream)a));
+ soundThread.Start(stream);
+ }
public Pong()
{
@@ -73,11 +122,9 @@ namespace ShiftOS.WinForms.Applications
private void Pong_Load(object sender, EventArgs e)
{
- setuplevelrewards();
+ rwdmultiplier = ShiftoriumFrontend.UpgradeInstalled("pong_upgrade") ? 2 : 1;
}
-
-
// Move the paddle according to the mouse position.
private void pongMain_MouseMove(object sender, MouseEventArgs e)
{
@@ -133,9 +180,7 @@ namespace ShiftOS.WinForms.Applications
{
if (this.Left < Screen.PrimaryScreen.Bounds.Width)
{
- ball.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
- paddleComputer.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
- paddleHuman.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
+ ball.BackColor = paddleComputer.BackColor = paddleHuman.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
//Check if paddle upgrade has been bought and change paddles accordingly
//if (ShiftoriumFrontend.UpgradeInstalled("pong_increased_paddle_size"))
@@ -146,7 +191,7 @@ namespace ShiftOS.WinForms.Applications
//I don't know the point of this but I'm fucking 86ing it. - Michael
//Set the computer player to move according to the ball's position.
- if (IsMultiplayerSession == true)
+ if (IsMultiplayerSession)
{
//If we're multiplayer, then we want to set the computer Y to the opponent's Y.
//If we're the leader, we set the AI paddle, else we set the player paddle.
@@ -160,83 +205,63 @@ namespace ShiftOS.WinForms.Applications
if (aiShouldIsbeEnabled)
if (ball.Location.X > (this.Width - (this.Width / 3)) - xVel * 10 && xVel > 0)
{
- if (ball.Location.Y > paddleComputer.Location.Y + 50)
- {
- paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed);
- }
- if (ball.Location.Y < paddleComputer.Location.Y + 50)
- {
- paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed);
- }
+ if (ball.Top > paddleComputer.Top + 50)
+ paddleComputer.Top += computerspeed;
+ else
+ paddleComputer.Top -= computerspeed;
casualposition = rand.Next(-150, 201);
}
else
{
//used to be me.location.y - except it's fucking C# and this comment is misleading as fuck. OH WAIT! I didn't write it! And none of the current devs did either! - Michael
- if (paddleComputer.Location.Y > this.Size.Height / 2 - paddleComputer.Height + casualposition)
- {
- paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed);
- }
- //Rylan is hot. Used to be //used to be me.location.y
- if (paddleComputer.Location.Y < this.Size.Height / 2 - paddleComputer.Height + casualposition)
- {
- paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed);
- }
+ if (paddleComputer.Top > this.Height / 2 - paddleComputer.Height + casualposition)
+ paddleComputer.Top -= computerspeed;
+ else
+ paddleComputer.Top += computerspeed;
}
}
//Set Xvel and Yvel speeds from decimal
if (xVel > 0)
xVel = (int)Math.Round(xveldec);
- if (xVel < 0)
+ else
xVel = (int)-Math.Round(xveldec);
if (yVel > 0)
yVel = (int)Math.Round(yveldec);
- if (yVel < 0)
+ else
yVel = (int)-Math.Round(yveldec);
- bool BallPhysics = true;
-
- if (IsMultiplayerSession)
+ if (IsMultiplayerSession && !IsLeader)
{
- //Logic for moving the ball in Multiplayer.
- if (IsLeader)
- {
- ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
- }
- else
- {
- //Move it to the leader's ball position.
- ball.Location = new Point(LeaderX, LeaderY);
- BallPhysics = false;
- }
+ // Move it to the leader's ball position.
+ ball.Location = new Point(LeaderX, LeaderY);
}
else
- {// Move the game ball.
- ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
- }
- if (BallPhysics)
{
+ var newRect = new Rectangle(ball.Location, ball.Size); // copy ball's Bounds
+ newRect.X += xVel;
+ newRect.Y += yVel;
+
// Check for top wall.
- if (ball.Location.Y < 0)
+ if (newRect.Y < 0)
{
- ball.Location = new Point(ball.Location.X, 0);
+ newRect.Y = 0;
yVel = -yVel;
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
+ playsound(Properties.Resources.typesound);
}
// Check for bottom wall.
- if (ball.Location.Y > pgcontents.Height - ball.Height)
+ if (newRect.Y > pgcontents.Height - ball.Height)
{
- ball.Location = new Point(ball.Location.X, pgcontents.Height - ball.Size.Height);
+ newRect.Y = pgcontents.Height - ball.Height;
yVel = -yVel;
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
+ playsound(Properties.Resources.typesound);
}
// Check for player paddle.
- if (ball.Bounds.IntersectsWith(paddleHuman.Bounds))
+ if (newRect.IntersectsWith(paddleHuman.Bounds))
{
- ball.Location = new Point(paddleHuman.Location.X + ball.Size.Width + 1, ball.Location.Y);
+ newRect.X = paddleHuman.Left + ball.Width + 1;
//randomly increase x or y speed of ball
switch (rand.Next(1, 3))
{
@@ -246,23 +271,24 @@ namespace ShiftOS.WinForms.Applications
case 2:
if (yveldec > 0)
yveldec = yveldec + incrementy;
- if (yveldec < 0)
+ else
yveldec = yveldec - incrementy;
break;
}
xVel = -xVel;
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.writesound);
+ playsound(Properties.Resources.writesound);
}
// Check for computer paddle.
- if (ball.Bounds.IntersectsWith(paddleComputer.Bounds))
+ if (newRect.IntersectsWith(paddleComputer.Bounds))
{
- ball.Location = new Point(paddleComputer.Location.X - paddleComputer.Size.Width - 1, ball.Location.Y);
+ newRect.X = paddleComputer.Left - paddleComputer.Width - 1;
xveldec = xveldec + incrementx;
xVel = -xVel;
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.writesound);
+ playsound(Properties.Resources.writesound);
}
+ ball.Location = newRect.Location;
}
@@ -297,11 +323,11 @@ namespace ShiftOS.WinForms.Applications
lblmissedout.Text = Localization.Parse("{YOU_MISSED_OUT_ON}:") + Environment.NewLine + lblstatscodepoints.Text.Replace(Localization.Parse("{CODEPOINTS}: "), "") + Localization.Parse(" {CODEPOINTS}");
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade_2"))
{
- totalreward = levelrewards[level - 1] + beatairewardtotal;
+ totalreward = (levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal);
double onePercent = (totalreward / 100);
lblbutyougained.Show();
lblbutyougained.Text = Localization.Parse("{BUT_YOU_GAINED}:") + Environment.NewLine + onePercent.ToString("") + (Localization.Parse(" {CODEPOINTS}"));
- SaveSystem.TransferCodepointsFrom("pong", (totalreward / 100));
+ SaveSystem.TransferCodepointsFrom("pong", (ulong)(onePercent));
}
else
{
@@ -343,10 +369,10 @@ namespace ShiftOS.WinForms.Applications
if (IsLeader)
{
//lblstats.Text = "Xspeed: " & Math.Abs(xVel) & " Yspeed: " & Math.Abs(yVel) & " Human Location: " & paddleHuman.Location.ToString & " Computer Location: " & paddleComputer.Location.ToString & Environment.NewLine & " Ball Location: " & ball.Location.ToString & " Xdec: " & xveldec & " Ydec: " & yveldec & " Xinc: " & incrementx & " Yinc: " & incrementy
- lblstatsX.Text = Localization.Parse("{H_VEL}: ") + xveldec;
- lblstatsY.Text = Localization.Parse("{V_VEL}: ") + yveldec;
- lblstatscodepoints.Text = Localization.Parse("{CODEPOINTS}: ") + (levelrewards[level - 1] + beatairewardtotal).ToString();
- lbllevelandtime.Text = Localization.Parse("{LEVEL}: " + level + " - " + secondsleft + " {SECONDS_LEFT}");
+ lblstatsX.Text = "X vel: " + xveldec;
+ lblstatsY.Text = "Y vel: " + yveldec;
+ lblstatscodepoints.Text = "Codepoints: " + (levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal).ToString();
+ lbllevelandtime.Text = "Level: " + level + " - " + secondsleft + " seconds left";
if (xVel > 20 || xVel < -20)
{
@@ -355,8 +381,7 @@ namespace ShiftOS.WinForms.Applications
}
else
{
- paddleHuman.Width = 20;
- paddleComputer.Width = 20;
+ paddleHuman.Width = paddleComputer.Width = 20;
}
}
if (!IsMultiplayerSession)
@@ -415,7 +440,7 @@ namespace ShiftOS.WinForms.Applications
StartLevel();
}));
}
- else if(msg.Name == "pong_mp_levelcompleted")
+ else if (msg.Name == "pong_mp_levelcompleted")
{
level = Convert.ToInt32(msg.Contents) + 1;
this.Invoke(new Action(CompleteLevel));
@@ -434,7 +459,7 @@ namespace ShiftOS.WinForms.Applications
pnlmultiplayerhandshake.Hide();
}));
}
- else if(msg.Name == "pong_mp_cashedout")
+ else if (msg.Name == "pong_mp_cashedout")
{
this.Invoke(new Action(() =>
{
@@ -442,19 +467,19 @@ namespace ShiftOS.WinForms.Applications
}));
Infobox.Show("Cashed out.", "The other player has cashed out their Codepoints. Therefore, we have automatically cashed yours out.");
}
- else if(msg.Name == "pong_mp_startlevel")
+ else if (msg.Name == "pong_mp_startlevel")
{
OpponentAgrees = true;
- if(YouAgree == false)
+ if (YouAgree == false)
{
- Infobox.PromptYesNo("Play another level?", "The opponent wants to play another level. Would you like to as well?", (answer)=>
+ Infobox.PromptYesNo("Play another level?", "The opponent wants to play another level. Would you like to as well?", (answer) =>
{
YouAgree = answer;
ServerManager.Forward(OpponentGUID, "pong_mp_level_callback", YouAgree.ToString());
});
}
}
- else if(msg.Name == "pong_mp_level_callback")
+ else if (msg.Name == "pong_mp_level_callback")
{
bool agreed = bool.Parse(msg.Contents);
OpponentAgrees = agreed;
@@ -472,7 +497,7 @@ namespace ShiftOS.WinForms.Applications
this.PossibleMatchmakes.Remove(msg.Contents);
this.Invoke(new Action(ListMatchmakes));
}
- else if(msg.Name == "pong_mp_clockupdate")
+ else if (msg.Name == "pong_mp_clockupdate")
{
secondsleft = Convert.ToInt32(msg.Contents);
}
@@ -566,7 +591,7 @@ namespace ShiftOS.WinForms.Applications
public void LoseMP()
{
ball.Location = new Point(this.Size.Width / 2 + 200, this.Size.Height / 2);
- if(IsLeader)
+ if (IsLeader)
if (xVel > 0)
xVel = -xVel;
lblbeatai.Show();
@@ -629,12 +654,12 @@ namespace ShiftOS.WinForms.Applications
if (this.Left < Screen.PrimaryScreen.Bounds.Width)
{
secondsleft = secondsleft - 1;
- if (secondsleft == 1)
+ if (secondsleft == 0)
{
CompleteLevel();
}
- lblstatscodepoints.Text = Localization.Parse("{CODEPOINTS}: ") + (levelrewards[level - 1] + beatairewardtotal).ToString();
+ lblstatscodepoints.Text = "Codepoints: " + (levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal).ToString();
}
}
SetupStats();
@@ -670,200 +695,56 @@ namespace ShiftOS.WinForms.Applications
lblpreviousstats.Text = Localization.Parse("{INITIAL_H_VEL}: " + levelxspeed + Environment.NewLine + "{INITIAL_V_VEL}: " + levelyspeed + Environment.NewLine + "{INC_H_VEL}: " + incrementx + Environment.NewLine + "{INC_V_VEL}: " + incrementy);
- switch (rand.Next(1, 3))
- {
- case 1:
- levelxspeed = levelxspeed + 1;
- break;
- case 2:
- levelxspeed = levelxspeed + 2;
- break;
- }
+ levelxspeed += rand.Next(1, 3);
- switch (rand.Next(1, 3))
- {
- case 1:
- levelyspeed = levelyspeed + 1;
- break;
- case 2:
- levelyspeed = levelyspeed + 2;
- break;
- }
+ levelyspeed += rand.Next(1, 3);
- switch (rand.Next(1, 6))
- {
- case 1:
- incrementx = incrementx + 0.1;
- break;
- case 2:
- incrementx = incrementx + 0.2;
- break;
- case 3:
- incrementy = incrementy + 0.1;
- break;
- case 4:
- incrementy = incrementy + 0.2;
- break;
- case 5:
- incrementy = incrementy + 0.3;
- break;
- }
+ int rndinc = rand.Next(1, 6);
+ if (rndinc == 5)
+ incrementy += 0.3;
+ else
+ incrementy += (((rndinc - 1) % 2) + 1) / 10;
lblnextstats.Text = Localization.Parse("{INITIAL_H_VEL}: " + levelxspeed + Environment.NewLine + "{INITIAL_V_VEL}: " + levelyspeed + Environment.NewLine + "{INC_H_VEL}: " + incrementx + Environment.NewLine + "{INC_V_VEL}: " + incrementy);
if (level < 15)
{
+ beataireward = (ulong)(level * 5);
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
- {
- beataireward = level * 10;
- } else
- {
- beataireward = level * 5;
- }
+ beataireward *= 2;
}
else
- {
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
- {
- double br = levelrewards[level - 1] / 10;
- beataireward = (int)Math.Round(br) * 10;
- } else
- {
- double br = levelrewards[level - 1] / 10;
- beataireward = (int)Math.Round(br) * 5;
- }
- }
+ beataireward = levelrewards[level - 1];
+ else
+ beataireward = (ulong)Math.Round((double) levelrewards[level - 1] / 2);
- totalreward = levelrewards[level - 1] + beatairewardtotal;
+ totalreward = levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal;
btncashout.Text = Localization.Parse("{CASH_OUT_WITH_CODEPOINTS}");
btnplayon.Text = Localization.Parse("{PONG_PLAY_ON_FOR_MORE}");
}
- private void setuplevelrewards()
- {
- if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
- {
- levelrewards[0] = 0;
- levelrewards[1] = 40;
- levelrewards[2] = 120;
- levelrewards[3] = 280;
- levelrewards[4] = 580;
- levelrewards[5] = 800;
- levelrewards[6] = 1200;
- levelrewards[7] = 1800;
- levelrewards[8] = 2400;
- levelrewards[9] = 3200;
- levelrewards[10] = 4000;
- levelrewards[11] = 5000;
- levelrewards[12] = 6000;
- levelrewards[13] = 8000;
- levelrewards[14] = 10000;
- levelrewards[15] = 12000;
- levelrewards[16] = 16000;
- levelrewards[17] = 20000;
- levelrewards[18] = 26000;
- levelrewards[19] = 32000;
- levelrewards[20] = 40000;
- levelrewards[21] = 50000;
- levelrewards[22] = 64000;
- levelrewards[23] = 80000;
- levelrewards[24] = 100000;
- levelrewards[25] = 120000;
- levelrewards[26] = 150000;
- levelrewards[27] = 180000;
- levelrewards[28] = 220000;
- levelrewards[29] = 280000;
- levelrewards[30] = 360000;
- levelrewards[31] = 440000;
- levelrewards[32] = 540000;
- levelrewards[33] = 640000;
- levelrewards[34] = 800000;
- levelrewards[35] = 1000000;
- levelrewards[36] = 1280000;
- levelrewards[37] = 1600000;
- levelrewards[38] = 2000000;
- levelrewards[39] = 3000000;
- levelrewards[40] = 4000000;
- } else
- {
- levelrewards[0] = 0;
- levelrewards[1] = 20;
- levelrewards[2] = 60;
- levelrewards[3] = 140;
- levelrewards[4] = 290;
- levelrewards[5] = 400;
- levelrewards[6] = 600;
- levelrewards[7] = 900;
- levelrewards[8] = 1200;
- levelrewards[9] = 1600;
- levelrewards[10] = 2000;
- levelrewards[11] = 2500;
- levelrewards[12] = 3000;
- levelrewards[13] = 4000;
- levelrewards[14] = 5000;
- levelrewards[15] = 6000;
- levelrewards[16] = 8000;
- levelrewards[17] = 10000;
- levelrewards[18] = 13000;
- levelrewards[19] = 16000;
- levelrewards[20] = 20000;
- levelrewards[21] = 25000;
- levelrewards[22] = 32000;
- levelrewards[23] = 40000;
- levelrewards[24] = 50000;
- levelrewards[25] = 60000;
- levelrewards[26] = 75000;
- levelrewards[27] = 90000;
- levelrewards[28] = 110000;
- levelrewards[29] = 140000;
- levelrewards[30] = 180000;
- levelrewards[31] = 220000;
- levelrewards[32] = 270000;
- levelrewards[33] = 320000;
- levelrewards[34] = 400000;
- levelrewards[35] = 500000;
- levelrewards[36] = 640000;
- levelrewards[37] = 800000;
- levelrewards[38] = 1000000;
- levelrewards[39] = 1500000;
- levelrewards[40] = 2000000;
- }
- }
-
// ERROR: Handles clauses are not supported in C#
private void countdown_Tick(object sender, EventArgs e)
{
if (this.Left < Screen.PrimaryScreen.Bounds.Width)
{
- switch (countdown)
+ if (countdown == 0)
{
- case 0:
- countdown = 3;
- lblcountdown.Hide();
- lblbeatai.Hide();
- gameTimer.Start();
- counter.Start();
- tmrcountdown.Stop();
- break;
- case 1:
- lblcountdown.Text = "1";
- countdown = countdown - 1;
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
- break;
- case 2:
- lblcountdown.Text = "2";
- countdown = countdown - 1;
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
- break;
- case 3:
- lblcountdown.Text = "3";
- countdown = countdown - 1;
- lblcountdown.Show();
- ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
- break;
+ countdown = 3;
+ lblcountdown.Hide();
+ lblbeatai.Hide();
+ gameTimer.Start();
+ counter.Start();
+ tmrcountdown.Stop();
+ return;
}
-
+ if (!lblcountdown.Visible)
+ lblcountdown.Show();
+ lblcountdown.Text = countdown.ToString();
+ countdown -= 1;
+ playsound(Properties.Resources.typesound);
}
}
@@ -874,7 +755,7 @@ namespace ShiftOS.WinForms.Applications
pnlfinalstats.Show();
lblfinalcodepointswithtext.Text = Localization.Parse("{YOU_WON} " + totalreward + " {CODEPOINTS}!");
lblfinallevelreached.Text = Localization.Parse("{CODEPOINTS_FOR_BEATING_LEVEL}: ") + (level - 1).ToString();
- lblfinallevelreward.Text = levelrewards[level - 1].ToString();
+ lblfinallevelreward.Text = (levelrewards[level - 1] * rwdmultiplier).ToString();
lblfinalcomputerreward.Text = beatairewardtotal.ToString();
lblfinalcodepoints.Text = totalreward + Localization.Parse(" {CODEPOINTS_SHORT}");
SaveSystem.TransferCodepointsFrom("pong", totalreward);
@@ -912,7 +793,8 @@ namespace ShiftOS.WinForms.Applications
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
{
beataireward = 10;
- } else
+ }
+ else
{
beataireward = 5;
}
@@ -981,6 +863,10 @@ namespace ShiftOS.WinForms.Applications
var hs = unite.GetPongHighscores();
foreach (var score in hs.Highscores)
{
+ if (this.ParentForm.Visible == false)
+ {
+ Thread.CurrentThread.Abort();
+ }
string username = unite.GetDisplayNameId(score.UserId);
this.Invoke(new Action(() =>
{
@@ -994,8 +880,15 @@ namespace ShiftOS.WinForms.Applications
}
catch
{
- Infobox.Show("Service unavailable.", "The Pong Highscore service is unavailable at this time.");
- this.Invoke(new Action(pnlgamestats.BringToFront));
+ try
+ {
+ if (this.ParentForm.Visible)
+ {
+ Infobox.Show("Service unavailable.", "The Pong Highscore service is unavailable at this time.");
+ this.Invoke(new Action(pnlgamestats.BringToFront));
+ }
+ }
+ catch { } //JUST. ABORT. THE. FUCKING. THREAD.
return;
}
});
@@ -1019,7 +912,7 @@ namespace ShiftOS.WinForms.Applications
{
newgame();
}
-
+
// ERROR: Handles clauses are not supported in C#
private void btnstartgame_Click(object sender, EventArgs e)
{
@@ -1034,9 +927,7 @@ namespace ShiftOS.WinForms.Applications
int i = rand.Next(0, 100);
if (i >= 25 && i <= 50)
- {
tmrstoryline.Stop();
- }
}
@@ -1046,25 +937,13 @@ namespace ShiftOS.WinForms.Applications
tmrstoryline.Stop();
}
- private void Label6_Click(object sender, EventArgs e)
- {
-
- }
-
- private void Label8_Click(object sender, EventArgs e)
+ private void ball_MouseEnter(object sender, EventArgs e)
{
-
- }
-
- private void pgcontents_Paint(object sender, PaintEventArgs e) {
-
- }
-
- private void ball_MouseEnter(object sender, EventArgs e) {
aiShouldIsbeEnabled = false;
}
- private void ball_MouseLeave(object sender, EventArgs e) {
+ private void ball_MouseLeave(object sender, EventArgs e)
+ {
aiShouldIsbeEnabled = true;
}
@@ -1091,12 +970,12 @@ namespace ShiftOS.WinForms.Applications
public bool OnUnload()
{
- if(IsMultiplayerSession == true)
+ if (IsMultiplayerSession)
{
- if(!string.IsNullOrWhiteSpace(OpponentGUID))
+ if (!string.IsNullOrWhiteSpace(OpponentGUID))
ServerManager.Forward(OpponentGUID, "pong_mp_left", null);
+ LeaveMatchmake();
}
- LeaveMatchmake();
ServerManager.MessageReceived -= this.ServerMessageReceivedHandler;
return true;
@@ -1123,10 +1002,10 @@ namespace ShiftOS.WinForms.Applications
private void lvotherplayers_DoubleClick(object sender, EventArgs e)
{
- if(lvotherplayers.SelectedItems.Count > 0)
+ if (lvotherplayers.SelectedItems.Count > 0)
{
SendLeaderGUID(lvotherplayers.SelectedItems[0].Text);
}
}
}
-}
+} \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/Pong.resx b/ShiftOS.WinForms/Applications/Pong.resx
index 3b5619d..cc96099 100644
--- a/ShiftOS.WinForms/Applications/Pong.resx
+++ b/ShiftOS.WinForms/Applications/Pong.resx
@@ -129,4 +129,7 @@
<metadata name="tmrstoryline.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
+ <metadata name="soundtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>472, 17</value>
+ </metadata>
</root> \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs
index b5e9aa4..0e9f74a 100644
--- a/ShiftOS.WinForms/Applications/ShiftLetters.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs
@@ -38,7 +38,7 @@ namespace ShiftOS.WinForms.Applications
{
[MultiplayerOnly]
[Launcher("ShiftLetters", false, null, "Games")]
- [RequiresUpgrade("shiftletters")]
+ [AppscapeEntry("ShiftLetters", "Let's see how much you know about ShiftOS by playing this tiny little Hangman game! Shiftorium Upgrades exist to allow you to buy different word sets!", 300, 150, null, "Games")]
[WinOpen("shiftletters")]
[DefaultIcon("iconShiftLetters")]
public partial class ShiftLetters : UserControl, IShiftOSWindow
@@ -217,7 +217,7 @@ namespace ShiftOS.WinForms.Applications
if (!lblword.Text.Contains("_"))
{
int oldlives = lives;
- int cp = (word.Length * oldlives) * 2; //drunky michael made this 5x...
+ ulong cp = (ulong)(word.Length * oldlives) * 2; //drunky michael made this 5x...
SaveSystem.TransferCodepointsFrom("shiftletters", cp);
StartGame();
}
diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs
index 5ab8154..3f940c7 100644
--- a/ShiftOS.WinForms/Applications/ShiftLotto.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs
@@ -88,7 +88,7 @@ namespace ShiftOS.WinForms.Applications
}
else
{
- if (SaveSystem.CurrentSave.Codepoints - (codePoints * difficulty) <= 0)
+ if (SaveSystem.CurrentSave.Codepoints - (ulong)(codePoints * difficulty) <= 0)
{
Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to gamble this amount!");
}
@@ -102,7 +102,7 @@ namespace ShiftOS.WinForms.Applications
int winningNumber = rnd.Next(0, difficulty);
// Multiply CodePoints * Difficulty
- int jackpot = codePoints * difficulty;
+ ulong jackpot = (ulong)(codePoints * difficulty);
// Test the random ints
if (guessedNumber == winningNumber)
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
index 72e9062..772ec26 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -35,7 +35,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications {
[Launcher("ShiftSweeper", true, "al_shiftsweeper", "Games")]
- [RequiresUpgrade("shiftsweeper")]
+ [AppscapeEntry("ShiftSweeper", "A simple Minesweeper game built for ShiftOS! Careful, it's a hard one.", 1600, 800, "shiftletters", "Games")]
[MultiplayerOnly]
[WinOpen("shiftsweeper")]
[DefaultIcon("iconShiftSweeper")]
@@ -300,12 +300,12 @@ namespace ShiftOS.WinForms.Applications {
}
public void winGame() {
- int cp = 0;
- int origminecount = gameBombCount * 10;
+ ulong cp = 0;
+ ulong origminecount = (ulong)(gameBombCount * 10);
if (minetimer < 31) cp = (origminecount * 3);
- else if (minetimer < 61) cp = (Int32)(origminecount * 2.5);
+ else if (minetimer < 61) cp = (ulong)(origminecount * 2.5);
else if (minetimer < 91) cp = (origminecount * 2);
- else if (minetimer < 121) cp = (Int32)(origminecount * 1.5);
+ else if (minetimer < 121) cp = (ulong)(origminecount * 1.5);
else if (minetimer > 120) cp = (origminecount * 1);
SaveSystem.TransferCodepointsFrom("shiftsweeper", cp);
panelGameStatus.Image = Properties.Resources.SweeperWinFace;
diff --git a/ShiftOS.WinForms/Applications/Shifter.cs b/ShiftOS.WinForms/Applications/Shifter.cs
index 05ba638..3b3a4f1 100644
--- a/ShiftOS.WinForms/Applications/Shifter.cs
+++ b/ShiftOS.WinForms/Applications/Shifter.cs
@@ -31,6 +31,8 @@ using System.Reflection;
using System.Windows.Forms;
using ShiftOS.Engine;
using ShiftOS.WinForms.Tools;
+using System.Linq;
+using System.Threading;
namespace ShiftOS.WinForms.Applications
{
@@ -139,10 +141,7 @@ namespace ShiftOS.WinForms.Applications
pnldesktoppreview.BackColor = Color.FromArgb(LoadedSkin.DesktopColor.R, LoadedSkin.DesktopColor.G, LoadedSkin.DesktopColor.B);
//Not doing this will cause an ArgumentException.
- DitheringEngine.DitherImage(SkinEngine.GetImage("desktopbackground"), new Action<Image>((img) =>
- {
- pnldesktoppreview.BackgroundImage = img;
- }));
+ pnldesktoppreview.BackgroundImage = SkinEngine.GetImage("desktopbackground");
pnldesktoppreview.BackgroundImageLayout = GetImageLayout("desktopbackground");
desktoppanel.BackColor = LoadedSkin.DesktopPanelColor;
@@ -392,7 +391,7 @@ namespace ShiftOS.WinForms.Applications
}
- public int CodepointValue = 0;
+ public uint CodepointValue = 0;
public List<ShifterSetting> settings = new List<ShifterSetting>();
public Skin LoadedSkin = null;
@@ -543,403 +542,425 @@ namespace ShiftOS.WinForms.Applications
{
flbody.Controls.Clear();
- List<ShifterSetting> cats = new List<ShifterSetting>();
+ IEnumerable<ShifterSetting> cats = this.settings.Where(x => x.SubCategory == subcat && x.Category == cat && x.Field.FlagFullfilled(LoadedSkin)).OrderBy(x=>x.Name);
- foreach (var c in this.settings)
+ new Thread(() =>
{
- if (c.SubCategory == subcat && c.Category == cat)
+ foreach (var c in cats)
{
- if (c.Field.FlagFullfilled(LoadedSkin))
+ Label lbl = null;
+ int labelHeight = 0;
+ Desktop.InvokeOnWorkerThread(() =>
{
- if (!cats.Contains(c))
- {
- cats.Add(c);
- }
- }
- }
- }
-
- foreach(var c in cats)
- {
- var lbl = new Label();
- int labelHeight = 0;
- lbl.AutoSize = true;
- lbl.Text = c.Name + ":";
- flbody.Controls.Add(lbl);
- lbl.TextAlign = ContentAlignment.MiddleLeft;
- lbl.Show();
- //Cool - label's in.
- if(c.Field.FieldType == typeof(Point))
- {
- var width = new TextBox();
- var height = new TextBox();
- labelHeight = width.Height; //irony?
- width.Width = 30;
- height.Width = width.Width;
- width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
- height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
- flbody.SetFlowBreak(height, true);
- ControlManager.SetupControl(width);
- ControlManager.SetupControl(height);
-
- flbody.Controls.Add(width);
- width.Show();
- flbody.Controls.Add(height);
- height.Show();
-
- EventHandler tc = (o, a) =>
+ lbl = new Label();
+ lbl.AutoSize = true;
+ lbl.Text = c.Name + ":";
+ flbody.Controls.Add(lbl);
+ lbl.TextAlign = ContentAlignment.MiddleLeft;
+ lbl.Show();
+ });
+ //Cool - label's in.
+ if (c.Field.FieldType == typeof(Point))
{
- try
+ TextBox width = null;
+ TextBox height = null;
+ Desktop.InvokeOnWorkerThread(() =>
{
- int x = Convert.ToInt32(width.Text);
- int y = Convert.ToInt32(height.Text);
+ width = new TextBox();
+ height = new TextBox();
+ labelHeight = width.Height; //irony?
+ width.Width = 30;
+ height.Width = width.Width;
+ width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
+ height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
+ flbody.SetFlowBreak(height, true);
+ ControlManager.SetupControl(width);
+ ControlManager.SetupControl(height);
- int oldx = ((Point)c.Field.GetValue(this.LoadedSkin)).X;
- int oldy = ((Point)c.Field.GetValue(this.LoadedSkin)).Y;
+ flbody.Controls.Add(width);
+ width.Show();
+ flbody.Controls.Add(height);
+ height.Show();
- if(x != oldx || y != oldy)
+ EventHandler tc = (o, a) =>
{
- c.Field.SetValue(LoadedSkin, new Point(x, y));
- CodepointValue += 200;
- }
- }
- catch
- {
- width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
- height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
- }
- InvokeSetup(cat);
- };
+ try
+ {
+ int x = Convert.ToInt32(width.Text);
+ int y = Convert.ToInt32(height.Text);
- width.TextChanged += tc;
- height.TextChanged += tc;
+ int oldx = ((Point)c.Field.GetValue(this.LoadedSkin)).X;
+ int oldy = ((Point)c.Field.GetValue(this.LoadedSkin)).Y;
- }
- else if(c.Field.FieldType == typeof(string))
- {
- var str = new TextBox();
- str.Width = 120;
- ControlManager.SetupControl(str);
- labelHeight = str.Height;
- str.Text = c.Field.GetValue(LoadedSkin).ToString();
- flbody.SetFlowBreak(str, true);
- str.TextChanged += (o, a) =>
- {
- c.Field.SetValue(LoadedSkin, str.Text); CodepointValue += 100;
+ if (x != oldx || y != oldy)
+ {
+ c.Field.SetValue(LoadedSkin, new Point(x, y));
+ CodepointValue += 200;
+ }
+ }
+ catch
+ {
+ width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
+ height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
+ }
+ InvokeSetup(cat);
+ };
- InvokeSetup(cat);
- };
- flbody.Controls.Add(str);
- str.Show();
- }
- else if(c.Field.FieldType == typeof(byte[]))
- {
- //We'll assume that this is an image file.
- var color = new Button();
- color.Width = 40;
- labelHeight = color.Height;
- //just so it's flat like the system.
- ControlManager.SetupControl(color);
- flbody.SetFlowBreak(color, true);
-
- color.BackgroundImage = SkinEngine.ImageFromBinary((byte[])c.Field.GetValue(this.LoadedSkin));
- color.Click += (o, a) =>
+ width.TextChanged += tc;
+ height.TextChanged += tc;
+ });
+ }
+ else if (c.Field.FieldType == typeof(string))
{
- AppearanceManager.SetupDialog(new GraphicPicker(color.BackgroundImage, c.Name, GetLayout(c.Field.GetImageName()), new Action<byte[], Image, ImageLayout>((col, gdiImg, layout) =>
+ Desktop.InvokeOnWorkerThread(() =>
{
- c.Field.SetValue(LoadedSkin, col);
- color.BackgroundImage = SkinEngine.ImageFromBinary(col);
- color.BackgroundImageLayout = layout;
- LoadedSkin.SkinImageLayouts[c.Field.GetImageName()] = layout;
- CodepointValue += 700;
- InvokeSetup(cat);
-
- })));
- };
- flbody.Controls.Add(color);
- color.Show();
- }
- else if (c.Field.FieldType == typeof(Size))
- {
- var width = new TextBox();
- var height = new TextBox();
- width.Width = 30;
- height.Width = width.Width;
- labelHeight = width.Height;
- flbody.SetFlowBreak(height, true);
-
- width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
- height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
- ControlManager.SetupControl(width);
- ControlManager.SetupControl(height);
-
- flbody.Controls.Add(width);
- width.Show();
- flbody.Controls.Add(height);
- height.Show();
-
- EventHandler tc = (o, a) =>
+ var str = new TextBox();
+ str.Width = 120;
+ ControlManager.SetupControl(str);
+ labelHeight = str.Height;
+ str.Text = c.Field.GetValue(LoadedSkin).ToString();
+ flbody.SetFlowBreak(str, true);
+ str.TextChanged += (o, a) =>
+ {
+ c.Field.SetValue(LoadedSkin, str.Text); CodepointValue += 100;
+
+ InvokeSetup(cat);
+ };
+ flbody.Controls.Add(str);
+ str.Show();
+ });
+ }
+ else if (c.Field.FieldType == typeof(byte[]))
{
- try
+ Desktop.InvokeOnWorkerThread(() =>
{
- int x = Convert.ToInt32(width.Text);
- int y = Convert.ToInt32(height.Text);
-
- int oldx = ((Size)c.Field.GetValue(this.LoadedSkin)).Width;
- int oldy = ((Size)c.Field.GetValue(this.LoadedSkin)).Height;
-
- if (x != oldx || y != oldy)
+ //We'll assume that this is an image file.
+ var color = new Button();
+ color.Width = 40;
+ labelHeight = color.Height;
+ //just so it's flat like the system.
+ ControlManager.SetupControl(color);
+ flbody.SetFlowBreak(color, true);
+
+ color.BackgroundImage = SkinEngine.ImageFromBinary((byte[])c.Field.GetValue(this.LoadedSkin));
+ color.Click += (o, a) =>
{
- c.Field.SetValue(LoadedSkin, new Size(x, y));
- CodepointValue += 200;
- }
- }
- catch
+ AppearanceManager.SetupDialog(new GraphicPicker(color.BackgroundImage, c.Name, GetLayout(c.Field.GetImageName()), new Action<byte[], Image, ImageLayout>((col, gdiImg, layout) =>
+ {
+ c.Field.SetValue(LoadedSkin, col);
+ color.BackgroundImage = SkinEngine.ImageFromBinary(col);
+ color.BackgroundImageLayout = layout;
+ LoadedSkin.SkinImageLayouts[c.Field.GetImageName()] = layout;
+ CodepointValue += 700;
+ InvokeSetup(cat);
+
+ })));
+ };
+ flbody.Controls.Add(color);
+ color.Show();
+ });
+ }
+ else if (c.Field.FieldType == typeof(Size))
+ {
+ Desktop.InvokeOnWorkerThread(() =>
{
+ var width = new TextBox();
+ var height = new TextBox();
+ width.Width = 30;
+ height.Width = width.Width;
+ labelHeight = width.Height;
+ flbody.SetFlowBreak(height, true);
+
width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
- }
- InvokeSetup(cat);
+ ControlManager.SetupControl(width);
+ ControlManager.SetupControl(height);
- };
+ flbody.Controls.Add(width);
+ width.Show();
+ flbody.Controls.Add(height);
+ height.Show();
- width.TextChanged += tc;
- height.TextChanged += tc;
+ EventHandler tc = (o, a) =>
+ {
+ try
+ {
+ int x = Convert.ToInt32(width.Text);
+ int y = Convert.ToInt32(height.Text);
- }
- else if(c.Field.FieldType == typeof(bool))
- {
- var check = new CheckBox();
- check.Checked = ((bool)c.Field.GetValue(LoadedSkin));
- labelHeight = check.Height;
- check.CheckedChanged += (o, a) =>
- {
- c.Field.SetValue(LoadedSkin, check.Checked);
- CodepointValue += 50;
- InvokeSetup(cat);
+ int oldx = ((Size)c.Field.GetValue(this.LoadedSkin)).Width;
+ int oldy = ((Size)c.Field.GetValue(this.LoadedSkin)).Height;
- };
- flbody.SetFlowBreak(check, true);
+ if (x != oldx || y != oldy)
+ {
+ c.Field.SetValue(LoadedSkin, new Size(x, y));
+ CodepointValue += 200;
+ }
+ }
+ catch
+ {
+ width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
+ height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
+ }
+ InvokeSetup(cat);
- flbody.Controls.Add(check);
- check.Show();
- }
- else if(c.Field.FieldType == typeof(Font))
- {
- var name = new ComboBox();
- var size = new TextBox();
- var style = new ComboBox();
-
- name.Width = 120;
- labelHeight = name.Height;
- size.Width = 40;
- style.Width = 80;
- flbody.SetFlowBreak(style, true);
-
- ControlManager.SetupControl(name);
- ControlManager.SetupControl(size);
- ControlManager.SetupControl(style);
-
- //populate the font name box
- foreach(var font in FontFamily.Families)
- {
- name.Items.Add(font.Name);
+ };
+
+ width.TextChanged += tc;
+ height.TextChanged += tc;
+ });
}
- name.Text = ((Font)c.Field.GetValue(LoadedSkin)).Name;
+ else if (c.Field.FieldType == typeof(bool))
+ {
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ var check = new CheckBox();
+ check.Checked = ((bool)c.Field.GetValue(LoadedSkin));
+ labelHeight = check.Height;
+ check.CheckedChanged += (o, a) =>
+ {
+ c.Field.SetValue(LoadedSkin, check.Checked);
+ CodepointValue += 50;
+ InvokeSetup(cat);
- size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
+ };
+ flbody.SetFlowBreak(check, true);
- //populate the style box
- foreach(var s in (FontStyle[])Enum.GetValues(typeof(FontStyle)))
- {
- style.Items.Add(s.ToString());
+ flbody.Controls.Add(check);
+ check.Show();
+ });
}
- style.Text = ((Font)c.Field.GetValue(LoadedSkin)).Style.ToString();
-
- name.SelectedIndexChanged += (o, a) =>
+ else if (c.Field.FieldType == typeof(Font))
{
- var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ var name = new ComboBox();
+ var size = new TextBox();
+ var style = new ComboBox();
+
+ name.Width = 120;
+ labelHeight = name.Height;
+ size.Width = 40;
+ style.Width = 80;
+ flbody.SetFlowBreak(style, true);
+
+ ControlManager.SetupControl(name);
+ ControlManager.SetupControl(size);
+ ControlManager.SetupControl(style);
+
+ //populate the font name box
+ foreach (var font in FontFamily.Families)
+ {
+ name.Items.Add(font.Name);
+ }
+ name.Text = ((Font)c.Field.GetValue(LoadedSkin)).Name;
- var f = en[style.SelectedIndex];
+ size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
- c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
- CodepointValue += 100;
- InvokeSetup(cat);
+ //populate the style box
+ foreach (var s in (FontStyle[])Enum.GetValues(typeof(FontStyle)))
+ {
+ style.Items.Add(s.ToString());
+ }
+ style.Text = ((Font)c.Field.GetValue(LoadedSkin)).Style.ToString();
- };
+ name.SelectedIndexChanged += (o, a) =>
+ {
+ var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
- style.SelectedIndexChanged += (o, a) =>
- {
- var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
+ var f = en[style.SelectedIndex];
- var f = en[style.SelectedIndex];
+ c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
+ CodepointValue += 100;
+ InvokeSetup(cat);
- c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
- CodepointValue += 50;
- InvokeSetup(cat);
+ };
- };
+ style.SelectedIndexChanged += (o, a) =>
+ {
+ var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
- size.TextChanged += (o, a) =>
- {
- try
- {
- var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
+ var f = en[style.SelectedIndex];
- var f = en[style.SelectedIndex];
+ c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
+ CodepointValue += 50;
+ InvokeSetup(cat);
- c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
- }
- catch
- {
- size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
- }
- CodepointValue += 50;
- InvokeSetup(cat);
+ };
+
+ size.TextChanged += (o, a) =>
+ {
+ try
+ {
+ var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
+
+ var f = en[style.SelectedIndex];
- };
+ c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
+ }
+ catch
+ {
+ size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
+ }
+ CodepointValue += 50;
+ InvokeSetup(cat);
- flbody.Controls.Add(name);
- flbody.Controls.Add(size);
- flbody.Controls.Add(style);
+ };
- name.Show();
- size.Show();
- style.Show();
+ flbody.Controls.Add(name);
+ flbody.Controls.Add(size);
+ flbody.Controls.Add(style);
- }
- else if(c.Field.FieldType == typeof(Color))
- {
- var color = new Button();
- color.Width = 40;
- labelHeight = color.Height;
- //just so it's flat like the system.
- ControlManager.SetupControl(color);
-
- color.BackColor = ((Color)c.Field.GetValue(LoadedSkin));
- color.BackColorChanged += (o, a) =>
- {
- c.Field.SetValue(LoadedSkin, color.BackColor);
- };
- color.Click += (o, a) =>
+ name.Show();
+ size.Show();
+ style.Show();
+ });
+ }
+ else if (c.Field.FieldType == typeof(Color))
{
- AppearanceManager.SetupDialog(new ColorPicker(color.BackColor, c.Name, new Action<Color>((col) =>
+ Desktop.InvokeOnWorkerThread(() =>
{
- color.BackColor = col;
- CodepointValue += 300;
- InvokeSetup(cat);
-
- })));
- };
- flbody.SetFlowBreak(color, true);
- color.Tag = "keepbg";
- flbody.Controls.Add(color);
- color.Show();
- }
- else if(c.Field.FieldType.IsEnum == true)
- {
- var cBox = new ComboBox();
- cBox.Width = 150;
- ControlManager.SetupControl(cBox);
-
- foreach(var itm in Enum.GetNames(c.Field.FieldType))
- {
- cBox.Items.Add(itm);
+ var color = new Button();
+ color.Width = 40;
+ labelHeight = color.Height;
+ //just so it's flat like the system.
+ ControlManager.SetupControl(color);
+
+ color.BackColor = ((Color)c.Field.GetValue(LoadedSkin));
+ color.Click += (o, a) =>
+ {
+ AppearanceManager.SetupDialog(new ColorPicker((Color)c.Field.GetValue(LoadedSkin), c.Name, new Action<Color>((col) =>
+ {
+ color.BackColor = col;
+ c.Field.SetValue(LoadedSkin, col);
+ CodepointValue += 300;
+ InvokeSetup(cat);
+
+ })));
+ };
+ flbody.SetFlowBreak(color, true);
+ color.Tag = "keepbg";
+ flbody.Controls.Add(color);
+ color.Show();
+ });
}
-
- cBox.Text = c.Field.GetValue(LoadedSkin).ToString();
-
- cBox.SelectedIndexChanged += (o, a) =>
+ else if (c.Field.FieldType.IsEnum == true)
{
- c.Field.SetValue(LoadedSkin, Enum.Parse(c.Field.FieldType, cBox.Text));
- InvokeSetup(cat);
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ var cBox = new ComboBox();
+ cBox.Width = 150;
+ ControlManager.SetupControl(cBox);
- };
+ foreach (var itm in Enum.GetNames(c.Field.FieldType))
+ {
+ cBox.Items.Add(itm);
+ }
- labelHeight = cBox.Height;
+ cBox.Text = c.Field.GetValue(LoadedSkin).ToString();
- flbody.Controls.Add(cBox);
- cBox.Show();
- flbody.SetFlowBreak(cBox, true);
- }
- else if(c.Field.FieldType == typeof(int))
- {
- if (c.Field.HasShifterEnumMask())
- {
- var name = new ComboBox();
- name.Width = 120;
- ControlManager.SetupControl(name);
- string[] items = c.Field.GetShifterEnumMask();
- foreach(var item in items)
- {
- name.Items.Add(item);
- }
- name.SelectedIndex = (int)c.Field.GetValue(LoadedSkin);
- name.SelectedIndexChanged += (o, a) =>
- {
- c.Field.SetValue(LoadedSkin, name.SelectedIndex);
- CodepointValue += 75;
- InvokeSetup(cat);
+ cBox.SelectedIndexChanged += (o, a) =>
+ {
+ c.Field.SetValue(LoadedSkin, Enum.Parse(c.Field.FieldType, cBox.Text));
+ InvokeSetup(cat);
+
+ };
- };
- labelHeight = name.Height;
- flbody.Controls.Add(name);
- name.Show();
- flbody.SetFlowBreak(name, true);
+ labelHeight = cBox.Height;
+ flbody.Controls.Add(cBox);
+ cBox.Show();
+ flbody.SetFlowBreak(cBox, true);
+ });
}
- else
+ else if (c.Field.FieldType == typeof(int))
{
- var width = new TextBox();
- width.Width = 30;
- width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
- ControlManager.SetupControl(width);
- labelHeight = width.Height;
- flbody.Controls.Add(width);
- width.Show();
-
- EventHandler tc = (o, a) =>
+ Desktop.InvokeOnWorkerThread(() =>
{
- try
+ if (c.Field.HasShifterEnumMask())
{
- int x = Convert.ToInt32(width.Text);
-
- int oldx = ((int)c.Field.GetValue(this.LoadedSkin));
-
- if (x != oldx)
+ var name = new ComboBox();
+ name.Width = 120;
+ ControlManager.SetupControl(name);
+ string[] items = c.Field.GetShifterEnumMask();
+ foreach (var item in items)
{
- c.Field.SetValue(LoadedSkin, x);
- CodepointValue += 75;
+ name.Items.Add(item);
}
+ name.SelectedIndex = (int)c.Field.GetValue(LoadedSkin);
+ name.SelectedIndexChanged += (o, a) =>
+ {
+ c.Field.SetValue(LoadedSkin, name.SelectedIndex);
+ CodepointValue += 75;
+ InvokeSetup(cat);
+
+ };
+ labelHeight = name.Height;
+ flbody.Controls.Add(name);
+ name.Show();
+ flbody.SetFlowBreak(name, true);
+
}
- catch
+ else
{
+ var width = new TextBox();
+ width.Width = 30;
width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
- }
- InvokeSetup(cat);
+ ControlManager.SetupControl(width);
+ labelHeight = width.Height;
+ flbody.Controls.Add(width);
+ width.Show();
+
+ EventHandler tc = (o, a) =>
+ {
+ try
+ {
+ int x = Convert.ToInt32(width.Text);
+
+ int oldx = ((int)c.Field.GetValue(this.LoadedSkin));
- };
+ if (x != oldx)
+ {
+ c.Field.SetValue(LoadedSkin, x);
+ CodepointValue += 75;
+ }
+ }
+ catch
+ {
+ width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
+ }
+ InvokeSetup(cat);
- width.TextChanged += tc;
- flbody.SetFlowBreak(width, true);
+ };
+ width.TextChanged += tc;
+ flbody.SetFlowBreak(width, true);
+
+ }
+ });
}
- }
- lbl.AutoSize = false;
- lbl.Width = (int)this.CreateGraphics().MeasureString(lbl.Text, SkinEngine.LoadedSkin.MainFont).Width + 15;
- lbl.Height = labelHeight;
- lbl.TextAlign = ContentAlignment.MiddleLeft;
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ lbl.AutoSize = false;
+ lbl.Width = (int)this.CreateGraphics().MeasureString(lbl.Text, SkinEngine.LoadedSkin.MainFont).Width + 15;
+ lbl.Height = labelHeight;
+ lbl.TextAlign = ContentAlignment.MiddleLeft;
+ });
- if (!string.IsNullOrWhiteSpace(c.Description))
- {
- var desc = new Label();
- flbody.SetFlowBreak(desc, true);
- desc.Text = c.Description;
- desc.AutoSize = true;
- flbody.Controls.Add(desc);
- desc.Show();
+ if (!string.IsNullOrWhiteSpace(c.Description))
+ {
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ var desc = new Label();
+ flbody.SetFlowBreak(desc, true);
+ desc.Text = c.Description;
+ desc.AutoSize = true;
+ flbody.Controls.Add(desc);
+ desc.Show();
+ });
+ }
}
- }
+ }).Start();
}
public ImageLayout GetLayout(string name)
diff --git a/ShiftOS.WinForms/Applications/Shiftnet.cs b/ShiftOS.WinForms/Applications/Shiftnet.cs
index 7f5d3c1..6ccdb19 100644
--- a/ShiftOS.WinForms/Applications/Shiftnet.cs
+++ b/ShiftOS.WinForms/Applications/Shiftnet.cs
@@ -80,6 +80,7 @@ namespace ShiftOS.WinForms.Applications
txturl.Location = new Point(btnforward.Left + btnforward.Width + 2, 2);
txturl.Width = flcontrols.Width - btnback.Width - 2 - btnforward.Width - 2 - (btngo.Width*2) - 2;
btngo.Location = new Point(flcontrols.Width - btngo.Width - 2, 2);
+ flcontrols.BackColor = SkinEngine.LoadedSkin.TitleBackgroundColor;
}
public bool OnUnload()
@@ -147,6 +148,7 @@ namespace ShiftOS.WinForms.Applications
public void NavigateToUrl(string url)
{
+
txturl.Text = url;
foreach(var exe in Directory.GetFiles(Environment.CurrentDirectory))
{
@@ -171,7 +173,7 @@ namespace ShiftOS.WinForms.Applications
var obj = (IShiftnetSite)Activator.CreateInstance(type, null);
obj.GoToUrl += (u) =>
{
- History.Push(u);
+ History.Push(CurrentUrl);
NavigateToUrl(u);
};
obj.GoBack += () =>
@@ -188,6 +190,7 @@ namespace ShiftOS.WinForms.Applications
obj.OnUpgrade();
obj.OnSkinLoad();
obj.Setup();
+ AppearanceManager.SetWindowTitle(this, attribute.Name + " - Shiftnet");
return;
}
}
diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs
index 32d508b..e4e493e 100644
--- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs
+++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.Designer.cs
@@ -61,16 +61,16 @@ namespace ShiftOS.WinForms.Applications
this.btnbuy = new System.Windows.Forms.Button();
this.lbupgradetitle = new System.Windows.Forms.Label();
this.pnllist = new System.Windows.Forms.Panel();
+ this.lbnoupgrades = new System.Windows.Forms.Label();
+ this.panel3 = new System.Windows.Forms.Panel();
+ this.lblcategorytext = new System.Windows.Forms.Label();
+ this.btncat_forward = new System.Windows.Forms.Button();
+ this.btncat_back = new System.Windows.Forms.Button();
this.lbcodepoints = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.pgupgradeprogress = new ShiftOS.WinForms.Controls.ShiftedProgressBar();
this.lbupgrades = new System.Windows.Forms.ListBox();
this.label3 = new System.Windows.Forms.Label();
- this.panel3 = new System.Windows.Forms.Panel();
- this.btncat_back = new System.Windows.Forms.Button();
- this.btncat_forward = new System.Windows.Forms.Button();
- this.lblcategorytext = new System.Windows.Forms.Label();
- this.lbnoupgrades = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.pnlupgradeactions.SuspendLayout();
@@ -159,6 +159,63 @@ namespace ShiftOS.WinForms.Applications
this.pnllist.Size = new System.Drawing.Size(406, 427);
this.pnllist.TabIndex = 0;
//
+ // lbnoupgrades
+ //
+ this.lbnoupgrades.AutoSize = true;
+ this.lbnoupgrades.Location = new System.Drawing.Point(69, 183);
+ this.lbnoupgrades.Name = "lbnoupgrades";
+ this.lbnoupgrades.Size = new System.Drawing.Size(71, 13);
+ this.lbnoupgrades.TabIndex = 6;
+ this.lbnoupgrades.Tag = "header2";
+ this.lbnoupgrades.Text = "No upgrades!";
+ this.lbnoupgrades.Visible = false;
+ //
+ // panel3
+ //
+ this.panel3.Controls.Add(this.lblcategorytext);
+ this.panel3.Controls.Add(this.btncat_forward);
+ this.panel3.Controls.Add(this.btncat_back);
+ this.panel3.Location = new System.Drawing.Point(6, 76);
+ this.panel3.Name = "panel3";
+ this.panel3.Size = new System.Drawing.Size(394, 23);
+ this.panel3.TabIndex = 5;
+ //
+ // lblcategorytext
+ //
+ this.lblcategorytext.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.lblcategorytext.Location = new System.Drawing.Point(29, 0);
+ this.lblcategorytext.Name = "lblcategorytext";
+ this.lblcategorytext.Size = new System.Drawing.Size(336, 23);
+ this.lblcategorytext.TabIndex = 2;
+ this.lblcategorytext.Text = "No Upgrades";
+ this.lblcategorytext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // btncat_forward
+ //
+ this.btncat_forward.AutoSize = true;
+ this.btncat_forward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btncat_forward.Dock = System.Windows.Forms.DockStyle.Right;
+ this.btncat_forward.Location = new System.Drawing.Point(365, 0);
+ this.btncat_forward.Name = "btncat_forward";
+ this.btncat_forward.Size = new System.Drawing.Size(29, 23);
+ this.btncat_forward.TabIndex = 1;
+ this.btncat_forward.Text = "-->";
+ this.btncat_forward.UseVisualStyleBackColor = true;
+ this.btncat_forward.Click += new System.EventHandler(this.btncat_forward_Click);
+ //
+ // btncat_back
+ //
+ this.btncat_back.AutoSize = true;
+ this.btncat_back.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btncat_back.Dock = System.Windows.Forms.DockStyle.Left;
+ this.btncat_back.Location = new System.Drawing.Point(0, 0);
+ this.btncat_back.Name = "btncat_back";
+ this.btncat_back.Size = new System.Drawing.Size(29, 23);
+ this.btncat_back.TabIndex = 0;
+ this.btncat_back.Text = "<--";
+ this.btncat_back.UseVisualStyleBackColor = true;
+ this.btncat_back.Click += new System.EventHandler(this.btncat_back_Click);
+ //
// lbcodepoints
//
this.lbcodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@@ -168,7 +225,6 @@ namespace ShiftOS.WinForms.Applications
this.lbcodepoints.Size = new System.Drawing.Size(135, 13);
this.lbcodepoints.TabIndex = 3;
this.lbcodepoints.Text = "You have: %cp Codepoints";
- this.lbcodepoints.Click += new System.EventHandler(this.lbcodepoints_Click);
//
// label1
//
@@ -184,12 +240,10 @@ namespace ShiftOS.WinForms.Applications
//
this.pgupgradeprogress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.pgupgradeprogress.BlockSize = 5;
this.pgupgradeprogress.Location = new System.Drawing.Point(146, 390);
this.pgupgradeprogress.Maximum = 100;
this.pgupgradeprogress.Name = "pgupgradeprogress";
this.pgupgradeprogress.Size = new System.Drawing.Size(254, 23);
- this.pgupgradeprogress.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.pgupgradeprogress.TabIndex = 1;
this.pgupgradeprogress.Value = 25;
//
@@ -215,63 +269,6 @@ namespace ShiftOS.WinForms.Applications
this.label3.Size = new System.Drawing.Size(137, 13);
this.label3.TabIndex = 2;
//
- // panel3
- //
- this.panel3.Controls.Add(this.lblcategorytext);
- this.panel3.Controls.Add(this.btncat_forward);
- this.panel3.Controls.Add(this.btncat_back);
- this.panel3.Location = new System.Drawing.Point(6, 76);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(394, 23);
- this.panel3.TabIndex = 5;
- //
- // btncat_back
- //
- this.btncat_back.AutoSize = true;
- this.btncat_back.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btncat_back.Dock = System.Windows.Forms.DockStyle.Left;
- this.btncat_back.Location = new System.Drawing.Point(0, 0);
- this.btncat_back.Name = "btncat_back";
- this.btncat_back.Size = new System.Drawing.Size(29, 23);
- this.btncat_back.TabIndex = 0;
- this.btncat_back.Text = "<--";
- this.btncat_back.UseVisualStyleBackColor = true;
- this.btncat_back.Click += new System.EventHandler(this.btncat_back_Click);
- //
- // btncat_forward
- //
- this.btncat_forward.AutoSize = true;
- this.btncat_forward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btncat_forward.Dock = System.Windows.Forms.DockStyle.Right;
- this.btncat_forward.Location = new System.Drawing.Point(365, 0);
- this.btncat_forward.Name = "btncat_forward";
- this.btncat_forward.Size = new System.Drawing.Size(29, 23);
- this.btncat_forward.TabIndex = 1;
- this.btncat_forward.Text = "-->";
- this.btncat_forward.UseVisualStyleBackColor = true;
- this.btncat_forward.Click += new System.EventHandler(this.btncat_forward_Click);
- //
- // lblcategorytext
- //
- this.lblcategorytext.Dock = System.Windows.Forms.DockStyle.Fill;
- this.lblcategorytext.Location = new System.Drawing.Point(29, 0);
- this.lblcategorytext.Name = "lblcategorytext";
- this.lblcategorytext.Size = new System.Drawing.Size(336, 23);
- this.lblcategorytext.TabIndex = 2;
- this.lblcategorytext.Text = "label2";
- this.lblcategorytext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // lbnoupgrades
- //
- this.lbnoupgrades.AutoSize = true;
- this.lbnoupgrades.Location = new System.Drawing.Point(69, 183);
- this.lbnoupgrades.Name = "lbnoupgrades";
- this.lbnoupgrades.Size = new System.Drawing.Size(71, 13);
- this.lbnoupgrades.TabIndex = 6;
- this.lbnoupgrades.Tag = "header2";
- this.lbnoupgrades.Text = "No upgrades!";
- this.lbnoupgrades.Visible = false;
- //
// ShiftoriumFrontend
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -281,7 +278,6 @@ namespace ShiftOS.WinForms.Applications
this.ForeColor = System.Drawing.Color.LightGreen;
this.Name = "ShiftoriumFrontend";
this.Size = new System.Drawing.Size(782, 427);
- this.Load += new System.EventHandler(this.Shiftorium_Load);
this.panel1.ResumeLayout(false);
this.panel2.ResumeLayout(false);
this.pnlupgradeactions.ResumeLayout(false);
diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
index 66b0448..0ae0803 100644
--- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
+++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
@@ -30,6 +30,7 @@ using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using ShiftOS.Engine;
@@ -46,19 +47,22 @@ namespace ShiftOS.WinForms.Applications
public partial class ShiftoriumFrontend : UserControl, IShiftOSWindow
{
public int CategoryId = 0;
- public static System.Timers.Timer timer100;
+ private string[] cats = backend.GetCategories();
+ private ShiftoriumUpgrade[] avail;
+ public void updatecounter()
+ {
+ Desktop.InvokeOnWorkerThread(() => { lbcodepoints.Text = $"You have {SaveSystem.CurrentSave.Codepoints} Codepoints."; });
+ }
+
public ShiftoriumFrontend()
{
- cp_update = new System.Windows.Forms.Timer();
- cp_update.Tick += (o, a) =>
- {
- lbcodepoints.Text = $"You have {SaveSystem.CurrentSave.Codepoints} Codepoints.";
- };
- cp_update.Interval = 100;
InitializeComponent();
- PopulateShiftorium();
+ SaveSystem.CurrentSave.addSetCpCallback(updatecounter);
+ updatecounter();
+ Populate();
+ SetList();
lbupgrades.SelectedIndexChanged += (o, a) =>
{
try
@@ -81,55 +85,57 @@ namespace ShiftOS.WinForms.Applications
public void SelectUpgrade(string name)
{
btnbuy.Show();
- var upg = upgrades[name];
+ var upg = upgrades[CategoryId][name];
lbupgradetitle.Text = Localization.Parse(upg.Name);
lbupgradedesc.Text = Localization.Parse(upg.Description);
}
- Dictionary<string, ShiftoriumUpgrade> upgrades = new Dictionary<string, ShiftoriumUpgrade>();
-
- public void PopulateShiftorium()
+ Dictionary<string, ShiftoriumUpgrade>[] upgrades;
+
+ private void Populate()
{
- try
+ upgrades = new Dictionary<string, ShiftoriumUpgrade>[cats.Length];
+ int numComplete = 0;
+ avail = backend.GetAvailable();
+ foreach (var it in cats.Select((catName, catId) => new { catName, catId }))
{
- lbnoupgrades.Hide();
- lbupgrades.Items.Clear();
- upgrades.Clear();
- Timer();
-
- foreach (var upg in backend.GetAvailable().Where(x => x.Category == backend.GetCategories()[CategoryId]))
- {
- String name = Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP";
- upgrades.Add(name, upg);
- lbupgrades.Items.Add(name);
- }
-
- if (lbupgrades.Items.Count == 0)
+ var upl = new Dictionary<string, ShiftoriumUpgrade>();
+ upgrades[it.catId] = upl;
+ var t = new Thread((tupobj) =>
{
- lbnoupgrades.Show();
- lbnoupgrades.Location = new Point(
- (lbupgrades.Width - lbnoupgrades.Width) / 2,
- (lbupgrades.Height - lbnoupgrades.Height) / 2
- );
+ foreach (var upg in avail.Where(x => x.Category == it.catName))
+ upl.Add(Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP", upg);
+ numComplete++;
+ });
+ t.Start();
+ }
+ while (numComplete < cats.Length) { } // wait for all threads to finish their job
+ }
- }
- else
- {
- lbnoupgrades.Hide();
- }
- lblcategorytext.Text = Shiftorium.GetCategories()[CategoryId];
- btncat_back.Visible = (CategoryId > 0);
- btncat_forward.Visible = (CategoryId < backend.GetCategories().Length - 1);
+ private void SetList()
+ {
+ lbnoupgrades.Hide();
+ lbupgrades.Items.Clear();
+ try
+ {
+ lbupgrades.Items.AddRange(upgrades[CategoryId].Keys.ToArray());
}
catch
{
+ Engine.Infobox.Show("Shiftorium Machine Broke", "Category ID " + CategoryId.ToString() + " is invalid, modulo is broken, and the world is doomed. Please tell Declan about this.");
+ return;
+ }
+ if (lbupgrades.Items.Count == 0)
+ {
lbnoupgrades.Show();
lbnoupgrades.Location = new Point(
(lbupgrades.Width - lbnoupgrades.Width) / 2,
- (lbupgrades.Height - lbnoupgrades.Height) / 2
+ lbupgrades.Top + (lbupgrades.Height - lbnoupgrades.Height) / 2
);
-
}
+ else
+ lbnoupgrades.Hide();
+ lblcategorytext.Text = cats[CategoryId];
}
public static bool UpgradeInstalled(string upg)
@@ -183,13 +189,14 @@ namespace ShiftOS.WinForms.Applications
private void btnbuy_Click(object sender, EventArgs e)
{
- long cpCost = 0;
+ ulong cpCost = 0;
backend.Silent = true;
- Dictionary<string, long> UpgradesToBuy = new Dictionary<string, long>();
+ Dictionary<string, ulong> UpgradesToBuy = new Dictionary<string, ulong>();
foreach (var itm in lbupgrades.SelectedItems)
{
- cpCost += upgrades[itm.ToString()].Cost;
- UpgradesToBuy.Add(upgrades[itm.ToString()].ID, upgrades[itm.ToString()].Cost);
+ var upg = upgrades[CategoryId][itm.ToString()];
+ cpCost += upg.Cost;
+ UpgradesToBuy.Add(upg.ID, upg.Cost);
}
if (SaveSystem.CurrentSave.Codepoints < cpCost)
{
@@ -200,22 +207,26 @@ namespace ShiftOS.WinForms.Applications
{
foreach(var upg in UpgradesToBuy)
{
- backend.Buy(upg.Key, upg.Value);
+ if (SaveSystem.CurrentSave.Upgrades.ContainsKey(upg.Key))
+ {
+ SaveSystem.CurrentSave.Upgrades[upg.Key] = true;
+ }
+ else
+ {
+ SaveSystem.CurrentSave.Upgrades.Add(upg.Key, true);
+ }
+ SaveSystem.SaveGame();
+ backend.InvokeUpgradeInstalled();
}
+ SaveSystem.CurrentSave.Codepoints -= cpCost;
}
backend.Silent = false;
- PopulateShiftorium();
btnbuy.Hide();
}
- private void Shiftorium_Load(object sender, EventArgs e) {
-
- }
-
public void OnLoad()
{
- cp_update.Start();
lbnoupgrades.Hide();
}
@@ -224,12 +235,9 @@ namespace ShiftOS.WinForms.Applications
}
- Timer cp_update = new System.Windows.Forms.Timer();
-
public bool OnUnload()
{
- cp_update.Stop();
- cp_update = null;
+ SaveSystem.CurrentSave.removeSetCpCallback(updatecounter);
return true;
}
@@ -237,38 +245,26 @@ namespace ShiftOS.WinForms.Applications
{
lbupgrades.SelectionMode = (UpgradeInstalled("shiftorium_gui_bulk_buy") == true) ? SelectionMode.MultiExtended : SelectionMode.One;
lbcodepoints.Visible = Shiftorium.UpgradeInstalled("shiftorium_gui_codepoints_display");
+ Populate();
+ SetList();
}
- private void lbcodepoints_Click(object sender, EventArgs e)
- {
-
- }
-
- void Timer()
+ private void moveCat(short direction) // direction is -1 to move backwards or 1 to move forwards
{
- timer100 = new System.Timers.Timer();
- timer100.Interval = 2000;
- //timer100.Elapsed += ???;
- timer100.AutoReset = true;
- timer100.Enabled = true;
+ CategoryId += direction;
+ CategoryId %= cats.Length;
+ if (CategoryId < 0) CategoryId += cats.Length; // fix modulo on negatives
+ SetList();
}
private void btncat_back_Click(object sender, EventArgs e)
{
- if(CategoryId > 0)
- {
- CategoryId--;
- PopulateShiftorium();
- }
+ moveCat(-1);
}
private void btncat_forward_Click(object sender, EventArgs e)
{
- if(CategoryId < backend.GetCategories().Length - 1)
- {
- CategoryId++;
- PopulateShiftorium();
- }
+ moveCat(1);
}
}
}
diff --git a/ShiftOS.WinForms/Applications/ShopItemCreator.cs b/ShiftOS.WinForms/Applications/ShopItemCreator.cs
index 61e7491..d2836ee 100644
--- a/ShiftOS.WinForms/Applications/ShopItemCreator.cs
+++ b/ShiftOS.WinForms/Applications/ShopItemCreator.cs
@@ -73,7 +73,7 @@ namespace ShiftOS.WinForms.Applications
Infobox.Show("No file chosen.", "Please select a file to sell.");
return;
}
- Item.Cost = Convert.ToInt32(txtcost.Text);
+ Item.Cost = Convert.ToUInt64(txtcost.Text);
Item.Description = txtdescription.Text;
Item.Name = txtitemname.Text;
Callback?.Invoke(Item);
@@ -101,7 +101,7 @@ namespace ShiftOS.WinForms.Applications
{
try
{
- Item.Cost = Convert.ToInt32(txtcost.Text);
+ Item.Cost = Convert.ToUInt64(txtcost.Text);
}
catch
{
diff --git a/ShiftOS.WinForms/Applications/Skin Loader.cs b/ShiftOS.WinForms/Applications/Skin Loader.cs
index f9857b7..e4f0597 100644
--- a/ShiftOS.WinForms/Applications/Skin Loader.cs
+++ b/ShiftOS.WinForms/Applications/Skin Loader.cs
@@ -65,8 +65,11 @@ namespace ShiftOS.WinForms.Applications
public void SetupUI()
{
- SetupDesktop();
- Setup();
+ if (LoadedSkin != null)
+ {
+ SetupDesktop();
+ Setup();
+ }
}
public void SetupDesktop()
@@ -78,7 +81,7 @@ namespace ShiftOS.WinForms.Applications
//upgrades
- if (SaveSystem.CurrentSave != null)
+ if (SaveSystem.CurrentSave != null && LoadedSkin != null)
{
desktoppanel.Visible = ShiftoriumFrontend.UpgradeInstalled("desktop");
lbtime.Visible = ShiftoriumFrontend.UpgradeInstalled("desktop_clock_widget");
@@ -303,7 +306,7 @@ namespace ShiftOS.WinForms.Applications
System.IO.Directory.CreateDirectory(Paths.SharedFolder + "\\skins");
}
- string path = Paths.SharedFolder + "\\skins\\" + SaveSystem.CurrentSave.Username + "-" + fname;
+ string path = Paths.SharedFolder + "\\skins\\" + SaveSystem.CurrentUser.Username + "-" + fname;
System.IO.File.WriteAllText(path, JsonConvert.SerializeObject(LoadedSkin));
})));
diff --git a/ShiftOS.WinForms/Applications/Terminal.cs b/ShiftOS.WinForms/Applications/Terminal.cs
index 32c5363..687b2b9 100644
--- a/ShiftOS.WinForms/Applications/Terminal.cs
+++ b/ShiftOS.WinForms/Applications/Terminal.cs
@@ -130,25 +130,31 @@ namespace ShiftOS.WinForms.Applications
{
this.Invoke(new Action(() =>
{
- ResetAllKeywords();
- rtbterm.Text = "";
- if (!Shiftorium.UpgradeInstalled("desktop"))
+ if (Shiftorium.UpgradeInstalled("first_steps"))
{
- TerminalBackend.PrefixEnabled = true;
- TerminalBackend.InStory = false;
- TerminalBackend.PrintPrompt();
- if (Shiftorium.UpgradeInstalled("wm_free_placement"))
+ if (!Shiftorium.UpgradeInstalled("desktop"))
{
- this.ParentForm.Width = 640;
- this.ParentForm.Height = 480;
- this.ParentForm.Left = (Screen.PrimaryScreen.Bounds.Width - 640) / 2;
- this.ParentForm.Top = (Screen.PrimaryScreen.Bounds.Height - 480) / 2;
+ TerminalBackend.PrefixEnabled = true;
+ TerminalBackend.InStory = false;
+ TerminalBackend.PrintPrompt();
+ if (Shiftorium.UpgradeInstalled("wm_free_placement"))
+ {
+ this.ParentForm.Width = 640;
+ this.ParentForm.Height = 480;
+ this.ParentForm.Left = (Screen.PrimaryScreen.Bounds.Width - 640) / 2;
+ this.ParentForm.Top = (Screen.PrimaryScreen.Bounds.Height - 480) / 2;
+ }
+ }
+ else
+ {
+ AppearanceManager.Close(this);
}
}
else
{
- AppearanceManager.Close(this);
+ Story.Start("first_steps");
+
}
}));
}
@@ -195,52 +201,6 @@ namespace ShiftOS.WinForms.Applications
public static event TextSentEventHandler TextSent;
- public void ResetAllKeywords()
- {
- string primary = SaveSystem.CurrentUser.Username + " ";
- string secondary = "shiftos ";
-
-
- var asm = Assembly.GetExecutingAssembly();
-
- var types = asm.GetTypes();
-
- foreach (var type in types)
- {
- foreach (var a in type.GetCustomAttributes(false))
- {
- if (ShiftoriumFrontend.UpgradeAttributesUnlocked(type))
- {
- if (a is Namespace)
- {
- var ns = a as Namespace;
- if (!primary.Contains(ns.name))
- {
- primary += ns.name + " ";
- }
- foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
- {
- if (ShiftoriumFrontend.UpgradeAttributesUnlocked(method))
- {
- foreach (var ma in method.GetCustomAttributes(false))
- {
- if (ma is Command)
- {
- var cmd = ma as Command;
- if (!secondary.Contains(cmd.name))
- secondary += cmd.name + " ";
- }
- }
- }
- }
- }
- }
- }
- }
-
-
- }
-
public static void MakeWidget(Controls.TerminalBox txt)
{
AppearanceManager.StartConsoleOut();
@@ -260,11 +220,19 @@ namespace ShiftOS.WinForms.Applications
{
try
{
- a.SuppressKeyPress = true;
- Console.WriteLine("");
+ if (!TerminalBackend.InStory)
+ a.SuppressKeyPress = false;
+ if (!TerminalBackend.PrefixEnabled)
+ {
+ string textraw = txt.Lines[txt.Lines.Length - 1];
+ TextSent?.Invoke(textraw);
+ TerminalBackend.SendText(textraw);
+ return;
+ }
var text = txt.Lines.ToArray();
- var text2 = text[text.Length - 2];
+ var text2 = text[text.Length - 1];
var text3 = "";
+ txt.AppendText(Environment.NewLine);
var text4 = Regex.Replace(text2, @"\t|\n|\r", "");
if (IsInRemoteSystem == true)
@@ -345,21 +313,24 @@ namespace ShiftOS.WinForms.Applications
}
else if (a.KeyCode == Keys.Left)
{
- var getstring = txt.Lines[txt.Lines.Length - 1];
- var stringlen = getstring.Length + 1;
- var header = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ";
- var headerlen = header.Length + 1;
- var selstart = txt.SelectionStart;
- var remstrlen = txt.TextLength - stringlen;
- var finalnum = selstart - remstrlen;
-
- if (finalnum != headerlen)
+ if (SaveSystem.CurrentSave != null)
{
- AppearanceManager.CurrentPosition--;
- }
- else
- {
- a.SuppressKeyPress = true;
+ var getstring = txt.Lines[txt.Lines.Length - 1];
+ var stringlen = getstring.Length + 1;
+ var header = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ";
+ var headerlen = header.Length + 1;
+ var selstart = txt.SelectionStart;
+ var remstrlen = txt.TextLength - stringlen;
+ var finalnum = selstart - remstrlen;
+
+ if (finalnum != headerlen)
+ {
+ AppearanceManager.CurrentPosition--;
+ }
+ else
+ {
+ a.SuppressKeyPress = true;
+ }
}
}
else if (a.KeyCode == Keys.Up)
@@ -367,6 +338,7 @@ namespace ShiftOS.WinForms.Applications
var tostring3 = txt.Lines[txt.Lines.Length - 1];
if (tostring3 == $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ")
Console.Write(TerminalBackend.LastCommand);
+ ConsoleEx.OnFlush?.Invoke();
a.SuppressKeyPress = true;
}
@@ -421,17 +393,212 @@ namespace ShiftOS.WinForms.Applications
if (SaveSystem.CurrentSave != null)
{
+ TerminalBackend.PrintPrompt();
if (!ShiftoriumFrontend.UpgradeInstalled("window_manager"))
{
rtbterm.Select(rtbterm.TextLength, 0);
}
}
- new Thread(() =>
- {
+ }
+
+ public static string RemoteSystemName { get; set; }
+ public static string RemoteUser { get; set; }
+ public static string RemotePass { get; set; }
+
+ [Story("first_steps")]
+ public static void FirstSteps()
+ {
+ TerminalBackend.PrefixEnabled = false;
+ TerminalBackend.InStory = true;
+ Console.WriteLine("Hey there, and welcome to ShiftOS.");
+ Thread.Sleep(2000);
+ Console.WriteLine("My name is DevX. I am the developer of this operating system.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Right now, I am using the Terminal application as a means of talking to you.");
+ Thread.Sleep(2000);
+ Console.WriteLine("ShiftOS is a very early operating system, but I have big plans for it.");
+ Thread.Sleep(2000);
+ Console.WriteLine("I can't reveal all my plans to you at this moment, but you play a big role.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Your role in all of this is to help me develop ShiftOS more.");
+ Thread.Sleep(2000);
+ Console.WriteLine("You may not know how to program, but that's perfectly fine. You don't need to.");
+ Thread.Sleep(2000);
+ Console.WriteLine("What you do need to do, is simply use the operating system - like you would a regular computer.");
+ Thread.Sleep(2000);
+ Console.WriteLine("As you use ShiftOS, you will earn a special currency called Codepoints.");
+ Thread.Sleep(2000);
+ Console.WriteLine("The more things you do, the more Codepoints you get! Simple, right?");
+ Thread.Sleep(2000);
+ Console.WriteLine("Once you rack up enough Codepoints, you can use them inside the Shiftorium to buy new features for ShiftOS.");
+ Thread.Sleep(2000);
+ Console.WriteLine("These features include new programs, system enhancements, Terminal commands, and so much more!");
+ Thread.Sleep(2000);
+ Console.WriteLine("Ahh, that reminds me. I suppose you don't know how to use the Terminal yet, do you...");
+ Thread.Sleep(2000);
+ Console.WriteLine("Well, the ShiftOS terminal is similar to a regular Linux terminal, however things are a bit... how you say.... primitive.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Let's just say.... I've been focusing more on function than form with this one.... Anyways, here's how the terminal works.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Each command is categorized into a \"Namespace\". All a namespace is, is a nice way of distinguishing between commands.");
+ Thread.Sleep(2000);
+ Console.WriteLine("...For example you may have a bunch of commands for managing files, and others for opening/closing programs.");
+ Thread.Sleep(2000);
+ Console.WriteLine("The three main namespaces you'll be using for the next while are the \"sos\", \"shiftorium\", and \"win\" namespaces.");
+ Thread.Sleep(2000);
+ Console.WriteLine("To run a command, simply type its namespace, followed by a period/full-stop, followed by the command name.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Give it a try! Type \"sos.help\" in the following prompt to view a list of all ShiftOS commands.");
+ Thread.Sleep(2000);
+ TerminalBackend.InStory = false;
+ TerminalBackend.PrefixEnabled = true;
+ TerminalBackend.PrintPrompt();
+ bool help_entered = false;
+ TerminalBackend.CommandProcessed += (text, args) =>
+ {
+ if (text.EndsWith("sos.help") && help_entered == false)
+ help_entered = true;
+ };
+ while (help_entered == false)
+ Thread.Sleep(10);
+ TerminalBackend.InStory = true;
+ TerminalBackend.PrefixEnabled = false;
+ Thread.Sleep(2000);
+ Console.WriteLine("Good job! Next, we will look at how to pass data to a command, such as win.open.");
+ Thread.Sleep(2000);
+ Console.WriteLine("In ShiftOS, passing data to a command is quite simple! After the command name, place an opening and closing curly brace, like so: \"win.open{}\".");
+ Thread.Sleep(2000);
+ Console.WriteLine("Everything between those two curly braces is treated as command data.");
+ Thread.Sleep(2000);
+ Console.WriteLine("However, you can't just spam a bunch of 1s and 0s and call it a day, nonono!");
+ Thread.Sleep(2000);
+ Console.WriteLine("Command data is split into a list of keys and values.");
+ Thread.Sleep(2000);
+ Console.WriteLine("The key tells the command the name of the data, and the value is what the command will see when it looks at the key.");
+ Thread.Sleep(2000);
+ Console.WriteLine("There are three main types of values. Booleans, which can be either \"true\" or \"false\", Numbers, which can be any integer number, positive or negative, and Strings - any piece of text as long as it is surrounded by double-quotes.");
+ Thread.Sleep(2000);
+ Console.WriteLine("For example, we could write every programmer's first program - by typing \"trm.echo{msg:\"Hello, world!\"}\". Running this will cause the Terminal to print, well, \"Hello, world!\"");
+ Thread.Sleep(2000);
+ Console.WriteLine("To open an application in ShiftOS, you can use this principle with the \"win.open\" command.");
+ Thread.Sleep(2000);
+ Console.WriteLine("First, type \"win.open\" with no data to see a list of all installed programs.");
+ Thread.Sleep(2000);
+ TerminalBackend.InStory = false;
+ bool winopenEntered = false;
+ TerminalBackend.PrefixEnabled = true;
+ TerminalBackend.PrintPrompt();
+ TerminalBackend.CommandProcessed += (text, args) =>
+ {
+ if (help_entered == true)
+ if (text.EndsWith("win.open") && winopenEntered == false)
+ winopenEntered = true;
+ };
+ while (winopenEntered == false)
+ Thread.Sleep(10);
+ TerminalBackend.InStory = true;
+ TerminalBackend.PrefixEnabled = false;
+
+ Thread.Sleep(2000);
+ Console.WriteLine("Pretty cool, it gave you a nice list of other win.open commands that will let you open each program.");
+ Thread.Sleep(2000);
+ Console.WriteLine("You've got the just of using ShiftOS. Now, for your goal.");
+ Thread.Sleep(2000);
+ Console.WriteLine("As you know, ShiftOS doesn't have very many features.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Using the applications you have, I need you to earn as many Codepoints as you can.");
+ Thread.Sleep(2000);
+ Console.WriteLine("You can use the Codepoints you earn to buy new applications and features in the Shiftorium, to help earn even more Codepoints.");
+ Thread.Sleep(2000);
+ Console.WriteLine("Once you earn 1,000 Codepoints, I will check back with you and see how well you've done.");
+ Thread.Sleep(2000);
+ Console.WriteLine("I'll leave you to it, you've got the hang of it! One last thing, if ever you find yourself in another program, and want to exit, simply press CTRL+T to return to the Terminal.");
+ Thread.Sleep(2000);
+ TerminalBackend.PrefixEnabled = true;
+ TerminalBackend.InStory = false;
+ SaveSystem.SaveGame();
Thread.Sleep(1000);
+
+ Story.Context.AutoComplete = false;
+
+ Console.WriteLine(@"Welcome to the ShiftOS Newbie's Guide.
+
+This tutorial will guide you through the more intermediate features of ShiftOS,
+such as earning Codepoints, buying Shiftoorium Upgrades, and using the objectives system.
+
+Every now and then, you'll get a notification in your terminal of a ""NEW OBJECTIVE"".
+This means that someone has instructed you to do something inside ShiftOS. At any moment
+you may type ""sos.status"" in your Terminal to see your current objectives.
+
+This command is very useful as not only does it allow you to see your current objectives
+but you can also see the amount of Codepoints you have as well as the upgrades you've
+installed and how many upgrades are available.
+
+Now, onto your first objective! All you need to do is earn 200 Codepoints using any
+program on your system.");
+
+ Story.PushObjective("First Steps: Your First Codepoints", "Play a few rounds of Pong, or use another program to earn 200 Codepoints.", () =>
+ {
+ return SaveSystem.CurrentSave.Codepoints >= 200;
+ }, () =>
+ {
+ Desktop.InvokeOnWorkerThread(() =>
+ {
+ AppearanceManager.SetupWindow(new Terminal());
+ });
+ Console.WriteLine("Good job! You've earned " + SaveSystem.CurrentSave.Codepoints + @" Codepoints! You can use these inside the
+Shiftorium to buy new upgrades inside ShiftOS.
+
+These upgrades can give ShiftOS more features, fixes and programs,
+which can make the operating system easier to use and navigate around
+and also make it easier for you to earn more Codepoints and thus upgrade
+te system further.
+
+Be cautious though! Only certain upgrades offer the ability to earn more
+Codepoints. These upgrades are typically in the form of new programs.
+
+So, try to get as many new programs as possible for your computer, and save
+the system feature upgrades for later unless you absolutely need them.
+
+The worst thing that could happen is you end up stuck with very little Codepoints
+and only a few small programs to use to earn very little amounts of Codepoints.
+
+Now, let's get you your first Shiftorium upgrade!");
+
+ Story.PushObjective("First Steps: The Shiftorium", "Buy your first Shiftorium upgrade with your new Codepoints using shiftorium.list, shiftorium.info and shiftorium.buy.",
+ () =>
+ {
+ return SaveSystem.CurrentSave.CountUpgrades() > 0;
+ }, () =>
+ {
+ Console.WriteLine("This concludes the ShiftOS Newbie's Guide! Now, go, and shift it your way!");
+ Console.WriteLine(@"
+Your goal: Earn 1,000 Codepoints.");
+ Story.Context.MarkComplete();
+ Story.Start("first_steps_transition");
+ });
TerminalBackend.PrintPrompt();
- }).Start();
+ });
+
+ TerminalBackend.PrintPrompt();
+ }
+
+
+ [Story("first_steps_transition")]
+ public static void FirstStepsTransition()
+ {
+ Story.PushObjective("Earn 1000 Codepoints", "You now know the basics of ShiftOS. Let's get your system up and running with a few upgrades, and get a decent amount of Codepoints.", () =>
+ {
+ return SaveSystem.CurrentSave.Codepoints >= 1000;
+ },
+ () =>
+ {
+ Story.Context.MarkComplete();
+ Story.Start("victortran_shiftnet");
+ });
+
+ Story.Context.AutoComplete = false;
}
public void OnSkinLoad()
diff --git a/ShiftOS.WinForms/Applications/TriPresent.Designer.cs b/ShiftOS.WinForms/Applications/TriPresent.Designer.cs
new file mode 100644
index 0000000..d0e704f
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/TriPresent.Designer.cs
@@ -0,0 +1,312 @@
+namespace ShiftOS.WinForms.Applications
+{
+ partial class TriPresent
+ {
+ /// <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 Component 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.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addLabelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addLabel = new System.Windows.Forms.Panel();
+ this.checkBox2 = new System.Windows.Forms.CheckBox();
+ this.checkBox1 = new System.Windows.Forms.CheckBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.yLabel = new System.Windows.Forms.Label();
+ this.xLabel = new System.Windows.Forms.Label();
+ this.yPosition = new System.Windows.Forms.NumericUpDown();
+ this.xPosition = new System.Windows.Forms.NumericUpDown();
+ this.labelContents = new System.Windows.Forms.TextBox();
+ this.addItemLabel = new System.Windows.Forms.Label();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.designerPanel = new System.Windows.Forms.Panel();
+ this.menuStrip1.SuspendLayout();
+ this.addLabel.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.yPosition)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.xPosition)).BeginInit();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // menuStrip1
+ //
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileToolStripMenuItem,
+ this.editToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(758, 24);
+ this.menuStrip1.TabIndex = 0;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // fileToolStripMenuItem
+ //
+ this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.openToolStripMenuItem,
+ this.saveToolStripMenuItem});
+ this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+ this.fileToolStripMenuItem.Text = "&File";
+ //
+ // openToolStripMenuItem
+ //
+ this.openToolStripMenuItem.Name = "openToolStripMenuItem";
+ this.openToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
+ this.openToolStripMenuItem.Text = "&Open";
+ //
+ // saveToolStripMenuItem
+ //
+ this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ this.saveToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
+ this.saveToolStripMenuItem.Text = "&Save";
+ //
+ // editToolStripMenuItem
+ //
+ this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.addToolStripMenuItem});
+ this.editToolStripMenuItem.Name = "editToolStripMenuItem";
+ this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
+ this.editToolStripMenuItem.Text = "&Edit";
+ //
+ // addToolStripMenuItem
+ //
+ this.addToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.addLabelToolStripMenuItem});
+ this.addToolStripMenuItem.Name = "addToolStripMenuItem";
+ this.addToolStripMenuItem.Size = new System.Drawing.Size(96, 22);
+ this.addToolStripMenuItem.Text = "Add";
+ //
+ // addLabelToolStripMenuItem
+ //
+ this.addLabelToolStripMenuItem.Name = "addLabelToolStripMenuItem";
+ this.addLabelToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
+ this.addLabelToolStripMenuItem.Text = "Add Label";
+ this.addLabelToolStripMenuItem.Click += new System.EventHandler(this.addLabelToolStripMenuItem_Click);
+ //
+ // addLabel
+ //
+ this.addLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.addLabel.Controls.Add(this.checkBox2);
+ this.addLabel.Controls.Add(this.checkBox1);
+ this.addLabel.Controls.Add(this.label1);
+ this.addLabel.Controls.Add(this.panel1);
+ this.addLabel.Controls.Add(this.yLabel);
+ this.addLabel.Controls.Add(this.xLabel);
+ this.addLabel.Controls.Add(this.yPosition);
+ this.addLabel.Controls.Add(this.xPosition);
+ this.addLabel.Controls.Add(this.labelContents);
+ this.addLabel.Controls.Add(this.addItemLabel);
+ this.addLabel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.addLabel.Location = new System.Drawing.Point(0, 0);
+ this.addLabel.Name = "addLabel";
+ this.addLabel.Size = new System.Drawing.Size(252, 456);
+ this.addLabel.TabIndex = 1;
+ this.addLabel.Visible = false;
+ //
+ // checkBox2
+ //
+ this.checkBox2.AutoSize = true;
+ this.checkBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.checkBox2.Location = new System.Drawing.Point(6, 163);
+ this.checkBox2.Name = "checkBox2";
+ this.checkBox2.Size = new System.Drawing.Size(48, 17);
+ this.checkBox2.TabIndex = 11;
+ this.checkBox2.Text = "Italic";
+ this.checkBox2.UseVisualStyleBackColor = true;
+ //
+ // checkBox1
+ //
+ this.checkBox1.AutoSize = true;
+ this.checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.checkBox1.Location = new System.Drawing.Point(6, 140);
+ this.checkBox1.Name = "checkBox1";
+ this.checkBox1.Size = new System.Drawing.Size(51, 17);
+ this.checkBox1.TabIndex = 10;
+ this.checkBox1.Text = "Bold";
+ this.checkBox1.UseVisualStyleBackColor = true;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(115, 144);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(58, 13);
+ this.label1.TabIndex = 9;
+ this.label1.Text = "Text Color:";
+ //
+ // panel1
+ //
+ this.panel1.BackColor = System.Drawing.Color.Black;
+ this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.panel1.ForeColor = System.Drawing.Color.Black;
+ this.panel1.Location = new System.Drawing.Point(179, 141);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(35, 20);
+ this.panel1.TabIndex = 8;
+ this.panel1.Click += new System.EventHandler(this.panel1_Click);
+ //
+ // yLabel
+ //
+ this.yLabel.AutoSize = true;
+ this.yLabel.Location = new System.Drawing.Point(200, 96);
+ this.yLabel.Name = "yLabel";
+ this.yLabel.Size = new System.Drawing.Size(14, 13);
+ this.yLabel.TabIndex = 5;
+ this.yLabel.Text = "Y";
+ //
+ // xLabel
+ //
+ this.xLabel.AutoSize = true;
+ this.xLabel.Location = new System.Drawing.Point(3, 95);
+ this.xLabel.Name = "xLabel";
+ this.xLabel.Size = new System.Drawing.Size(14, 13);
+ this.xLabel.TabIndex = 4;
+ this.xLabel.Text = "X";
+ //
+ // yPosition
+ //
+ this.yPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.yPosition.Location = new System.Drawing.Point(127, 114);
+ this.yPosition.Maximum = new decimal(new int[] {
+ 999999999,
+ 0,
+ 0,
+ 0});
+ this.yPosition.Name = "yPosition";
+ this.yPosition.Size = new System.Drawing.Size(87, 20);
+ this.yPosition.TabIndex = 3;
+ //
+ // xPosition
+ //
+ this.xPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.xPosition.Location = new System.Drawing.Point(3, 114);
+ this.xPosition.Maximum = new decimal(new int[] {
+ 999999999,
+ 0,
+ 0,
+ 0});
+ this.xPosition.Name = "xPosition";
+ this.xPosition.Size = new System.Drawing.Size(87, 20);
+ this.xPosition.TabIndex = 2;
+ //
+ // labelContents
+ //
+ this.labelContents.Location = new System.Drawing.Point(3, 26);
+ this.labelContents.Multiline = true;
+ this.labelContents.Name = "labelContents";
+ this.labelContents.Size = new System.Drawing.Size(211, 67);
+ this.labelContents.TabIndex = 1;
+ this.labelContents.Text = "Text";
+ //
+ // addItemLabel
+ //
+ this.addItemLabel.Location = new System.Drawing.Point(0, 0);
+ this.addItemLabel.Name = "addItemLabel";
+ this.addItemLabel.Size = new System.Drawing.Size(214, 23);
+ this.addItemLabel.TabIndex = 0;
+ this.addItemLabel.Text = "{ADD_ITEM_LABEL}";
+ this.addItemLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 24);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.addLabel);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.designerPanel);
+ this.splitContainer1.Size = new System.Drawing.Size(758, 456);
+ this.splitContainer1.SplitterDistance = 252;
+ this.splitContainer1.TabIndex = 2;
+ //
+ // designerPanel
+ //
+ this.designerPanel.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.designerPanel.Location = new System.Drawing.Point(0, 0);
+ this.designerPanel.Name = "designerPanel";
+ this.designerPanel.Size = new System.Drawing.Size(502, 456);
+ this.designerPanel.TabIndex = 0;
+ this.designerPanel.Click += new System.EventHandler(this.designerPanel_Click);
+ //
+ // TriPresent
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.splitContainer1);
+ this.Controls.Add(this.menuStrip1);
+ this.Name = "TriPresent";
+ this.Size = new System.Drawing.Size(758, 480);
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
+ this.addLabel.ResumeLayout(false);
+ this.addLabel.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.yPosition)).EndInit();
+ ((System.ComponentModel.ISupportInitialize)(this.xPosition)).EndInit();
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+ this.splitContainer1.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addLabelToolStripMenuItem;
+ private System.Windows.Forms.Panel addLabel;
+ private System.Windows.Forms.Label addItemLabel;
+ private System.Windows.Forms.Label yLabel;
+ private System.Windows.Forms.Label xLabel;
+ private System.Windows.Forms.NumericUpDown yPosition;
+ private System.Windows.Forms.NumericUpDown xPosition;
+ private System.Windows.Forms.TextBox labelContents;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.CheckBox checkBox2;
+ private System.Windows.Forms.CheckBox checkBox1;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.Panel designerPanel;
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/TriPresent.cs b/ShiftOS.WinForms/Applications/TriPresent.cs
new file mode 100644
index 0000000..fc1d982
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/TriPresent.cs
@@ -0,0 +1,91 @@
+#define BETA_2_5
+
+using ShiftOS.Objects.ShiftFS;
+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 System.Threading;
+
+namespace ShiftOS.WinForms.Applications
+{
+#if !BETA_2_5
+ [WinOpen("tripresent")]
+ [AppscapeEntry("TriPresent", "Part of the trilogy of office applications for enhancement of your system. TriPresent is easliy the best presentation creator out there for ShiftOS.", 2048, 1500, "file_skimmer", "Office")]
+ [DefaultTitle("TriPresent")]
+ [Launcher("TriPresent", false, null, "Office")]
+#endif
+ public partial class TriPresent : UserControl, IShiftOSWindow
+ {
+ public TriPresent()
+ {
+ InitializeComponent();
+ }
+
+ private void addLabelToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ addItemLabel.Text = "Add Label";
+ addLabel.Show();
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ addLabel.Hide();
+ }
+
+ public void OnLoad()
+ {
+ panel1.ForeColor = Color.Black;
+ panel1.BackColor = Color.Black;
+ }
+
+ public void OnSkinLoad()
+ {
+
+ }
+
+ public bool OnUnload()
+ {
+ return true;
+ }
+
+ public void OnUpgrade()
+ {
+
+ }
+
+ private void placeAdd_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void panel1_Click(object sender, EventArgs e)
+ {
+ AppearanceManager.SetupDialog(new ColorPicker(panel1.BackColor, "Text Color", new Action<Color>((col) =>
+ {
+ panel1.ForeColor = col;
+ panel1.BackColor = col;
+ })));
+ }
+
+ private void designerPanel_Click(object sender, EventArgs e)
+ {
+ if (addLabel.Visible == true)
+ {
+ Label label = new Label();
+ label.Parent = designerPanel;
+ label.BackColor = Color.Transparent;
+ label.ForeColor = panel1.BackColor;
+ label.Text = labelContents.Text;
+ label.Location = new Point(Cursor.Position.X / 3, Cursor.Position.Y);
+ label.Text = labelContents.Text;
+ }
+ }
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/TriPresent.resx b/ShiftOS.WinForms/Applications/TriPresent.resx
new file mode 100644
index 0000000..d5494e3
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/TriPresent.resx
@@ -0,0 +1,123 @@
+<?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>
+ <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+</root> \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/TriSheet.Designer.cs b/ShiftOS.WinForms/Applications/TriSheet.Designer.cs
new file mode 100644
index 0000000..b4aa1c4
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/TriSheet.Designer.cs
@@ -0,0 +1,65 @@
+namespace ShiftOS.WinForms.Applications
+{
+ partial class TriSheet
+ {
+ /// <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 Component 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.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
+ this.toolStripContainer1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // toolStripContainer1
+ //
+ //
+ // toolStripContainer1.ContentPanel
+ //
+ this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(710, 464);
+ this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
+ this.toolStripContainer1.Name = "toolStripContainer1";
+ this.toolStripContainer1.Size = new System.Drawing.Size(710, 489);
+ this.toolStripContainer1.TabIndex = 0;
+ this.toolStripContainer1.Text = "toolStripContainer1";
+ //
+ // TriSheet
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.toolStripContainer1);
+ this.Name = "TriSheet";
+ this.Size = new System.Drawing.Size(710, 489);
+ this.toolStripContainer1.ResumeLayout(false);
+ this.toolStripContainer1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ToolStripContainer toolStripContainer1;
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/TriSheet.cs b/ShiftOS.WinForms/Applications/TriSheet.cs
new file mode 100644
index 0000000..18b09b3
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/TriSheet.cs
@@ -0,0 +1,22 @@
+#define BETA_2_5
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS.WinForms.Applications
+{
+ public partial class TriSheet : UserControl
+ {
+ public TriSheet()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/TriSheet.resx b/ShiftOS.WinForms/Applications/TriSheet.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/TriSheet.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
diff --git a/ShiftOS.WinForms/Applications/TriWrite.Designer.cs b/ShiftOS.WinForms/Applications/TriWrite.Designer.cs
index e420fd5..a1432d8 100644
--- a/ShiftOS.WinForms/Applications/TriWrite.Designer.cs
+++ b/ShiftOS.WinForms/Applications/TriWrite.Designer.cs
@@ -36,15 +36,27 @@
this.panel1 = new System.Windows.Forms.Panel();
this.txtbody = new System.Windows.Forms.Label();
this.lbtitle = new System.Windows.Forms.Label();
- this.txtcontents = new System.Windows.Forms.TextBox();
this.menuStrip2 = new System.Windows.Forms.MenuStrip();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.menuStrip3 = new System.Windows.Forms.MenuStrip();
+ this.txtcontents = new System.Windows.Forms.RichTextBox();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.bold = new System.Windows.Forms.ToolStripButton();
+ this.italic = new System.Windows.Forms.ToolStripButton();
+ this.underline = new System.Windows.Forms.ToolStripButton();
+ this.strikethrough = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.fonts = new System.Windows.Forms.ToolStripComboBox();
+ this.size = new System.Windows.Forms.ToolStripTextBox();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.left = new System.Windows.Forms.ToolStripButton();
+ this.center = new System.Windows.Forms.ToolStripButton();
+ this.right = new System.Windows.Forms.ToolStripButton();
this.menuStrip1.SuspendLayout();
this.panel1.SuspendLayout();
this.menuStrip2.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@@ -61,16 +73,17 @@
// addContactToolStripMenuItem
//
this.addContactToolStripMenuItem.Name = "addContactToolStripMenuItem";
- this.addContactToolStripMenuItem.Size = new System.Drawing.Size(32, 19);
+ this.addContactToolStripMenuItem.Size = new System.Drawing.Size(12, 20);
//
// removeToolStripMenuItem
//
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
- this.removeToolStripMenuItem.Size = new System.Drawing.Size(32, 19);
+ this.removeToolStripMenuItem.Size = new System.Drawing.Size(12, 20);
//
// tvcontacts
//
this.tvcontacts.Dock = System.Windows.Forms.DockStyle.Left;
+ this.tvcontacts.LineColor = System.Drawing.Color.Empty;
this.tvcontacts.Location = new System.Drawing.Point(0, 24);
this.tvcontacts.Name = "tvcontacts";
this.tvcontacts.Size = new System.Drawing.Size(224, 551);
@@ -107,16 +120,6 @@
this.lbtitle.Tag = "header1";
this.lbtitle.Text = "TriWrite";
//
- // txtcontents
- //
- this.txtcontents.Dock = System.Windows.Forms.DockStyle.Fill;
- this.txtcontents.Location = new System.Drawing.Point(0, 53);
- this.txtcontents.Multiline = true;
- this.txtcontents.Name = "txtcontents";
- this.txtcontents.Size = new System.Drawing.Size(527, 460);
- this.txtcontents.TabIndex = 1;
- this.txtcontents.TabStop = false;
- //
// menuStrip2
//
this.menuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -125,7 +128,7 @@
this.saveToolStripMenuItem});
this.menuStrip2.Location = new System.Drawing.Point(0, 0);
this.menuStrip2.Name = "menuStrip2";
- this.menuStrip2.Size = new System.Drawing.Size(527, 24);
+ this.menuStrip2.Size = new System.Drawing.Size(652, 24);
this.menuStrip2.TabIndex = 2;
this.menuStrip2.Text = "menuStrip2";
//
@@ -134,40 +137,173 @@
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(43, 20);
this.newToolStripMenuItem.Text = "New";
+ this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
this.openToolStripMenuItem.Text = "Open";
+ this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(43, 20);
this.saveToolStripMenuItem.Text = "Save";
+ this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
+ //
+ // txtcontents
+ //
+ this.txtcontents.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.txtcontents.Location = new System.Drawing.Point(0, 49);
+ this.txtcontents.Name = "txtcontents";
+ this.txtcontents.Size = new System.Drawing.Size(652, 365);
+ this.txtcontents.TabIndex = 4;
+ this.txtcontents.Text = "";
+ this.txtcontents.SelectionChanged += new System.EventHandler(this.txtcontents_SelectionChanged);
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.bold,
+ this.italic,
+ this.underline,
+ this.strikethrough,
+ this.toolStripSeparator1,
+ this.fonts,
+ this.size,
+ this.toolStripSeparator2,
+ this.left,
+ this.center,
+ this.right});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 24);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.Size = new System.Drawing.Size(652, 25);
+ this.toolStrip1.TabIndex = 5;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // bold
+ //
+ this.bold.CheckOnClick = true;
+ this.bold.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.bold.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
+ this.bold.Image = ((System.Drawing.Image)(resources.GetObject("bold.Image")));
+ this.bold.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.bold.Name = "bold";
+ this.bold.Size = new System.Drawing.Size(23, 22);
+ this.bold.Text = "B";
+ this.bold.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
+ //
+ // italic
+ //
+ this.italic.CheckOnClick = true;
+ this.italic.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.italic.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Italic);
+ this.italic.Image = ((System.Drawing.Image)(resources.GetObject("italic.Image")));
+ this.italic.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.italic.Name = "italic";
+ this.italic.Size = new System.Drawing.Size(23, 22);
+ this.italic.Text = "I";
+ this.italic.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
+ //
+ // underline
+ //
+ this.underline.CheckOnClick = true;
+ this.underline.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.underline.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Underline);
+ this.underline.Image = ((System.Drawing.Image)(resources.GetObject("underline.Image")));
+ this.underline.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.underline.Name = "underline";
+ this.underline.Size = new System.Drawing.Size(23, 22);
+ this.underline.Text = "U";
+ this.underline.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
+ //
+ // strikethrough
+ //
+ this.strikethrough.CheckOnClick = true;
+ this.strikethrough.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.strikethrough.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.strikethrough.Image = ((System.Drawing.Image)(resources.GetObject("strikethrough.Image")));
+ this.strikethrough.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.strikethrough.Name = "strikethrough";
+ this.strikethrough.Size = new System.Drawing.Size(23, 22);
+ this.strikethrough.Text = "S";
+ this.strikethrough.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // fonts
+ //
+ this.fonts.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.fonts.Name = "fonts";
+ this.fonts.Size = new System.Drawing.Size(121, 25);
+ this.fonts.SelectedIndexChanged += new System.EventHandler(this.fonts_SelectedIndexChanged);
+ //
+ // size
+ //
+ this.size.AutoSize = false;
+ this.size.MaxLength = 3;
+ this.size.Name = "size";
+ this.size.Size = new System.Drawing.Size(40, 25);
+ this.size.TextChanged += new System.EventHandler(this.size_Click);
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // left
+ //
+ this.left.CheckOnClick = true;
+ this.left.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.left.Image = ((System.Drawing.Image)(resources.GetObject("left.Image")));
+ this.left.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.left.Name = "left";
+ this.left.Size = new System.Drawing.Size(31, 22);
+ this.left.Text = "Left";
+ this.left.Click += new System.EventHandler(this.left_Click);
+ //
+ // center
+ //
+ this.center.CheckOnClick = true;
+ this.center.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.center.Image = ((System.Drawing.Image)(resources.GetObject("center.Image")));
+ this.center.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.center.Name = "center";
+ this.center.Size = new System.Drawing.Size(46, 22);
+ this.center.Text = "Center";
+ this.center.Click += new System.EventHandler(this.center_Click);
//
- // menuStrip3
+ // right
//
- this.menuStrip3.Location = new System.Drawing.Point(0, 30);
- this.menuStrip3.Name = "menuStrip3";
- this.menuStrip3.Size = new System.Drawing.Size(527, 24);
- this.menuStrip3.TabIndex = 3;
- this.menuStrip3.Text = "menuStrip3";
+ this.right.CheckOnClick = true;
+ this.right.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.right.Image = ((System.Drawing.Image)(resources.GetObject("right.Image")));
+ this.right.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.right.Name = "right";
+ this.right.Size = new System.Drawing.Size(39, 22);
+ this.right.Text = "Right";
+ this.right.Click += new System.EventHandler(this.right_Click);
//
// TriWrite
//
this.Controls.Add(this.txtcontents);
- this.Controls.Add(this.menuStrip3);
+ this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.menuStrip2);
this.Name = "TriWrite";
- this.Size = new System.Drawing.Size(527, 513);
+ this.Size = new System.Drawing.Size(652, 414);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.menuStrip2.ResumeLayout(false);
this.menuStrip2.PerformLayout();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -182,11 +318,22 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label txtbody;
private System.Windows.Forms.Label lbtitle;
- private System.Windows.Forms.TextBox txtcontents;
private System.Windows.Forms.MenuStrip menuStrip2;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
- private System.Windows.Forms.MenuStrip menuStrip3;
+ private System.Windows.Forms.RichTextBox txtcontents;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton bold;
+ private System.Windows.Forms.ToolStripButton italic;
+ private System.Windows.Forms.ToolStripButton underline;
+ private System.Windows.Forms.ToolStripButton strikethrough;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripComboBox fonts;
+ private System.Windows.Forms.ToolStripTextBox size;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripButton left;
+ private System.Windows.Forms.ToolStripButton center;
+ private System.Windows.Forms.ToolStripButton right;
}
}
diff --git a/ShiftOS.WinForms/Applications/TriWrite.cs b/ShiftOS.WinForms/Applications/TriWrite.cs
index 6fb814f..291aa30 100644
--- a/ShiftOS.WinForms/Applications/TriWrite.cs
+++ b/ShiftOS.WinForms/Applications/TriWrite.cs
@@ -13,7 +13,7 @@ using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
[WinOpen("triwrite")]
- [AppscapeEntry("TriWrite", "Part of the trilogy of office applications for enhancement of your system. TriWrite is easliy the best text editor out there for ShiftOS.", 1024, 750, null, "Office")]
+ [AppscapeEntry("TriWrite", "Part of the trilogy of office applications for enhancement of your system. TriWrite is easliy the best text editor out there for ShiftOS.", 1024, 750, "file_skimmer;textpad", "Office")]
[DefaultTitle("TriWrite")]
[Launcher("TriWrite", false, null, "Office")]
public partial class TriWrite : UserControl, IShiftOSWindow
@@ -21,7 +21,7 @@ namespace ShiftOS.WinForms.Applications
public TriWrite()
{
- InitializeComponent();
+ InitializeComponent(); //From the library of babel: "FIRST COMMIT FROM A MAC WOOOO TURIANS ARE COOL"
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)
@@ -32,35 +32,54 @@ namespace ShiftOS.WinForms.Applications
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
var txt = new List<string>();
- txt.Add(".txt");
+ txt.Add(".rtf");
- AppearanceManager.SetupDialog(new FileDialog(txt.ToArray(), FileOpenerStyle.Open, new Action<string>((file) => this.LoadFile(file))));
+ FileSkimmerBackend.GetFile(txt.ToArray(), FileOpenerStyle.Open, (path) => LoadFile(path));
}
public void LoadFile(string file)
{
- txtcontents.Text = Utils.ReadAllText(file);
+ txtcontents.Rtf = Utils.ReadAllText(file);
}
public void SaveFile(string file)
{
- Utils.WriteAllText(file, txtcontents.Text);
+ if (file.ToLower().EndsWith(".rtf"))
+ {
+ Utils.WriteAllText(file, txtcontents.Rtf);
+ }
+ else
+ {
+ Utils.WriteAllText(file, txtcontents.Text);
+ }
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
var txt = new List<string>();
+ txt.Add(".rtf");
txt.Add(".txt");
-
- AppearanceManager.SetupDialog(new FileDialog(txt.ToArray(), FileOpenerStyle.Save, new Action<string>((file) => this.SaveFile(file))));
+ FileSkimmerBackend.GetFile(txt.ToArray(), FileOpenerStyle.Save, (path) => SaveFile(path));
}
public void OnLoad()
{
+ UpdateUI();
}
public void OnSkinLoad()
{
+ ResetFonts();
+ }
+
+ public void ResetFonts()
+ {
+ fonts.Items.Clear();
+ foreach(var font in FontFamily.Families)
+ {
+ fonts.Items.Add(font.Name);
+ }
+ UpdateUI();
}
public bool OnUnload()
@@ -72,5 +91,92 @@ namespace ShiftOS.WinForms.Applications
{
}
+ public void UpdateUI()
+ {
+ bold.Checked = txtcontents.SelectionFont.Bold;
+ italic.Checked = txtcontents.SelectionFont.Italic;
+ underline.Checked = txtcontents.SelectionFont.Underline;
+ strikethrough.Checked = txtcontents.SelectionFont.Strikeout;
+ fonts.Text = txtcontents.SelectionFont.Name;
+ size.Text = txtcontents.SelectionFont.Size.ToString();
+ left.Checked = txtcontents.SelectionAlignment == HorizontalAlignment.Left;
+ center.Checked = txtcontents.SelectionAlignment == HorizontalAlignment.Center;
+ right.Checked = txtcontents.SelectionAlignment == HorizontalAlignment.Right;
+
+ }
+
+ private void txtcontents_SelectionChanged(object sender, EventArgs e)
+ {
+ UpdateUI();
+ }
+
+ public void SetFontStyle(bool bold, bool italic, bool underline, bool strikethrough)
+ {
+ FontStyle fs = FontStyle.Regular;
+ if (bold)
+ fs |= FontStyle.Bold;
+ if (italic)
+ fs |= FontStyle.Italic;
+ if (underline)
+ fs |= FontStyle.Underline;
+ if (strikethrough)
+ fs |= FontStyle.Strikeout;
+ txtcontents.SelectionFont = new Font(txtcontents.SelectionFont, fs);
+ UpdateUI();
+ }
+
+ private void bold_CheckedChanged(object sender, EventArgs e)
+ {
+ SetFontStyle(bold.Checked, italic.Checked, underline.Checked, strikethrough.Checked);
+ }
+
+ public void SetFontFamily(string family, float emSize)
+ {
+ var style = txtcontents.SelectionFont.Style;
+ var size = emSize;
+ txtcontents.SelectionFont = new Font(family, size, style);
+ UpdateUI();
+ }
+
+ private void fonts_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ SetFontFamily(fonts.Text, Convert.ToSingle(size.Text));
+ }
+
+ private void left_Click(object sender, EventArgs e)
+ {
+ txtcontents.SelectionAlignment = HorizontalAlignment.Left;
+ UpdateUI();
+ }
+
+ private void center_Click(object sender, EventArgs e)
+ {
+ txtcontents.SelectionAlignment = HorizontalAlignment.Center;
+ UpdateUI();
+
+ }
+
+ private void right_Click(object sender, EventArgs e)
+ {
+ txtcontents.SelectionAlignment = HorizontalAlignment.Right;
+ UpdateUI();
+
+ }
+
+ private void size_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ float s = Convert.ToSingle(size.Text);
+ if(s != txtcontents.SelectionFont.Size)
+ {
+ SetFontFamily(fonts.Text, s);
+ }
+ }
+ catch
+ {
+ UpdateUI();
+ }
+ }
}
} \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/TriWrite.resx b/ShiftOS.WinForms/Applications/TriWrite.resx
index 525a23c..a06716c 100644
--- a/ShiftOS.WinForms/Applications/TriWrite.resx
+++ b/ShiftOS.WinForms/Applications/TriWrite.resx
@@ -130,7 +130,113 @@ To add a contact, simply click "Add Contact", and to remove one, click "Remove".
<metadata name="menuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
- <metadata name="menuStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>247, 17</value>
</metadata>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="bold.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="italic.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="underline.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="strikethrough.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="left.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="center.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
+ <data name="right.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+</value>
+ </data>
</root> \ No newline at end of file
diff --git a/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs b/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs
index 0b23b8e..d30e2df 100644
--- a/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs
+++ b/ShiftOS.WinForms/Applications/UpdateManager.Designer.cs
@@ -64,12 +64,10 @@
//
this.pgdownload.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
- this.pgdownload.BlockSize = 5;
this.pgdownload.Location = new System.Drawing.Point(86, 4);
this.pgdownload.Maximum = 100;
this.pgdownload.Name = "pgdownload";
this.pgdownload.Size = new System.Drawing.Size(427, 23);
- this.pgdownload.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.pgdownload.TabIndex = 2;
this.pgdownload.Text = "Updating...";
this.pgdownload.Value = 0;
diff --git a/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs b/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs
index d915c31..1d93047 100644
--- a/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs
+++ b/ShiftOS.WinForms/Applications/VideoPlayer.Designer.cs
@@ -91,12 +91,10 @@
//
// pgplaytime
//
- this.pgplaytime.BlockSize = 5;
this.pgplaytime.Location = new System.Drawing.Point(46, 3);
this.pgplaytime.Maximum = 100;
this.pgplaytime.Name = "pgplaytime";
this.pgplaytime.Size = new System.Drawing.Size(749, 23);
- this.pgplaytime.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.pgplaytime.TabIndex = 1;
this.pgplaytime.Tag = "keepbg";
this.pgplaytime.Text = "shiftedProgressBar1";
diff --git a/ShiftOS.WinForms/Applications/WebBrowser.Designer.cs b/ShiftOS.WinForms/Applications/WebBrowser.Designer.cs
new file mode 100644
index 0000000..6b7ae83
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/WebBrowser.Designer.cs
@@ -0,0 +1,153 @@
+namespace ShiftOS.WinForms.Applications
+{
+ partial class WebBrowser
+ {
+ /// <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 Component 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.flcontrols = new System.Windows.Forms.FlowLayoutPanel();
+ this.btnback = new System.Windows.Forms.Button();
+ this.btnforward = new System.Windows.Forms.Button();
+ this.txturl = new System.Windows.Forms.TextBox();
+ this.btngo = new System.Windows.Forms.Button();
+ this.pnlcanvas = new System.Windows.Forms.Panel();
+ this.wbmain = new System.Windows.Forms.WebBrowser();
+ this.flcontrols.SuspendLayout();
+ this.pnlcanvas.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // flcontrols
+ //
+ this.flcontrols.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.flcontrols.Controls.Add(this.btnback);
+ this.flcontrols.Controls.Add(this.btnforward);
+ this.flcontrols.Controls.Add(this.txturl);
+ this.flcontrols.Controls.Add(this.btngo);
+ this.flcontrols.Dock = System.Windows.Forms.DockStyle.Top;
+ this.flcontrols.Location = new System.Drawing.Point(0, 0);
+ this.flcontrols.Name = "flcontrols";
+ this.flcontrols.Size = new System.Drawing.Size(539, 29);
+ this.flcontrols.TabIndex = 2;
+ //
+ // btnback
+ //
+ this.btnback.AutoSize = true;
+ this.btnback.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnback.Location = new System.Drawing.Point(3, 3);
+ this.btnback.Name = "btnback";
+ this.btnback.Size = new System.Drawing.Size(23, 23);
+ this.btnback.TabIndex = 0;
+ this.btnback.Text = "<";
+ this.btnback.UseVisualStyleBackColor = true;
+ this.btnback.Click += new System.EventHandler(this.btnback_Click);
+ //
+ // btnforward
+ //
+ this.btnforward.AutoSize = true;
+ this.btnforward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnforward.Location = new System.Drawing.Point(32, 3);
+ this.btnforward.Name = "btnforward";
+ this.btnforward.Size = new System.Drawing.Size(23, 23);
+ this.btnforward.TabIndex = 1;
+ this.btnforward.Text = ">";
+ this.btnforward.UseVisualStyleBackColor = true;
+ this.btnforward.Click += new System.EventHandler(this.btnforward_Click);
+ //
+ // txturl
+ //
+ this.txturl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txturl.Location = new System.Drawing.Point(61, 3);
+ this.txturl.Name = "txturl";
+ this.txturl.Size = new System.Drawing.Size(435, 20);
+ this.txturl.TabIndex = 2;
+ this.txturl.WordWrap = false;
+ this.txturl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txturl_KeyDown);
+ //
+ // btngo
+ //
+ this.btngo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.btngo.AutoSize = true;
+ this.btngo.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btngo.Location = new System.Drawing.Point(502, 3);
+ this.btngo.Name = "btngo";
+ this.btngo.Size = new System.Drawing.Size(31, 23);
+ this.btngo.TabIndex = 3;
+ this.btngo.Text = "Go";
+ this.btngo.UseVisualStyleBackColor = true;
+ this.btngo.Click += new System.EventHandler(this.btngo_Click);
+ //
+ // pnlcanvas
+ //
+ this.pnlcanvas.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlcanvas.Controls.Add(this.wbmain);
+ this.pnlcanvas.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlcanvas.Location = new System.Drawing.Point(0, 29);
+ this.pnlcanvas.Name = "pnlcanvas";
+ this.pnlcanvas.Size = new System.Drawing.Size(539, 374);
+ this.pnlcanvas.TabIndex = 3;
+ //
+ // wbmain
+ //
+ this.wbmain.AllowWebBrowserDrop = false;
+ this.wbmain.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.wbmain.IsWebBrowserContextMenuEnabled = false;
+ this.wbmain.Location = new System.Drawing.Point(0, 0);
+ this.wbmain.MinimumSize = new System.Drawing.Size(20, 20);
+ this.wbmain.Name = "wbmain";
+ this.wbmain.ScriptErrorsSuppressed = true;
+ this.wbmain.Size = new System.Drawing.Size(537, 372);
+ this.wbmain.TabIndex = 0;
+ this.wbmain.WebBrowserShortcutsEnabled = false;
+ this.wbmain.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.wbmain_Navigated);
+ this.wbmain.NewWindow += new System.ComponentModel.CancelEventHandler(this.wbmain_NewWindow);
+ //
+ // WebBrowser
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.pnlcanvas);
+ this.Controls.Add(this.flcontrols);
+ this.Name = "WebBrowser";
+ this.Size = new System.Drawing.Size(539, 403);
+ this.flcontrols.ResumeLayout(false);
+ this.flcontrols.PerformLayout();
+ this.pnlcanvas.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.FlowLayoutPanel flcontrols;
+ private System.Windows.Forms.Button btnback;
+ private System.Windows.Forms.Button btnforward;
+ private System.Windows.Forms.TextBox txturl;
+ private System.Windows.Forms.Button btngo;
+ private System.Windows.Forms.Panel pnlcanvas;
+ private System.Windows.Forms.WebBrowser wbmain;
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/WebBrowser.cs b/ShiftOS.WinForms/Applications/WebBrowser.cs
new file mode 100644
index 0000000..751e7e2
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/WebBrowser.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.Engine;
+
+namespace ShiftOS.WinForms.Applications
+{
+ [WinOpen("web_browser")]
+ [AppscapeEntry("Web Browser", "We're going surfing on the Internet! This application allows you to break the bounds of the Digital Society and connect to the outer Internet inside ShiftOS.",
+ 4096, 10000, "color_depth_24_bits", "Networking")]
+ [Launcher("Web Browser", false, null, "Networking")]
+ [DefaultTitle("Web Browser")]
+ [DefaultIcon("iconShiftnet")]
+ public partial class WebBrowser : UserControl, IShiftOSWindow
+ {
+ public WebBrowser()
+ {
+ InitializeComponent();
+ uiupdate = new Timer();
+ uiupdate.Tick += (o, a) =>
+ {
+ btnback.Location = new Point(2, 2);
+ btnforward.Location = new Point(btnback.Left + btnback.Width + 2, 2);
+ txturl.Location = new Point(btnforward.Left + btnforward.Width + 2, 2);
+ txturl.Width = flcontrols.Width - btnback.Width - 2 - btnforward.Width - 2 - (btngo.Width * 2) - 2;
+ btngo.Location = new Point(flcontrols.Width - btngo.Width - 2, 2);
+ btnback.Enabled = wbmain.CanGoBack;
+ btnforward.Enabled = wbmain.CanGoForward;
+ };
+ uiupdate.Interval = 100;
+ }
+
+ Timer uiupdate = null;
+
+ public void OnLoad()
+ {
+ uiupdate.Start();
+ wbmain.Url = new Uri("http://getshiftos.ml/");
+ }
+
+ public void OnSkinLoad()
+ {
+ }
+
+ public bool OnUnload()
+ {
+ uiupdate.Stop();
+ return true;
+ }
+
+ public void OnUpgrade()
+ {
+ }
+
+ private void btnback_Click(object sender, EventArgs e)
+ {
+ wbmain.GoBack();
+ }
+
+ private void btnforward_Click(object sender, EventArgs e)
+ {
+ wbmain.GoForward();
+ }
+
+ private void btngo_Click(object sender, EventArgs e)
+ {
+ wbmain.Navigate(txturl.Text);
+ }
+
+ private void wbmain_NewWindow(object sender, CancelEventArgs e)
+ {
+ e.Cancel = true;
+ if (Shiftorium.UpgradeInstalled("web_browser_new_window"))
+ {
+ AppearanceManager.SetupWindow(new WebBrowser());
+ }
+ }
+
+ private void txturl_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ btngo_Click(sender, EventArgs.Empty);
+ }
+
+ private void wbmain_Navigated(object sender, WebBrowserNavigatedEventArgs e)
+ {
+ txturl.Text = wbmain.Url.ToString();
+ AppearanceManager.SetWindowTitle(this, wbmain.DocumentTitle + " - " + NameChangerBackend.GetNameRaw(this.GetType()));
+ }
+ }
+}
diff --git a/ShiftOS.WinForms/Applications/WebBrowser.resx b/ShiftOS.WinForms/Applications/WebBrowser.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ShiftOS.WinForms/Applications/WebBrowser.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