aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS_TheReturn')
-rw-r--r--ShiftOS_TheReturn/Commands.cs16
-rw-r--r--ShiftOS_TheReturn/Desktop.cs27
-rw-r--r--ShiftOS_TheReturn/Scripting.cs2
3 files changed, 44 insertions, 1 deletions
diff --git a/ShiftOS_TheReturn/Commands.cs b/ShiftOS_TheReturn/Commands.cs
index dcc96f2..acbecce 100644
--- a/ShiftOS_TheReturn/Commands.cs
+++ b/ShiftOS_TheReturn/Commands.cs
@@ -230,9 +230,25 @@ namespace ShiftOS.Engine
}
#if DEVEL
+ internal class Rock : Exception
+ {
+ internal Rock() : base("Someone threw a motherfucking rock at the window, and the Terminal fucking shattered.")
+ {
+
+ }
+ }
+
[Namespace("dev")]
public static class ShiftOSDevCommands
{
+ [Command("rock", description = "A little surprise for unstable builds...")]
+ public static bool ThrowAFuckingRock()
+ {
+ Infobox.Show("Fuck.", new Rock().Message);
+ return false;
+ }
+
+
[Command("unbuy")]
[RequiresArgument("upgrade")]
public static bool UnbuyUpgrade(Dictionary<string, object> args)
diff --git a/ShiftOS_TheReturn/Desktop.cs b/ShiftOS_TheReturn/Desktop.cs
index 712f05d..d30e3c3 100644
--- a/ShiftOS_TheReturn/Desktop.cs
+++ b/ShiftOS_TheReturn/Desktop.cs
@@ -32,6 +32,7 @@ using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using ShiftOS.Objects.ShiftFS;
using static ShiftOS.Engine.SkinEngine;
namespace ShiftOS.Engine
@@ -72,6 +73,8 @@ namespace ShiftOS.Engine
public interface IDesktop
{
+ string DesktopName { get; }
+
void SetupDesktop();
void PopulateAppLauncher(LauncherItem[] items);
void ShowWindow(IWindowBorder border);
@@ -88,6 +91,30 @@ namespace ShiftOS.Engine
{
private static IDesktop _desktop = null;
+ public static IDesktop[] GetAllDesktops()
+ {
+ List<IDesktop> desktops = new List<IDesktop>();
+ foreach(var exe in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
+ {
+ if(exe.EndsWith(".exe") || exe.EndsWith(".dll"))
+ {
+ try
+ {
+ var asm = Assembly.LoadFile(exe);
+ foreach(var type in asm.GetTypes())
+ {
+ if (type.GetInterfaces().Contains(typeof(IDesktop)))
+ {
+ desktops.Add(Activator.CreateInstance(type) as IDesktop);
+ }
+ }
+ }
+ catch { }
+ }
+ }
+ return desktops.ToArray();
+ }
+
public static Size Size { get
{
return _desktop.GetSize();
diff --git a/ShiftOS_TheReturn/Scripting.cs b/ShiftOS_TheReturn/Scripting.cs
index 246852f..e699939 100644
--- a/ShiftOS_TheReturn/Scripting.cs
+++ b/ShiftOS_TheReturn/Scripting.cs
@@ -40,7 +40,7 @@ namespace ShiftOS.Engine.Scripting
{
public class LuaInterpreter
{
- dynamic Lua = new DynamicLua.DynamicLua();
+ public dynamic Lua = new DynamicLua.DynamicLua();
public bool Running = true;
public LuaInterpreter()