More documentation

This commit is contained in:
Michael 2017-04-16 09:48:33 -04:00
parent c145742839
commit a0fc2b5e70
7 changed files with 129 additions and 22 deletions

View file

@ -115,11 +115,12 @@ namespace ShiftOS.WinForms.Applications
paddleHuman.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
//Check if paddle upgrade has been bought and change paddles accordingly
if (ShiftoriumFrontend.UpgradeInstalled("pong_increased_paddle_size"))
{
paddleHuman.Height = 150;
paddleComputer.Height = 150;
}
//if (ShiftoriumFrontend.UpgradeInstalled("pong_increased_paddle_size"))
//{
// paddleHuman.Height = 150;
// paddleComputer.Height = 150;
//}
//I don't know the point of this but I'm fucking 86ing it. - Michael
//Set the computer player to move according to the ball's position.
if (aiShouldIsbeEnabled)

View file

@ -321,7 +321,6 @@ namespace ShiftOS.WinForms.Applications {
if (SaveSystem.CurrentSave != null) {
if (!ShiftoriumFrontend.UpgradeInstalled("window_manager")) {
rtbterm.Text = AppearanceManager.LastTerminalText;
rtbterm.Select(rtbterm.TextLength, 0);
}
TerminalBackend.PrintPrompt();

View file

@ -259,13 +259,6 @@
Category: "Device Drivers",
Description: "With the free placement upgrade, you can place windows of any size anywhere on the desktop, which means theoretically you could add kernel coherence between ShiftOS and another GUI-based operating system and run their applications inside ShiftOS. This upgrade unlocks that.",
},
{
Name: "Pong Increased Paddle Size",
Cost: 1000,
Dependencies: "pong_upgrade",
Category: "Enhancements",
Description: "Having trouble keeping that darn ball in front of you? Well, with this upgrade, your paddle increases in height.... slightly.",
},
{
Name: "WM 4 Windows",
Cost: 150,

View file

@ -125,12 +125,6 @@ namespace ShiftOS.WinForms
public override void SetupWindow(IShiftOSWindow form)
{
if (!AppearanceManager.CanOpenWindow(form))
{
Infobox.Show("{MULTIPLAYER_ONLY}", "{MULTIPLAYER_ONLY_EXP}");
return;
}
foreach(var attr in form.GetType().GetCustomAttributes(true))
{
if(attr is MultiplayerOnlyAttribute)

View file

@ -6,8 +6,14 @@ using System.Threading.Tasks;
namespace ShiftOS.Engine
{
/// <summary>
/// Provides extra eye candy data that can be used by ShiftOS terminals.
/// </summary>
public static class ConsoleEx
{
/// <summary>
/// Initializes the <see cref="ConsoleEx"/> class, performing core configuration.
/// </summary>
static ConsoleEx()
{
ForegroundColor = ConsoleColor.White;
@ -18,11 +24,29 @@ namespace ShiftOS.Engine
Underline = false;
}
/// <summary>
/// Gets or sets the foreground color of text in the Terminal.
/// </summary>
public static ConsoleColor ForegroundColor { get; set; }
/// <summary>
/// Gets or sets the background color of text in the Terminal.
/// </summary>
public static ConsoleColor BackgroundColor { get; set; }
/// <summary>
/// Gets or sets whether text in the Terminal is bold.
/// </summary>
public static bool Bold { get; set; }
/// <summary>
/// Gets or sets whether text in the Terminal is italic.
/// </summary>
public static bool Italic { get; set; }
/// <summary>
/// Gets or sets whether text in the Terminal is underlined.
/// </summary>
public static bool Underline { get; set; }
}
}

View file

@ -97,7 +97,6 @@ namespace ShiftOS.Engine
{
if(SaveSystem.CurrentSave != null)
TerminalBackend.InvokeCommand("sos.save");
AudioManager.Kill();
ServerManager.Disconnect();
while (Application.OpenForms.Count > 0)

View file

@ -37,6 +37,10 @@ using static ShiftOS.Engine.SkinEngine;
namespace ShiftOS.Engine
{
/// <summary>
/// Denotes that this class is launchable from the App Launcher.
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class LauncherAttribute : Attribute
{
/// <summary>
@ -54,10 +58,29 @@ namespace ShiftOS.Engine
ID = upgradeID;
}
/// <summary>
/// Gets or sets the name of the launcher item
/// </summary>
public string Name { get; set; }
/// <summary>
/// Gets or sets whether this entry requires a Shiftorium upgrade.
/// </summary>
public bool RequiresUpgrade { get; set; }
/// <summary>
/// Gets or sets the ID of the required upgrade.
/// </summary>
public string ID { get; set; }
/// <summary>
/// Gets or sets this item's category.
/// </summary>
public string Category { get; private set; }
/// <summary>
/// Gets whether or not the required upgrade is installed.
/// </summary>
public bool UpgradeInstalled
{
get
@ -70,36 +93,110 @@ namespace ShiftOS.Engine
}
}
/// <summary>
/// Provides core functionality for a typical ShiftOS desktop.
/// </summary>
public interface IDesktop
{
/// <summary>
/// Gets the name of the desktop.
/// </summary>
string DesktopName { get; }
/// <summary>
/// Performs most of the skinning and layout handling for the desktop.
/// </summary>
void SetupDesktop();
/// <summary>
/// Hides the currently-opened app launcher menu.
/// </summary>
void HideAppLauncher();
/// <summary>
/// Populates the app launcher menu.
/// </summary>
/// <param name="items">All items to be placed in the menu.</param>
void PopulateAppLauncher(LauncherItem[] items);
/// <summary>
/// Handles desktop-specific routines for showing ShiftOS windows.
/// </summary>
/// <param name="border">The calling window.</param>
void ShowWindow(IWindowBorder border);
/// <summary>
/// Handles desktop-specific routines for closing ShiftOS windows.
/// </summary>
/// <param name="border">The calling window.</param>
void KillWindow(IWindowBorder border);
/// <summary>
/// Populates the panel button list with all open windows.
/// </summary>
void PopulatePanelButtons();
/// <summary>
/// Performs desktop-specific routines for minimizing a window.
/// </summary>
/// <param name="brdr">The calling window.</param>
void MinimizeWindow(IWindowBorder brdr);
/// <summary>
/// Performs desktop-specific routines for maximizing a window.
/// </summary>
/// <param name="brdr">The calling window.</param>
void MaximizeWindow(IWindowBorder brdr);
/// <summary>
/// Performs desktop-specific routines for restoring a window to its default state.
/// </summary>
/// <param name="brdr">The calling window.</param>
void RestoreWindow(IWindowBorder brdr);
/// <summary>
/// Invokes an action on the UI thread.
/// </summary>
/// <param name="act">The action to invoke.</param>
void InvokeOnWorkerThread(Action act);
/// <summary>
/// Calculates the screen size of the desktop.
/// </summary>
/// <returns>The desktop's screen size.</returns>
Size GetSize();
/// <summary>
/// Opens the app launcher at a specific point.
/// </summary>
/// <param name="loc">Where the app launcher should be opened.</param>
void OpenAppLauncher(Point loc);
/// <summary>
/// Opens the desktop.
/// </summary>
void Show();
/// <summary>
/// Closes the desktop.
/// </summary>
void Close();
}
public static class Desktop
{
/// <summary>
/// The underlying desktop object.
/// </summary>
private static IDesktop _desktop = null;
public static Size Size { get
public static Size Size
{
get
{
return _desktop.GetSize();
}