aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Applications/ShiftLetters.cs
diff options
context:
space:
mode:
authorlempamo <[email protected]>2017-02-25 20:28:58 -0500
committerlempamo <[email protected]>2017-02-25 20:28:58 -0500
commitb2bd8eb462f222db64efbc729c6ce2cfb5b65d61 (patch)
tree15fba5f2ad7a08e4f5b39918bb58f64984c4d594 /ShiftOS.WinForms/Applications/ShiftLetters.cs
parentf51200b5d763f11c151a01909aea7a400f267a86 (diff)
downloadshiftos_thereturn-b2bd8eb462f222db64efbc729c6ce2cfb5b65d61.tar.gz
shiftos_thereturn-b2bd8eb462f222db64efbc729c6ce2cfb5b65d61.tar.bz2
shiftos_thereturn-b2bd8eb462f222db64efbc729c6ce2cfb5b65d61.zip
Added custom wordlist feature to shiftletters
Diffstat (limited to 'ShiftOS.WinForms/Applications/ShiftLetters.cs')
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLetters.cs50
1 files changed, 25 insertions, 25 deletions
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs
index 0dd1505..4e02e3c 100644
--- a/ShiftOS.WinForms/Applications/ShiftLetters.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs
@@ -46,6 +46,11 @@ namespace ShiftOS.WinForms.Applications
string word = "";
static Random rng = new Random();
string guessedCharacters = "";
+ List<String> shiftWordlist = new List<string> { "shiftos", "devx", "artpad", "shifter", "pong",
+ "shiftorium", "codepoints", "shiftletters", "shops", "mud", "notification", "namechanger",
+ "skinning", "skinloader", "calculator", "fileskimmer", "lua", "shiftnet", "terminal", "textpad"};
+ List<String> contributorsWordlist = new List<string> { "12padams", "carverh", "computelinux", "lempamo",
+ "wowmom98", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox"};
public ShiftLetters()
{
@@ -56,34 +61,14 @@ namespace ShiftOS.WinForms.Applications
{
guessedCharacters = "";
lives = 7;
+ comboBox1.Visible = false;
tbguess.Visible = true;
lbllives.Visible = true;
lblword.Visible = true;
btnrestart.Visible = false;
- var wordlist = new List<string>
- {
- "shiftos",
- "devx",
- "artpad",
- "shifter",
- "pong",
- "shiftorium",
- "codepoints",
- "shiftletters",
- "shops",
- "mud",
- "notification",
- "namechanger",
- "skinning",
- "skinloader",
- "calculator",
- "fileskimmer",
- "lua",
- "shiftnet",
- "terminal",
- "textpad"
- };
- word = wordlist[rng.Next(wordlist.Count)];
+ if ((String)comboBox1.SelectedItem == "ShiftOS") word = shiftWordlist[rng.Next(shiftWordlist.Count)];
+ else if ((String)comboBox1.SelectedItem == "Contributors") word = contributorsWordlist[rng.Next(contributorsWordlist.Count)];
+ else throw new NullWordlistException(":P");
lbllives.Text = "You have 7 lives left!";
lblword.Text = "";
for (int i=0; i<word.Length; i++)
@@ -94,7 +79,10 @@ namespace ShiftOS.WinForms.Applications
public void OnLoad()
{
- StartGame();
+ tbguess.Visible = false;
+ comboBox1.Items.Add("ShiftOS");
+ if (ShiftoriumFrontend.UpgradeInstalled("sl_contributors_wordlist")) comboBox1.Items.Add("Contributors");
+ btnrestart.Visible = true;
}
public void OnUpgrade()
@@ -134,6 +122,8 @@ namespace ShiftOS.WinForms.Applications
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);
@@ -150,6 +140,8 @@ namespace ShiftOS.WinForms.Applications
tbguess.Visible = false;
lbllives.Visible = false;
btnrestart.Visible = true;
+ btnrestart.Text = "Restart";
+ comboBox1.Visible = true;
}
}
}
@@ -159,5 +151,13 @@ namespace ShiftOS.WinForms.Applications
{
StartGame();
}
+
+ private class NullWordlistException : Exception
+ {
+ public NullWordlistException(string message) : base("ShiftLetters tried to use a Null Wordlist.")
+ {
+
+ }
+ }
}
}