2017-01-08 10:17:07 -05:00
/ *
* MIT License
*
* Copyright ( c ) 2017 Michael VanOverbeek and ShiftOS devs
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the "Software" ) , to deal
* in the Software without restriction , including without limitation the rights
* to use , copy , modify , merge , publish , distribute , sublicense , and / or sell
* copies of the Software , and to permit persons to whom the Software is
* furnished to do so , subject to the following conditions :
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software .
*
* THE SOFTWARE IS PROVIDED "AS IS" , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
* IMPLIED , INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY ,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER
* LIABILITY , WHETHER IN AN ACTION OF CONTRACT , TORT OR OTHERWISE , ARISING FROM ,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE .
* /
using System ;
2017-01-08 09:57:10 -05:00
using System.Collections.Generic ;
using System.ComponentModel ;
using System.Data ;
using System.Drawing ;
using System.Linq ;
using System.Text ;
using System.Threading ;
using System.Threading.Tasks ;
using System.Windows.Forms ;
using Newtonsoft.Json ;
using ShiftOS.Engine ;
using ShiftOS.Objects ;
using ShiftOS.Objects.ShiftFS ;
2017-04-30 17:50:50 -04:00
using ShiftOS.Unite ;
2017-04-17 15:10:34 -04:00
using ShiftOS.WinForms.Tools ;
2017-01-08 09:57:10 -05:00
namespace ShiftOS.WinForms
{
2017-01-18 10:01:37 -05:00
public partial class Oobe : Form , IOobe , ITutorial
2017-01-08 09:57:10 -05:00
{
public Oobe ( )
{
InitializeComponent ( ) ;
2017-01-17 17:08:27 -05:00
this . FormBorderStyle = FormBorderStyle . None ;
this . WindowState = FormWindowState . Maximized ;
this . BackColor = Color . Black ;
2017-04-17 15:10:34 -04:00
this . Load + = ( o , a ) = >
{
ControlManager . SetupControls ( this ) ;
} ;
2017-01-08 09:57:10 -05:00
}
2017-01-17 17:08:27 -05:00
string rtext ;
string gtexttotype ;
int charcount ;
int slashcount ;
Label textgeninput ;
public bool upgraded = false ;
2017-02-26 10:24:27 -05:00
2017-02-05 13:09:28 -05:00
private bool typing = false ;
2017-01-17 17:08:27 -05:00
public void TextType ( string texttotype )
2017-01-08 09:57:10 -05:00
{
2017-04-17 15:10:34 -04:00
textgeninput . TextAlign = ContentAlignment . MiddleCenter ;
2017-02-05 13:09:28 -05:00
while ( typing = = true )
{
2017-04-03 18:36:13 -04:00
//JESUS CHRIST PAST MICHAEL.
2017-02-05 13:09:28 -05:00
2017-04-03 18:36:13 -04:00
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-02-05 13:09:28 -05:00
}
2017-01-17 17:08:27 -05:00
charcount = texttotype . Length ;
gtexttotype = texttotype ;
slashcount = 1 ;
foreach ( var c in gtexttotype )
2017-01-08 09:57:10 -05:00
{
2017-02-05 13:09:28 -05:00
typing = true ;
2017-01-17 17:08:27 -05:00
rtext + = c ;
2017-02-05 13:09:28 -05:00
2017-01-08 09:57:10 -05:00
this . Invoke ( new Action ( ( ) = >
{
2017-01-17 17:08:27 -05:00
textgeninput . Text = rtext + "|" ;
2017-01-08 09:57:10 -05:00
} ) ) ;
2017-01-17 17:08:27 -05:00
slashcount + + ;
if ( slashcount = = 5 )
slashcount = 1 ;
2017-02-23 15:41:22 -05:00
Thread . Sleep ( 50 ) ;
2017-01-08 09:57:10 -05:00
}
2017-01-17 17:08:27 -05:00
rtext + = Environment . NewLine ;
2017-02-05 13:09:28 -05:00
typing = false ;
2017-01-08 09:57:10 -05:00
}
2017-01-17 17:08:27 -05:00
public Save MySave = null ;
2017-01-18 10:01:37 -05:00
public event EventHandler OnComplete ;
private int tutPrg = 0 ;
public int TutorialProgress
{
get
{
return tutPrg ;
}
set
{
tutPrg = value ;
}
}
2017-01-17 17:08:27 -05:00
public void StartShowing ( Save save )
2017-01-08 09:57:10 -05:00
{
2017-01-17 17:08:27 -05:00
var t = new Thread ( new ThreadStart ( ( ) = >
2017-01-08 09:57:10 -05:00
{
2017-02-05 13:55:27 -05:00
try
2017-01-08 09:57:10 -05:00
{
2017-02-05 13:55:27 -05:00
textgeninput = this . lblhackwords ;
this . Invoke ( new Action ( ( ) = >
{
lblHijack . Hide ( ) ;
} ) ) ;
2017-04-17 15:10:34 -04:00
TextType ( @ "Throughout many years, man has tried to develop
a digital environment usable by anyone that never goes
offline , full of AIs and humans alike , thinking , interacting ,
innovating .
No one has ever come close to a digital society of such
properties yet , except for one sentient being . It does not
have a life , a gender , an age or a body , but simply one name .
They call it "" DevX "" .
If anyone sees this message , my identity is anonymous , but I
need your help . I am trapped within "" DevX "" ' s digital society
with no way out , constantly under attack .
You must join the digital society , rise up the ranks , and save us .
- undisclosed_0x1DDFB5977 . ");
Thread . Sleep ( 5000 ) ;
while ( this . Opacity > 0f )
2017-02-05 13:55:27 -05:00
{
2017-04-17 15:10:34 -04:00
this . Invoke ( new Action ( ( ) = >
2017-02-23 15:41:22 -05:00
{
2017-04-17 15:10:34 -04:00
this . Opacity - = 0.01f ;
2017-02-23 15:41:22 -05:00
} ) ) ;
2017-04-17 15:10:34 -04:00
Thread . Sleep ( 25 ) ;
2017-02-23 15:41:22 -05:00
}
2017-04-17 15:10:34 -04:00
Story . Start ( "mud_fundamentals" ) ;
2017-02-08 11:20:02 -05:00
this . Invoke ( new Action ( this . Close ) ) ;
2017-01-17 17:08:27 -05:00
}
2017-02-08 11:20:02 -05:00
catch ( Exception e )
2017-01-08 09:57:10 -05:00
{
2017-02-05 13:55:27 -05:00
TextType ( "I have experienced an error." ) ;
TextType ( e . ToString ( ) ) ;
}
2017-01-17 17:08:27 -05:00
} ) ) ;
2017-01-08 09:57:10 -05:00
this . Show ( ) ;
2017-01-17 17:08:27 -05:00
this . BringToFront ( ) ;
2017-01-08 09:57:10 -05:00
this . TopMost = true ;
2017-01-17 17:08:27 -05:00
t . IsBackground = true ;
t . Start ( ) ;
2017-01-08 09:57:10 -05:00
}
2017-01-17 17:08:27 -05:00
public void Clear ( )
2017-01-08 09:57:10 -05:00
{
2017-01-17 17:08:27 -05:00
this . Invoke ( new Action ( ( ) = >
2017-01-08 09:57:10 -05:00
{
2017-01-18 18:09:48 -05:00
rtext = "" ;
2017-01-17 17:08:27 -05:00
textgeninput . Text = "" ;
} ) ) ;
2017-01-08 09:57:10 -05:00
}
2017-01-17 17:08:27 -05:00
public void ShowSaveTransfer ( Save save )
2017-01-08 09:57:10 -05:00
{
2017-01-22 20:04:46 -05:00
this . Show ( ) ;
2017-01-22 19:03:59 -05:00
var fSetup = new FakeSetupScreen ( this , 7 ) ;
var t = new Thread ( ( ) = >
{
textgeninput = lblhackwords ;
Clear ( ) ;
TextType ( "Welcome back to ShiftOS." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Since your last time inside ShiftOS, the operating system has changed. Your user account is no longer stored on your local system." ) ;
Thread . Sleep ( 500 ) ;
this . Invoke ( new Action ( ( ) = >
{
//UPS is drunky heaven over here... it's a liquor store, I think... - Drunk Michael
fSetup . UserReregistered + = ( u , p , s ) = >
{
save . Username = u ;
save . Password = p ;
save . SystemName = s ;
SaveSystem . CurrentSave = save ;
2017-02-04 15:21:17 -05:00
SaveSystem . CurrentSave . Upgrades = new Dictionary < string , bool > ( ) ;
Shiftorium . Init ( ) ;
2017-01-22 19:03:59 -05:00
SaveSystem . SaveGame ( ) ;
if ( Utils . FileExists ( Paths . SaveFileInner ) )
Utils . Delete ( Paths . SaveFileInner ) ;
this . Close ( ) ;
} ;
fSetup . Show ( ) ;
} ) ) ;
} ) ;
t . IsBackground = true ;
t . Start ( ) ;
2017-01-08 09:57:10 -05:00
}
2017-01-08 14:35:24 -05:00
2017-04-30 17:50:50 -04:00
public void PerformUniteLogin ( )
{
}
2017-01-17 17:08:27 -05:00
public void PromptForLogin ( )
2017-01-08 14:35:24 -05:00
{
2017-04-30 17:50:50 -04:00
Infobox . Show ( "Login" , "Since the last time you've played ShiftOS, some changes have been made to the login system. You must now login using your website credentials." , ( ) = >
2017-02-02 11:02:58 -05:00
{
2017-04-30 17:50:50 -04:00
Infobox . PromptYesNo ( "Website account" , "Do you have an account at http://getshiftos.ml?" , ( hasAccount ) = >
2017-04-28 20:01:04 -04:00
{
2017-04-30 17:50:50 -04:00
if ( hasAccount = = true )
{
var loginDialog = new UniteLoginDialog ( ( success ) = >
{
string token = success ;
var uClient = new UniteClient ( "http://getshiftos.ml" , token ) ;
Infobox . Show ( "Welcome to ShiftOS." , $"Hello, {uClient.GetDisplayName()}! We've signed you into your account. We'll now try to link your ShiftOS account with your save file." , ( ) = >
{
ServerMessageReceived smr = null ;
smr = ( msg ) = >
{
ServerManager . MessageReceived - = smr ;
if ( msg . Name = = "mud_savefile" )
{
SaveSystem . CurrentSave = JsonConvert . DeserializeObject < Save > ( msg . Contents ) ;
SaveSystem . SaveGame ( ) ;
}
else
{
LinkSaveFile ( token ) ;
}
} ;
ServerManager . MessageReceived + = smr ;
ServerManager . SendMessage ( "mud_token_login" , token ) ;
} ) ;
} ) ;
AppearanceManager . SetupDialog ( loginDialog ) ;
}
2017-04-30 18:50:54 -04:00
else
{
var signupDialog = new UniteSignupDialog ( ( token ) = >
{
2017-04-30 19:26:00 -04:00
ServerMessageReceived smr = null ;
smr = ( msg ) = >
{
ServerManager . MessageReceived - = smr ;
if ( msg . Name = = "mud_savefile" )
{
SaveSystem . CurrentSave = JsonConvert . DeserializeObject < Save > ( msg . Contents ) ;
SaveSystem . SaveGame ( ) ;
}
else
{
LinkSaveFile ( token ) ;
}
} ;
ServerManager . MessageReceived + = smr ;
ServerManager . SendMessage ( "mud_token_login" , token ) ;
2017-04-30 18:50:54 -04:00
} ) ;
AppearanceManager . SetupDialog ( signupDialog ) ;
}
2017-04-30 17:50:50 -04:00
} ) ;
} ) ;
}
public void LinkSaveFile ( string token )
{
2017-04-30 18:50:54 -04:00
if ( Utils . FileExists ( Paths . GetPath ( "user.dat" ) ) )
2017-04-28 20:01:04 -04:00
{
2017-04-30 18:50:54 -04:00
try
2017-04-28 20:01:04 -04:00
{
2017-04-30 18:50:54 -04:00
var details = JsonConvert . DeserializeObject < ClientSave > ( Utils . ReadAllText ( Paths . GetPath ( "user.dat" ) ) ) ;
ServerMessageReceived smr = null ;
bool msgreceived = false ;
bool found = false ;
smr = ( msg ) = >
2017-04-28 20:01:04 -04:00
{
2017-04-30 18:50:54 -04:00
if ( msg . Name = = "mud_savefile" )
2017-04-28 20:01:04 -04:00
{
2017-04-30 18:50:54 -04:00
var save = JsonConvert . DeserializeObject < Save > ( msg . Contents ) ;
2017-04-30 17:50:50 -04:00
save . UniteAuthToken = token ;
2017-04-30 18:50:54 -04:00
Infobox . Show ( "Migration complete." , "We have migrated your old save file to the new system successfully. You can still log in using the old system on old builds of ShiftOS." , ( ) = >
2017-04-28 20:01:04 -04:00
{
2017-04-30 17:50:50 -04:00
SaveSystem . CurrentSave = save ;
SaveSystem . SaveGame ( ) ;
2017-04-30 18:50:54 -04:00
found = true ;
msgreceived = true ;
2017-04-30 17:50:50 -04:00
} ) ;
}
else
{
2017-04-30 18:50:54 -04:00
found = false ;
msgreceived = true ;
2017-04-30 17:50:50 -04:00
}
2017-04-30 18:50:54 -04:00
ServerManager . MessageReceived - = smr ;
2017-04-30 17:50:50 -04:00
} ;
2017-04-30 18:50:54 -04:00
ServerManager . MessageReceived + = smr ;
2017-04-30 17:50:50 -04:00
ServerManager . SendMessage ( "mud_login" , JsonConvert . SerializeObject ( new
2017-04-28 20:01:04 -04:00
{
2017-04-30 18:50:54 -04:00
username = details . Username ,
password = details . Password
2017-04-30 17:50:50 -04:00
} ) ) ;
2017-04-30 18:50:54 -04:00
while ( msgreceived = = false )
Thread . Sleep ( 10 ) ;
if ( found )
return ;
}
catch
{
}
}
var client = new UniteClient ( "http://getshiftos.ml" , token ) ;
var sve = new Save ( ) ;
sve . Username = client . GetEmail ( ) ;
sve . Password = Guid . NewGuid ( ) . ToString ( ) ;
sve . SystemName = client . GetSysName ( ) ;
sve . UniteAuthToken = token ;
sve . Codepoints = 0 ;
sve . Upgrades = new Dictionary < string , bool > ( ) ;
sve . ID = Guid . NewGuid ( ) ;
Infobox . Show ( "Welcome to ShiftOS." , "Welcome to ShiftOS, " + client . GetDisplayName ( ) + ". We have created a save file for you. Now, go on and Shift It Your Way." , ( ) = >
{
sve . StoryPosition = 8675309 ;
SaveSystem . CurrentSave = sve ;
SaveSystem . SaveGame ( ) ;
2017-04-28 20:01:04 -04:00
} ) ;
2017-04-30 17:50:50 -04:00
}
public void ForceReboot ( )
{
string json = Utils . ExportMount ( 0 ) ;
System . IO . File . WriteAllText ( Paths . SaveFile , json ) ;
System . Diagnostics . Process . Start ( Application . ExecutablePath ) ;
Environment . Exit ( 0 ) ;
2017-01-08 14:35:24 -05:00
}
2017-01-18 10:01:37 -05:00
2017-01-18 18:09:48 -05:00
public void StartTrailer ( )
{
while ( AppearanceManager . OpenForms . Count > 0 )
{
AppearanceManager . OpenForms [ 0 ] . Close ( ) ;
}
this . Show ( ) ;
this . TopMost = true ;
this . TransparencyKey = Color . Magenta ;
this . BackColor = this . TransparencyKey ;
textgeninput = lblHijack ;
textgeninput . BackColor = Color . Black ;
textgeninput . Font = new Font ( "Lucida Console" , 13F , FontStyle . Bold ) ;
textgeninput . AutoSize = true ;
textgeninput . TextAlign = ContentAlignment . MiddleCenter ;
textgeninput . TextChanged + = ( o , a ) = >
{
textgeninput . Location = new Point (
( this . Width - textgeninput . Width ) / 2 ,
( this . Height - textgeninput . Height ) / 2
) ;
} ;
var t = new Thread ( ( ) = >
{
Clear ( ) ;
Thread . Sleep ( 5000 ) ;
TextType ( "Michael VanOverbeek" ) ;
TextType ( "presents..." ) ;
Thread . Sleep ( 2000 ) ;
Clear ( ) ;
Thread . Sleep ( 1000 ) ;
TextType ( "A community-developed game" ) ;
Thread . Sleep ( 3000 ) ;
Clear ( ) ;
Thread . Sleep ( 1000 ) ;
this . Invoke ( new Action ( ( ) = >
{
textgeninput . Font = new Font ( "Lucida Console" , 14F , FontStyle . Bold ) ;
this . BackColor = Color . Black ;
} ) ) ;
TextType ( "Welcome to ShiftOS." ) ;
Thread . Sleep ( 4000 ) ;
Clear ( ) ;
textgeninput = lblhackwords ;
TextType ( "Hello." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "You have been cordially and involuntarily selected to participate in the development and testing of an experimental operating system called ShiftOS." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "I want ShiftOS to be the most advanced operating system in the world." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "In ShiftOS, you start out with nothing." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "And your goal is to upgrade the operating system from a barebones command line to a fully graphical operating system." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Along the way, you'll meet many people - hackers, rebels, programmers, administrators and many more." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "You'll meet new friends and foes." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Your goal: Take it over. Upgrade the operating system, and take over its multi-user domain." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "I won't reveal quite what you have to do, but if you can handle it, head over to http://getshiftos.ml/ and download the operating system now." ) ;
Thread . Sleep ( 5000 ) ;
Clear ( ) ;
textgeninput = lblHijack ;
TextType ( "Think you can handle it?" ) ;
} ) ;
t . IsBackground = false ;
t . Start ( ) ;
}
2017-01-18 10:01:37 -05:00
public void Start ( )
{
2017-02-05 13:55:27 -05:00
Shiftorium . Silent = false ;
2017-01-18 10:01:37 -05:00
foreach ( var frm in AppearanceManager . OpenForms )
{
2017-02-08 10:17:28 -05:00
( frm as Form ) . Invoke ( new Action ( ( ) = > {
frm . Close ( ) ;
} ) ) ;
2017-01-18 10:01:37 -05:00
}
TerminalBackend . CommandProcessed + = ( cmd , args ) = >
{
if ( cmd = = "sos.help" )
{
if ( TutorialProgress = = 0 )
TutorialProgress = 1 ;
}
else if ( cmd = = "sos.status" )
{
if ( TutorialProgress = = 1 )
TutorialProgress = 2 ;
}
else if ( cmd = = "shiftorium.list" )
{
if ( TutorialProgress = = 2 )
2017-02-10 08:59:24 -05:00
{
2017-01-18 10:01:37 -05:00
TutorialProgress = 3 ;
2017-02-10 08:59:24 -05:00
SaveSystem . TransferCodepointsFrom ( "sys" , 50 ) ;
}
2017-01-18 10:01:37 -05:00
}
else if ( cmd = = "shiftorium.info" & & args = = "{\"upgrade\":\"mud_fundamentals\"}" )
{
if ( TutorialProgress = = 3 )
TutorialProgress = 4 ;
}
else if ( cmd = = "win.open" )
{
if ( TutorialProgress = = 4 )
TutorialProgress = 5 ;
}
} ;
2017-02-05 13:55:27 -05:00
if ( this . Visible = = false )
this . Show ( ) ;
2017-01-18 10:01:37 -05:00
var t = new Thread ( ( ) = >
{
textgeninput = lblHijack ;
Clear ( ) ;
textgeninput = lblhackwords ;
Clear ( ) ;
2017-04-02 14:26:25 -04:00
2017-01-18 10:01:37 -05:00
this . Invoke ( new Action ( ( ) = >
{
textgeninput . Font = SkinEngine . LoadedSkin . TerminalFont ;
} ) ) ;
TextType ( "ShiftOS has been installed successfully." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Before you can continue to the operating system, here's a little tutorial on how to use it." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Starting a Terminal..." ) ;
Applications . Terminal term = null ;
this . Invoke ( new Action ( ( ) = >
{
term = new Applications . Terminal ( ) ;
this . Controls . Add ( term ) ;
term . Location = new Point (
( this . Width - term . Width ) / 2 ,
( this . Height - term . Height ) / 2
) ;
term . Show ( ) ;
term . OnLoad ( ) ;
term . OnSkinLoad ( ) ;
term . OnUpgrade ( ) ;
} ) ) ;
TextType ( "This little text box is called a Terminal." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Normally, it would appear in full-screen, but this window is hosting it as a control so you can see this text as well." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "In ShiftOS, the Terminal is your main control centre for the operating system. You can see system status, check Codepoints, open other programs, buy upgrades, and more." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Go ahead and type 'sos.help' to see a list of commands." ) ;
2017-04-02 14:26:25 -04:00
while ( TutorialProgress = = 0 )
2017-01-18 10:01:37 -05:00
{
2017-04-03 18:36:13 -04:00
//JESUS CHRIST PAST MICHAEL.
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-01-18 10:01:37 -05:00
}
TextType ( "As you can see, sos.help gives you a list of all commands in the system." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "You can run any command, by typing in their Namespace, followed by a period (.), followed by their Command Name." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Go ahead and run the 'status' command within the 'sos' namespace to see what the command does." ) ;
2017-04-02 14:26:25 -04:00
while ( TutorialProgress = = 1 )
2017-01-18 10:01:37 -05:00
{
2017-04-03 18:36:13 -04:00
//JESUS CHRIST PAST MICHAEL.
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-01-18 10:01:37 -05:00
}
TextType ( "Brilliant. The sos.status command will tell you how many Codepoints you have, as well as how many upgrades you have installed and how many are available." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Codepoints, as you know, are a special currency within ShiftOS. They are used to buy things within the multi-user domain, such as upgrades, scripts, and applications." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "You can earn Codepoints by doing things in ShiftOS - such as completing jobs for other users, making things like skins, scripts, documents, etc, and playing games like Pong." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "At times, you'll be given Codepoints to help complete a task. You will receive Codepoints from 'sys' - the multi-user domain itself." ) ;
2017-02-10 08:59:24 -05:00
//SaveSystem.TransferCodepointsFrom("sys", 50);
2017-01-18 10:01:37 -05:00
TextType ( "Right now, you don't have any upgrades. Upgrades can give ShiftOS additional features and capabilities - like new core applications, supported file types, and new Terminal commands." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "You can easily get upgrades using the Shiftorium - a repository of approved ShiftOS upgrades." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "To start using the Shiftorium, simply type 'shiftorium.list' to see available upgrades." ) ;
2017-04-02 14:26:25 -04:00
while ( TutorialProgress = = 2 )
2017-01-18 10:01:37 -05:00
{
2017-04-03 18:36:13 -04:00
//JESUS CHRIST PAST MICHAEL.
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-01-18 10:01:37 -05:00
}
2017-02-24 15:56:33 -05:00
Clear ( ) ;
2017-01-18 10:01:37 -05:00
TextType ( "Right now, you have enough Codepoints to buy the 'mud_fundamentals' upgrade. You can use shiftorium.info to see information about this upgrade." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Some commands, like shiftorium.info, require you to pass information to them in the form of arguments." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Argument pairs sit at the end of the command, and are enclosed in curly braces." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Inside these curly braces, you can input an argument key, followed by a colon, followed by the value. Then, if you need multiple arguments, you can put a comma after the value, and then insert another argument pair." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "There are different value types - numeric values, which can be any positive or negative 32-bit integer" ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Then there are boolean values which can be either 'true' or 'false'" ) ;
Thread . Sleep ( 500 ) ;
2017-02-24 15:56:33 -05:00
TextType ( "Then there are string values, which are enclosed in double-quotes." ) ;
Thread . Sleep ( 500 ) ;
TextType ( " If for some reason you need to use a double-quote inside a string, you must escape it using a single backslash followed by the quote, like this: key:\"My \\\"awesome\\\" value.\"" ) ;
2017-01-18 10:01:37 -05:00
Thread . Sleep ( 500 ) ;
TextType ( "If you want to escape a backslash inside a string, simply type two backslashes instead of one - for example key:\"Back\\\\slash.\"" ) ;
Thread . Sleep ( 500 ) ;
TextType ( "shiftorium.info requires an upgrade argument, which is a string type. Go ahead and give shiftorium.info's upgrade argument the 'mud_fundamentals' upgrade's ID." ) ;
2017-04-02 14:26:25 -04:00
while ( TutorialProgress = = 3 )
2017-01-18 10:01:37 -05:00
{
2017-04-03 18:36:13 -04:00
//JESUS CHRIST PAST MICHAEL.
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-01-18 10:01:37 -05:00
2017-04-02 14:26:25 -04:00
}
2017-01-18 10:01:37 -05:00
TextType ( "As you can see, mud_fundamentals is very useful. In fact, a lot of useful upgrades depend on it. You should buy it!" ) ;
Thread . Sleep ( 500 ) ;
TextType ( "shiftorium.info already gave you a command that will let you buy the upgrade - go ahead and run that command!" ) ;
while ( ! Shiftorium . UpgradeInstalled ( "mud_fundamentals" ) )
2017-04-03 18:36:13 -04:00
{ //JESUS CHRIST PAST MICHAEL.
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-01-18 10:01:37 -05:00
2017-04-02 14:26:25 -04:00
}
2017-01-18 10:01:37 -05:00
TextType ( "Hooray! You now have the MUD Fundamentals upgrade." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "You can also earn more Codepoints by playing Pong. To open Pong, you can use the win.open command." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "If you run win.open without arguments, you can see a list of applications that you can open." ) ;
Thread . Sleep ( 500 ) ;
TextType ( "Just run win.open without arguments, and this tutorial will be completed!" ) ;
2017-04-02 14:26:25 -04:00
while ( TutorialProgress = = 4 )
2017-01-18 10:01:37 -05:00
{
2017-04-03 18:36:13 -04:00
//JESUS CHRIST PAST MICHAEL.
//We should PROBABLY block the thread... You know... not everyone has a 10-core processor.
Thread . Sleep ( 100 ) ;
2017-01-18 10:01:37 -05:00
}
TextType ( "This concludes the ShiftOS beginners' guide brought to you by the multi-user domain. Stay safe in a connected world." ) ;
Thread . Sleep ( 2000 ) ;
2017-04-02 14:26:25 -04:00
Desktop . InvokeOnWorkerThread ( ( ) = >
2017-01-18 10:01:37 -05:00
{
OnComplete ? . Invoke ( this , EventArgs . Empty ) ;
SaveSystem . CurrentSave . StoryPosition = 2 ;
2017-04-03 18:36:13 -04:00
this . Close ( ) ;
2017-01-18 10:01:37 -05:00
SaveSystem . SaveGame ( ) ;
AppearanceManager . SetupWindow ( new Applications . Terminal ( ) ) ;
2017-04-02 14:26:25 -04:00
} ) ;
2017-01-18 10:01:37 -05:00
} ) ;
t . IsBackground = true ;
t . Start ( ) ;
}
2017-01-08 09:57:10 -05:00
}
}