From 1661f9a5bd46dbd7d2586787c55bfc407c027629 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 23 Jun 2017 20:20:38 -0400 Subject: hacking work Me: [squeaky] IT'S WORKING!! Phil: Michael... You just creeped me out... --- .../ShiftnetSites/ShiftOSOnline.Designer.cs | 89 +++++++++++++++ ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.cs | 105 +++++++++++++++++ ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.resx | 125 +++++++++++++++++++++ 3 files changed, 319 insertions(+) create mode 100644 ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.Designer.cs create mode 100644 ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.cs create mode 100644 ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.resx (limited to 'ShiftOS.WinForms/ShiftnetSites') diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.Designer.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.Designer.cs new file mode 100644 index 0000000..8c25ea8 --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.Designer.cs @@ -0,0 +1,89 @@ +namespace ShiftOS.WinForms.ShiftnetSites +{ + partial class ShiftOSOnline + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShiftOSOnline)); + this.lbtitle = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.btnsubscribe = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lbtitle + // + this.lbtitle.AutoSize = true; + this.lbtitle.Location = new System.Drawing.Point(242, 294); + this.lbtitle.Name = "lbtitle"; + this.lbtitle.Size = new System.Drawing.Size(76, 13); + this.lbtitle.TabIndex = 0; + this.lbtitle.Tag = "header1"; + this.lbtitle.Text = "ShiftOS Online"; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(42, 64); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(327, 137); + this.label1.TabIndex = 1; + this.label1.Text = resources.GetString("label1.Text"); + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // btnsubscribe + // + this.btnsubscribe.AutoSize = true; + this.btnsubscribe.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.btnsubscribe.Location = new System.Drawing.Point(45, 401); + this.btnsubscribe.Name = "btnsubscribe"; + this.btnsubscribe.Size = new System.Drawing.Size(96, 23); + this.btnsubscribe.TabIndex = 2; + this.btnsubscribe.Tag = "header3"; + this.btnsubscribe.Text = "Subscribe today!"; + this.btnsubscribe.UseVisualStyleBackColor = true; + this.btnsubscribe.Click += new System.EventHandler(this.btnsubscribe_Click); + // + // ShiftOSOnline + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.btnsubscribe); + this.Controls.Add(this.label1); + this.Controls.Add(this.lbtitle); + this.Name = "ShiftOSOnline"; + this.Size = new System.Drawing.Size(562, 469); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lbtitle; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnsubscribe; + } +} diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.cs b/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.cs new file mode 100644 index 0000000..7f6185e --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.cs @@ -0,0 +1,105 @@ +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 ShiftOS.WinForms.Tools; + +namespace ShiftOS.WinForms.ShiftnetSites +{ + [ShiftnetSite("shiftnet/sol/subscription", "ShiftOS Online", "SOL is the Shiftnet.")] + [ShiftnetFundamental] + public partial class ShiftOSOnline : UserControl, IShiftnetSite + { + public ShiftOSOnline() + { + InitializeComponent(); + } + + public event Action GoBack; + public event Action GoToUrl; + + public void OnSkinLoad() + { + Tools.ControlManager.SetupControls(this); + lbtitle.CenterParent(); + lbtitle.Top = 15; + label1.CenterParent(); + btnsubscribe.CenterParent(); + btnsubscribe.Top = (label1.Top + label1.Height) + 15; + } + + public void OnUpgrade() + { + + } + + public string SOL_YOUARESUBSCRIBED + { + get + { + return Localization.Parse("You're already subscribed! Unsubscribe here."); + } + } + + public string SOL_SUBSCRIBE + { + get + { + return Localization.Parse("Subscribe today!"); + } + } + + public void Setup() + { + if(SaveSystem.CurrentSave.ShiftnetSubscription == 3) + { + btnsubscribe.Text = SOL_YOUARESUBSCRIBED; + } + else + { + btnsubscribe.Text = SOL_SUBSCRIBE; + } + } + + private void btnsubscribe_Click(object sender, EventArgs e) + { + if(btnsubscribe.Text == SOL_YOUARESUBSCRIBED) + { + Infobox.PromptYesNo("Unsubscribe", "Are you sure you want to unsubscribe from ShiftOS Online?", (result) => + { + if (result == true) + { + SaveSystem.CurrentSave.ShiftnetSubscription = 0; + Setup(); + OnSkinLoad(); + } + }); + } + else + { + Infobox.PromptYesNo("Subscribe?", "Would you like to subscribe to ShiftOS Online to get 768 kb/s for 300 Codepoints?", (result) => + { + if(result == true) + { + if(SaveSystem.CurrentSave.Codepoints >= 300) + { + SaveSystem.CurrentSave.Codepoints -= 300; + SaveSystem.CurrentSave.ShiftnetSubscription = 3; + Infobox.Show("Subscribed.", "You have sent 300 Codepoints to ShiftOS Online and have successfully subscribed to their Shiftnet Service."); + } + else + { + Infobox.Show("Insufficient Codepoints", "You do not have enough Codepoints to complete this operation."); + } + } + }); + } + } + } +} diff --git a/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.resx b/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.resx new file mode 100644 index 0000000..e8c0c08 --- /dev/null +++ b/ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.resx @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + In need of a speedboost when browsing the Shiftnet? We'll be happy to provide. + +With our staggering 768 kilobytes per second connection speed, and one of the cheapest subscription costs in the entire Digital Society, ShiftOS Online is the perfect choice for anyone wanting to get the best bang for their buck. + + \ No newline at end of file -- cgit v1.2.3