aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
authorwowmom98 <[email protected]>2017-02-26 15:52:08 -0500
committerwowmom98 <[email protected]>2017-02-26 15:52:08 -0500
commitec61f5dfe9de92470cd91269c77713549e7d6159 (patch)
tree47faf338907cd5c57040556cff7e7a4bbd1547da /ShiftOS.WinForms
parent2809d9c76d47640e6ac076e7484801415eff625f (diff)
parent0e3362e8e3c635150d92fd5acc9d69473ec588fc (diff)
downloadshiftos_thereturn-ec61f5dfe9de92470cd91269c77713549e7d6159.tar.gz
shiftos_thereturn-ec61f5dfe9de92470cd91269c77713549e7d6159.tar.bz2
shiftos_thereturn-ec61f5dfe9de92470cd91269c77713549e7d6159.zip
Merge remote-tracking branch 'origin/master'
# Conflicts: # ShiftOS.WinForms/Resources/Shiftorium.txt
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/Applications/ColorPicker.cs1
-rw-r--r--ShiftOS.WinForms/Applications/MUDControlCentre.cs3
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs37
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLetters.cs151
-rw-r--r--ShiftOS.WinForms/Applications/Terminal.cs1
-rw-r--r--ShiftOS.WinForms/Oobe.cs8
-rw-r--r--ShiftOS.WinForms/Resources/Shiftorium.txt23
-rw-r--r--ShiftOS.WinForms/ShiftOS.WinForms.csproj6
-rw-r--r--ShiftOS.WinForms/Tools/ControlManager.cs5
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.Designer.cs1
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs34
11 files changed, 198 insertions, 72 deletions
diff --git a/ShiftOS.WinForms/Applications/ColorPicker.cs b/ShiftOS.WinForms/Applications/ColorPicker.cs
index a8c0b3f..bf35567 100644
--- a/ShiftOS.WinForms/Applications/ColorPicker.cs
+++ b/ShiftOS.WinForms/Applications/ColorPicker.cs
@@ -1049,7 +1049,6 @@ namespace ShiftOS.WinForms.Applications
case 1:
pnlpink1.BackColor = Color.HotPink;
pnlpink1.Show();
- break;
pnlpink1.BackColor = Color.DeepPink;
pnlpink1.Show();
pnlpink2.BackColor = Color.HotPink;
diff --git a/ShiftOS.WinForms/Applications/MUDControlCentre.cs b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
index 6426562..02fe868 100644
--- a/ShiftOS.WinForms/Applications/MUDControlCentre.cs
+++ b/ShiftOS.WinForms/Applications/MUDControlCentre.cs
@@ -243,8 +243,7 @@ namespace ShiftOS.WinForms.Applications
}
private Shop editingShop = null;
- private string editingShopOldName = "";
-
+
public void ShowCreateShop()
{
this.Invoke(new Action(() =>
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs
index 4c56732..0692244 100644
--- a/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLetters.Designer.cs
@@ -56,19 +56,22 @@ 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.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
//
@@ -80,28 +83,39 @@ 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.Size = new System.Drawing.Size(310, 13);
this.lbllives.TabIndex = 3;
- this.lbllives.Text = "Still loading...";
+ this.lbllives.Text = "To play, guess letters by typing in the box.";
+ 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 +132,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;
}
}
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs
index 2578669..32a1ed4 100644
--- a/ShiftOS.WinForms/Applications/ShiftLetters.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs
@@ -46,6 +46,52 @@ 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> { "philipadams", "carverh", "computelinux", "lempamo",
+ "wowmom", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox"};
+
+ List<string> osWordlist = new List<string>
+ {
+ "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()
{
@@ -56,40 +102,58 @@ 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>
+
+ 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<string>();
+ if (isOSes)
{
- "shiftos",
- "devx",
- "artpad",
- "shifter",
- "pong",
- "shiftorium",
- "codepoints",
- "shiftletters",
- "shops",
- "mud",
- "notification",
- "namechanger",
- "skinning",
- "skinloader",
- "calculator",
- "fileskimmer",
- "lua",
- "shiftnet",
- "terminal",
- "textpad"
- };
- //This can diversify the amount of ShiftOS-related words in the game.
- foreach(var upg in Shiftorium.GetDefaults())
+ foreach (var w in osWordlist)
+ {
+ if (!wordlist.Contains(w.ToLower()))
+ {
+ wordlist.Add(w.ToLower());
+ }
+ }
+ }
+ if (isShiftOS)
{
- foreach(var w in upg.Name.Split(' '))
+ foreach (var w in shiftWordlist)
{
if (!wordlist.Contains(w.ToLower()))
+ {
wordlist.Add(w.ToLower());
+ }
+ }
+ }
+ else if (isContributors)
+ {
+ 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)];
@@ -108,7 +172,12 @@ 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");
+ if (Shiftorium.UpgradeInstalled("sl_operating_systems_wordlist")) comboBox1.Items.Add("Operating Systems");
+ btnrestart.Visible = true;
+ lblword.Left = (this.Width - lblword.Width) / 2;
}
public void OnUpgrade()
@@ -123,7 +192,7 @@ namespace ShiftOS.WinForms.Applications
public void OnSkinLoad()
{
-
+ lblword.Left = (this.Width - lblword.Width) / 2;
}
string lastword = "";
@@ -146,13 +215,9 @@ namespace ShiftOS.WinForms.Applications
if (!lblword.Text.Contains("_"))
{
int oldlives = lives;
- tbguess.Visible = false;
- lives = 0;
- lbllives.Visible = true;
- btnrestart.Visible = true;
int cp = word.Length * oldlives;
- lbllives.Text = "You earned: " + cp + " codepoints!";
SaveSystem.TransferCodepointsFrom("shiftletters", cp);
+ StartGame();
}
}
}
@@ -160,12 +225,19 @@ namespace ShiftOS.WinForms.Applications
{
guessedCharacters = guessedCharacters + charGuessed;
lives--;
- lbllives.Text = "You have: " + lives + " lives left!";
+ if (lives == 1)
+ {
+ lbllives.Text = "You have 1 life left! Be careful...";
+ } else {
+ lbllives.Text = "You have " + lives + " lives left!";
+ }
if (lives == 0)
{
tbguess.Visible = false;
lbllives.Visible = false;
btnrestart.Visible = true;
+ btnrestart.Text = "Restart";
+ comboBox1.Visible = true;
}
}
}
@@ -175,5 +247,18 @@ namespace ShiftOS.WinForms.Applications
{
StartGame();
}
+
+ private class NullWordlistException : Exception
+ {
+ public NullWordlistException(string message) : base("ShiftLetters tried to use a Null Wordlist.")
+ {
+
+ }
+ }
+
+ private void lblword_TextChanged(object sender, EventArgs e)
+ {
+ lblword.Left = (this.Width - lblword.Width) / 2;
+ }
}
}
diff --git a/ShiftOS.WinForms/Applications/Terminal.cs b/ShiftOS.WinForms/Applications/Terminal.cs
index ff3569b..7bab213 100644
--- a/ShiftOS.WinForms/Applications/Terminal.cs
+++ b/ShiftOS.WinForms/Applications/Terminal.cs
@@ -187,7 +187,6 @@ namespace ShiftOS.WinForms.Applications
public static event TextSentEventHandler TextSent;
- public event EventHandler OnComplete;
public void ResetAllKeywords()
{
diff --git a/ShiftOS.WinForms/Oobe.cs b/ShiftOS.WinForms/Oobe.cs
index aa37792..7370396 100644
--- a/ShiftOS.WinForms/Oobe.cs
+++ b/ShiftOS.WinForms/Oobe.cs
@@ -54,15 +54,10 @@ namespace ShiftOS.WinForms
string rtext;
string gtexttotype;
int charcount;
- int currentletter;
int slashcount;
- int conversationcount = 0;
Label textgeninput;
- bool needtoclose = false;
public bool upgraded = false;
- int hackeffect;
- int percentcount;
-
+
private bool typing = false;
public void TextType(string texttotype)
@@ -74,7 +69,6 @@ namespace ShiftOS.WinForms
charcount = texttotype.Length;
gtexttotype = texttotype;
- currentletter = 0;
slashcount = 1;
foreach (var c in gtexttotype)
{
diff --git a/ShiftOS.WinForms/Resources/Shiftorium.txt b/ShiftOS.WinForms/Resources/Shiftorium.txt
index 3833d75..3a73a01 100644
--- a/ShiftOS.WinForms/Resources/Shiftorium.txt
+++ b/ShiftOS.WinForms/Resources/Shiftorium.txt
@@ -7,6 +7,12 @@
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: 150,
Dependencies: "calculator;app_launcher",
@@ -72,6 +78,8 @@
Dependencies: "app_launcher",
Description: "Want to open the Notifications application from within the App Launcher? This upgrade is for you."
},
+
+ // SHIFTLETTERS AND WORDLISTS
{
Name: "ShiftLetters",
Cost: 150,
@@ -85,6 +93,12 @@
Description: "This upgrade allows you to find ShiftLetters in your App Launcher."
},
{
+ Name: "SL Contributors Wordlist",
+ Cost: 250,
+ Dependencies: "shiftletters",
+ Description: "This nice wordlist lets you find out the people who contributed to the development of ShiftOS!"
+ },
+ {
Name: "Panel Notifications",
Cost: 150,
Description: "It's good to know what time it is, but how about knowing how many notifications you have? After all, notifications are a great way to tell what's going on! This upgrade adds a button that displays how many notifications you have. If you click it, you will open the Notifications app!",
@@ -95,6 +109,9 @@
Cost: 80,
Description: "Want to adjust the volume of ShiftOS's audio? This upgrade will let you."
},
+
+ // COLOR DEPTH AND DITHERING
+
{
Name: "Color Depth Dithering",
Cost: 1000,
@@ -435,13 +452,13 @@
Dependencies: "mud_fundamentals;window_manager;pong_upgrade"
},
{
- Name: "WAV Player",
- Cost: 6000,
+ Name: "Audio Player",
+ Cost: 10000,
Description: "Want to listen to the greatest tunes? Well get this app asap!",
Dependencies: "desktop;wm_free_placement"
},
{
- Name: "WAV Player AL",
+ Name: "Audio Player AL",
Cost: 150,
Description: "Just another app launcher, making it easier to listen to your favorite songs!",
Dependencies: "desktop;wm_free_placement;wav_player"
diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
index be83036..e458704 100644
--- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj
+++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj
@@ -70,6 +70,12 @@
<Compile Include="Applications\Artpad.Designer.cs">
<DependentUpon>Artpad.cs</DependentUpon>
</Compile>
+ <Compile Include="Applications\AudioPlayer.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Applications\AudioPlayer.Designer.cs">
+ <DependentUpon>AudioPlayer.cs</DependentUpon>
+ </Compile>
<Compile Include="Applications\Calculator.cs">
<SubType>UserControl</SubType>
</Compile>
diff --git a/ShiftOS.WinForms/Tools/ControlManager.cs b/ShiftOS.WinForms/Tools/ControlManager.cs
index 32f0217..5cc4813 100644
--- a/ShiftOS.WinForms/Tools/ControlManager.cs
+++ b/ShiftOS.WinForms/Tools/ControlManager.cs
@@ -194,10 +194,7 @@ namespace ShiftOS.WinForms.Tools
}
}
- Image dithered = null;
-
-
- ctrl.ForeColor = SkinEngine.LoadedSkin.ControlTextColor;
+ ctrl.ForeColor = SkinEngine.LoadedSkin.ControlTextColor;
ctrl.Font = SkinEngine.LoadedSkin.MainFont;
diff --git a/ShiftOS.WinForms/WinformsDesktop.Designer.cs b/ShiftOS.WinForms/WinformsDesktop.Designer.cs
index 0585199..aef7296 100644
--- a/ShiftOS.WinForms/WinformsDesktop.Designer.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.Designer.cs
@@ -76,6 +76,7 @@ namespace ShiftOS.WinForms
this.desktoppanel.Name = "desktoppanel";
this.desktoppanel.Size = new System.Drawing.Size(1296, 24);
this.desktoppanel.TabIndex = 0;
+ this.desktoppanel.Paint += new System.Windows.Forms.PaintEventHandler(this.desktoppanel_Paint);
//
// btnnotifications
//
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 45730c4..899eb0d 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -49,11 +49,6 @@ namespace ShiftOS.WinForms
public partial class WinformsDesktop : Form, IDesktop
{
/// <summary>
- /// Occurs when window added.
- /// </summary>
- private static event Action<WindowBorder> windowAdded;
-
- /// <summary>
/// Initializes a new instance of the <see cref="ShiftOS.WinForms.WinformsDesktop"/> class.
/// </summary>
public WinformsDesktop()
@@ -274,14 +269,29 @@ namespace ShiftOS.WinForms
this.BackgroundImage = img;
}));
this.BackgroundImageLayout = GetImageLayout("desktopbackground");
- desktoppanel.BackgroundImage = ((Bitmap)GetImage("desktoppanel"));
+ desktoppanel.BackColor = LoadedSkin.DesktopPanelColor;
+
+ var pnlimg = GetImage("desktoppanel");
+ if (pnlimg != null)
+ {
+ var bmp = new Bitmap(pnlimg);
+ bmp.MakeTransparent(Color.FromArgb(1, 0, 1));
+ pnlimg = bmp;
+ }
+
+ desktoppanel.BackgroundImage = pnlimg;
if (desktoppanel.BackgroundImage != null)
{
- ((Bitmap)desktoppanel.BackgroundImage).MakeTransparent(Color.FromArgb(1, 0, 1));
desktoppanel.BackColor = Color.Transparent;
}
- menuStrip1.BackgroundImage = GetImage("applauncher");
- if (menuStrip1.BackgroundImage != null) ((Bitmap)menuStrip1.BackgroundImage).MakeTransparent(Color.FromArgb(1, 0, 1));
+ var appimg = GetImage("applauncher");
+ if (appimg != null)
+ {
+ var bmp = new Bitmap(appimg);
+ bmp.MakeTransparent(Color.FromArgb(1, 0, 1));
+ appimg = bmp;
+ }
+ menuStrip1.BackgroundImage = appimg;
lbtime.ForeColor = LoadedSkin.DesktopPanelClockColor;
lbtime.Font = LoadedSkin.DesktopPanelClockFont;
if (desktoppanel.BackgroundImage == null)
@@ -297,7 +307,6 @@ namespace ShiftOS.WinForms
sysmenuholder.Size = LoadedSkin.AppLauncherHolderSize;
apps.Size = sysmenuholder.Size;
menuStrip1.Renderer = new ShiftOSMenuRenderer(new AppLauncherColorTable());
- desktoppanel.BackColor = LoadedSkin.DesktopPanelColor;
desktoppanel.BackgroundImageLayout = GetImageLayout("desktoppanel");
desktoppanel.Height = LoadedSkin.DesktopPanelHeight;
if (LoadedSkin.DesktopPanelPosition == 1)
@@ -562,6 +571,11 @@ namespace ShiftOS.WinForms
{
AppearanceManager.SetupWindow(new Applications.Notifications());
}
+
+ private void desktoppanel_Paint(object sender, PaintEventArgs e)
+ {
+ e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
+ }
}
[ShiftOS.Engine.Scripting.Exposed("desktop")]