diff options
| author | william341 <[email protected]> | 2017-06-29 13:13:45 -0700 |
|---|---|---|
| committer | william341 <[email protected]> | 2017-06-29 13:13:45 -0700 |
| commit | ad387c41e7d6cc547431e88695d4723ea2dba913 (patch) | |
| tree | a68282dda40c4f0b28883241c7adcf9010f4550e /ShiftOS.WinForms/ShiftnetSites | |
| parent | b4b19e7a4d203b58537f5b98214296ab52c49b2d (diff) | |
| parent | 5bebd4411bc6266cbee482a429ba794eefa8f9b6 (diff) | |
| download | shiftos_thereturn-ad387c41e7d6cc547431e88695d4723ea2dba913.tar.gz shiftos_thereturn-ad387c41e7d6cc547431e88695d4723ea2dba913.tar.bz2 shiftos_thereturn-ad387c41e7d6cc547431e88695d4723ea2dba913.zip | |
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS.WinForms/ShiftnetSites')
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs | 12 | ||||
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.Designer.cs | 89 | ||||
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.cs | 105 | ||||
| -rw-r--r-- | ShiftOS.WinForms/ShiftnetSites/ShiftOSOnline.resx | 125 |
4 files changed, 325 insertions, 6 deletions
diff --git a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs index c9b6f64..d14f1fa 100644 --- a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs +++ b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs @@ -48,8 +48,8 @@ namespace ShiftOS.WinForms.ShiftnetSites if (upgrades.Count() > 0) foreach (var upg in upgrades) { - if (!cats.Contains(upg.Category)) - cats.Add(upg.Category); + if (!cats.Contains(Localization.Parse(upg.Category))) + cats.Add(Localization.Parse(upg.Category)); } } catch { } @@ -63,9 +63,9 @@ namespace ShiftOS.WinForms.ShiftnetSites pnlappslist.Controls.Clear(); pnlappslist.Show(); pnlappslist.BringToFront(); - Category = cat; + Category = Localization.Parse(cat); var upgrades = GetAllInCategory(); - lbtitle.Text = cat; + lbtitle.Text = Localization.Parse(cat); if(upgrades.Length == 0) { var err = new Label(); @@ -282,7 +282,7 @@ namespace ShiftOS.WinForms.ShiftnetSites if (Category == "All") return upgrades.ToArray(); else - return upgrades.Where(x => x.Category == Category).ToArray(); + return upgrades.Where(x => Localization.Parse(x.Category) == Localization.Parse(Category)).ToArray(); } public void Setup() @@ -360,7 +360,7 @@ namespace ShiftOS.WinForms /// </summary> public class AppscapeEntryAttribute : RequiresUpgradeAttribute { - public AppscapeEntryAttribute(string name, string description, int downloadSize, ulong cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_')) + public AppscapeEntryAttribute(string id, string name, string description, int downloadSize, ulong cost, string dependencies = "", string category = "Misc") : base(id) { Name = name; Description = description; 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 + { + /// <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() + { + 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<string> 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 @@ +<?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> + <data name="label1.Text" xml:space="preserve"> + <value>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.</value> + </data> +</root>
\ No newline at end of file |
