aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-07-24 21:09:48 -0400
committerMichael <[email protected]>2017-07-24 21:09:48 -0400
commit2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84 (patch)
tree257a13c3c1ff5752d872a6da5292ab7f551f7699
parent5ab60d77068edce177841e94b8260e1a40231730 (diff)
downloadshiftos_thereturn-2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84.tar.gz
shiftos_thereturn-2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84.tar.bz2
shiftos_thereturn-2cd1452ff1dd9813cedb15ee18bf9a84e0baaf84.zip
Fucking fuckrape the motherfucking winforms proj
-rw-r--r--ModLauncher/ModLauncher.csproj4
-rw-r--r--ShiftOS.Frontend/Apps/Terminal.cs19
-rw-r--r--ShiftOS.Frontend/Infobox.cs10
-rw-r--r--ShiftOS.Frontend/MonoGameOOBE.cs150
-rw-r--r--ShiftOS.Frontend/ShiftOS.Frontend.csproj1
-rw-r--r--ShiftOS.Frontend/ShiftOS.cs3
-rw-r--r--ShiftOS.Modding.VB.LegacySkinConverter/ShiftOS.Modding.VB.LegacySkinConverter.vbproj4
-rw-r--r--ShiftOS.Modding.VirtualMachine/ShiftOS.Modding.VirtualMachine.csproj4
-rw-r--r--ShiftOS.Updater/ShiftOS.Updater.csproj6
-rw-r--r--ShiftOS_TheReturn.sln6
10 files changed, 178 insertions, 29 deletions
diff --git a/ModLauncher/ModLauncher.csproj b/ModLauncher/ModLauncher.csproj
index 7021bfe..260fba1 100644
--- a/ModLauncher/ModLauncher.csproj
+++ b/ModLauncher/ModLauncher.csproj
@@ -79,10 +79,6 @@
<Project>{ff0b1831-ac9f-4093-9747-ddae4467516a}</Project>
<Name>ShiftOS.Modding.VirtualMachine</Name>
</ProjectReference>
- <ProjectReference Include="..\ShiftOS.WinForms\ShiftOS.WinForms.csproj">
- <Project>{2295d2e2-3a00-4e02-b66f-b961ac329fe6}</Project>
- <Name>ShiftOS.WinForms</Name>
- </ProjectReference>
<ProjectReference Include="..\ShiftOS_TheReturn\ShiftOS.Engine.csproj">
<Project>{7C979B07-0585-4033-A110-E5555B9D6651}</Project>
<Name>ShiftOS.Engine</Name>
diff --git a/ShiftOS.Frontend/Apps/Terminal.cs b/ShiftOS.Frontend/Apps/Terminal.cs
index aea246e..b425063 100644
--- a/ShiftOS.Frontend/Apps/Terminal.cs
+++ b/ShiftOS.Frontend/Apps/Terminal.cs
@@ -152,6 +152,8 @@ namespace ShiftOS.Frontend.Apps
Invalidate();
}
+ public bool ReadOnly = false;
+
/// <summary>
/// Gets the X and Y coordinates (in pixels) of the caret.
/// </summary>
@@ -194,8 +196,17 @@ namespace ShiftOS.Frontend.Apps
protected override void OnKeyEvent(KeyEvent a)
{
- if (a.Key == Keys.Enter)
+ if (a.Key == Keys.Enter && !ReadOnly)
{
+ if (!PerformTerminalBehaviours)
+ {
+ Text = Text.Insert(Index, Environment.NewLine);
+ Index+=2;
+ RecalculateLayout();
+ Invalidate();
+ return;
+ }
+
try
{
if (!TerminalBackend.PrefixEnabled)
@@ -249,7 +260,7 @@ namespace ShiftOS.Frontend.Apps
}
}
- else if (a.Key == Keys.Back)
+ else if (a.Key == Keys.Back && !ReadOnly)
{
try
{
@@ -320,7 +331,7 @@ namespace ShiftOS.Frontend.Apps
}
else
{
- if (TerminalBackend.InStory)
+ if ((PerformTerminalBehaviours && TerminalBackend.InStory) || ReadOnly)
{
return;
}
@@ -428,7 +439,7 @@ namespace ShiftOS.Frontend.Apps
var measure = gfx.MeasureString(s, font, width, textformat);
if (string.IsNullOrEmpty(s))
measure.Width = 0;
- return new SizeF((float)Math.Ceiling(measure.Width), (float)Math.Ceiling(measure.Height));
+ return new SizeF((float)Math.Ceiling(Math.Max(1,measure.Width)), (float)Math.Ceiling(Math.Max(1,measure.Height)));
}
public static SizeF SmartMeasureString(this Graphics gfx, string s, Font font)
diff --git a/ShiftOS.Frontend/Infobox.cs b/ShiftOS.Frontend/Infobox.cs
index 21b5538..cc10f0e 100644
--- a/ShiftOS.Frontend/Infobox.cs
+++ b/ShiftOS.Frontend/Infobox.cs
@@ -91,6 +91,7 @@ namespace ShiftOS.Frontend
callback?.Invoke(txtinput.Text);
AppearanceManager.Close(this);
};
+ txtinput.BringToFront();
}
public void OnSkinLoad()
@@ -176,6 +177,7 @@ namespace ShiftOS.Frontend
this.Width = 341;
this.Height = 157;
this.AddControl(pbicon);
+ this.AddControl(txtinput);
this.AddControl(btnok);
this.AddControl(flyesno);
this.AddControl(lbmessage);
@@ -187,6 +189,14 @@ namespace ShiftOS.Frontend
{
btnok.Y = this.Height - btnok.Height - 10;
flyesno.Y = this.Height - flyesno.Height - 10;
+ txtinput.Width = lbmessage.Width;
+ txtinput.X = lbmessage.X;
+ txtinput.Y = btnok.Y - txtinput.Height - 2;
+ if (txtinput.Visible)
+ {
+ lbmessage.Height = (txtinput.Y - lbmessage.Y) - 2;
+ }
+
}
catch { }
}
diff --git a/ShiftOS.Frontend/MonoGameOOBE.cs b/ShiftOS.Frontend/MonoGameOOBE.cs
new file mode 100644
index 0000000..4e6705d
--- /dev/null
+++ b/ShiftOS.Frontend/MonoGameOOBE.cs
@@ -0,0 +1,150 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using ShiftOS.Engine;
+using ShiftOS.Objects;
+
+namespace ShiftOS.Frontend
+{
+ public class MonoGameOOBE : IOobe
+ {
+ public void PromptForLogin()
+ {
+ throw new NotImplementedException();
+ }
+
+ public void ShowSaveTransfer(Save save)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void SlowWriteLine(string text)
+ {
+ if (!string.IsNullOrWhiteSpace(Console.Text))
+ Console.WriteLine("");
+
+ for (int i = 0; i < text.Length; i++)
+ {
+ System.Threading.Thread.Sleep(50);
+ Console.Write(text[i].ToString());
+ }
+ }
+
+ private Apps.TerminalControl Console = null;
+
+ public void StartShowing(Save save)
+ {
+ TerminalBackend.InStory = true;
+ TerminalBackend.PrefixEnabled = false;
+
+ var term = new Apps.TerminalControl();
+ GraphicsSubsystem.UIManager.AddTopLevel(term);
+ term.Width = GraphicsSubsystem.UIManager.Viewport.Width;
+ term.Height = GraphicsSubsystem.UIManager.Viewport.Height;
+ term.X = 0;
+ term.Y = 0;
+ AppearanceManager.ConsoleOut = term;
+ AppearanceManager.StartConsoleOut();
+ Console = term;
+
+ var t = new System.Threading.Thread(() =>
+ {
+ SlowWriteLine("Michael VanOverbeek presents...");
+ Thread.Sleep(2000);
+ SlowWriteLine("A Philip Adams game...");
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"It's not often technology becomes out of mankind's league, out of its
+control. I mean, we are the creators of technology, we are the ones with the ideas,
+innovations, and skill. It just does what we tell it to, right?");
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"Such a naive being you are to think that, after all,
+you have no idea where you are... what's going on... who I am.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"To you, I'm just text. Something you understand. Words...
+paragraphs... ideas... the very things that caused and became technology.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"""Where am I? What the hell's going on!?"" I hear you ask.
+Such important questions, but please adjust your emotional and
+mental state. This is not your concern.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"My name is DevX. What is yours?");
+
+ bool nameChosen = false;
+ Engine.Infobox.PromptText("What is your name?", "Please enter your name in the box below, then hit 'OK'.", (name) =>
+ {
+ nameChosen = true;
+ save.Username = name;
+ });
+
+ while (nameChosen == false)
+ Thread.Sleep(10);
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine($@"Hello there, {save.Username}. Nice to meet you.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"Welcome to my Digital Society.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"I can't and won't tell you what happened to you, but I'm going to tell you
+what you're going to be doing for me... with me.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"But it's not time for that. First, you must be trained.
+I'm installing the Digital Society's gateway operating system onto your sentience.
+It's called ShiftOS.");
+
+ Thread.Sleep(2000);
+
+ SlowWriteLine("");
+ SlowWriteLine(@"When the system is installed, I'll contact you. DevX out.");
+
+ Thread.Sleep(5000);
+
+ GraphicsSubsystem.UIManager.StopHandling(term);
+ while(AppearanceManager.OpenForms.Count > 0)
+ {
+ AppearanceManager.OpenForms[0].Close();
+ AppearanceManager.OpenForms.RemoveAt(0);
+ }
+
+ GUI.TextControl _shiftos = new GUI.TextControl();
+ GraphicsSubsystem.UIManager.AddTopLevel(_shiftos);
+ term.Clear();
+ _shiftos.AutoSize = true;
+ _shiftos.Font = SkinEngine.LoadedSkin.HeaderFont;
+ _shiftos.Text = "ShiftOS";
+ _shiftos.Y = GraphicsSubsystem.UIManager.Viewport.Height / 3;
+ _shiftos.Layout(new Microsoft.Xna.Framework.GameTime());
+ _shiftos.X = (GraphicsSubsystem.UIManager.Viewport.Width - _shiftos.Width) / 2;
+
+
+ });
+ t.Start();
+ }
+ }
+}
diff --git a/ShiftOS.Frontend/ShiftOS.Frontend.csproj b/ShiftOS.Frontend/ShiftOS.Frontend.csproj
index ebdeff7..0a417a9 100644
--- a/ShiftOS.Frontend/ShiftOS.Frontend.csproj
+++ b/ShiftOS.Frontend/ShiftOS.Frontend.csproj
@@ -65,6 +65,7 @@
<Compile Include="HackerTestCommands.cs" />
<Compile Include="Infobox.cs" />
<Compile Include="MonoGameLanguageProvider.cs" />
+ <Compile Include="MonoGameOOBE.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
diff --git a/ShiftOS.Frontend/ShiftOS.cs b/ShiftOS.Frontend/ShiftOS.cs
index 7286151..4a563c2 100644
--- a/ShiftOS.Frontend/ShiftOS.cs
+++ b/ShiftOS.Frontend/ShiftOS.cs
@@ -52,7 +52,6 @@ namespace ShiftOS.Frontend
}
- private GUI.TextControl _titleLabel = null;
private Keys lastKey = Keys.None;
@@ -64,6 +63,8 @@ namespace ShiftOS.Frontend
/// </summary>
protected override void Initialize()
{
+ OutOfBoxExperience.Init(new MonoGameOOBE());
+
//Before we do ANYTHING, we've got to initiate the ShiftOS engine.
UIManager.GraphicsDevice = GraphicsDevice.GraphicsDevice;
diff --git a/ShiftOS.Modding.VB.LegacySkinConverter/ShiftOS.Modding.VB.LegacySkinConverter.vbproj b/ShiftOS.Modding.VB.LegacySkinConverter/ShiftOS.Modding.VB.LegacySkinConverter.vbproj
index 3a53cc8..2a5303c 100644
--- a/ShiftOS.Modding.VB.LegacySkinConverter/ShiftOS.Modding.VB.LegacySkinConverter.vbproj
+++ b/ShiftOS.Modding.VB.LegacySkinConverter/ShiftOS.Modding.VB.LegacySkinConverter.vbproj
@@ -125,10 +125,6 @@
<Project>{a069089a-8962-4607-b2b2-4cf4a371066e}</Project>
<Name>ShiftOS.Objects</Name>
</ProjectReference>
- <ProjectReference Include="..\ShiftOS.WinForms\ShiftOS.WinForms.csproj">
- <Project>{2295d2e2-3a00-4e02-b66f-b961ac329fe6}</Project>
- <Name>ShiftOS.WinForms</Name>
- </ProjectReference>
<ProjectReference Include="..\ShiftOS_TheReturn\ShiftOS.Engine.csproj">
<Project>{7c979b07-0585-4033-a110-e5555b9d6651}</Project>
<Name>ShiftOS.Engine</Name>
diff --git a/ShiftOS.Modding.VirtualMachine/ShiftOS.Modding.VirtualMachine.csproj b/ShiftOS.Modding.VirtualMachine/ShiftOS.Modding.VirtualMachine.csproj
index a8c2409..e2a3cc9 100644
--- a/ShiftOS.Modding.VirtualMachine/ShiftOS.Modding.VirtualMachine.csproj
+++ b/ShiftOS.Modding.VirtualMachine/ShiftOS.Modding.VirtualMachine.csproj
@@ -87,10 +87,6 @@
<Project>{a069089a-8962-4607-b2b2-4cf4a371066e}</Project>
<Name>ShiftOS.Objects</Name>
</ProjectReference>
- <ProjectReference Include="..\ShiftOS.WinForms\ShiftOS.WinForms.csproj">
- <Project>{2295d2e2-3a00-4e02-b66f-b961ac329fe6}</Project>
- <Name>ShiftOS.WinForms</Name>
- </ProjectReference>
<ProjectReference Include="..\ShiftOS_TheReturn\ShiftOS.Engine.csproj">
<Project>{7c979b07-0585-4033-a110-e5555b9d6651}</Project>
<Name>ShiftOS.Engine</Name>
diff --git a/ShiftOS.Updater/ShiftOS.Updater.csproj b/ShiftOS.Updater/ShiftOS.Updater.csproj
index 70d8263..0b8e78e 100644
--- a/ShiftOS.Updater/ShiftOS.Updater.csproj
+++ b/ShiftOS.Updater/ShiftOS.Updater.csproj
@@ -49,12 +49,6 @@
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ShiftOS.WinForms\ShiftOS.WinForms.csproj">
- <Project>{2295d2e2-3a00-4e02-b66f-b961ac329fe6}</Project>
- <Name>ShiftOS.WinForms</Name>
- </ProjectReference>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/ShiftOS_TheReturn.sln b/ShiftOS_TheReturn.sln
index b14cb3f..e870d99 100644
--- a/ShiftOS_TheReturn.sln
+++ b/ShiftOS_TheReturn.sln
@@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftOS.Objects", "ShiftOS.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftOS.Server", "ShiftOS.Server\ShiftOS.Server.csproj", "{226C63B4-E60D-4949-B4E7-7A2DDBB96776}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftOS.WinForms", "ShiftOS.WinForms\ShiftOS.WinForms.csproj", "{2295D2E2-3A00-4E02-B66F-B961AC329FE6}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftOS.MFSProfiler", "ShiftOS.MFSProfiler\ShiftOS.MFSProfiler.csproj", "{AF587F3F-CA85-4183-BEEB-ACF527B1FFF3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftOS.Modding.VirtualMachine", "ShiftOS.Modding.VirtualMachine\ShiftOS.Modding.VirtualMachine.csproj", "{FF0B1831-AC9F-4093-9747-DDAE4467516A}"
@@ -41,10 +39,6 @@ Global
{226C63B4-E60D-4949-B4E7-7A2DDBB96776}.Debug|Any CPU.Build.0 = Debug|Any CPU
{226C63B4-E60D-4949-B4E7-7A2DDBB96776}.Release|Any CPU.ActiveCfg = Release|Any CPU
{226C63B4-E60D-4949-B4E7-7A2DDBB96776}.Release|Any CPU.Build.0 = Release|Any CPU
- {2295D2E2-3A00-4E02-B66F-B961AC329FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2295D2E2-3A00-4E02-B66F-B961AC329FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2295D2E2-3A00-4E02-B66F-B961AC329FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2295D2E2-3A00-4E02-B66F-B961AC329FE6}.Release|Any CPU.Build.0 = Release|Any CPU
{AF587F3F-CA85-4183-BEEB-ACF527B1FFF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF587F3F-CA85-4183-BEEB-ACF527B1FFF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF587F3F-CA85-4183-BEEB-ACF527B1FFF3}.Release|Any CPU.ActiveCfg = Release|Any CPU