aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-27 16:59:54 -0400
committerMichael <[email protected]>2017-05-27 16:59:54 -0400
commite841b168e13e0bd699c0e0d19857167aa725f1ca (patch)
tree6d8754bbf66fcc52e80d4d0bf642d919c5a41aee
parentfde832b35763443afdc57dc8a5d82fb3bb25009b (diff)
downloadshiftos_thereturn-e841b168e13e0bd699c0e0d19857167aa725f1ca.tar.gz
shiftos_thereturn-e841b168e13e0bd699c0e0d19857167aa725f1ca.tar.bz2
shiftos_thereturn-e841b168e13e0bd699c0e0d19857167aa725f1ca.zip
stuff
-rw-r--r--ShiftOS.WinForms/Applications/Chat.cs1
-rw-r--r--ShiftOS.WinForms/Controls/TerminalBox.cs11
-rw-r--r--ShiftOS.WinForms/Stories/LegionStory.cs9
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs49
-rw-r--r--ShiftOS_TheReturn/AppearanceManager.cs2
5 files changed, 35 insertions, 37 deletions
diff --git a/ShiftOS.WinForms/Applications/Chat.cs b/ShiftOS.WinForms/Applications/Chat.cs
index e150b1a..f9e601f 100644
--- a/ShiftOS.WinForms/Applications/Chat.cs
+++ b/ShiftOS.WinForms/Applications/Chat.cs
@@ -186,6 +186,7 @@ namespace ShiftOS.WinForms.Applications
SendMessage(ch, ch, "A little birdie tells me you know about the RTS exploits going around... Try using that on Aiden's server. You can find his systemname on Appscape under \"Contact Us.\" He has a mailserver on Appscape - and also has RTS on the same server.");
Thread.Sleep(2500);
SendMessage(ch, ch, "Good luck... My life depends on you!");
+ complete = true;
});
t.IsBackground = true;
t.Start();
diff --git a/ShiftOS.WinForms/Controls/TerminalBox.cs b/ShiftOS.WinForms/Controls/TerminalBox.cs
index a6dd610..7658c8c 100644
--- a/ShiftOS.WinForms/Controls/TerminalBox.cs
+++ b/ShiftOS.WinForms/Controls/TerminalBox.cs
@@ -63,15 +63,12 @@ namespace ShiftOS.WinForms.Controls
public void Write(string text)
{
- Thread.Sleep(5);
- this.SuspendLayout();
this.HideSelection = true;
this.SelectionFont = ConstructFont();
this.SelectionColor = ControlManager.ConvertColor(ConsoleEx.ForegroundColor);
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);
this.AppendText(Localization.Parse(text));
this.HideSelection = false;
- this.ResumeLayout();
}
private Font ConstructFont()
@@ -89,8 +86,6 @@ namespace ShiftOS.WinForms.Controls
public void WriteLine(string text)
{
- Thread.Sleep(5);
- this.SuspendLayout();
Engine.AudioManager.PlayStream(Properties.Resources.writesound);
this.HideSelection = true;
this.Select(this.TextLength, 0);
@@ -99,11 +94,12 @@ namespace ShiftOS.WinForms.Controls
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);
this.AppendText(Localization.Parse(text) + Environment.NewLine);
this.HideSelection = false;
- this.ResumeLayout();
}
bool quickCopying = false;
+ bool busy = false;
+
protected override void OnMouseDown(MouseEventArgs e)
{
//if right-clicking, then we initiate a quick-copy.
@@ -255,8 +251,11 @@ namespace ShiftOS.WinForms.Controls
}
}
+ public string ThreadId = "";
+
public TerminalBox() : base()
{
+ ThreadId = Thread.CurrentThread.ManagedThreadId.ToString();
this.Tag = "keepbg keepfg keepfont";
}
}
diff --git a/ShiftOS.WinForms/Stories/LegionStory.cs b/ShiftOS.WinForms/Stories/LegionStory.cs
index 9b4966f..53d55fb 100644
--- a/ShiftOS.WinForms/Stories/LegionStory.cs
+++ b/ShiftOS.WinForms/Stories/LegionStory.cs
@@ -92,14 +92,7 @@ namespace ShiftOS.WinForms.Stories
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
ConsoleEx.Bold = false;
- foreach (var c in text)
- {
- Desktop.InvokeOnWorkerThread(() =>
- {
- Console.Write(c);
- });
- Thread.Sleep(75);
- }
+ Console.WriteLine(text);
Thread.Sleep(1000);
}
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 15ecb7a..6ce8cc9 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -188,14 +188,40 @@ namespace ShiftOS.WinForms
widget.OnSkinLoad();
}
+
SetupDesktop();
};
+
+ long lastcp = 0;
+
+ var storythread = new Thread(() =>
+ {
+ do
+ {
+ if (SaveSystem.CurrentSave != null)
+ {
+ if (SaveSystem.CurrentSave.Codepoints != lastcp)
+ lastcp = SaveSystem.CurrentSave.Codepoints;
+ if (lastcp >= 10000)
+ {
+ if (!Shiftorium.UpgradeInstalled("victortran_shiftnet"))
+ {
+ Story.Start("victortran_shiftnet");
+ }
+ }
+ }
+ } while (!SaveSystem.ShuttingDown);
+ });
+ storythread.IsBackground = true;
+ storythread.Start();
+
time.Tick += (o, a) =>
{
if (Shiftorium.IsInitiated == true)
{
- if (SaveSystem.CurrentSave != null && TutorialManager.IsInTutorial == false)
+ if (SaveSystem.CurrentSave != null)
{
+
lbtime.Text = Applications.Terminal.GetTime();
lbtime.Left = pnlnotifications.Width - lbtime.Width - LoadedSkin.DesktopPanelClockFromRight.X;
lbtime.Top = LoadedSkin.DesktopPanelClockFromRight.Y;
@@ -230,27 +256,6 @@ namespace ShiftOS.WinForms
};
time.Start();
- var ssThread = new Thread(() =>
- {
- while(this.Visible == true)
- {
- var mousePos = Cursor.Position;
- while(Cursor.Position == mousePos)
- {
- if(millisecondsUntilScreensaver <= 0)
- {
- ShowScreensaver();
- }
- millisecondsUntilScreensaver--;
- Thread.Sleep(1);
- }
- millisecondsUntilScreensaver = 300000;
- HideScreensaver();
- }
- });
- ssThread.IsBackground = true;
- ssThread.Start();
-
this.DoubleBuffered = true;
}
diff --git a/ShiftOS_TheReturn/AppearanceManager.cs b/ShiftOS_TheReturn/AppearanceManager.cs
index 81858d3..7cf06c9 100644
--- a/ShiftOS_TheReturn/AppearanceManager.cs
+++ b/ShiftOS_TheReturn/AppearanceManager.cs
@@ -190,7 +190,7 @@ namespace ShiftOS.Engine
ServerManager.Disconnect();
Desktop.InvokeOnWorkerThread(() =>
{
- Environment.Exit(0); //bye bye
+ Process.GetCurrentProcess().Kill(); //bye bye
});
}