mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-01-22 17:22:14 +00:00
Merge pull request #2 from MichaelTheShifter/shiftui_integration
Shifter UI rewrite, fix shiftnet and spkg paths.
This commit is contained in:
commit
e25a0a7066
6 changed files with 1478 additions and 6416 deletions
|
@ -6,6 +6,7 @@
|
|||
using ShiftUI.Theming.Default;
|
||||
using System.Drawing;
|
||||
using ShiftUI.ShiftOS;
|
||||
using System.Drawing.Drawing2D;
|
||||
|
||||
namespace ShiftUI.Theming
|
||||
{
|
||||
|
@ -23,10 +24,202 @@ public override ButtonPainter ButtonPainter
|
|||
return new Memphis.ButtonPainter();
|
||||
}
|
||||
}
|
||||
|
||||
public override CheckBoxPainter CheckBoxPainter
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Memphis.CheckBoxPainter();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Memphis
|
||||
{
|
||||
internal class CheckBoxPainter : Default.CheckBoxPainter
|
||||
{
|
||||
#region Standard
|
||||
public override void DrawNormalCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
int check_box_visible_size = (bounds.Height > bounds.Width) ? bounds.Width : bounds.Height;
|
||||
int x_pos = Math.Max(0, bounds.X + (bounds.Width / 2) - check_box_visible_size / 2);
|
||||
int y_pos = Math.Max(0, bounds.Y + (bounds.Height / 2) - check_box_visible_size / 2);
|
||||
|
||||
Rectangle rect = new Rectangle(x_pos, y_pos, check_box_visible_size, check_box_visible_size);
|
||||
|
||||
g.FillRectangle(new SolidBrush(Application.CurrentSkin.CheckBoxBackgroundColor), rect.X + 2, rect.Y + 2, rect.Width - 3, rect.Height - 3);
|
||||
|
||||
Pen pen = new Pen(Application.CurrentSkin.Border3DTopLeftInner, 1);
|
||||
g.DrawLine(pen, rect.X, rect.Y, rect.X, rect.Bottom - 2);
|
||||
g.DrawLine(pen, rect.X + 1, rect.Y, rect.Right - 2, rect.Y);
|
||||
|
||||
pen = new Pen(Application.CurrentSkin.Border3DBottomRight, 1);
|
||||
g.DrawLine(pen, rect.X + 1, rect.Y + 1, rect.X + 1, rect.Bottom - 3);
|
||||
g.DrawLine(pen, rect.X + 2, rect.Y + 1, rect.Right - 3, rect.Y + 1);
|
||||
|
||||
pen = new Pen(Application.CurrentSkin.Border3DTopLeftInner, 1);
|
||||
g.DrawLine(pen, rect.Right - 1, rect.Y, rect.Right - 1, rect.Bottom - 1);
|
||||
g.DrawLine(pen, rect.X, rect.Bottom - 1, rect.Right - 1, rect.Bottom - 1);
|
||||
|
||||
// oh boy, matching ms is like fighting against windmills
|
||||
using (Pen h_pen = new Pen(Application.CurrentSkin.CheckBoxCheckColor))
|
||||
{
|
||||
g.DrawLine(h_pen, rect.X + 1, rect.Bottom - 2, rect.Right - 2, rect.Bottom - 2);
|
||||
g.DrawLine(h_pen, rect.Right - 2, rect.Y + 1, rect.Right - 2, rect.Bottom - 2);
|
||||
}
|
||||
|
||||
if (state == CheckState.Checked)
|
||||
DrawCheck(g, bounds, Application.CurrentSkin.CheckBoxCheckColor);
|
||||
else if (state == CheckState.Indeterminate)
|
||||
DrawCheck(g, bounds, Application.CurrentSkin.CheckBoxCheckColor);
|
||||
}
|
||||
|
||||
public override void DrawHotCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawNormalCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
public override void DrawPressedCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
int check_box_visible_size = (bounds.Height > bounds.Width) ? bounds.Width : bounds.Height;
|
||||
int x_pos = Math.Max(0, bounds.X + (bounds.Width / 2) - check_box_visible_size / 2);
|
||||
int y_pos = Math.Max(0, bounds.Y + (bounds.Height / 2) - check_box_visible_size / 2);
|
||||
|
||||
Rectangle rect = new Rectangle(x_pos, y_pos, check_box_visible_size, check_box_visible_size);
|
||||
|
||||
g.FillRectangle(new SolidBrush(Application.CurrentSkin.CheckBoxCheckColor), rect.X + 2, rect.Y + 2, rect.Width - 3, rect.Height - 3);
|
||||
|
||||
Pen pen = new Pen(Application.CurrentSkin.Border3DBottomRightInner, 1);
|
||||
g.DrawLine(pen, rect.X, rect.Y, rect.X, rect.Bottom - 2);
|
||||
g.DrawLine(pen, rect.X + 1, rect.Y, rect.Right - 2, rect.Y);
|
||||
|
||||
pen = new Pen(Application.CurrentSkin.Border3DBottomRight, 1);
|
||||
g.DrawLine(pen, rect.X + 1, rect.Y + 1, rect.X + 1, rect.Bottom - 3);
|
||||
g.DrawLine(pen, rect.X + 2, rect.Y + 1, rect.Right - 3, rect.Y + 1);
|
||||
|
||||
pen = new Pen(Application.CurrentSkin.Border3DTopLeftInner, 1);
|
||||
g.DrawLine(pen, rect.Right - 1, rect.Y, rect.Right - 1, rect.Bottom - 1);
|
||||
g.DrawLine(pen, rect.X, rect.Bottom - 1, rect.Right - 1, rect.Bottom - 1);
|
||||
|
||||
// oh boy, matching ms is like fighting against windmills
|
||||
using (Pen h_pen = new Pen(Application.CurrentSkin.CheckBoxCheckColor))
|
||||
{
|
||||
g.DrawLine(h_pen, rect.X + 1, rect.Bottom - 2, rect.Right - 2, rect.Bottom - 2);
|
||||
g.DrawLine(h_pen, rect.Right - 2, rect.Y + 1, rect.Right - 2, rect.Bottom - 2);
|
||||
}
|
||||
|
||||
if (state == CheckState.Checked)
|
||||
DrawCheck(g, bounds, Application.CurrentSkin.CheckBoxCheckColor);
|
||||
else if (state == CheckState.Indeterminate)
|
||||
DrawCheck(g, bounds, Application.CurrentSkin.CheckBoxCheckColor);
|
||||
}
|
||||
|
||||
public override void DrawDisabledCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawPressedCheckBox(g, bounds, backColor, foreColor, CheckState.Unchecked);
|
||||
|
||||
if (state == CheckState.Checked || state == CheckState.Indeterminate)
|
||||
DrawCheck(g, bounds, SystemColors.ControlDark);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region FlatStyle
|
||||
public override void DrawFlatNormalCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawNormalCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
public override void DrawFlatHotCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawFlatNormalCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
public override void DrawFlatPressedCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawPressedCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
/* public override void DrawFlatDisabledCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
Rectangle checkbox_rectangle;
|
||||
|
||||
checkbox_rectangle = new Rectangle(bounds.X, bounds.Y, Math.Max(bounds.Width - 2, 0), Math.Max(bounds.Height - 2, 0));
|
||||
|
||||
WidgetPaint.DrawBorder(g, checkbox_rectangle, foreColor, ButtonBorderStyle.Solid);
|
||||
|
||||
bounds.Offset(-1, 0);
|
||||
|
||||
if (state == CheckState.Checked || state == CheckState.Indeterminate)
|
||||
DrawCheck(g, bounds, SystemColors.ControlDarkDark);
|
||||
}*/
|
||||
#endregion
|
||||
|
||||
#region Popup
|
||||
public override void DrawPopupNormalCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawFlatNormalCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
public override void DrawPopupHotCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawFlatNormalCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
public override void DrawPopupPressedCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
DrawFlatPressedCheckBox(g, bounds, backColor, foreColor, state);
|
||||
}
|
||||
|
||||
public override void DrawPopupDisabledCheckBox(Graphics g, Rectangle bounds, Color backColor, Color foreColor, CheckState state)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Check
|
||||
public override void DrawCheck(Graphics g, Rectangle bounds, Color checkColor)
|
||||
{
|
||||
int check_size = (bounds.Height > bounds.Width) ? bounds.Width / 2 : bounds.Height / 2;
|
||||
|
||||
Pen check_pen = ResPool.GetPen(checkColor);
|
||||
|
||||
if (check_size < 7)
|
||||
{
|
||||
int lineWidth = Math.Max(3, check_size / 3);
|
||||
int Scale = Math.Max(1, check_size / 9);
|
||||
|
||||
Rectangle rect = new Rectangle(bounds.X + (bounds.Width / 2) - (check_size / 2) - 1, bounds.Y + (bounds.Height / 2) - (check_size / 2) - 1,
|
||||
check_size, check_size);
|
||||
|
||||
for (int i = 0; i < lineWidth; i++)
|
||||
{
|
||||
g.DrawLine(check_pen, rect.Left + lineWidth / 2, rect.Top + lineWidth + i, rect.Left + lineWidth / 2 + 2 * Scale, rect.Top + lineWidth + 2 * Scale + i);
|
||||
g.DrawLine(check_pen, rect.Left + lineWidth / 2 + 2 * Scale, rect.Top + lineWidth + 2 * Scale + i, rect.Left + lineWidth / 2 + 6 * Scale, rect.Top + lineWidth - 2 * Scale + i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int lineWidth = Math.Max(3, check_size / 3) + 1;
|
||||
|
||||
int x_half = bounds.Width / 2;
|
||||
int y_half = bounds.Height / 2;
|
||||
|
||||
Rectangle rect = new Rectangle(bounds.X + x_half - (check_size / 2) - 1, bounds.Y + y_half - (check_size / 2),
|
||||
check_size, check_size);
|
||||
|
||||
int gradient_left = check_size / 3;
|
||||
int gradient_right = check_size - gradient_left - 1;
|
||||
|
||||
for (int i = 0; i < lineWidth; i++)
|
||||
{
|
||||
g.DrawLine(check_pen, rect.X, rect.Bottom - 1 - gradient_left - i, rect.X + gradient_left, rect.Bottom - 1 - i);
|
||||
g.DrawLine(check_pen, rect.X + gradient_left, rect.Bottom - 1 - i, rect.Right - 1, rect.Bottom - i - 1 - gradient_right);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
internal class ButtonPainter : Default.ButtonPainter
|
||||
{
|
||||
|
||||
|
|
5903
source/WindowsFormsApplication1/Apps/Shifter.Designer.cs
generated
5903
source/WindowsFormsApplication1/Apps/Shifter.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -19,6 +19,7 @@ public Shifter()
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
/*
|
||||
public Skinning.Skin CustomizingSkin = null;
|
||||
public Skinning.Images CustomizingImages = null;
|
||||
private bool EarnCP = false;
|
||||
|
@ -1442,7 +1443,7 @@ private void btnmenus_Click(object sender, EventArgs e)
|
|||
HideAll();
|
||||
pnlmenuoptions.Show();
|
||||
pnlmenuoptions.BringToFront();
|
||||
SetPreviewSkin(true);*/
|
||||
SetPreviewSkin(true);
|
||||
}
|
||||
|
||||
private void Button2_Click(object sender, EventArgs e)
|
||||
|
@ -3088,6 +3089,6 @@ public void SetupLuaForm(Dictionary<string, object> d)
|
|||
};
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public static string VisitSite(string url)
|
|||
{
|
||||
try
|
||||
{
|
||||
string content = wc.DownloadString(url.Replace("shiftnet://", "http://www.playshiftos.ml/shiftnet/www/"));
|
||||
string content = wc.DownloadString(url.Replace("shiftnet://", "http://releases.playshiftos.ml/shiftnet/www/"));
|
||||
if (content.StartsWith("<!STML>"))
|
||||
{
|
||||
LastUrl = url;
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using ShiftUI;
|
||||
using ShiftOS.FinalMission;
|
||||
using ShiftOS;
|
||||
|
||||
namespace ShiftOS
|
||||
{
|
||||
|
@ -1383,15 +1385,40 @@ public string GetParent(string path)
|
|||
|
||||
public void DoCommand()
|
||||
{
|
||||
API.LastRanCommand = command;
|
||||
string[] args = command.ToLower().Split(' ');
|
||||
switch (args[0])
|
||||
//Grab the type of this class using Reflection.
|
||||
var terminal = this.GetType();
|
||||
string[] cmdargs = command.Split(' ');
|
||||
var method_info = terminal.GetMethod("cmd_" + cmdargs[0].ToLower());
|
||||
if(method_info != null)
|
||||
{
|
||||
case "ls":
|
||||
case "dir":
|
||||
if(API.Upgrades["fileskimmer"])
|
||||
method_info.Invoke(this, new object[] { cmdargs });
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach(var d in Directory.GetDirectories(current_dir))
|
||||
terminal.GetMethod("cmd_default").Invoke(this, new object[] { cmdargs });
|
||||
}
|
||||
}
|
||||
|
||||
#region Terminal command methods
|
||||
|
||||
/*
|
||||
* Adding terminal commands has been changed.
|
||||
*
|
||||
* It's now done in a way that doesn't require hardcoding.
|
||||
*
|
||||
* Simply add a new method here with a prefix 'cmd_', for example 'cmd_05tray', and
|
||||
* one argument of type 'string[]'. Then, put all the stuff you want your command to
|
||||
* do in that method, and try running your command (without the 'cmd_' prefix) in the
|
||||
* Terminal and it should work just fine.
|
||||
*
|
||||
* Thanks to @carverh for inspiring this by making all commands their own function.
|
||||
*/
|
||||
|
||||
public void cmd_dir(String[] args)
|
||||
{
|
||||
if (API.Upgrades["fileskimmer"])
|
||||
{
|
||||
foreach (var d in Directory.GetDirectories(current_dir))
|
||||
{
|
||||
WriteLine($"[DIR] {new DirectoryInfo(d).Name}");
|
||||
}
|
||||
|
@ -1404,8 +1431,12 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "cd":
|
||||
}
|
||||
|
||||
public void cmd_cd(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (API.Upgrades["fileskimmer"])
|
||||
{
|
||||
if (args[1] == "..")
|
||||
|
@ -1432,13 +1463,21 @@ public void DoCommand()
|
|||
SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> ");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "upg":
|
||||
if(API.DeveloperMode)
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
WriteLine("cd: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void cmd_upg(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch(args[1])
|
||||
switch (args[1])
|
||||
{
|
||||
case "get":
|
||||
WriteLine(API.Upgrades[args[2]].ToString());
|
||||
|
@ -1454,8 +1493,10 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "endgame_test":
|
||||
}
|
||||
|
||||
public void cmd_endgame_test(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
try
|
||||
|
@ -1483,11 +1524,15 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "htutorial":
|
||||
}
|
||||
|
||||
public void cmd_htutorial(String[] args)
|
||||
{
|
||||
ShiftOS.Hacking.StartBattleTutorial();
|
||||
break;
|
||||
case "fake_buy":
|
||||
}
|
||||
|
||||
public void cmd_fake_buy(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
try
|
||||
|
@ -1514,14 +1559,16 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "connections":
|
||||
}
|
||||
|
||||
public void cmd_connections(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch(args[1])
|
||||
switch (args[1])
|
||||
{
|
||||
case "list":
|
||||
foreach(var client in Package_Grabber.clients)
|
||||
foreach (var client in Package_Grabber.clients)
|
||||
{
|
||||
WriteLine($"Hostname: {client.Key}, Port: {client.Value.RemotePort}, Online: {client.Value.IsConnected}");
|
||||
}
|
||||
|
@ -1530,7 +1577,7 @@ public void DoCommand()
|
|||
API.CreateForm(new ConnectionManager(), "Connections", API.GetIcon("Connections"));
|
||||
break;
|
||||
case "drop":
|
||||
foreach(var client in Package_Grabber.clients)
|
||||
foreach (var client in Package_Grabber.clients)
|
||||
{
|
||||
Package_Grabber.Disconnect(client.Key);
|
||||
}
|
||||
|
@ -1552,7 +1599,8 @@ public void DoCommand()
|
|||
c.Connect(host, port);
|
||||
WriteLine("Re-established connection with host.");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
WriteLine("This host has been connected to already.");
|
||||
}
|
||||
}
|
||||
|
@ -1563,13 +1611,15 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("connections: Missing arguments.");
|
||||
}
|
||||
break;
|
||||
case "story":
|
||||
if(API.DeveloperMode == true && API.Upgrades["shiftnet"])
|
||||
}
|
||||
|
||||
public void cmd_story(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode == true && API.Upgrades["shiftnet"])
|
||||
{
|
||||
try
|
||||
{
|
||||
switch(args[1])
|
||||
switch (args[1])
|
||||
{
|
||||
case "aidennirh":
|
||||
StartAidenNirhStory();
|
||||
|
@ -1594,8 +1644,10 @@ public void DoCommand()
|
|||
}
|
||||
}
|
||||
else { wrongcommand(); }
|
||||
break;
|
||||
case "make":
|
||||
}
|
||||
|
||||
public void cmd_make(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
string path = command.Replace("make ", "");
|
||||
|
@ -1614,12 +1666,14 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("make: Invalid arguments.");
|
||||
}
|
||||
break;
|
||||
case "linux":
|
||||
if(API.DeveloperMode)
|
||||
}
|
||||
|
||||
public void cmd_devupg(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
WriteLine("Upgrading your system...");
|
||||
foreach(var upg in Shiftorium.Utilities.GetAvailable())
|
||||
foreach (var upg in Shiftorium.Utilities.GetAvailable())
|
||||
{
|
||||
API.Upgrades[upg.id] = true;
|
||||
WriteLine("Installed upgrade \"" + upg.Name + "\"...");
|
||||
|
@ -1631,13 +1685,17 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "netgen":
|
||||
}
|
||||
|
||||
public void cmd_netgen(String[] args)
|
||||
{
|
||||
WriteLine("Starting netgen...");
|
||||
API.CreateForm(new NetGen(), "Network Generator", API.GetIcon("Terminal"));
|
||||
break;
|
||||
case "lua":
|
||||
if(API.DeveloperMode == true)
|
||||
}
|
||||
|
||||
public void cmd_lua(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1678,9 +1736,11 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "hack":
|
||||
if(API.Upgrades["hacking"] == true)
|
||||
}
|
||||
|
||||
public void cmd_hack(String[] args)
|
||||
{
|
||||
if (API.Upgrades["hacking"] == true)
|
||||
{
|
||||
StartHackingSession("random");
|
||||
}
|
||||
|
@ -1688,24 +1748,26 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "virusscanner":
|
||||
case "vscan":
|
||||
if(API.Upgrades["virusscanner"] == true)
|
||||
}
|
||||
|
||||
public void cmd_vscan(String[] args)
|
||||
{
|
||||
if (API.Upgrades["virusscanner"] == true)
|
||||
{
|
||||
WriteLine("Scanning for infected files...");
|
||||
var goodList = new Dictionary<string, string>();
|
||||
foreach (KeyValuePair<string, string> kv in Viruses.Infections)
|
||||
{
|
||||
if(kv.Value.Contains(";"))
|
||||
if (kv.Value.Contains(";"))
|
||||
{
|
||||
foreach(string file in kv.Value.Split(';'))
|
||||
foreach (string file in kv.Value.Split(';'))
|
||||
{
|
||||
if (goodList.ContainsKey(file))
|
||||
{
|
||||
goodList[file] += ", " + kv.Key;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
goodList.Add(file, kv.Key);
|
||||
}
|
||||
}
|
||||
|
@ -1716,7 +1778,8 @@ public void DoCommand()
|
|||
{
|
||||
goodList[kv.Value] += ", " + kv.Key;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
goodList.Add(kv.Value, kv.Key);
|
||||
}
|
||||
}
|
||||
|
@ -1736,8 +1799,10 @@ public void DoCommand()
|
|||
WriteLine("No infections found. You are safe.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "infections":
|
||||
}
|
||||
|
||||
public void cmd_infections(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode == true)
|
||||
{
|
||||
foreach (KeyValuePair<string, string> kv in Viruses.Infections)
|
||||
|
@ -1749,22 +1814,27 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "binarywater":
|
||||
}
|
||||
|
||||
public void cmd_binarywater(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode)
|
||||
{
|
||||
ShiftOS.Hacking.AddCharacter(new Character("Philip Adams", "Hello, and welcome to another episode of OSFirstTimer.", 100, 100, 0));
|
||||
WriteLine("Philip Adams is now in the list of hirable hackers.");
|
||||
WriteLine("\" I Don't Think This is Canon \" -Carver");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("I see you went in the ShiftOS source code... ummm yeah... this isn't a developer mode release so I can't just give you a full-skilled hacker even if you beg.");
|
||||
}
|
||||
break;
|
||||
case "color":
|
||||
}
|
||||
|
||||
public void cmd_color(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(API.Upgrades["setterminalcolors"] == true)
|
||||
if (API.Upgrades["setterminalcolors"] == true)
|
||||
{
|
||||
|
||||
Color bcol = SetColor(args[1]);
|
||||
|
@ -1774,12 +1844,14 @@ public void DoCommand()
|
|||
|
||||
}
|
||||
}
|
||||
catch(Exception)
|
||||
catch (Exception)
|
||||
{
|
||||
WriteLine("color: Missing arguments.");
|
||||
}
|
||||
break;
|
||||
case "encrypt":
|
||||
}
|
||||
|
||||
public void cmd_encrypt(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode == true)
|
||||
{
|
||||
string messageToEncrypt = command.Replace("encrypt ", "");
|
||||
|
@ -1790,12 +1862,14 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "font":
|
||||
if(API.Upgrades["setterminalfont"] == true)
|
||||
}
|
||||
|
||||
public void cmd_font(String[] args)
|
||||
{
|
||||
if (API.Upgrades["setterminalfont"] == true)
|
||||
{
|
||||
var fname = command.Replace("font ", "");
|
||||
if(GetFonts().Contains(fname))
|
||||
if (GetFonts().Contains(fname))
|
||||
{
|
||||
API.CurrentSkin.TerminalFontStyle = fname;
|
||||
}
|
||||
|
@ -1808,11 +1882,13 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "colorlist":
|
||||
if(API.Upgrades["setterminalcolors"] == true)
|
||||
}
|
||||
|
||||
public void cmd_colorlist(String[] args)
|
||||
{
|
||||
foreach(string itm in GetColorList())
|
||||
if (API.Upgrades["setterminalcolors"] == true)
|
||||
{
|
||||
foreach (string itm in GetColorList())
|
||||
{
|
||||
WriteLine(itm);
|
||||
}
|
||||
|
@ -1821,8 +1897,10 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "spkg":
|
||||
}
|
||||
|
||||
public void cmd_spkg(String[] args)
|
||||
{
|
||||
if (!API.LimitedMode)
|
||||
{
|
||||
if (API.Upgrades["shiftnet"] == true)
|
||||
|
@ -1884,9 +1962,9 @@ public void DoCommand()
|
|||
{
|
||||
try
|
||||
{
|
||||
if(args[2] == "god_utils")
|
||||
if (args[2] == "god_utils")
|
||||
{
|
||||
if(FinalMission.EndGameHandler.GodModeInstallEnabled == true)
|
||||
if (FinalMission.EndGameHandler.GodModeInstallEnabled == true)
|
||||
{
|
||||
var t = new Thread(new ThreadStart(new Action(() =>
|
||||
{
|
||||
|
@ -1897,9 +1975,7 @@ public void DoCommand()
|
|||
WriteLine("Beginning installation.");
|
||||
Thread.Sleep(1000);
|
||||
WriteLine(@" == GOD MODE ==
|
||||
|
||||
God Mode gives you FULL control of ShiftOS. You can add/remove Codepoints, buy or unbuy Shiftorium upgrades, and can do whatever you want.
|
||||
|
||||
Installing core applications...");
|
||||
Thread.Sleep(250);
|
||||
WriteLine("Installing subpackage 'json_edit'...");
|
||||
|
@ -1909,7 +1985,6 @@ public void DoCommand()
|
|||
WriteLine("Installing subpackage 'hijacker'...");
|
||||
Thread.Sleep(500);
|
||||
WriteLine(@" == HIJACKER by DevX ==
|
||||
|
||||
HIJACKER is a utility that allows you to hijack any system and install ShiftOS on it during a hacker battle.");
|
||||
Thread.Sleep(100);
|
||||
WriteLine("[hijacker] Injecting HIJACKER code into hbattleui.sft...");
|
||||
|
@ -1937,11 +2012,17 @@ public void DoCommand()
|
|||
WriteLine("spkg: Missing arguments.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "alias":
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Command Functions, to Be Used For ShiftBatch
|
||||
/// </summary>
|
||||
/// <param name="args">String[] args</param>
|
||||
public void cmd_alias(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
switch(args[1])
|
||||
switch (args[1])
|
||||
{
|
||||
case "-?":
|
||||
case "--help":
|
||||
|
@ -1955,7 +2036,7 @@ public void DoCommand()
|
|||
break;
|
||||
case "--add":
|
||||
case "-a":
|
||||
if(API.AddAlias(args[2], command.Replace("alias " + args[1] + " " + args[2] + " ", "")))
|
||||
if (API.AddAlias(args[2], command.Replace("alias " + args[1] + " " + args[2] + " ", "")))
|
||||
{
|
||||
WriteLine("Alias added successfully.");
|
||||
API.SaveAliases();
|
||||
|
@ -1967,7 +2048,7 @@ public void DoCommand()
|
|||
break;
|
||||
case "--delete":
|
||||
case "-d":
|
||||
if(API.RemoveAlias(args[2]) == true)
|
||||
if (API.RemoveAlias(args[2]) == true)
|
||||
{
|
||||
WriteLine("Alias \"" + args[2] + "\" removed successfully.");
|
||||
API.SaveAliases();
|
||||
|
@ -1980,7 +2061,7 @@ public void DoCommand()
|
|||
case "-l":
|
||||
case "--list":
|
||||
WriteLine("Aliases:");
|
||||
foreach(KeyValuePair<string, string> kv in API.CommandAliases)
|
||||
foreach (KeyValuePair<string, string> kv in API.CommandAliases)
|
||||
{
|
||||
WriteLine(kv.Key + " => " + kv.Value);
|
||||
}
|
||||
|
@ -1994,9 +2075,11 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("alias: Missing arguments. Try alias --help for help with the Alias command.");
|
||||
}
|
||||
break;
|
||||
case "username":
|
||||
if(API.Upgrades["customusername"] == true)
|
||||
}
|
||||
|
||||
public void cmd_username(String[] args)
|
||||
{
|
||||
if (API.Upgrades["customusername"] == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -2011,8 +2094,10 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "osname":
|
||||
}
|
||||
|
||||
public void cmd_osname(String[] args)
|
||||
{
|
||||
if (API.Upgrades["customusername"] == true)
|
||||
{
|
||||
try
|
||||
|
@ -2028,32 +2113,40 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "unity":
|
||||
public void cmd_unity(String[] args)
|
||||
{
|
||||
if (API.Upgrades["unitymode"] == true)
|
||||
{
|
||||
API.CurrentSession.SetUnityMode();
|
||||
API.CurrentSession.SetupDesktop();
|
||||
txtterm.Focus();
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "time":
|
||||
}
|
||||
|
||||
public void cmd_time(String[] args)
|
||||
{
|
||||
if (API.Upgrades["pmandam"] == false)
|
||||
{
|
||||
if (API.Upgrades["hourssincemidnight"] == false)
|
||||
{
|
||||
if (API.Upgrades["minutessincemidnight"] == false)
|
||||
{
|
||||
if (API.Upgrades["secondssincemidnight"] == true) {
|
||||
if (API.Upgrades["secondssincemidnight"] == true)
|
||||
{
|
||||
WriteLine("Since midnight, " + API.GetTime() + " seconds have passed.");
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
wrongcommand();
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("Since midnight, " + API.GetTime() + " minutes have passed.");
|
||||
}
|
||||
|
@ -2062,13 +2155,17 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("Since Midnight, " + API.GetTime() + " hours have passed.");
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine("Current time: " + API.GetTime());
|
||||
}
|
||||
break;
|
||||
case "saa":
|
||||
if (API.Upgrades["shiftnet"]) {
|
||||
}
|
||||
|
||||
public void cmd_saa(String[] args)
|
||||
{
|
||||
if (API.Upgrades["shiftnet"])
|
||||
{
|
||||
var f = command.Replace("saa ", "");
|
||||
if (f.StartsWith("/"))
|
||||
{
|
||||
|
@ -2101,8 +2198,10 @@ public void DoCommand()
|
|||
{
|
||||
wrongcommand();
|
||||
}
|
||||
break;
|
||||
case "help":
|
||||
}
|
||||
|
||||
public void cmd_help(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
showhelp(args[1]);
|
||||
|
@ -2111,18 +2210,25 @@ public void DoCommand()
|
|||
{
|
||||
showhelp();
|
||||
}
|
||||
break;
|
||||
case "codepoints":
|
||||
case "cp":
|
||||
}
|
||||
|
||||
public void cmd_cp(String[] args)
|
||||
{
|
||||
WriteLine("You have " + API.Codepoints.ToString() + " Codepoints.");
|
||||
break;
|
||||
case "shutdown":
|
||||
}
|
||||
|
||||
public void cmd_shutdown(String[] args)
|
||||
{
|
||||
API.ShutDownShiftOS();
|
||||
break;
|
||||
case "clear":
|
||||
}
|
||||
|
||||
public void cmd_clear(String[] args)
|
||||
{
|
||||
txtterm.Text = "";
|
||||
break;
|
||||
case "close":
|
||||
}
|
||||
|
||||
public void cmd_close(String[] args)
|
||||
{
|
||||
if (command.Contains("close "))
|
||||
{
|
||||
var pid = command.Replace("close ", "");
|
||||
|
@ -2139,19 +2245,23 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("Insufficient arguments.");
|
||||
}
|
||||
break;
|
||||
case "05tray":
|
||||
}
|
||||
|
||||
public void cmd_05tray(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode == true)
|
||||
{
|
||||
API.AddCodepoints(500);
|
||||
WriteLine("You've been granted 500 Codepoints.");
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
wrongcommand();
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case "debug":
|
||||
public void cmd_debug(String[] args)
|
||||
{
|
||||
if (API.DeveloperMode == true)
|
||||
{
|
||||
try
|
||||
|
@ -2176,7 +2286,9 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("debug: " + ex.Message);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
switch (args[1].ToLower())
|
||||
|
@ -2186,17 +2298,20 @@ public void DoCommand()
|
|||
API.DeveloperMode = true;
|
||||
break;
|
||||
default:
|
||||
wrongcommand();
|
||||
WriteLine("debug: lp0 is on fire"); // Keeps Cheaters from Flooding The Fourms With "The Debug Mode Doesn't Work"
|
||||
break;
|
||||
}
|
||||
} catch
|
||||
}
|
||||
catch
|
||||
{
|
||||
wrongcommand(); //Debug command pretends to be an invalid command if an exception is thrown.
|
||||
WriteLine("debug: lp0 is on fire"); // Keeps Cheaters from Flooding The Fourms With "The Debug Mode Doesn't Work"
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "echo":
|
||||
if(command.Contains("echo "))
|
||||
}
|
||||
|
||||
public void cmd_echo(String[] args)
|
||||
{
|
||||
if (command.Contains("echo "))
|
||||
{
|
||||
WriteLine(command.Replace("echo ", ""));
|
||||
}
|
||||
|
@ -2204,20 +2319,18 @@ public void DoCommand()
|
|||
{
|
||||
WriteLine("echo: Insufficient Parameters.");
|
||||
}
|
||||
break;
|
||||
case "syncsave":
|
||||
WriteLine("Command removed.");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
public void cmd_default(String[] args)
|
||||
{
|
||||
if (API.OpenProgram(args[0]) == false)
|
||||
{
|
||||
if (API.Upgrades["trmfiles"] == false)
|
||||
{
|
||||
bool done = false;
|
||||
foreach(KeyValuePair<string, string> kv in API.CommandAliases)
|
||||
foreach (KeyValuePair<string, string> kv in API.CommandAliases)
|
||||
{
|
||||
if(kv.Key == command)
|
||||
if (kv.Key == command)
|
||||
{
|
||||
command = kv.Value;
|
||||
done = true;
|
||||
|
@ -2225,7 +2338,7 @@ public void DoCommand()
|
|||
}
|
||||
|
||||
}
|
||||
if(done == false)
|
||||
if (done == false)
|
||||
{
|
||||
wrongcommand();
|
||||
}
|
||||
|
@ -2267,10 +2380,30 @@ public void DoCommand()
|
|||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// About Box, Created By Carver Harrison
|
||||
/// </summary>
|
||||
/// <param name="args">String[] args</param>
|
||||
public void cmd_about(String[] args)
|
||||
{
|
||||
API.CreateInfoboxSession("About ShiftOS", "ShiftOS Version " + ProductVersion + "\n Copyright 2014-2016 ShiftOS Dev Team \n Type 'credits' in Terminal to Show Credits", infobox.InfoboxMode.Info);
|
||||
}
|
||||
|
||||
// HISTACOM REFERENCES, DO NOT REMOVE, CRUCIAL FOR SECRET STORY ARC
|
||||
public void cmd_histacom_year(String[] args)
|
||||
{
|
||||
WriteLine("Year: 2002");
|
||||
}
|
||||
|
||||
public void cmd_histacom_timedistorter(String[] args)
|
||||
{
|
||||
WriteLine("Install 'timedistorter' by going to shiftnet://12padams");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void StartChoice1EndStory()
|
||||
{
|
||||
var t = new ShiftUI.Timer();
|
||||
|
|
|
@ -188,7 +188,7 @@ public static bool GetPackage(string pkgname)
|
|||
Directory.CreateDirectory(downloadpath);
|
||||
}
|
||||
WebClient wc = new WebClient();
|
||||
wc.DownloadFile("http://playshiftos.ml/shiftnet/packages/" + pkgname + ".pkg", downloadpath + pkgname + ".pkg");
|
||||
wc.DownloadFile("http://releases.playshiftos.ml/shiftnet/packages/" + pkgname + ".pkg", downloadpath + pkgname + ".pkg");
|
||||
LastPackage_DownloadPath = downloadpath + pkgname + ".pkg";
|
||||
}
|
||||
catch
|
||||
|
|
Loading…
Reference in a new issue