From 9533b7b98f87381632aabf914384d92832343a20 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 13 Feb 2017 16:50:13 -0500 Subject: [PATCH] Fuckton of client-side fixes --- .../Applications/Chat.Designer.cs | 25 ++-- ShiftOS.WinForms/Applications/Chat.cs | 6 + .../Applications/Discord.Designer.cs | 71 ----------- ShiftOS.WinForms/Applications/Discord.cs | 75 ----------- ShiftOS.WinForms/Applications/Discord.resx | 120 ------------------ .../Applications/MUDControlCentre.Designer.cs | 92 +++++++------- .../Applications/MUDControlCentre.cs | 7 +- .../Applications/MUDControlCentre.resx | 2 +- ShiftOS.WinForms/ShiftOS.WinForms.csproj | 9 -- 9 files changed, 72 insertions(+), 335 deletions(-) delete mode 100644 ShiftOS.WinForms/Applications/Discord.Designer.cs delete mode 100644 ShiftOS.WinForms/Applications/Discord.cs delete mode 100644 ShiftOS.WinForms/Applications/Discord.resx diff --git a/ShiftOS.WinForms/Applications/Chat.Designer.cs b/ShiftOS.WinForms/Applications/Chat.Designer.cs index f2c0a70..62c9b42 100644 --- a/ShiftOS.WinForms/Applications/Chat.Designer.cs +++ b/ShiftOS.WinForms/Applications/Chat.Designer.cs @@ -53,8 +53,8 @@ namespace ShiftOS.WinForms.Applications private void InitializeComponent() { this.panel1 = new System.Windows.Forms.Panel(); - this.txtuserinput = new System.Windows.Forms.TextBox(); this.rtbchat = new System.Windows.Forms.RichTextBox(); + this.txtuserinput = new System.Windows.Forms.TextBox(); this.panel1.SuspendLayout(); this.SuspendLayout(); // @@ -68,6 +68,18 @@ namespace ShiftOS.WinForms.Applications this.panel1.Size = new System.Drawing.Size(633, 318); this.panel1.TabIndex = 0; // + // rtbchat + // + this.rtbchat.Dock = System.Windows.Forms.DockStyle.Fill; + this.rtbchat.HideSelection = false; + this.rtbchat.Location = new System.Drawing.Point(0, 0); + this.rtbchat.Name = "rtbchat"; + this.rtbchat.Size = new System.Drawing.Size(633, 298); + this.rtbchat.TabIndex = 1; + this.rtbchat.Text = ""; + this.rtbchat.TextChanged += new System.EventHandler(this.rtbchat_TextChanged); + this.rtbchat.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown); + // // txtuserinput // this.txtuserinput.Dock = System.Windows.Forms.DockStyle.Bottom; @@ -77,23 +89,12 @@ namespace ShiftOS.WinForms.Applications this.txtuserinput.TabIndex = 0; this.txtuserinput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtuserinput_KeyDown); // - // rtbchat - // - this.rtbchat.Dock = System.Windows.Forms.DockStyle.Fill; - this.rtbchat.Location = new System.Drawing.Point(0, 0); - this.rtbchat.Name = "rtbchat"; - this.rtbchat.Size = new System.Drawing.Size(633, 298); - this.rtbchat.TabIndex = 1; - this.rtbchat.Text = ""; - this.rtbchat.KeyDown += new System.Windows.Forms.KeyEventHandler(this.richTextBox1_KeyDown); - // // Chat // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.panel1); this.Name = "Chat"; - this.Text = "{CHAT_NAME}"; this.Size = new System.Drawing.Size(633, 318); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); diff --git a/ShiftOS.WinForms/Applications/Chat.cs b/ShiftOS.WinForms/Applications/Chat.cs index 48b40de..da68fc6 100644 --- a/ShiftOS.WinForms/Applications/Chat.cs +++ b/ShiftOS.WinForms/Applications/Chat.cs @@ -114,5 +114,11 @@ namespace ShiftOS.WinForms.Applications txtuserinput.Text = ""; } } + + private void rtbchat_TextChanged(object sender, EventArgs e) + { + rtbchat.SelectionStart = rtbchat.Text.Length; + rtbchat.ScrollToCaret(); + } } } diff --git a/ShiftOS.WinForms/Applications/Discord.Designer.cs b/ShiftOS.WinForms/Applications/Discord.Designer.cs deleted file mode 100644 index 5b1c52d..0000000 --- a/ShiftOS.WinForms/Applications/Discord.Designer.cs +++ /dev/null @@ -1,71 +0,0 @@ -namespace ShiftOS.WinForms.Applications -{ - partial class Discord - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.button1 = new System.Windows.Forms.Button(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(162, 168); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(91, 23); - this.button1.TabIndex = 0; - this.button1.Text = "Send Message"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // textBox1 - // - this.textBox1.Location = new System.Drawing.Point(135, 93); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(146, 20); - this.textBox1.TabIndex = 1; - // - // Discord - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Black; - this.Controls.Add(this.textBox1); - this.Controls.Add(this.button1); - this.Name = "Discord"; - this.Size = new System.Drawing.Size(446, 271); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button button1; - private System.Windows.Forms.TextBox textBox1; - } -} diff --git a/ShiftOS.WinForms/Applications/Discord.cs b/ShiftOS.WinForms/Applications/Discord.cs deleted file mode 100644 index d6b33dd..0000000 --- a/ShiftOS.WinForms/Applications/Discord.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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. - */ - -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.Net; -using System.IO; -using ShiftOS.Engine; -using System.Windows.Forms; - -namespace ShiftOS.WinForms.Applications -{ - [Launcher("Discord", false, null, "Networking")] - public partial class Discord : UserControl, IShiftOSWindow - { - public void OnUpgrade() - { - } - - public void OnSkinLoad() - { - } - - public void OnLoad() - { - WebRequest joinRequest = WebRequest.Create("http://selfbot-areno.rhcloud.com/send/" + SaveSystem.CurrentSave.Username + " has connected!"); - joinRequest.GetResponse(); - } - - public bool OnUnload() - { - WebRequest leaveRequest = WebRequest.Create("http://selfbot-areno.rhcloud.com/send/" + SaveSystem.CurrentSave.Username + " has left!"); - leaveRequest.GetResponse(); - return true; - } - - public Discord() - { - InitializeComponent(); - } - - private void button1_Click(object sender, EventArgs e) - { - WebRequest sendMessageRequest = WebRequest.Create("http://selfbot-areno.rhcloud.com/send/[" + SaveSystem.CurrentSave.Username + "@" + SaveSystem.CurrentSave.SystemName + "]: " + this.textBox1.Text); - sendMessageRequest.GetResponse(); // It doesn't actually send the request until you use GetResponse() - } - } -} diff --git a/ShiftOS.WinForms/Applications/Discord.resx b/ShiftOS.WinForms/Applications/Discord.resx deleted file mode 100644 index 1af7de1..0000000 --- a/ShiftOS.WinForms/Applications/Discord.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs index b61991b..610e289 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.Designer.cs @@ -69,6 +69,8 @@ namespace ShiftOS.WinForms.Applications this.createLegionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.joinLegionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.myLegionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.chatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.joinAChatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.txtappstatus = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer(); @@ -100,8 +102,8 @@ namespace ShiftOS.WinForms.Applications this.btnedititem = new System.Windows.Forms.Button(); this.shop_all = new System.Windows.Forms.Panel(); this.flshoplist = new System.Windows.Forms.FlowLayoutPanel(); - this.label12 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); + this.lblistdesc = new System.Windows.Forms.Label(); + this.lblistname = new System.Windows.Forms.Label(); this.lgn_create = new System.Windows.Forms.Panel(); this.btncreate = new System.Windows.Forms.Button(); this.txtnewlegiondescription = new System.Windows.Forms.TextBox(); @@ -146,8 +148,6 @@ namespace ShiftOS.WinForms.Applications this.you_systemstatus = new System.Windows.Forms.Panel(); this.lblsysstatus = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); - this.chatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.joinAChatToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.toolStripContainer1.BottomToolStripPanel.SuspendLayout(); @@ -292,24 +292,39 @@ namespace ShiftOS.WinForms.Applications // createLegionToolStripMenuItem // this.createLegionToolStripMenuItem.Name = "createLegionToolStripMenuItem"; - this.createLegionToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.createLegionToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.createLegionToolStripMenuItem.Text = "Create Legion"; this.createLegionToolStripMenuItem.Click += new System.EventHandler(this.createLegionToolStripMenuItem_Click); // // joinLegionToolStripMenuItem // this.joinLegionToolStripMenuItem.Name = "joinLegionToolStripMenuItem"; - this.joinLegionToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.joinLegionToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.joinLegionToolStripMenuItem.Text = "Join Legion"; this.joinLegionToolStripMenuItem.Click += new System.EventHandler(this.joinLegionToolStripMenuItem_Click); // // myLegionToolStripMenuItem // this.myLegionToolStripMenuItem.Name = "myLegionToolStripMenuItem"; - this.myLegionToolStripMenuItem.Size = new System.Drawing.Size(147, 22); + this.myLegionToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.myLegionToolStripMenuItem.Text = "My Legion"; this.myLegionToolStripMenuItem.Click += new System.EventHandler(this.myLegionToolStripMenuItem_Click); // + // chatToolStripMenuItem + // + this.chatToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.joinAChatToolStripMenuItem}); + this.chatToolStripMenuItem.Name = "chatToolStripMenuItem"; + this.chatToolStripMenuItem.Size = new System.Drawing.Size(44, 20); + this.chatToolStripMenuItem.Text = "Chat"; + // + // joinAChatToolStripMenuItem + // + this.joinAChatToolStripMenuItem.Name = "joinAChatToolStripMenuItem"; + this.joinAChatToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.joinAChatToolStripMenuItem.Text = "Join a chat"; + this.joinAChatToolStripMenuItem.Click += new System.EventHandler(this.joinAChatToolStripMenuItem_Click); + // // statusStrip1 // this.statusStrip1.Dock = System.Windows.Forms.DockStyle.None; @@ -336,9 +351,9 @@ namespace ShiftOS.WinForms.Applications // // toolStripContainer1.ContentPanel // + this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_all); this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_view); this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_editor); - this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_all); this.toolStripContainer1.ContentPanel.Controls.Add(this.lgn_create); this.toolStripContainer1.ContentPanel.Controls.Add(this.job_current); this.toolStripContainer1.ContentPanel.Controls.Add(this.lgn_view); @@ -645,8 +660,8 @@ namespace ShiftOS.WinForms.Applications // shop_all // this.shop_all.Controls.Add(this.flshoplist); - this.shop_all.Controls.Add(this.label12); - this.shop_all.Controls.Add(this.label13); + this.shop_all.Controls.Add(this.lblistdesc); + this.shop_all.Controls.Add(this.lblistname); this.shop_all.Dock = System.Windows.Forms.DockStyle.Fill; this.shop_all.Location = new System.Drawing.Point(0, 0); this.shop_all.Name = "shop_all"; @@ -664,28 +679,28 @@ namespace ShiftOS.WinForms.Applications this.flshoplist.TabIndex = 1; this.flshoplist.WrapContents = false; // - // label12 + // lblistdesc // - this.label12.Dock = System.Windows.Forms.DockStyle.Top; - this.label12.Location = new System.Drawing.Point(0, 43); - this.label12.Name = "label12"; - this.label12.Padding = new System.Windows.Forms.Padding(15, 0, 15, 15); - this.label12.Size = new System.Drawing.Size(756, 51); - this.label12.TabIndex = 0; - this.label12.Tag = ""; - this.label12.Text = resources.GetString("label12.Text"); + this.lblistdesc.Dock = System.Windows.Forms.DockStyle.Top; + this.lblistdesc.Location = new System.Drawing.Point(0, 43); + this.lblistdesc.Name = "lblistdesc"; + this.lblistdesc.Padding = new System.Windows.Forms.Padding(15, 0, 15, 15); + this.lblistdesc.Size = new System.Drawing.Size(756, 51); + this.lblistdesc.TabIndex = 0; + this.lblistdesc.Tag = ""; + this.lblistdesc.Text = resources.GetString("lblistdesc.Text"); // - // label13 + // lblistname // - this.label13.AutoSize = true; - this.label13.Dock = System.Windows.Forms.DockStyle.Top; - this.label13.Location = new System.Drawing.Point(0, 0); - this.label13.Name = "label13"; - this.label13.Padding = new System.Windows.Forms.Padding(15); - this.label13.Size = new System.Drawing.Size(67, 43); - this.label13.TabIndex = 2; - this.label13.Tag = "header1"; - this.label13.Text = "Shops"; + this.lblistname.AutoSize = true; + this.lblistname.Dock = System.Windows.Forms.DockStyle.Top; + this.lblistname.Location = new System.Drawing.Point(0, 0); + this.lblistname.Name = "lblistname"; + this.lblistname.Padding = new System.Windows.Forms.Padding(15); + this.lblistname.Size = new System.Drawing.Size(67, 43); + this.lblistname.TabIndex = 2; + this.lblistname.Tag = "header1"; + this.lblistname.Text = "Shops"; // // lgn_create // @@ -1202,21 +1217,6 @@ namespace ShiftOS.WinForms.Applications this.label1.Tag = "header1"; this.label1.Text = "You"; // - // chatToolStripMenuItem - // - this.chatToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.joinAChatToolStripMenuItem}); - this.chatToolStripMenuItem.Name = "chatToolStripMenuItem"; - this.chatToolStripMenuItem.Size = new System.Drawing.Size(44, 20); - this.chatToolStripMenuItem.Text = "Chat"; - // - // joinAChatToolStripMenuItem - // - this.joinAChatToolStripMenuItem.Name = "joinAChatToolStripMenuItem"; - this.joinAChatToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.joinAChatToolStripMenuItem.Text = "Join a chat"; - this.joinAChatToolStripMenuItem.Click += new System.EventHandler(this.joinAChatToolStripMenuItem_Click); - // // MUDControlCentre // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1363,8 +1363,8 @@ namespace ShiftOS.WinForms.Applications private System.Windows.Forms.Label lbtaskdescription; private System.Windows.Forms.Panel shop_all; private System.Windows.Forms.FlowLayoutPanel flshoplist; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label lblistdesc; + private System.Windows.Forms.Label lblistname; private System.Windows.Forms.Panel shop_editor; private System.Windows.Forms.Panel panel7; private System.Windows.Forms.TextBox txtshopdescription; diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs index f2d5e77..c8289ab 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs @@ -182,6 +182,9 @@ namespace ShiftOS.WinForms.Applications flshoplist.Controls.Clear(); + lblistname.Text = "Chat"; + lblistdesc.Text = "Want to talk with other Shifters on the multi-user domain? Simply select a chatroom below and click 'Join' to join in!"; + foreach (var shop in channels) { var bnr = new Panel(); @@ -214,7 +217,7 @@ namespace ShiftOS.WinForms.Applications flButtons.Show(); var btn = new Button(); - btn.Text = "Browse"; + btn.Text = "Join"; btn.Click += (o, a) => { OpenChat(shop.ID); @@ -273,6 +276,8 @@ namespace ShiftOS.WinForms.Applications shop_all.BringToFront(); flshoplist.Controls.Clear(); + lblistname.Text = "Shops"; + lblistdesc.Text = "The multi-user domain is full of various shops ran by other users. They can contain anything from skins to applications to full system modifications. Just select a shop below to browse its contents!"; foreach (var shop in shops) { diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.resx b/ShiftOS.WinForms/Applications/MUDControlCentre.resx index 4c4f474..ce33ac5 100644 --- a/ShiftOS.WinForms/Applications/MUDControlCentre.resx +++ b/ShiftOS.WinForms/Applications/MUDControlCentre.resx @@ -123,7 +123,7 @@ 132, 17 - + The multi-user domain has many unique shops selling many items such as applications, skins and other things. Just choose a shop, browse for an item you'd like, then pay Codepoints and the download will begin. diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index a7b90d4..126f32f 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -88,12 +88,6 @@ Dialog.cs - - UserControl - - - Discord.cs - UserControl @@ -248,9 +242,6 @@ Dialog.cs - - Discord.cs - Downloader.cs