Fucking fuckrape the motherfucking winforms proj

This commit is contained in:
Michael 2017-07-24 21:09:48 -04:00
parent 5ab60d7706
commit 2cd1452ff1
10 changed files with 178 additions and 29 deletions

View file

@ -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>

View file

@ -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)

View file

@ -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 { }
}

View file

@ -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();
}
}
}

View file

@ -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>

View file

@ -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;

View file

@ -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>

View file

@ -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>

View file

@ -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.

View file

@ -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