From a9754b7df28795b6bb2c5cfe04c1b38b19fb0d05 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 10 Mar 2017 12:29:28 -0500 Subject: Lock certain apps away when system offline. --- ShiftOS_TheReturn/AppLauncherDaemon.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'ShiftOS_TheReturn/AppLauncherDaemon.cs') diff --git a/ShiftOS_TheReturn/AppLauncherDaemon.cs b/ShiftOS_TheReturn/AppLauncherDaemon.cs index 7ef34c1..5e3bd72 100644 --- a/ShiftOS_TheReturn/AppLauncherDaemon.cs +++ b/ShiftOS_TheReturn/AppLauncherDaemon.cs @@ -66,12 +66,24 @@ namespace ShiftOS.Engine { foreach (var attr in type.GetCustomAttributes(false)) { - if (attr is LauncherAttribute) + bool isAllowed = true; + if(attr is MultiplayerOnlyAttribute) { - var launch = attr as LauncherAttribute; - if (launch.UpgradeInstalled) + if(KernelWatchdog.MudConnected == false) { - win.Add(new LauncherItem { DisplayData = launch, LaunchType = type }); + isAllowed = false; + + } + } + if (isAllowed == true) + { + if (attr is LauncherAttribute) + { + var launch = attr as LauncherAttribute; + if (launch.UpgradeInstalled) + { + win.Add(new LauncherItem { DisplayData = launch, LaunchType = type }); + } } } } -- cgit v1.2.3 From 112c05cb5e460e277ea93604ba1bb5d6ea010f0a Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 16 Apr 2017 08:12:30 -0400 Subject: Document the App Launcher Daemon --- ShiftOS_TheReturn/AppLauncherDaemon.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'ShiftOS_TheReturn/AppLauncherDaemon.cs') diff --git a/ShiftOS_TheReturn/AppLauncherDaemon.cs b/ShiftOS_TheReturn/AppLauncherDaemon.cs index 5e3bd72..d1506b2 100644 --- a/ShiftOS_TheReturn/AppLauncherDaemon.cs +++ b/ShiftOS_TheReturn/AppLauncherDaemon.cs @@ -34,8 +34,17 @@ using ShiftOS.Objects.ShiftFS; namespace ShiftOS.Engine { + /// + /// Provides functionality for pulling data about the App Launcher. + /// public static class AppLauncherDaemon { + /// + /// Extension method that allows you to determine if a list of s contains a given name. + /// + /// The list of assembly names + /// The name to look for. + /// Whether or not the name was found in the list. public static bool Contains(this AssemblyName[] asms, string name) { foreach(var asm in asms) @@ -46,6 +55,10 @@ namespace ShiftOS.Engine return false; } + /// + /// Pulls a list of all available App Launcher items. + /// + /// A containing all available App Launcher items. public static List Available() { List win = new List(); @@ -111,20 +124,39 @@ namespace ShiftOS.Engine } + /// + /// Provides a data object for app launcher items + /// public class LauncherItem { + /// + /// Display data including icons, names, and the category of the item. + /// public LauncherAttribute DisplayData { get; internal set; } + /// + /// A .NET that is associated with this item. + /// public Type LaunchType { get; internal set; } } + /// + /// Provides the ability to run Lua scripts from the App Launcher. + /// public class LuaLauncherItem : LauncherItem { + /// + /// Creates a new instance of the . + /// + /// A script file to run when the item is activated. public LuaLauncherItem(string file) { LaunchPath = file; } + /// + /// Gets or sets the launch path of this App Launcher item. + /// public string LaunchPath { get; private set; } } } -- cgit v1.2.3 From 0f2fc4271ba75e1d2314fbc865682d53472c8d11 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 25 Apr 2017 12:47:20 -0400 Subject: Fix bug with App Launcher & upgrades --- ShiftOS_TheReturn/AppLauncherDaemon.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ShiftOS_TheReturn/AppLauncherDaemon.cs') diff --git a/ShiftOS_TheReturn/AppLauncherDaemon.cs b/ShiftOS_TheReturn/AppLauncherDaemon.cs index d1506b2..716a6a3 100644 --- a/ShiftOS_TheReturn/AppLauncherDaemon.cs +++ b/ShiftOS_TheReturn/AppLauncherDaemon.cs @@ -77,9 +77,9 @@ namespace ShiftOS.Engine { if (type.GetInterfaces().Contains(typeof(IShiftOSWindow))) { + bool isAllowed = true; foreach (var attr in type.GetCustomAttributes(false)) { - bool isAllowed = true; if(attr is MultiplayerOnlyAttribute) { if(KernelWatchdog.MudConnected == false) @@ -92,10 +92,13 @@ namespace ShiftOS.Engine { if (attr is LauncherAttribute) { - var launch = attr as LauncherAttribute; - if (launch.UpgradeInstalled) + if (Shiftorium.UpgradeAttributesUnlocked(type)) { - win.Add(new LauncherItem { DisplayData = launch, LaunchType = type }); + var launch = attr as LauncherAttribute; + if (launch.UpgradeInstalled) + { + win.Add(new LauncherItem { DisplayData = launch, LaunchType = type }); + } } } } -- cgit v1.2.3