From b2bd8eb462f222db64efbc729c6ce2cfb5b65d61 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 25 Feb 2017 20:28:58 -0500 Subject: Added custom wordlist feature to shiftletters --- .../Applications/ShiftLetters.Designer.cs | 33 ++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs index 4c56732..9e79181 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs @@ -56,19 +56,20 @@ namespace ShiftOS.WinForms.Applications this.tbguess = new System.Windows.Forms.TextBox(); this.lbllives = new System.Windows.Forms.Label(); this.btnrestart = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // // lblword // this.lblword.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.lblword.AutoSize = true; - this.lblword.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F); - this.lblword.Location = new System.Drawing.Point(116, 34); + this.lblword.Font = new System.Drawing.Font("Microsoft Sans Serif", 12.75F); + this.lblword.Location = new System.Drawing.Point(5, 41); this.lblword.Name = "lblword"; this.lblword.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.lblword.Size = new System.Drawing.Size(89, 22); + this.lblword.Size = new System.Drawing.Size(302, 22); this.lblword.TabIndex = 1; - this.lblword.Text = "Loading..."; + this.lblword.Text = "Choose a wordlist from the box below."; + this.lblword.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // tbguess // @@ -80,28 +81,37 @@ namespace ShiftOS.WinForms.Applications // // lbllives // - this.lbllives.AutoSize = true; - this.lbllives.Location = new System.Drawing.Point(127, 190); + this.lbllives.Anchor = System.Windows.Forms.AnchorStyles.None; + this.lbllives.Location = new System.Drawing.Point(9, 201); this.lbllives.Name = "lbllives"; - this.lbllives.Size = new System.Drawing.Size(69, 13); this.lbllives.TabIndex = 3; - this.lbllives.Text = "Still loading..."; + this.lbllives.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // btnrestart // - this.btnrestart.Location = new System.Drawing.Point(130, 148); + this.btnrestart.Location = new System.Drawing.Point(121, 148); this.btnrestart.Name = "btnrestart"; this.btnrestart.Size = new System.Drawing.Size(75, 23); this.btnrestart.TabIndex = 4; - this.btnrestart.Text = "Restart"; + this.btnrestart.Text = "Play"; this.btnrestart.UseVisualStyleBackColor = true; this.btnrestart.Visible = false; this.btnrestart.Click += new System.EventHandler(this.btnrestart_Click); // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Location = new System.Drawing.Point(99, 81); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(121, 21); + this.comboBox1.TabIndex = 5; + // // ShiftLetters // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.comboBox1); this.Controls.Add(this.btnrestart); this.Controls.Add(this.lbllives); this.Controls.Add(this.tbguess); @@ -118,5 +128,6 @@ namespace ShiftOS.WinForms.Applications private System.Windows.Forms.TextBox tbguess; private System.Windows.Forms.Label lbllives; private System.Windows.Forms.Button btnrestart; + private System.Windows.Forms.ComboBox comboBox1; } } -- cgit v1.2.3 From 8c679e4650b98890902fbbe0e7c348b02f9e6cf3 Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 25 Feb 2017 20:30:13 -0500 Subject: forgot this --- ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs index 9e79181..928ff82 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs @@ -84,7 +84,9 @@ namespace ShiftOS.WinForms.Applications this.lbllives.Anchor = System.Windows.Forms.AnchorStyles.None; this.lbllives.Location = new System.Drawing.Point(9, 201); this.lbllives.Name = "lbllives"; + this.lbllives.Size = new System.Drawing.Size(310, 13); this.lbllives.TabIndex = 3; + this.lbllives.Text = "To play, guess numbers and letters by typing in the box."; this.lbllives.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // btnrestart -- cgit v1.2.3 From ab8c5c6f467b9ae61c27cdfb1a68c2812cb7d78f Mon Sep 17 00:00:00 2001 From: lempamo Date: Sat, 25 Feb 2017 20:34:17 -0500 Subject: removed numbers --- ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs | 2 +- ShiftOS.WinForms/Applications/ShiftLetters.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs index 928ff82..48e77bf 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs @@ -86,7 +86,7 @@ namespace ShiftOS.WinForms.Applications this.lbllives.Name = "lbllives"; this.lbllives.Size = new System.Drawing.Size(310, 13); this.lbllives.TabIndex = 3; - this.lbllives.Text = "To play, guess numbers and letters by typing in the box."; + this.lbllives.Text = "To play, guess letters by typing in the box."; this.lbllives.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // btnrestart diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs index 4e02e3c..4514157 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs @@ -49,8 +49,8 @@ namespace ShiftOS.WinForms.Applications List shiftWordlist = new List { "shiftos", "devx", "artpad", "shifter", "pong", "shiftorium", "codepoints", "shiftletters", "shops", "mud", "notification", "namechanger", "skinning", "skinloader", "calculator", "fileskimmer", "lua", "shiftnet", "terminal", "textpad"}; - List contributorsWordlist = new List { "12padams", "carverh", "computelinux", "lempamo", - "wowmom98", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox"}; + List contributorsWordlist = new List { "philipadams", "carverh", "computelinux", "lempamo", + "wowmom", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox"}; public ShiftLetters() { -- cgit v1.2.3 From 8d72f2c4d4ac742f942262159b5195bb44875846 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 26 Feb 2017 10:11:58 -0500 Subject: shiftletters improvements --- .../Applications/ShiftLetters.Designer.cs | 2 + ShiftOS.WinForms/Applications/ShiftLetters.cs | 121 ++++++++++++++------- ShiftOS.WinForms/Resources/Shiftorium.txt | 6 + 3 files changed, 90 insertions(+), 39 deletions(-) (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs index 48e77bf..0692244 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs @@ -68,8 +68,10 @@ namespace ShiftOS.WinForms.Applications this.lblword.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblword.Size = new System.Drawing.Size(302, 22); this.lblword.TabIndex = 1; + this.lblword.Tag = "header3"; this.lblword.Text = "Choose a wordlist from the box below."; this.lblword.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.lblword.TextChanged += new System.EventHandler(this.lblword_TextChanged); // // tbguess // diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs index 7a3000a..e4adde2 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs @@ -52,6 +52,47 @@ namespace ShiftOS.WinForms.Applications List contributorsWordlist = new List { "philipadams", "carverh", "computelinux", "lempamo", "wowmom", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox"}; + List osWordlist = new List + { + "windows", + "longhorn", + "memphis", + "neptune", + "vista", + "visopsys", + "ubuntu", + "linux", + "arch", + "debian", + "redhat", + "fedora", + "opensuse", + "kubuntu", + "lubuntu", + "xubuntu", + "mythbuntu", + "ubuntumate", + "zorin", + "lindows", + "msdos", + "freedos", + "freebsd", + "netbsd", + "pcbsd", + "android", + "ios", + "macos", + "mint", + "mikeos", + "raspbian", + "cosmos", + "chicago", + "vienna", + "whistler", + "windowsxp", + "windowsforworkgroups" + }; + public ShiftLetters() { InitializeComponent(); @@ -67,50 +108,52 @@ namespace ShiftOS.WinForms.Applications lblword.Visible = true; btnrestart.Visible = false; - var wordlist = new List - { - "shiftos", - "devx", - "artpad", - "shifter", - "pong", - "shiftorium", - "codepoints", - "shiftletters", - "shops", - "mud", - "notification", - "namechanger", - "skinning", - "skinloader", - "calculator", - "fileskimmer", - "lua", - "shiftnet", - "terminal", - "textpad" - }; - foreach(var w in shiftWordlist) + bool isShiftOS = comboBox1.SelectedItem.ToString().ToLower() == "shiftos"; + bool isContributors = comboBox1.SelectedItem.ToString().ToLower() == "contributors"; + bool isOSes = comboBox1.SelectedItem.ToString().ToLower() == "operating systems"; + + + var wordlist = new List(); + if (isOSes) { - if (!wordlist.Contains(w.ToLower())) + foreach (var w in osWordlist) { - wordlist.Add(w.ToLower()); + if (!wordlist.Contains(w.ToLower())) + { + wordlist.Add(w.ToLower()); + } } } - foreach(var w in contributorsWordlist) + if (isShiftOS) { - if (!wordlist.Contains(w.ToLower())) + foreach (var w in shiftWordlist) { - wordlist.Add(w.ToLower()); + if (!wordlist.Contains(w.ToLower())) + { + wordlist.Add(w.ToLower()); + } } } - //This can diversify the amount of ShiftOS-related words in the game. - foreach(var upg in Shiftorium.GetDefaults()) + else if (isContributors) { - foreach(var w in upg.Name.Split(' ')) + foreach (var w in contributorsWordlist) { if (!wordlist.Contains(w.ToLower())) + { wordlist.Add(w.ToLower()); + } + } + } + if (isShiftOS) + { + //This can diversify the amount of ShiftOS-related words in the game. + foreach (var upg in Shiftorium.GetDefaults()) + { + foreach (var w in upg.Name.Split(' ')) + { + if (!wordlist.Contains(w.ToLower())) + wordlist.Add(w.ToLower()); + } } } word = wordlist[rng.Next(wordlist.Count)]; @@ -132,6 +175,7 @@ namespace ShiftOS.WinForms.Applications tbguess.Visible = false; comboBox1.Items.Add("ShiftOS"); if (ShiftoriumFrontend.UpgradeInstalled("sl_contributors_wordlist")) comboBox1.Items.Add("Contributors"); + if (Shiftorium.UpgradeInstalled("sl_operating_systems_wordlist")) comboBox1.Items.Add("Operating Systems"); btnrestart.Visible = true; } @@ -170,15 +214,9 @@ namespace ShiftOS.WinForms.Applications if (!lblword.Text.Contains("_")) { int oldlives = lives; - tbguess.Visible = false; - lives = 0; - lbllives.Visible = true; - btnrestart.Visible = true; - btnrestart.Text = "Restart"; - comboBox1.Visible = true; int cp = word.Length * oldlives; - lbllives.Text = "You earned: " + cp + " codepoints!"; SaveSystem.TransferCodepointsFrom("shiftletters", cp); + StartGame(); } } } @@ -211,5 +249,10 @@ namespace ShiftOS.WinForms.Applications } } + + private void lblword_TextChanged(object sender, EventArgs e) + { + lblword.Left = (this.Width - lblword.Width) / 2; + } } } diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt index 1945707..04cf6ac 100644 --- a/ShiftOS.WinForms/Resources/Shiftorium.txt +++ b/ShiftOS.WinForms/Resources/Shiftorium.txt @@ -6,6 +6,12 @@ Dependencies: "wm_free_placement;desktop", Description: "Crazy math problems getting you down? Well, this calculator will take care of that!" }, + { + Name: "SL Operating Systems Wordlist", + Cost: 500, + Dependencies: "shiftletters", + Description: "Know a lot about computer operating systems? This upgrade adds a wordlist to ShiftLetters, full of various Linux distros, Windows codenames and other OS names. All for the low price of 500 Codepoints! It's an incredible value but it's true! Upgrade today... except out of ShiftOS!" + }, { Name: "AL Calculator", Cost: 350, -- cgit v1.2.3