Release Candidate 2

We're almost there...
This commit is contained in:
MichaelTheShifter 2016-05-25 20:50:35 -04:00
parent e2d2829ce9
commit c43d82eebd
5 changed files with 82 additions and 163 deletions

View file

@ -30,6 +30,7 @@ private void setbgcolor(object sender, MouseEventArgs e)
var c = API.GetLastColorFromSession(); var c = API.GetLastColorFromSession();
pnl.BackgroundColor = c; pnl.BackgroundColor = c;
pnl.BackgroundImage = null; pnl.BackgroundImage = null;
pnl.ImagePath = null;
}; };
} }
else if(e.Button == MouseButtons.Right) else if(e.Button == MouseButtons.Right)

View file

@ -1,5 +1,6 @@
{ {
"BufferOverflow":{"IsLeader":false,"Name":"BufferOverflow","FriendDesc":"BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.","Description":"BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.","FriendSpeed":0,"FriendSkill":0,"Difficulty":"easy","Network":[{"Hostname":"bufferoverflow","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"main_av","ModuleType":0,"Type":1,"HP":0,"Grade":4,"X":371,"Y":148},{"Hostname":"defense1","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":252,"Y":121},{"Hostname":"defense2","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":251,"Y":163}]}, "BufferOverflow":{"IsLeader":false,"Name":"BufferOverflow","FriendDesc":"BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.","Description":"BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.","FriendSpeed":0,"FriendSkill":0,"Difficulty":"easy","Network":[{"Hostname":"bufferoverflow","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"main_av","ModuleType":0,"Type":1,"HP":0,"Grade":4,"X":371,"Y":148},{"Hostname":"defense1","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":252,"Y":121},{"Hostname":"defense2","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":251,"Y":163}]},
"Exodus Software":{"IsLeader":false,"Name":"Exodus Software","FriendDesc":"Known for their ShiftOS desktop environment \"Exodus Desktop Environment\", Exodus Software is well-known among the ShiftOS user-base. Now they're trying to dig their hands into hacker battles.","Description":"Known for their ShiftOS desktop environment \"Exodus Desktop Environment\", Exodus Software is well-known among the ShiftOS user-base. Now they're trying to dig their hands into hacker battles.","FriendSpeed":75,"FriendSkill":45,"Difficulty":"easy","Network":[{"Hostname":"exodus_software","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"exds_turret1","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":500,"Y":215},{"Hostname":"exds_antimalware","ModuleType":0,"Type":1,"HP":0,"Grade":1,"X":500,"Y":259},{"Hostname":"exds_antimalware2","ModuleType":0,"Type":1,"HP":0,"Grade":1,"X":498,"Y":162},{"Hostname":"exds_repairman","ModuleType":0,"Type":9,"HP":0,"Grade":2,"X":351,"Y":210}]}, "Exodus Software":{"IsLeader":false,"Name":"Exodus Software","FriendDesc":"Known for their ShiftOS desktop environment \"Exodus Desktop Environment\", Exodus Software is well-known among the ShiftOS user-base. Now they're trying to dig their hands into hacker battles.","Description":"Known for their ShiftOS desktop environment \"Exodus Desktop Environment\", Exodus Software is well-known among the ShiftOS user-base. Now they're trying to dig their hands into hacker battles.","FriendSpeed":75,"FriendSkill":45,"Difficulty":"easy","Network":[{"Hostname":"exodus_software","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"exds_turret1","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":500,"Y":215},{"Hostname":"exds_antimalware","ModuleType":0,"Type":1,"HP":0,"Grade":1,"X":500,"Y":259},{"Hostname":"exds_antimalware2","ModuleType":0,"Type":1,"HP":0,"Grade":1,"X":498,"Y":162},{"Hostname":"exds_repairman","ModuleType":0,"Type":9,"HP":0,"Grade":2,"X":351,"Y":210}]},
"Orange Inc.":{"IsLeader":false,"Name":"Orange Inc.","FriendDesc":"Orange is a computer industry giant. Let's see how they can compete in a Hacker Battle.","Description":"Orange is a computer industry giant. Let's see how they can compete in a Hacker Battle.","FriendSpeed":100,"FriendSkill":2001,"Difficulty":"hard","Network":[{"Hostname":"orange_inc.","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"blood_orange","ModuleType":0,"Type":6,"HP":0,"Grade":4,"X":484,"Y":203},{"Hostname":"yummy","ModuleType":0,"Type":2,"HP":0,"Grade":3,"X":497,"Y":150},{"Hostname":"juicy","ModuleType":0,"Type":5,"HP":0,"Grade":4,"X":356,"Y":212},{"Hostname":"sweet","ModuleType":0,"Type":9,"HP":0,"Grade":2,"X":316,"Y":212},{"Hostname":"orange","ModuleType":0,"Type":2,"HP":0,"Grade":3,"X":490,"Y":270}]} "Orange Inc.":{"IsLeader":false,"Name":"Orange Inc.","FriendDesc":"Orange is a computer industry giant. Let's see how they can compete in a Hacker Battle.","Description":"Orange is a computer industry giant. Let's see how they can compete in a Hacker Battle.","FriendSpeed":100,"FriendSkill":2001,"Difficulty":"hard","Network":[{"Hostname":"orange_inc.","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"blood_orange","ModuleType":0,"Type":6,"HP":0,"Grade":4,"X":484,"Y":203},{"Hostname":"yummy","ModuleType":0,"Type":2,"HP":0,"Grade":3,"X":497,"Y":150},{"Hostname":"juicy","ModuleType":0,"Type":5,"HP":0,"Grade":4,"X":356,"Y":212},{"Hostname":"sweet","ModuleType":0,"Type":9,"HP":0,"Grade":2,"X":316,"Y":212},{"Hostname":"orange","ModuleType":0,"Type":2,"HP":0,"Grade":3,"X":490,"Y":270}]},
"UltraDOS Foundation":{"IsLeader":false,"Name":"UltraDOS Foundation","FriendDesc":"UltraDOS Foundation is a group of competent programmers responsible for the ShiftOS-based UltraDOS operating system.","Description":"UltraDOS Foundation is a group of competent programmers responsible for the ShiftOS-based UltraDOS operating system.","FriendSpeed":65,"FriendSkill":75,"Difficulty":"medium","Network":[{"Hostname":"ultrados_foundation","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"ud_trt1","ModuleType":0,"Type":3,"HP":0,"Grade":2,"X":361,"Y":171},{"Hostname":"ud_trt2","ModuleType":0,"Type":3,"HP":0,"Grade":2,"X":358,"Y":220},{"Hostname":"ud_repairer","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":494,"Y":215}]}
} }

View file

@ -4,6 +4,7 @@
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -482,6 +483,7 @@ private void btnwindows_Click(object sender, EventArgs e)
public void GrabSkinData() public void GrabSkinData()
{ {
Skinning.Utilities.SavePanels();
string json = JsonConvert.SerializeObject(API.CurrentSkin); string json = JsonConvert.SerializeObject(API.CurrentSkin);
CustomizingSkin = JsonConvert.DeserializeObject<Skinning.Skin>(json); CustomizingSkin = JsonConvert.DeserializeObject<Skinning.Skin>(json);
GetAllImages(); GetAllImages();
@ -625,6 +627,8 @@ private void btnapply_Click(object sender, EventArgs e)
Skinning.Utilities.loadedSkin = CustomizingSkin; Skinning.Utilities.loadedSkin = CustomizingSkin;
Skinning.Utilities.loadedskin_images = CustomizingImages; Skinning.Utilities.loadedskin_images = CustomizingImages;
API.CurrentSkin.DesktopPanels = JsonConvert.DeserializeObject<List<Skinning.DesktopPanel>>(File.ReadAllText(Paths.LoadedSkin + "panels.json"));
Skinning.Utilities.LoadPanels();
Skinning.Utilities.saveimages(); Skinning.Utilities.saveimages();
Skinning.Utilities.saveskin(); Skinning.Utilities.saveskin();
API.AddCodepoints(codepointstogive); API.AddCodepoints(codepointstogive);

View file

@ -1451,6 +1451,8 @@ public void DoCommand()
} }
break; break;
case "endgame_test": case "endgame_test":
if (API.DeveloperMode)
{
try try
{ {
switch (args[1]) switch (args[1])
@ -1471,8 +1473,15 @@ public void DoCommand()
{ {
WriteLine("Invalid arguments."); WriteLine("Invalid arguments.");
} }
}
else
{
wrongcommand();
}
break; break;
case "fake_buy": case "fake_buy":
if (API.DeveloperMode)
{
try try
{ {
if (API.Upgrades.ContainsKey(args[1])) if (API.Upgrades.ContainsKey(args[1]))
@ -1492,6 +1501,11 @@ public void DoCommand()
{ {
WriteLine("fake_buy: Bad arguments."); WriteLine("fake_buy: Bad arguments.");
} }
}
else
{
wrongcommand();
}
break; break;
case "connections": case "connections":
try try
@ -1571,21 +1585,9 @@ public void DoCommand()
else { wrongcommand(); } else { wrongcommand(); }
break; break;
case "htutorial": case "htutorial":
if (API.DeveloperMode)
{
ShiftOS.Hacking.StartBattleTutorial(); ShiftOS.Hacking.StartBattleTutorial();
break;
case "lua_test":
if(API.DeveloperMode == true)
{
if(Lua_API.UseLuaAPI == true)
{
WriteLine("Lua API disabled, 'saa' command uses old Modding API");
Lua_API.UseLuaAPI = false;
}
else
{
WriteLine("ShiftOS Lua API enabled. 'saa' command now parses Lua code and interprets it.");
Lua_API.UseLuaAPI = true;
}
} }
else else
{ {
@ -1613,6 +1615,8 @@ public void DoCommand()
} }
break; break;
case "toggle_music": case "toggle_music":
if (API.DeveloperMode)
{
if (Audio.Enabled == false) if (Audio.Enabled == false)
{ {
WriteLine(@"Music enabled. WriteLine(@"Music enabled.
@ -1622,6 +1626,11 @@ public void DoCommand()
Warning: Music is not embedded within the game. You must download the external resources directory at http://playshiftos.ml/shiftos/resources.zip to have applications play their music."); Warning: Music is not embedded within the game. You must download the external resources directory at http://playshiftos.ml/shiftos/resources.zip to have applications play their music.");
} }
Audio.Enabled = !Audio.Enabled; Audio.Enabled = !Audio.Enabled;
}
else
{
wrongcommand();
}
break; break;
case "linux": case "linux":
if(API.DeveloperMode) if(API.DeveloperMode)
@ -1651,22 +1660,6 @@ public void DoCommand()
wrongcommand(); wrongcommand();
} }
break; break;
case "enemy_test":
var e = new EnemyHacker("DevX", "I am the god of this world.", "I am the god of this world.", 100, 100, "Hard");
e.AddModule(new Module(SystemType.Antivirus, 4, "you_can't_stop_me"));
e.AddModule(new Module(SystemType.Antivirus, 4, "not_happening"));
e.AddModule(new Module(SystemType.DedicatedDDoS, 2, "dos"));
e.AddModule(new Module(SystemType.Turret, 4, "remotehost"));
e.AddModule(new Module(SystemType.Turret, 2, "boom"));
string json = JsonConvert.SerializeObject(e);
var tp = new TextPad();
API.CreateForm(tp, "Enemy JSON", API.GetIcon("TextPad"));
tp.txtuserinput.Text = json;
break;
case "htest":
var hui = new HackUI();
hui.Show();
break;
case "lua": case "lua":
if(API.DeveloperMode == true) if(API.DeveloperMode == true)
{ {
@ -1720,17 +1713,6 @@ public void DoCommand()
wrongcommand(); wrongcommand();
} }
break; break;
case "unitytest":
if (API.DeveloperMode == true)
{
var u = new AlternateDesktop();
u.Show();
}
else
{
wrongcommand();
}
break;
case "virusscanner": case "virusscanner":
case "vscan": case "vscan":
if(API.Upgrades["virusscanner"] == true) if(API.Upgrades["virusscanner"] == true)
@ -1792,26 +1774,16 @@ public void DoCommand()
wrongcommand(); wrongcommand();
} }
break; break;
case "infect": case "binarywater":
try { if (API.DeveloperMode)
if (API.DeveloperMode == true)
{ {
Viruses.InfectRandom(); ShiftOS.Hacking.AddCharacter(new Character("Philip Adams", "Hello, and welcome to another episode of OSFirstTimer.", 100, 100, 0));
WriteLine("A random file has been infected."); WriteLine("Philip Adams is now in the list of hirable hackers.");
} }
else else
{ {
wrongcommand(); 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.");
} }
}
catch(Exception ex)
{
WriteLine("infect: Error. Probably a mess-up with the virus scanner.");
}
break;
case "binarywater":
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.");
break; break;
case "color": case "color":
try try
@ -2159,75 +2131,11 @@ public void DoCommand()
{ {
showhelp(args[1]); showhelp(args[1]);
} }
catch (Exception ex) catch
{ {
showhelp(); showhelp();
} }
break; break;
case "kill":
if(API.Upgrades["shiftnet"] == true)
{
List<Process> cleanup = new List<Process>();
try
{
foreach (Process mod in API.RunningModProcesses)
{
try
{
if (args[1] == mod.Id.ToString() || args[1].ToLower() == mod.ProcessName.Remove(0, 1).Replace(".exe", "").ToLower())
{
WriteLine("[" + mod.Id.ToString() + "] - Killed.");
cleanup.Add(mod);
mod.Kill();
}
}
catch (Exception ex)
{
}
}
}
catch(Exception ex)
{
WriteLine("kill: Missing argument.");
}
foreach (Process prc in cleanup)
{
try
{
API.RunningModProcesses.Remove(prc);
}
catch (Exception ex)
{
}
}
}
else
{
wrongcommand();
}
break;
case "proclist":
if(API.Upgrades["shiftnet"] == true)
{
WriteLine("Running Applications:");
foreach(Process mod in API.RunningModProcesses)
{
try {
WriteLine("[" + mod.Id.ToString() + "] " + mod.ProcessName.Replace(".exe", ""));
}
catch(Exception ex)
{
}
}
}
else
{
wrongcommand();
}
break;
case "codepoints": case "codepoints":
case "cp": case "cp":
WriteLine("You have " + API.Codepoints.ToString() + " Codepoints."); WriteLine("You have " + API.Codepoints.ToString() + " Codepoints.");
@ -2383,7 +2291,6 @@ public void DoCommand()
} }
break; break;
} }
//cmds(UBound(cmds)) = command
} }
private void StartChoice1EndStory() private void StartChoice1EndStory()

View file

@ -463,19 +463,25 @@ public static void LoadPanels()
public static void SavePanels() public static void SavePanels()
{ {
string dir = Paths.LoadedSkin + "panels"; string dir = Paths.LoadedSkin + "panels";
if(Directory.Exists(dir)) if (!Directory.Exists(dir))
{ {
Directory.Delete(dir, true);
}
Directory.CreateDirectory(dir); Directory.CreateDirectory(dir);
}
foreach (var pnl in loadedSkin.DesktopPanels) foreach (var pnl in loadedSkin.DesktopPanels)
{ {
string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.Position + loadedSkin.DesktopPanels.IndexOf(pnl).ToString(); string dpath = Paths.LoadedSkin + "panels" + OSInfo.DirectorySeparator + pnl.Position + loadedSkin.DesktopPanels.IndexOf(pnl).ToString();
if (pnl.BackgroundImage != null) if (pnl.BackgroundImage != null)
{
try
{ {
pnl.BackgroundImage.Save(dpath); pnl.BackgroundImage.Save(dpath);
pnl.BackgroundImage = null; pnl.BackgroundImage = null;
} }
catch
{
pnl.BackgroundImage = null;
}
}
} }
} }
/// <summary> /// <summary>