aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1
diff options
context:
space:
mode:
Diffstat (limited to 'source/WindowsFormsApplication1')
-rw-r--r--source/WindowsFormsApplication1/API.cs155
-rw-r--r--source/WindowsFormsApplication1/AlternateDesktop.Designer.cs133
-rw-r--r--source/WindowsFormsApplication1/AlternateDesktop.cs165
-rw-r--r--source/WindowsFormsApplication1/Apps/Appscape.Designer.cs (renamed from source/WindowsFormsApplication1/Appscape.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Appscape.cs (renamed from source/WindowsFormsApplication1/Appscape.cs)10
-rw-r--r--source/WindowsFormsApplication1/Apps/Appscape.resx (renamed from source/WindowsFormsApplication1/Appscape.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/AppscapeUploader.Designer.cs (renamed from source/WindowsFormsApplication1/AppscapeUploader.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/AppscapeUploader.cs (renamed from source/WindowsFormsApplication1/AppscapeUploader.cs)9
-rw-r--r--source/WindowsFormsApplication1/Apps/AppscapeUploader.resx (renamed from source/WindowsFormsApplication1/AppscapeUploader.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Artpad.Designer.cs (renamed from source/WindowsFormsApplication1/Artpad.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Artpad.cs (renamed from source/WindowsFormsApplication1/Artpad.cs)10
-rw-r--r--source/WindowsFormsApplication1/Apps/Artpad.resx (renamed from source/WindowsFormsApplication1/Artpad.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteConverter.Designer.cs (renamed from source/WindowsFormsApplication1/BitnoteConverter.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteConverter.cs (renamed from source/WindowsFormsApplication1/BitnoteConverter.cs)2
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteConverter.resx (renamed from source/WindowsFormsApplication1/BitnoteConverter.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteDigger.Designer.cs (renamed from source/WindowsFormsApplication1/BitnoteDigger.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteDigger.cs (renamed from source/WindowsFormsApplication1/BitnoteDigger.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteDigger.resx (renamed from source/WindowsFormsApplication1/BitnoteDigger.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteWallet.Designer.cs (renamed from source/WindowsFormsApplication1/BitnoteWallet.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteWallet.cs (renamed from source/WindowsFormsApplication1/BitnoteWallet.cs)4
-rw-r--r--source/WindowsFormsApplication1/Apps/BitnoteWallet.resx (renamed from source/WindowsFormsApplication1/BitnoteWallet.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Dodge.Designer.cs (renamed from source/WindowsFormsApplication1/Dodge.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Dodge.cs (renamed from source/WindowsFormsApplication1/Dodge.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Dodge.resx (renamed from source/WindowsFormsApplication1/Dodge.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/File Skimmer.Designer.cs (renamed from source/WindowsFormsApplication1/File Skimmer.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/File Skimmer.cs (renamed from source/WindowsFormsApplication1/File Skimmer.cs)13
-rw-r--r--source/WindowsFormsApplication1/Apps/File Skimmer.resx (renamed from source/WindowsFormsApplication1/File Skimmer.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/HoloChat.Designer.cs (renamed from source/WindowsFormsApplication1/HoloChat.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/HoloChat.cs (renamed from source/WindowsFormsApplication1/HoloChat.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/HoloChat.resx (renamed from source/WindowsFormsApplication1/HoloChat.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/IconManager.Designer.cs (renamed from source/WindowsFormsApplication1/IconManager.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/IconManager.cs (renamed from source/WindowsFormsApplication1/IconManager.cs)4
-rw-r--r--source/WindowsFormsApplication1/Apps/IconManager.resx (renamed from source/WindowsFormsApplication1/IconManager.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/KnowledgeInput.Designer.cs (renamed from source/WindowsFormsApplication1/KnowledgeInput.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/KnowledgeInput.cs (renamed from source/WindowsFormsApplication1/KnowledgeInput.cs)3
-rw-r--r--source/WindowsFormsApplication1/Apps/KnowledgeInput.resx (renamed from source/WindowsFormsApplication1/KnowledgeInput.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Labyrinth.Designer.cs (renamed from source/WindowsFormsApplication1/Labyrinth.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Labyrinth.cs (renamed from source/WindowsFormsApplication1/Labyrinth.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NameChanger.Designer.cs (renamed from source/WindowsFormsApplication1/NameChanger.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NameChanger.cs (renamed from source/WindowsFormsApplication1/NameChanger.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NameChanger.resx (renamed from source/WindowsFormsApplication1/NameChanger.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NetGen.Designer.cs (renamed from source/WindowsFormsApplication1/NetGen.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NetGen.cs (renamed from source/WindowsFormsApplication1/NetGen.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NetGen.resx (renamed from source/WindowsFormsApplication1/NetGen.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/NetworkBrowser.Designer.cs (renamed from source/WindowsFormsApplication1/NetworkBrowser.Designer.cs)153
-rw-r--r--source/WindowsFormsApplication1/Apps/NetworkBrowser.cs461
-rw-r--r--source/WindowsFormsApplication1/Apps/NetworkBrowser.resx (renamed from source/WindowsFormsApplication1/NetworkBrowser.resx)7
-rw-r--r--source/WindowsFormsApplication1/Apps/PanelManager.Designer.cs (renamed from source/WindowsFormsApplication1/PanelManager.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/PanelManager.cs (renamed from source/WindowsFormsApplication1/PanelManager.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/PanelManager.resx (renamed from source/WindowsFormsApplication1/PanelManager.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Pong.Designer.cs (renamed from source/WindowsFormsApplication1/Pong.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Pong.cs (renamed from source/WindowsFormsApplication1/Pong.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Pong.resx (renamed from source/WindowsFormsApplication1/Pong.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Shifter.Designer.cs (renamed from source/WindowsFormsApplication1/Shifter.Designer.cs)320
-rw-r--r--source/WindowsFormsApplication1/Apps/Shifter.cs (renamed from source/WindowsFormsApplication1/Shifter.cs)190
-rw-r--r--source/WindowsFormsApplication1/Apps/Shifter.resx (renamed from source/WindowsFormsApplication1/Shifter.resx)3
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs (renamed from source/WindowsFormsApplication1/Shiftnet.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftnet.cs (renamed from source/WindowsFormsApplication1/Shiftnet.cs)2
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftnet.resx (renamed from source/WindowsFormsApplication1/Shiftnet.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.Designer.cs (renamed from source/WindowsFormsApplication1/ShiftnetDecryptor.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.cs (renamed from source/WindowsFormsApplication1/ShiftnetDecryptor.cs)4
-rw-r--r--source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.resx (renamed from source/WindowsFormsApplication1/ShiftnetDecryptor.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftorium.Designer.cs (renamed from source/WindowsFormsApplication1/Shiftorium.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftorium.cs (renamed from source/WindowsFormsApplication1/Shiftorium.cs)6
-rw-r--r--source/WindowsFormsApplication1/Apps/Shiftorium.resx (renamed from source/WindowsFormsApplication1/Shiftorium.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/SkinLoader.Designer.cs (renamed from source/WindowsFormsApplication1/SkinLoader.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/SkinLoader.cs (renamed from source/WindowsFormsApplication1/SkinLoader.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/SkinLoader.resx (renamed from source/WindowsFormsApplication1/SkinLoader.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Terminal.Designer.cs (renamed from source/WindowsFormsApplication1/Terminal.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/Terminal.cs (renamed from source/WindowsFormsApplication1/Terminal.cs)128
-rw-r--r--source/WindowsFormsApplication1/Apps/Terminal.resx (renamed from source/WindowsFormsApplication1/Terminal.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/TextPad.Designer.cs (renamed from source/WindowsFormsApplication1/TextPad.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/TextPad.cs (renamed from source/WindowsFormsApplication1/TextPad.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/TextPad.resx (renamed from source/WindowsFormsApplication1/TextPad.resx)0
-rw-r--r--source/WindowsFormsApplication1/Apps/WidgetManager.Designer.cs (renamed from source/WindowsFormsApplication1/WidgetManager.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/WidgetManager.cs (renamed from source/WindowsFormsApplication1/WidgetManager.cs)0
-rw-r--r--source/WindowsFormsApplication1/Apps/WidgetManager.resx (renamed from source/WindowsFormsApplication1/WidgetManager.resx)0
-rw-r--r--source/WindowsFormsApplication1/AudioResourceClient.cs250
-rw-r--r--source/WindowsFormsApplication1/Controls/Computer.Designer.cs (renamed from source/WindowsFormsApplication1/Computer.Designer.cs)4
-rw-r--r--source/WindowsFormsApplication1/Controls/Computer.cs (renamed from source/WindowsFormsApplication1/Computer.cs)80
-rw-r--r--source/WindowsFormsApplication1/Controls/Computer.resx (renamed from source/WindowsFormsApplication1/Computer.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/Connection.Designer.cs (renamed from source/WindowsFormsApplication1/Connection.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/Connection.cs (renamed from source/WindowsFormsApplication1/Connection.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/Connection.resx (renamed from source/WindowsFormsApplication1/Connection.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/DesktopIcon.Designer.cs (renamed from source/WindowsFormsApplication1/DesktopIcon.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/DesktopIcon.cs (renamed from source/WindowsFormsApplication1/DesktopIcon.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/DesktopIcon.resx (renamed from source/WindowsFormsApplication1/DesktopIcon.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/IconControl.Designer.cs (renamed from source/WindowsFormsApplication1/IconControl.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/IconControl.cs (renamed from source/WindowsFormsApplication1/IconControl.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/IconControl.resx (renamed from source/WindowsFormsApplication1/IconControl.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ImageSelector.Designer.cs (renamed from source/WindowsFormsApplication1/ImageSelector.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ImageSelector.cs (renamed from source/WindowsFormsApplication1/ImageSelector.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ImageSelector.resx (renamed from source/WindowsFormsApplication1/ImageSelector.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/NetModuleStatus.Designer.cs (renamed from source/WindowsFormsApplication1/NetModuleStatus.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/NetModuleStatus.cs (renamed from source/WindowsFormsApplication1/NetModuleStatus.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/NetModuleStatus.resx (renamed from source/WindowsFormsApplication1/NetModuleStatus.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/Notification.Designer.cs (renamed from source/WindowsFormsApplication1/Notification.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/Notification.cs (renamed from source/WindowsFormsApplication1/Notification.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/Notification.resx (renamed from source/WindowsFormsApplication1/Notification.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ProgressBarEX.Designer.cs (renamed from source/WindowsFormsApplication1/ProgressBarEX.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ProgressBarEX.cs (renamed from source/WindowsFormsApplication1/ProgressBarEX.cs)37
-rw-r--r--source/WindowsFormsApplication1/Controls/ProgressBarEX.resx (renamed from source/WindowsFormsApplication1/ProgressBarEX.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterColorInput.Designer.cs77
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterColorInput.cs47
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterColorInput.resx (renamed from source/WindowsFormsApplication1/Color_Picker.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterGraphicInput.Designer.cs76
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterGraphicInput.cs49
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterGraphicInput.resx (renamed from source/WindowsFormsApplication1/ListViewEx.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterIntInput.Designer.cs83
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterIntInput.cs62
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterIntInput.resx (renamed from source/WindowsFormsApplication1/infobox.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterTextInput.Designer.cs78
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterTextInput.cs65
-rw-r--r--source/WindowsFormsApplication1/Controls/ShifterTextInput.resx (renamed from source/WindowsFormsApplication1/Jumper.resx)3
-rw-r--r--source/WindowsFormsApplication1/Controls/SyntaxHighlighter.cs324
-rw-r--r--source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs (renamed from source/WindowsFormsApplication1/WindowBorder.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/WindowBorder.cs (renamed from source/WindowsFormsApplication1/WindowBorder.cs)135
-rw-r--r--source/WindowsFormsApplication1/Controls/WindowBorder.resx (renamed from source/WindowsFormsApplication1/WindowBorder.resx)0
-rw-r--r--source/WindowsFormsApplication1/Controls/infobox.Designer.cs (renamed from source/WindowsFormsApplication1/infobox.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/infobox.cs (renamed from source/WindowsFormsApplication1/infobox.cs)0
-rw-r--r--source/WindowsFormsApplication1/Controls/infobox.resx (renamed from source/WindowsFormsApplication1/Hacking_Enemy.resx)3
-rw-r--r--source/WindowsFormsApplication1/CreditScroller.Designer.cs263
-rw-r--r--source/WindowsFormsApplication1/CreditScroller.cs273
-rw-r--r--source/WindowsFormsApplication1/CreditScroller.resx (renamed from source/WindowsFormsApplication1/Template.resx)13
-rw-r--r--source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.Designer.cs (renamed from source/WindowsFormsApplication1/ShiftOSDesktop.Designer.cs)2
-rw-r--r--source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.cs (renamed from source/WindowsFormsApplication1/ShiftOSDesktop.cs)115
-rw-r--r--source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.resx (renamed from source/WindowsFormsApplication1/ShiftOSDesktop.resx)0
-rw-r--r--source/WindowsFormsApplication1/Dialogs/Color_Picker.Designer.cs (renamed from source/WindowsFormsApplication1/Color_Picker.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Dialogs/Color_Picker.cs (renamed from source/WindowsFormsApplication1/Color_Picker.cs)0
-rw-r--r--source/WindowsFormsApplication1/Dialogs/Color_Picker.resx (renamed from source/WindowsFormsApplication1/QuickChat.resx)3
-rw-r--r--source/WindowsFormsApplication1/Dialogs/Graphic_Picker.Designer.cs (renamed from source/WindowsFormsApplication1/Graphic_Picker.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Dialogs/Graphic_Picker.cs (renamed from source/WindowsFormsApplication1/Graphic_Picker.cs)0
-rw-r--r--source/WindowsFormsApplication1/Dialogs/Graphic_Picker.resx (renamed from source/WindowsFormsApplication1/Graphic_Picker.resx)0
-rw-r--r--source/WindowsFormsApplication1/Engine/AudioResourceClient.cs208
-rw-r--r--source/WindowsFormsApplication1/Engine/Lua_Interp.cs (renamed from source/WindowsFormsApplication1/Lua_Interp.cs)318
-rw-r--r--source/WindowsFormsApplication1/Engine/SaveSystem.cs (renamed from source/WindowsFormsApplication1/SaveSystem.cs)38
-rw-r--r--source/WindowsFormsApplication1/Engine/Viruses.cs (renamed from source/WindowsFormsApplication1/Viruses.cs)25
-rw-r--r--source/WindowsFormsApplication1/Engine/undo.cs (renamed from source/WindowsFormsApplication1/undo.cs)0
-rw-r--r--source/WindowsFormsApplication1/FinalMission/ChooseYourApproach.cs25
-rw-r--r--source/WindowsFormsApplication1/GameSettings.Designer.cs130
-rw-r--r--source/WindowsFormsApplication1/GameSettings.cs50
-rw-r--r--source/WindowsFormsApplication1/GameSettings.resx (renamed from source/WindowsFormsApplication1/AlternateDesktop.resx)6
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs (renamed from source/WindowsFormsApplication1/HackUI.Designer.cs)142
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HackUI.cs (renamed from source/WindowsFormsApplication1/HackUI.cs)903
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HackUI.resx (renamed from source/WindowsFormsApplication1/HackUI.resx)12
-rw-r--r--source/WindowsFormsApplication1/Gameplay/Hacking.cs (renamed from source/WindowsFormsApplication1/Hacking.cs)23
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs (renamed from source/WindowsFormsApplication1/HijackScreen.Designer.cs)0
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HijackScreen.cs (renamed from source/WindowsFormsApplication1/HijackScreen.cs)0
-rw-r--r--source/WindowsFormsApplication1/Gameplay/HijackScreen.resx (renamed from source/WindowsFormsApplication1/HijackScreen.resx)0
-rw-r--r--source/WindowsFormsApplication1/Hacking_Enemy.Designer.cs98
-rw-r--r--source/WindowsFormsApplication1/Hacking_Enemy.cs322
-rw-r--r--source/WindowsFormsApplication1/Hacking_YourHealth.Designer.cs479
-rw-r--r--source/WindowsFormsApplication1/Hacking_YourHealth.cs950
-rw-r--r--source/WindowsFormsApplication1/Hacking_YourHealth.resx162
-rw-r--r--source/WindowsFormsApplication1/HostLayer/MountMgr.cs (renamed from source/WindowsFormsApplication1/MountMgr.cs)0
-rw-r--r--source/WindowsFormsApplication1/HostLayer/OSInfo.cs (renamed from source/WindowsFormsApplication1/OSInfo.cs)0
-rw-r--r--source/WindowsFormsApplication1/HostLayer/Paths.cs (renamed from source/WindowsFormsApplication1/Paths.cs)3
-rw-r--r--source/WindowsFormsApplication1/Jumper.Designer.cs130
-rw-r--r--source/WindowsFormsApplication1/Jumper.cs146
-rw-r--r--source/WindowsFormsApplication1/Labyrinth.designer.vb1048
-rw-r--r--source/WindowsFormsApplication1/Labyrinth.vb684
-rw-r--r--source/WindowsFormsApplication1/ListViewEx.Designer.cs66
-rw-r--r--source/WindowsFormsApplication1/ListViewEx.cs65
-rw-r--r--source/WindowsFormsApplication1/NetworkBrowser.cs301
-rw-r--r--source/WindowsFormsApplication1/Online/ConnectionManager.Designer.cs129
-rw-r--r--source/WindowsFormsApplication1/Online/ConnectionManager.cs91
-rw-r--r--source/WindowsFormsApplication1/Online/ConnectionManager.resx120
-rw-r--r--source/WindowsFormsApplication1/Online/Hacking/Matchmaker.cs383
-rw-r--r--source/WindowsFormsApplication1/Online/Hacking/Objects.cs37
-rw-r--r--source/WindowsFormsApplication1/Online/Package_Grabber.cs (renamed from source/WindowsFormsApplication1/Package_Grabber.cs)6
-rw-r--r--source/WindowsFormsApplication1/Program.cs20
-rw-r--r--source/WindowsFormsApplication1/Properties/Resources.Designer.cs80
-rw-r--r--source/WindowsFormsApplication1/Properties/Resources.resx24
-rw-r--r--source/WindowsFormsApplication1/QuickChat.Designer.cs228
-rw-r--r--source/WindowsFormsApplication1/QuickChat.cs204
-rw-r--r--source/WindowsFormsApplication1/RemoteCoherence.cs12
-rw-r--r--source/WindowsFormsApplication1/Resources/Credits.txt121
-rw-r--r--source/WindowsFormsApplication1/Resources/MusicData.txt45
-rw-r--r--source/WindowsFormsApplication1/Resources/NetBrowser_Enemies.txt9
-rw-r--r--source/WindowsFormsApplication1/ShiftOS.csproj416
-rw-r--r--source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs (renamed from source/WindowsFormsApplication1/ShiftOSColorTable.cs)0
-rw-r--r--source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs (renamed from source/WindowsFormsApplication1/WindowComposition.cs)3
-rw-r--r--source/WindowsFormsApplication1/SkinEngine/skins.cs (renamed from source/WindowsFormsApplication1/skins.cs)6
-rw-r--r--source/WindowsFormsApplication1/SpeechListener.cs53
-rw-r--r--source/WindowsFormsApplication1/Template.Designer.cs243
-rw-r--r--source/WindowsFormsApplication1/Template.cs589
186 files changed, 5920 insertions, 7057 deletions
diff --git a/source/WindowsFormsApplication1/API.cs b/source/WindowsFormsApplication1/API.cs
index b99f98f..4199223 100644
--- a/source/WindowsFormsApplication1/API.cs
+++ b/source/WindowsFormsApplication1/API.cs
@@ -13,9 +13,20 @@ using System.Security.Cryptography;
using System.Diagnostics;
using System.Net;
using System.ComponentModel;
+using System.Net.NetworkInformation;
namespace ShiftOS
{
+ public static class Consts
+ {
+ public const string Version = "0.1.2";
+ }
+
+ public class Settings
+ {
+ public int MusicVolume { get; set; }
+ }
+
public class PanelButton
{
/// <summary>
@@ -71,6 +82,15 @@ namespace ShiftOS
public class API
{
+ public static Dictionary<Form, string> OpenGUIDs = new Dictionary<Form, string>();
+ public static Dictionary<string, Control> DEF_PanelGUIDs = new Dictionary<string, Control>();
+
+
+ /// <summary>
+ /// Settings file.
+ /// </summary>
+ public static Settings LoadedSettings = null;
+
/// <summary>
/// Whether or not dev commands like '05tray' are available.
/// Typically, this is set to true if the release is classified as
@@ -83,7 +103,7 @@ namespace ShiftOS
/// to test new features or to bring in lots of codepoints. This is why
/// Developer mode should ALWAYS be off in non-dev releases, to prevent cheating.
/// </summary>
- public static bool DeveloperMode = false;
+ public static bool DeveloperMode = true;
/// <summary>
/// If this is true, only certain applications will open and only
@@ -99,6 +119,22 @@ namespace ShiftOS
public static bool InfoboxesPlaySounds = true;
+ public static void SkinControl(Control c)
+ {
+ if(c is Button)
+ {
+ var b = c as Button;
+ b.FlatStyle = FlatStyle.Flat;
+ }
+ if(c is Panel || c is FlowLayoutPanel)
+ {
+ foreach(Control child in c.Controls)
+ {
+ SkinControl(child);
+ }
+ }
+ }
+
public static List<Process> RunningModProcesses = new List<Process>();
public static Dictionary<string, string> CommandAliases = new Dictionary<string, string>();
public static Terminal LoggerTerminal = null;
@@ -335,10 +371,6 @@ namespace ShiftOS
{
CreateForm(new Labyrinth(), "Labyrinth", null);
}
- else if (File.ReadAllText(modSAA) == HiddenQuickChatCommand)
- {
- CreateForm(new QuickChat(), "QuickChat", null);
- }
else
{
try
@@ -389,6 +421,23 @@ namespace ShiftOS
{
private static readonly string passPhrase = "h8gf9dh790df87h9";
+ private static string GetMacAddress()
+ {
+ string macAddresses = string.Empty;
+
+ foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
+ {
+ if (nic.OperationalStatus == OperationalStatus.Up)
+ {
+ macAddresses += nic.GetPhysicalAddress().ToString();
+ break;
+ }
+ }
+
+ return macAddresses;
+ }
+
+
// This constant string is used as a "salt" value for the PasswordDeriveBytes function calls.
// This size of the IV (in bytes) must = (keysize / 8). Default keysize is 256, so the IV must be
// 32 bytes long. Using a 16 character string here gives us 32 bytes when converted to a byte array.
@@ -405,6 +454,32 @@ namespace ShiftOS
public static string Encrypt(string plainText)
{
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
+ using (PasswordDeriveBytes password = new PasswordDeriveBytes(GetMacAddress(), null))
+ {
+ byte[] keyBytes = password.GetBytes(keysize / 8);
+ using (RijndaelManaged symmetricKey = new RijndaelManaged())
+ {
+ symmetricKey.Mode = CipherMode.CBC;
+ using (ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, initVectorBytes))
+ {
+ using (MemoryStream memoryStream = new MemoryStream())
+ {
+ using (CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write))
+ {
+ cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length);
+ cryptoStream.FlushFinalBlock();
+ byte[] cipherTextBytes = memoryStream.ToArray();
+ return Convert.ToBase64String(cipherTextBytes);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public static string Encrypt_old(string plainText)
+ {
+ byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);
using (PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase, null))
{
byte[] keyBytes = password.GetBytes(keysize / 8);
@@ -428,6 +503,7 @@ namespace ShiftOS
}
}
+
/// <summary>
/// Decrypts an encrypted string.
/// </summary>
@@ -435,6 +511,38 @@ namespace ShiftOS
/// <returns>The decrypted string.</returns>
public static string Decrypt(string cipherText)
{
+ try
+ {
+ byte[] cipherTextBytes = Convert.FromBase64String(cipherText);
+ using (PasswordDeriveBytes password = new PasswordDeriveBytes(GetMacAddress(), null))
+ {
+ byte[] keyBytes = password.GetBytes(keysize / 8);
+ using (RijndaelManaged symmetricKey = new RijndaelManaged())
+ {
+ symmetricKey.Mode = CipherMode.CBC;
+ using (ICryptoTransform decryptor = symmetricKey.CreateDecryptor(keyBytes, initVectorBytes))
+ {
+ using (MemoryStream memoryStream = new MemoryStream(cipherTextBytes))
+ {
+ using (CryptoStream cryptoStream = new CryptoStream(memoryStream, decryptor, CryptoStreamMode.Read))
+ {
+ byte[] plainTextBytes = new byte[cipherTextBytes.Length];
+ int decryptedByteCount = cryptoStream.Read(plainTextBytes, 0, plainTextBytes.Length);
+ return Encoding.UTF8.GetString(plainTextBytes, 0, decryptedByteCount);
+ }
+ }
+ }
+ }
+ }
+ }
+ catch
+ {
+ return Decrypt_old(cipherText);
+ }
+ }
+
+ public static string Decrypt_old(string cipherText)
+ {
byte[] cipherTextBytes = Convert.FromBase64String(cipherText);
using (PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase, null))
{
@@ -830,16 +938,17 @@ namespace ShiftOS
/// </summary>
public static void ShutDownShiftOS()
{
+ File.WriteAllText(Paths.SystemDir + "settings.json", JsonConvert.SerializeObject(LoadedSettings));
+ Audio.running = false;
if (!LimitedMode)
{
- //dispose audio clients
- Audio.DisposeAll();
//Disconnect from server.
try
{
- foreach (string ip in Package_Grabber.clients.Keys)
+ foreach (var ip in Package_Grabber.clients)
{
- Package_Grabber.Disconnect(ip);
+ if (ip.Value.IsConnected)
+ ip.Value.Disconnect();
}
}
catch
@@ -1012,12 +1121,14 @@ namespace ShiftOS
{
formToCreate.Controls.Remove(ctrl);
ctrl.Show();
+ SkinControl(ctrl);
}
- catch (Exception ex)
+ catch
{
API.CurrentSession.Invoke(new Action(() =>
{
ctrl.Show();
+ SkinControl(ctrl);
}));
}
}
@@ -1032,7 +1143,7 @@ namespace ShiftOS
{
if (e.KeyCode == Keys.T && e.Control && formToCreate.Name != "Terminal")
{
- CreateForm(new Terminal(), CurrentSave.TerminalName, Properties.Resources.iconTerminal);
+ CurrentSession.InvokeCTRLT();
}
if (formToCreate.Name != "Terminal" || Upgrades["windowedterminal"] == true)
{
@@ -1080,6 +1191,8 @@ namespace ShiftOS
}
}));
WindowComposition.SafeToAddControls = true;
+ API.OpenGUIDs.Add(formToCreate, Guid.NewGuid().ToString());
+ API.CurrentSession.Invoke(new Action(() => { CurrentSession.InvokeWindowOp("open", formToCreate); }));
};
bw.RunWorkerAsync();
}
@@ -1197,7 +1310,8 @@ namespace ShiftOS
/// <returns>I don't know.</returns>
public static bool CloseProgram(string command)
{
- try {
+ try
+ {
List<PanelButton> PanelButtonsToKill = new List<PanelButton>();
bool closed = false;
foreach (Form app in OpenPrograms)
@@ -1236,7 +1350,8 @@ namespace ShiftOS
PanelButtons.Remove(pbtn);
}
return closed;
- } catch(Exception ex)
+ }
+ catch
{
return false;
}
@@ -1608,7 +1723,7 @@ namespace ShiftOS
return "success";
}
}
- catch (Exception ex)
+ catch
{
API.LogException("User didn't guess a valid knowledge input guess.", false);
return "not_valid";
@@ -1672,6 +1787,17 @@ namespace ShiftOS
bool succeeded = true;
switch (cmd)
{
+
+ case "settings":
+ API.CreateForm(new GameSettings(), "Settings", API.GetIcon("Settings"));
+ break;
+ case "credits":
+ var c = new CreditScroller();
+ c.FormBorderStyle = FormBorderStyle.None;
+ c.Show();
+ c.WindowState = FormWindowState.Maximized;
+ c.TopMost = true;
+ break;
case "netbrowse":
if(Upgrades["networkbrowser"])
{
@@ -1909,6 +2035,7 @@ namespace ShiftOS
public static Color[] graymemory = new Color[16];
public static Color[] yellowmemory = new Color[16];
public static Color[] pinkmemory = new Color[16];
+ internal static Dictionary<string, Dictionary<string, object>> LuaShifterRegistry = null;
#endregion
}
diff --git a/source/WindowsFormsApplication1/AlternateDesktop.Designer.cs b/source/WindowsFormsApplication1/AlternateDesktop.Designer.cs
deleted file mode 100644
index c26006e..0000000
--- a/source/WindowsFormsApplication1/AlternateDesktop.Designer.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-namespace ShiftOS
-{
- partial class AlternateDesktop
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.pnlcontext = new System.Windows.Forms.Panel();
- this.pnlapplauncher = new System.Windows.Forms.Panel();
- this.pnlsidebar = new System.Windows.Forms.FlowLayoutPanel();
- this.lbclock = new System.Windows.Forms.Label();
- this.ClockTick = new System.Windows.Forms.Timer(this.components);
- this.lblapplabel = new System.Windows.Forms.Label();
- this.apptick = new System.Windows.Forms.Timer(this.components);
- this.pnlcontext.SuspendLayout();
- this.SuspendLayout();
- //
- // pnlcontext
- //
- this.pnlcontext.BackColor = System.Drawing.Color.Gray;
- this.pnlcontext.Controls.Add(this.lbclock);
- this.pnlcontext.Dock = System.Windows.Forms.DockStyle.Top;
- this.pnlcontext.Location = new System.Drawing.Point(0, 0);
- this.pnlcontext.Name = "pnlcontext";
- this.pnlcontext.Size = new System.Drawing.Size(936, 28);
- this.pnlcontext.TabIndex = 0;
- //
- // pnlapplauncher
- //
- this.pnlapplauncher.BackColor = System.Drawing.Color.Gray;
- this.pnlapplauncher.Location = new System.Drawing.Point(71, 47);
- this.pnlapplauncher.Name = "pnlapplauncher";
- this.pnlapplauncher.Size = new System.Drawing.Size(664, 353);
- this.pnlapplauncher.TabIndex = 1;
- this.pnlapplauncher.Visible = false;
- //
- // pnlsidebar
- //
- this.pnlsidebar.BackColor = System.Drawing.Color.Gray;
- this.pnlsidebar.Dock = System.Windows.Forms.DockStyle.Left;
- this.pnlsidebar.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
- this.pnlsidebar.Location = new System.Drawing.Point(0, 28);
- this.pnlsidebar.Name = "pnlsidebar";
- this.pnlsidebar.Size = new System.Drawing.Size(52, 509);
- this.pnlsidebar.TabIndex = 2;
- //
- // lbclock
- //
- this.lbclock.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.lbclock.Location = new System.Drawing.Point(820, 0);
- this.lbclock.Name = "lbclock";
- this.lbclock.Size = new System.Drawing.Size(113, 28);
- this.lbclock.TabIndex = 0;
- this.lbclock.Text = "500023";
- this.lbclock.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // ClockTick
- //
- this.ClockTick.Enabled = true;
- this.ClockTick.Tick += new System.EventHandler(this.ClockTick_Tick);
- //
- // lblapplabel
- //
- this.lblapplabel.AutoSize = true;
- this.lblapplabel.Location = new System.Drawing.Point(823, 313);
- this.lblapplabel.Name = "lblapplabel";
- this.lblapplabel.Size = new System.Drawing.Size(35, 13);
- this.lblapplabel.TabIndex = 3;
- this.lblapplabel.Text = "label1";
- this.lblapplabel.Visible = false;
- //
- // apptick
- //
- this.apptick.Enabled = true;
- this.apptick.Interval = 2000;
- this.apptick.Tick += new System.EventHandler(this.apptick_Tick);
- //
- // AlternateDesktop
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.BackColor = System.Drawing.Color.Black;
- this.ClientSize = new System.Drawing.Size(936, 537);
- this.Controls.Add(this.lblapplabel);
- this.Controls.Add(this.pnlsidebar);
- this.Controls.Add(this.pnlapplauncher);
- this.Controls.Add(this.pnlcontext);
- this.ForeColor = System.Drawing.Color.White;
- this.Name = "AlternateDesktop";
- this.Text = "AlternateDesktop";
- this.Load += new System.EventHandler(this.AlternateDesktop_Load);
- this.pnlcontext.ResumeLayout(false);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel pnlcontext;
- private System.Windows.Forms.Label lbclock;
- private System.Windows.Forms.Panel pnlapplauncher;
- private System.Windows.Forms.FlowLayoutPanel pnlsidebar;
- private System.Windows.Forms.Timer ClockTick;
- private System.Windows.Forms.Label lblapplabel;
- private System.Windows.Forms.Timer apptick;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/AlternateDesktop.cs b/source/WindowsFormsApplication1/AlternateDesktop.cs
deleted file mode 100644
index f3c7b73..0000000
--- a/source/WindowsFormsApplication1/AlternateDesktop.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class AlternateDesktop : Form
- {
- public AlternateDesktop()
- {
- InitializeComponent();
- }
-
- private void ClockTick_Tick(object sender, EventArgs e)
- {
- lbclock.Text = API.GetTime();
-
- }
-
- public void GetApps()
- {
- pnlsidebar.Controls.Clear();
- API.GetAppLauncherItems();
- Panel appbtn = new Panel();
- appbtn.BackColor = Color.Black;
- appbtn.Size = new Size(32, 32);
- appbtn.Visible = true;
- appbtn.Name = "ashow";
- appbtn.Click += new EventHandler(this.SidebarButton_Click);
-
- pnlsidebar.Controls.Add(appbtn);
- foreach(ApplauncherItem itm in API.AppLauncherItems)
- {
- if(itm.Display == true)
- {
- Panel btn = new Panel();
- btn.BackColor = Color.Gray;
- btn.BackgroundImage = itm.Icon;
- btn.BackgroundImageLayout = ImageLayout.Stretch;
- btn.Size = new Size(32, 32);
- btn.Name = $"al_{new Random().Next(1000, 9999)}";
- btn.Tag = itm;
- btn.MouseMove += new MouseEventHandler(this.SidebarButton_Hover);
- btn.MouseLeave += new EventHandler(this.SidebarButton_Leave);
- btn.Click += new EventHandler(this.SidebarButton_Click);
- pnlsidebar.Controls.Add(btn);
- btn.Show();
- }
- }
- foreach(PanelButton pbtn in API.PanelButtons)
- {
- Panel btn = new Panel();
- btn.Tag = pbtn;
- btn.Name = $"pnl_{new Random().Next(1000, 9999)}";
- btn.BackgroundImage = pbtn.Icon;
- btn.BackgroundImageLayout = ImageLayout.Stretch;
- btn.BackColor = Color.Black;
- btn.Size = new Size(32, 32);
- btn.MouseMove += new MouseEventHandler(this.SidebarButton_Hover);
- btn.MouseLeave += new EventHandler(this.SidebarButton_Leave);
- btn.Click += new EventHandler(this.SidebarButton_Click);
- pnlsidebar.Controls.Add(btn);
- btn.Show();
- }
- }
-
- public void SidebarButton_Hover(object sender, MouseEventArgs e)
- {
- Panel s = (Panel)sender;
- int labelLoc = pnlcontext.Height + (s.Bottom - (s.Height / 2));
- lblapplabel.Location = new Point(pnlsidebar.Width + 5, labelLoc);
- if(s.Name.Contains("al"))
- {
- var itm = (ApplauncherItem)s.Tag;
- lblapplabel.Text = itm.Name;
- }
- else
- {
- var itm = (PanelButton)s.Tag;
- lblapplabel.Text = itm.Name;
- }
- lblapplabel.Visible = true;
- }
-
- public void SidebarButton_Click(object sender, EventArgs e)
- {
- var s = (Panel)sender;
- if (s.Name.Contains("al"))
- {
- var itm = (ApplauncherItem)s.Tag;
- var li = new LuaInterpreter();
- li.mod(itm.Lua);
- li = null;
- }
- else if(s.Name.Contains("ashow"))
- {
- pnlapplauncher.Show();
- foreach(Control ctrl in this.Controls)
- {
- ctrl.MouseDown += (object se, MouseEventArgs a) =>
- {
- pnlapplauncher.Hide();
- };
- }
- }
- else
- {
- try
- {
- PanelButton pbtn = (PanelButton)s.Tag;
- API.ToggleMinimized(pbtn.FormToManage);
- }
- catch (Exception ex)
- {
-
- }
- }
- }
-
- public void SidebarButton_Leave(object sender, EventArgs e)
- {
- lblapplabel.Hide();
- }
-
- private void AlternateDesktop_Load(object sender, EventArgs e)
- {
- this.ShowInTaskbar = false;
- this.FormBorderStyle = FormBorderStyle.None;
- this.WindowState = FormWindowState.Maximized;
- GetApps();
- }
-
- private void apptick_Tick(object sender, EventArgs e)
- {
- //GetApps();
- }
-
- private bool unity = false;
-
- public void ToggleUnityMode()
- {
- if (unity == false)
- {
- unity = true;
- this.BackColor = Skinning.Utilities.globaltransparencycolour;
- this.BackgroundImage = null;
- this.TransparencyKey = Skinning.Utilities.globaltransparencycolour;
- }
- else
- {
- unity = false;
- this.BackColor = API.CurrentSkin.desktopbackgroundcolour;
- this.BackgroundImage = API.CurrentSkinImages.desktopbackground;
- this.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.desktopbackgroundlayout;
- this.TransparencyKey = Skinning.Utilities.globaltransparencycolour;
- }
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Appscape.Designer.cs b/source/WindowsFormsApplication1/Apps/Appscape.Designer.cs
index e8ef295..e8ef295 100644
--- a/source/WindowsFormsApplication1/Appscape.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Appscape.Designer.cs
diff --git a/source/WindowsFormsApplication1/Appscape.cs b/source/WindowsFormsApplication1/Apps/Appscape.cs
index a482a04..92171d9 100644
--- a/source/WindowsFormsApplication1/Appscape.cs
+++ b/source/WindowsFormsApplication1/Apps/Appscape.cs
@@ -236,7 +236,7 @@ namespace ShiftOS
pbappscreenshot.Show();
pbappscreenshot.Load(pkg.ScreenshotPath);
}
- catch(Exception ex)
+ catch
{
pbappscreenshot.Hide();
}
@@ -266,7 +266,7 @@ namespace ShiftOS
pbappicon.Show();
pbappicon.Load("http://playshiftos.ml/appscape/packages/" + pkg.PkgIconPath);
}
- catch(Exception ex)
+ catch
{
pbappicon.Hide();
}
@@ -490,8 +490,6 @@ namespace ShiftOS
return new KeyValuePair<AppscapeModder, AppscapeClient>(dev, clt);
}
- private Dictionary<string, AppscapeModder> LocalDevList = null;
-
/// <summary>
/// Adds a new developer key to the specified client's listing.
/// </summary>
@@ -670,7 +668,7 @@ namespace ShiftOS
{
pkg.Cost = Convert.ToDecimal(Convert.ToDecimal(txtprice.Text).ToString("#.#####"));
}
- catch (Exception ex)
+ catch
{
ContinueUpload = false;
API.CreateInfoboxSession("Error", "You have entered an incorrect price value.", infobox.InfoboxMode.Info);
@@ -871,7 +869,7 @@ namespace ShiftOS
};
_IP = ip_address;
}
- catch(Exception ex)
+ catch
{
throw new ArgumentException("IP address not found in client list.");
}
diff --git a/source/WindowsFormsApplication1/Appscape.resx b/source/WindowsFormsApplication1/Apps/Appscape.resx
index 524af34..524af34 100644
--- a/source/WindowsFormsApplication1/Appscape.resx
+++ b/source/WindowsFormsApplication1/Apps/Appscape.resx
diff --git a/source/WindowsFormsApplication1/AppscapeUploader.Designer.cs b/source/WindowsFormsApplication1/Apps/AppscapeUploader.Designer.cs
index e23ef2d..e23ef2d 100644
--- a/source/WindowsFormsApplication1/AppscapeUploader.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/AppscapeUploader.Designer.cs
diff --git a/source/WindowsFormsApplication1/AppscapeUploader.cs b/source/WindowsFormsApplication1/Apps/AppscapeUploader.cs
index 3c2465c..5cc8560 100644
--- a/source/WindowsFormsApplication1/AppscapeUploader.cs
+++ b/source/WindowsFormsApplication1/Apps/AppscapeUploader.cs
@@ -31,8 +31,6 @@ namespace ShiftOS
private AppscapeModder MyProfile = null;
private AppscapeClient Repo = null;
- private string result = "cancelled";
-
private void btncancel_Click(object sender, EventArgs e)
{
this.Close();
@@ -52,7 +50,7 @@ namespace ShiftOS
{
pkg.Cost = Convert.ToDecimal(Convert.ToDecimal(txtprice.Text).ToString("#.#####"));
}
- catch(Exception ex)
+ catch
{
ContinueUpload = false;
API.CreateInfoboxSession("Error", "You have entered an incorrect price value.", infobox.InfoboxMode.Info);
@@ -112,7 +110,6 @@ namespace ShiftOS
- result = "finished";
this.Close();
}
}
@@ -136,7 +133,7 @@ namespace ShiftOS
RecursiveControlSetup(c);
}
}
- catch(Exception ex) {
+ catch {
}
}
@@ -325,7 +322,7 @@ namespace ShiftOS
ZipFile.CreateFromDirectory(dir, API.GetFSResult());
API.CreateInfoboxSession("Success", "The SAA file has been created successfully.", infobox.InfoboxMode.Info);
}
- catch(Exception ex)
+ catch
{
API.CreateInfoboxSession("Error", "Could not create the SAA file.", infobox.InfoboxMode.Info);
}
diff --git a/source/WindowsFormsApplication1/AppscapeUploader.resx b/source/WindowsFormsApplication1/Apps/AppscapeUploader.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/AppscapeUploader.resx
+++ b/source/WindowsFormsApplication1/Apps/AppscapeUploader.resx
diff --git a/source/WindowsFormsApplication1/Artpad.Designer.cs b/source/WindowsFormsApplication1/Apps/Artpad.Designer.cs
index 13bfba1..13bfba1 100644
--- a/source/WindowsFormsApplication1/Artpad.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Artpad.Designer.cs
diff --git a/source/WindowsFormsApplication1/Artpad.cs b/source/WindowsFormsApplication1/Apps/Artpad.cs
index 1ba144d..c393ae0 100644
--- a/source/WindowsFormsApplication1/Artpad.cs
+++ b/source/WindowsFormsApplication1/Apps/Artpad.cs
@@ -229,7 +229,7 @@ namespace ShiftOS
canvasbitmap.SetPixel(Convert.ToInt32(txtpixelsetterxcoordinate.Text), Convert.ToInt32(txtpixelsetterycoordinate.Text), drawingcolour);
picdrawingdisplay.Invalidate();
}
- catch (Exception ex)
+ catch
{
API.CreateInfoboxSession("ArtPad - Placement Error!", "You have specified invalid coordinates for the pixel setter." + Environment.NewLine + Environment.NewLine + "Remember that the top left pixel has the coordinates 0, 0", infobox.InfoboxMode.Info);
}
@@ -344,7 +344,7 @@ namespace ShiftOS
e.Graphics.DrawImage(canvasbitmap, 0, 0);
e.Graphics.DrawImage(previewcanvasbitmap, 0, 0);
}
- catch (System.OutOfMemoryException ex)
+ catch
{
}
@@ -1075,7 +1075,7 @@ namespace ShiftOS
}
}
}
- catch(Exception ex)
+ catch
{
}
@@ -1295,7 +1295,7 @@ namespace ShiftOS
graphicsbitmap = Graphics.FromImage(canvasbitmap);
picdrawingdisplay.Invalidate();
}
- catch (Exception ex)
+ catch
{
API.CreateInfoboxSession("ArtPad - Undo Error!"
,"There doesn't appear to be any more actions to undo." + Environment.NewLine + Environment.NewLine + "One more step back would undo the creation of the canvas. If this is your goal just click new.", infobox.InfoboxMode.Info);
@@ -1312,7 +1312,7 @@ namespace ShiftOS
graphicsbitmap = Graphics.FromImage(canvasbitmap);
picdrawingdisplay.Invalidate();
}
- catch (Exception ex)
+ catch
{
API.CreateInfoboxSession("ArtPad - Redo Error!"
, "There doesn't appear to be any more actions to redo." + Environment.NewLine + Environment.NewLine + "If you have drawn on the canvas recently all future history would have been wiped!", infobox.InfoboxMode.Info);
diff --git a/source/WindowsFormsApplication1/Artpad.resx b/source/WindowsFormsApplication1/Apps/Artpad.resx
index 4175077..4175077 100644
--- a/source/WindowsFormsApplication1/Artpad.resx
+++ b/source/WindowsFormsApplication1/Apps/Artpad.resx
diff --git a/source/WindowsFormsApplication1/BitnoteConverter.Designer.cs b/source/WindowsFormsApplication1/Apps/BitnoteConverter.Designer.cs
index 2ad4885..2ad4885 100644
--- a/source/WindowsFormsApplication1/BitnoteConverter.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/BitnoteConverter.Designer.cs
diff --git a/source/WindowsFormsApplication1/BitnoteConverter.cs b/source/WindowsFormsApplication1/Apps/BitnoteConverter.cs
index 3059114..d28b970 100644
--- a/source/WindowsFormsApplication1/BitnoteConverter.cs
+++ b/source/WindowsFormsApplication1/Apps/BitnoteConverter.cs
@@ -37,7 +37,7 @@ namespace ShiftOS
lbstatus.Text = "> " + decstr + " BTN";
BitnotesToAdd = Convert.ToDecimal(decstr);
}
- catch(Exception ex)
+ catch
{
BitnotesToAdd = 0;
}
diff --git a/source/WindowsFormsApplication1/BitnoteConverter.resx b/source/WindowsFormsApplication1/Apps/BitnoteConverter.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/BitnoteConverter.resx
+++ b/source/WindowsFormsApplication1/Apps/BitnoteConverter.resx
diff --git a/source/WindowsFormsApplication1/BitnoteDigger.Designer.cs b/source/WindowsFormsApplication1/Apps/BitnoteDigger.Designer.cs
index b1fa081..b1fa081 100644
--- a/source/WindowsFormsApplication1/BitnoteDigger.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/BitnoteDigger.Designer.cs
diff --git a/source/WindowsFormsApplication1/BitnoteDigger.cs b/source/WindowsFormsApplication1/Apps/BitnoteDigger.cs
index df0b124..df0b124 100644
--- a/source/WindowsFormsApplication1/BitnoteDigger.cs
+++ b/source/WindowsFormsApplication1/Apps/BitnoteDigger.cs
diff --git a/source/WindowsFormsApplication1/BitnoteDigger.resx b/source/WindowsFormsApplication1/Apps/BitnoteDigger.resx
index 7beae4d..7beae4d 100644
--- a/source/WindowsFormsApplication1/BitnoteDigger.resx
+++ b/source/WindowsFormsApplication1/Apps/BitnoteDigger.resx
diff --git a/source/WindowsFormsApplication1/BitnoteWallet.Designer.cs b/source/WindowsFormsApplication1/Apps/BitnoteWallet.Designer.cs
index df0b7d8..df0b7d8 100644
--- a/source/WindowsFormsApplication1/BitnoteWallet.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/BitnoteWallet.Designer.cs
diff --git a/source/WindowsFormsApplication1/BitnoteWallet.cs b/source/WindowsFormsApplication1/Apps/BitnoteWallet.cs
index e3c6a2a..6d5cb9f 100644
--- a/source/WindowsFormsApplication1/BitnoteWallet.cs
+++ b/source/WindowsFormsApplication1/Apps/BitnoteWallet.cs
@@ -76,7 +76,7 @@ namespace ShiftOS
};
t.RunWorkerAsync();
}
- catch(Exception ex)
+ catch
{
SyncBitnotes(new List<SaveSystem.PrivateBitnoteAddress>());
API.CreateInfoboxSession("Error", "You cannot sync your Bitnotes as the connection to the server has failed.", infobox.InfoboxMode.Info);
@@ -211,7 +211,7 @@ namespace ShiftOS
};
_IP = IP;
}
- catch (Exception ex)
+ catch
{
throw new ArgumentException("IP address not found in client list.");
}
diff --git a/source/WindowsFormsApplication1/BitnoteWallet.resx b/source/WindowsFormsApplication1/Apps/BitnoteWallet.resx
index 09c4313..09c4313 100644
--- a/source/WindowsFormsApplication1/BitnoteWallet.resx
+++ b/source/WindowsFormsApplication1/Apps/BitnoteWallet.resx
diff --git a/source/WindowsFormsApplication1/Dodge.Designer.cs b/source/WindowsFormsApplication1/Apps/Dodge.Designer.cs
index 46fce33..46fce33 100644
--- a/source/WindowsFormsApplication1/Dodge.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Dodge.Designer.cs
diff --git a/source/WindowsFormsApplication1/Dodge.cs b/source/WindowsFormsApplication1/Apps/Dodge.cs
index 320347d..320347d 100644
--- a/source/WindowsFormsApplication1/Dodge.cs
+++ b/source/WindowsFormsApplication1/Apps/Dodge.cs
diff --git a/source/WindowsFormsApplication1/Dodge.resx b/source/WindowsFormsApplication1/Apps/Dodge.resx
index f6e2b3b..f6e2b3b 100644
--- a/source/WindowsFormsApplication1/Dodge.resx
+++ b/source/WindowsFormsApplication1/Apps/Dodge.resx
diff --git a/source/WindowsFormsApplication1/File Skimmer.Designer.cs b/source/WindowsFormsApplication1/Apps/File Skimmer.Designer.cs
index 30d41d8..30d41d8 100644
--- a/source/WindowsFormsApplication1/File Skimmer.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/File Skimmer.Designer.cs
diff --git a/source/WindowsFormsApplication1/File Skimmer.cs b/source/WindowsFormsApplication1/Apps/File Skimmer.cs
index 883ff95..4ee8531 100644
--- a/source/WindowsFormsApplication1/File Skimmer.cs
+++ b/source/WindowsFormsApplication1/Apps/File Skimmer.cs
@@ -177,10 +177,11 @@ namespace ShiftOS
{
if (lbcurrentfolder.Text != "/")
{
- if (lbcurrentfolder.Text == MountPoint.Replace("\\", "/"))
+ if (MountPoint != null && lbcurrentfolder.Text == MountPoint.Replace("\\", "/"))
{
CurrentFolder = Paths.SaveRoot;
ListFiles();
+
}
else
{
@@ -402,24 +403,18 @@ namespace ShiftOS
case ".docx":
case ".txt":
return "doc";
- break;
case ".exe":
case ".saa":
return "application";
- break;
case ".stp":
case ".pkg":
case ".mod":
return "package";
- break;
case ".skn":
case ".spk":
return "skin";
- break;
default:
return "none";
- break;
-
}
}
@@ -454,7 +449,7 @@ namespace ShiftOS
Directory.CreateDirectory(fullname);
}
}
- catch (Exception ex)
+ catch
{
API.CreateInfoboxSession("Error", "File Skimmer could not create the directory.", infobox.InfoboxMode.Info);
}
@@ -598,7 +593,7 @@ namespace ShiftOS
txtfilename.Text = itm.Text;
}
}
- catch(Exception ex)
+ catch
{
}
diff --git a/source/WindowsFormsApplication1/File Skimmer.resx b/source/WindowsFormsApplication1/Apps/File Skimmer.resx
index 2d817a4..2d817a4 100644
--- a/source/WindowsFormsApplication1/File Skimmer.resx
+++ b/source/WindowsFormsApplication1/Apps/File Skimmer.resx
diff --git a/source/WindowsFormsApplication1/HoloChat.Designer.cs b/source/WindowsFormsApplication1/Apps/HoloChat.Designer.cs
index 6f040ec..6f040ec 100644
--- a/source/WindowsFormsApplication1/HoloChat.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/HoloChat.Designer.cs
diff --git a/source/WindowsFormsApplication1/HoloChat.cs b/source/WindowsFormsApplication1/Apps/HoloChat.cs
index 1795d7b..1795d7b 100644
--- a/source/WindowsFormsApplication1/HoloChat.cs
+++ b/source/WindowsFormsApplication1/Apps/HoloChat.cs
diff --git a/source/WindowsFormsApplication1/HoloChat.resx b/source/WindowsFormsApplication1/Apps/HoloChat.resx
index 53f34aa..53f34aa 100644
--- a/source/WindowsFormsApplication1/HoloChat.resx
+++ b/source/WindowsFormsApplication1/Apps/HoloChat.resx
diff --git a/source/WindowsFormsApplication1/IconManager.Designer.cs b/source/WindowsFormsApplication1/Apps/IconManager.Designer.cs
index 3203088..3203088 100644
--- a/source/WindowsFormsApplication1/IconManager.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/IconManager.Designer.cs
diff --git a/source/WindowsFormsApplication1/IconManager.cs b/source/WindowsFormsApplication1/Apps/IconManager.cs
index 0f5002e..2ffa24a 100644
--- a/source/WindowsFormsApplication1/IconManager.cs
+++ b/source/WindowsFormsApplication1/Apps/IconManager.cs
@@ -48,7 +48,7 @@ namespace ShiftOS
IconControl ic = (IconControl)ctrl;
Skinning.Utilities.IconRegistry[ic.IconName] = ic.LargeImage;
}
- catch(Exception ex)
+ catch
{
IconControl ic = (IconControl)ctrl;
Skinning.Utilities.IconRegistry.Add(ic.IconName, ic.LargeImage);
@@ -105,7 +105,7 @@ namespace ShiftOS
API.IconRegistry[finf.Name] = Image.FromStream(stream);
}
}
- catch (Exception ex)
+ catch
{
API.IconRegistry.Add(finf.Name, Image.FromFile(finf.FullName));
}
diff --git a/source/WindowsFormsApplication1/IconManager.resx b/source/WindowsFormsApplication1/Apps/IconManager.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/IconManager.resx
+++ b/source/WindowsFormsApplication1/Apps/IconManager.resx
diff --git a/source/WindowsFormsApplication1/KnowledgeInput.Designer.cs b/source/WindowsFormsApplication1/Apps/KnowledgeInput.Designer.cs
index 3fc5f81..3fc5f81 100644
--- a/source/WindowsFormsApplication1/KnowledgeInput.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/KnowledgeInput.Designer.cs
diff --git a/source/WindowsFormsApplication1/KnowledgeInput.cs b/source/WindowsFormsApplication1/Apps/KnowledgeInput.cs
index fdb9f81..a494a93 100644
--- a/source/WindowsFormsApplication1/KnowledgeInput.cs
+++ b/source/WindowsFormsApplication1/Apps/KnowledgeInput.cs
@@ -31,7 +31,6 @@ namespace ShiftOS
bool levelup;
int rewardbase;
- string[] savecontent;
int totalguessed;
int level;
@@ -314,8 +313,6 @@ namespace ShiftOS
}
}
- int chance = 101;
- // ERROR: Handles clauses are not supported in C#
// ERROR: Handles clauses are not supported in C#
private void me_closing()
diff --git a/source/WindowsFormsApplication1/KnowledgeInput.resx b/source/WindowsFormsApplication1/Apps/KnowledgeInput.resx
index 7310dd5..7310dd5 100644
--- a/source/WindowsFormsApplication1/KnowledgeInput.resx
+++ b/source/WindowsFormsApplication1/Apps/KnowledgeInput.resx
diff --git a/source/WindowsFormsApplication1/Labyrinth.Designer.cs b/source/WindowsFormsApplication1/Apps/Labyrinth.Designer.cs
index 8efe097..8efe097 100644
--- a/source/WindowsFormsApplication1/Labyrinth.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Labyrinth.Designer.cs
diff --git a/source/WindowsFormsApplication1/Labyrinth.cs b/source/WindowsFormsApplication1/Apps/Labyrinth.cs
index ade5495..ade5495 100644
--- a/source/WindowsFormsApplication1/Labyrinth.cs
+++ b/source/WindowsFormsApplication1/Apps/Labyrinth.cs
diff --git a/source/WindowsFormsApplication1/NameChanger.Designer.cs b/source/WindowsFormsApplication1/Apps/NameChanger.Designer.cs
index c9380a8..c9380a8 100644
--- a/source/WindowsFormsApplication1/NameChanger.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/NameChanger.Designer.cs
diff --git a/source/WindowsFormsApplication1/NameChanger.cs b/source/WindowsFormsApplication1/Apps/NameChanger.cs
index 0dcac90..0dcac90 100644
--- a/source/WindowsFormsApplication1/NameChanger.cs
+++ b/source/WindowsFormsApplication1/Apps/NameChanger.cs
diff --git a/source/WindowsFormsApplication1/NameChanger.resx b/source/WindowsFormsApplication1/Apps/NameChanger.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/NameChanger.resx
+++ b/source/WindowsFormsApplication1/Apps/NameChanger.resx
diff --git a/source/WindowsFormsApplication1/NetGen.Designer.cs b/source/WindowsFormsApplication1/Apps/NetGen.Designer.cs
index b596cdb..b596cdb 100644
--- a/source/WindowsFormsApplication1/NetGen.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/NetGen.Designer.cs
diff --git a/source/WindowsFormsApplication1/NetGen.cs b/source/WindowsFormsApplication1/Apps/NetGen.cs
index 616505d..616505d 100644
--- a/source/WindowsFormsApplication1/NetGen.cs
+++ b/source/WindowsFormsApplication1/Apps/NetGen.cs
diff --git a/source/WindowsFormsApplication1/NetGen.resx b/source/WindowsFormsApplication1/Apps/NetGen.resx
index c6bdcd8..c6bdcd8 100644
--- a/source/WindowsFormsApplication1/NetGen.resx
+++ b/source/WindowsFormsApplication1/Apps/NetGen.resx
diff --git a/source/WindowsFormsApplication1/NetworkBrowser.Designer.cs b/source/WindowsFormsApplication1/Apps/NetworkBrowser.Designer.cs
index cf9468d..04683ac 100644
--- a/source/WindowsFormsApplication1/NetworkBrowser.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/NetworkBrowser.Designer.cs
@@ -29,7 +29,14 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NetworkBrowser));
this.panel1 = new System.Windows.Forms.Panel();
+ this.pnlonline = new System.Windows.Forms.Panel();
+ this.btnjoinlobby = new System.Windows.Forms.Button();
+ this.lbonlineservers = new System.Windows.Forms.ListBox();
+ this.lbonlinedesc = new System.Windows.Forms.Label();
+ this.lbonlineheader = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.btnscreen = new System.Windows.Forms.Button();
this.pnlmynet = new System.Windows.Forms.Panel();
@@ -44,18 +51,25 @@
this.panel2 = new System.Windows.Forms.Panel();
this.lbnetdesc = new System.Windows.Forms.Label();
this.lbtitle = new System.Windows.Forms.Label();
- this.pgtotalhealth = new ShiftOS.ProgressBarEX();
this.tmrcalctotal = new System.Windows.Forms.Timer(this.components);
+ this.pgtotalhealth = new ShiftOS.ProgressBarEX();
+ this.label6 = new System.Windows.Forms.Label();
+ this.label7 = new System.Windows.Forms.Label();
+ this.txtmyname = new System.Windows.Forms.TextBox();
+ this.txtmydescription = new System.Windows.Forms.TextBox();
this.panel1.SuspendLayout();
+ this.pnlonline.SuspendLayout();
this.pnlmynet.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// panel1
//
+ this.panel1.Controls.Add(this.pnlmynet);
+ this.panel1.Controls.Add(this.pnlonline);
+ this.panel1.Controls.Add(this.button1);
this.panel1.Controls.Add(this.label3);
this.panel1.Controls.Add(this.btnscreen);
- this.panel1.Controls.Add(this.pnlmynet);
this.panel1.Controls.Add(this.btntier);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.label1);
@@ -68,6 +82,75 @@
this.panel1.Size = new System.Drawing.Size(725, 495);
this.panel1.TabIndex = 0;
//
+ // pnlonline
+ //
+ this.pnlonline.Controls.Add(this.btnjoinlobby);
+ this.pnlonline.Controls.Add(this.lbonlineservers);
+ this.pnlonline.Controls.Add(this.lbonlinedesc);
+ this.pnlonline.Controls.Add(this.lbonlineheader);
+ this.pnlonline.Location = new System.Drawing.Point(12, 12);
+ this.pnlonline.Name = "pnlonline";
+ this.pnlonline.Size = new System.Drawing.Size(404, 447);
+ this.pnlonline.TabIndex = 10;
+ //
+ // btnjoinlobby
+ //
+ this.btnjoinlobby.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.btnjoinlobby.Enabled = false;
+ this.btnjoinlobby.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnjoinlobby.Location = new System.Drawing.Point(306, 415);
+ this.btnjoinlobby.Name = "btnjoinlobby";
+ this.btnjoinlobby.Size = new System.Drawing.Size(84, 23);
+ this.btnjoinlobby.TabIndex = 8;
+ this.btnjoinlobby.Text = "Join Lobby";
+ this.btnjoinlobby.UseVisualStyleBackColor = true;
+ this.btnjoinlobby.Click += new System.EventHandler(this.btnjoinlobby_Click);
+ //
+ // lbonlineservers
+ //
+ this.lbonlineservers.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lbonlineservers.BackColor = System.Drawing.Color.Black;
+ this.lbonlineservers.ForeColor = System.Drawing.Color.White;
+ this.lbonlineservers.FormattingEnabled = true;
+ this.lbonlineservers.Location = new System.Drawing.Point(1, 72);
+ this.lbonlineservers.Name = "lbonlineservers";
+ this.lbonlineservers.Size = new System.Drawing.Size(389, 329);
+ this.lbonlineservers.TabIndex = 4;
+ this.lbonlineservers.SelectedIndexChanged += new System.EventHandler(this.lbonlineservers_SelectedIndexChanged);
+ //
+ // lbonlinedesc
+ //
+ this.lbonlinedesc.Location = new System.Drawing.Point(4, 37);
+ this.lbonlinedesc.Name = "lbonlinedesc";
+ this.lbonlinedesc.Size = new System.Drawing.Size(386, 364);
+ this.lbonlinedesc.TabIndex = 3;
+ this.lbonlinedesc.Text = "You can battle other Shifters over the Internet by joining a lobby and waiting fo" +
+ "r a match to be made. Please select a server from the list below.";
+ //
+ // lbonlineheader
+ //
+ this.lbonlineheader.AutoSize = true;
+ this.lbonlineheader.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+ this.lbonlineheader.Location = new System.Drawing.Point(3, 5);
+ this.lbonlineheader.Name = "lbonlineheader";
+ this.lbonlineheader.Size = new System.Drawing.Size(106, 20);
+ this.lbonlineheader.TabIndex = 2;
+ this.lbonlineheader.Text = "Online battles";
+ //
+ // button1
+ //
+ this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.button1.Location = new System.Drawing.Point(549, 465);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(83, 23);
+ this.button1.TabIndex = 9;
+ this.button1.Text = "Battle online!";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
// label3
//
this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@@ -95,6 +178,10 @@
this.pnlmynet.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
+ this.pnlmynet.Controls.Add(this.txtmydescription);
+ this.pnlmynet.Controls.Add(this.txtmyname);
+ this.pnlmynet.Controls.Add(this.label7);
+ this.pnlmynet.Controls.Add(this.label6);
this.pnlmynet.Controls.Add(this.pgtotalhealth);
this.pnlmynet.Controls.Add(this.flmodules);
this.pnlmynet.Controls.Add(this.label5);
@@ -112,7 +199,7 @@
this.flmodules.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.flmodules.Location = new System.Drawing.Point(7, 140);
this.flmodules.Name = "flmodules";
- this.flmodules.Size = new System.Drawing.Size(394, 298);
+ this.flmodules.Size = new System.Drawing.Size(394, 219);
this.flmodules.TabIndex = 3;
this.flmodules.WrapContents = false;
//
@@ -209,7 +296,7 @@
this.lbnetdesc.Name = "lbnetdesc";
this.lbnetdesc.Size = new System.Drawing.Size(283, 290);
this.lbnetdesc.TabIndex = 1;
- this.lbnetdesc.Text = "No network selected.";
+ this.lbnetdesc.Text = resources.GetString("lbnetdesc.Text");
//
// lbtitle
//
@@ -221,6 +308,11 @@
this.lbtitle.TabIndex = 0;
this.lbtitle.Text = "Network Browser";
//
+ // tmrcalctotal
+ //
+ this.tmrcalctotal.Enabled = true;
+ this.tmrcalctotal.Tick += new System.EventHandler(this.tmrcalctotal_Tick);
+ //
// pgtotalhealth
//
this.pgtotalhealth.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@@ -229,11 +321,13 @@
this.pgtotalhealth.BlockSeparation = 3;
this.pgtotalhealth.BlockWidth = 5;
this.pgtotalhealth.Color = System.Drawing.Color.Gray;
+ this.pgtotalhealth.Label = "Progress:";
this.pgtotalhealth.Location = new System.Drawing.Point(7, 98);
this.pgtotalhealth.MaxValue = 100;
this.pgtotalhealth.MinValue = 0;
this.pgtotalhealth.Name = "pgtotalhealth";
this.pgtotalhealth.Orientation = ShiftOS.ProgressBarEX.ProgressBarOrientation.Horizontal;
+ this.pgtotalhealth.ShowLabel = false;
this.pgtotalhealth.ShowValue = true;
this.pgtotalhealth.Size = new System.Drawing.Size(394, 32);
this.pgtotalhealth.Step = 10;
@@ -241,10 +335,42 @@
this.pgtotalhealth.TabIndex = 4;
this.pgtotalhealth.Value = 0;
//
- // tmrcalctotal
+ // label6
//
- this.tmrcalctotal.Enabled = true;
- this.tmrcalctotal.Tick += new System.EventHandler(this.tmrcalctotal_Tick);
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(7, 369);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(61, 13);
+ this.label6.TabIndex = 5;
+ this.label6.Text = "Your name:";
+ //
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.Location = new System.Drawing.Point(7, 400);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(63, 13);
+ this.label7.TabIndex = 6;
+ this.label7.Text = "Description:";
+ //
+ // txtmyname
+ //
+ this.txtmyname.Location = new System.Drawing.Point(74, 366);
+ this.txtmyname.MaxLength = 18;
+ this.txtmyname.Name = "txtmyname";
+ this.txtmyname.Size = new System.Drawing.Size(186, 20);
+ this.txtmyname.TabIndex = 7;
+ this.txtmyname.TextChanged += new System.EventHandler(this.txtmyname_TextChanged);
+ //
+ // txtmydescription
+ //
+ this.txtmydescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtmydescription.Location = new System.Drawing.Point(74, 397);
+ this.txtmydescription.Name = "txtmydescription";
+ this.txtmydescription.Size = new System.Drawing.Size(316, 20);
+ this.txtmydescription.TabIndex = 8;
+ this.txtmydescription.TextChanged += new System.EventHandler(this.txtmydescription_TextChanged);
//
// NetworkBrowser
//
@@ -256,9 +382,12 @@
this.ForeColor = System.Drawing.Color.Black;
this.Name = "NetworkBrowser";
this.Text = "NetworkBrowser";
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.stop_matchmake);
this.Load += new System.EventHandler(this.NetworkBrowser_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
+ this.pnlonline.ResumeLayout(false);
+ this.pnlonline.PerformLayout();
this.pnlmynet.ResumeLayout(false);
this.pnlmynet.PerformLayout();
this.panel2.ResumeLayout(false);
@@ -286,5 +415,15 @@
private System.Windows.Forms.Label label4;
private ProgressBarEX pgtotalhealth;
private System.Windows.Forms.Timer tmrcalctotal;
+ private System.Windows.Forms.Panel pnlonline;
+ private System.Windows.Forms.Label lbonlinedesc;
+ private System.Windows.Forms.Label lbonlineheader;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.ListBox lbonlineservers;
+ private System.Windows.Forms.Button btnjoinlobby;
+ private System.Windows.Forms.TextBox txtmydescription;
+ private System.Windows.Forms.TextBox txtmyname;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Label label6;
}
} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs b/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
new file mode 100644
index 0000000..58dd811
--- /dev/null
+++ b/source/WindowsFormsApplication1/Apps/NetworkBrowser.cs
@@ -0,0 +1,461 @@
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using ShiftOS.Online.Hacking;
+
+namespace ShiftOS
+{
+ public partial class NetworkBrowser : Form
+ {
+ public NetworkBrowser()
+ {
+ InitializeComponent();
+ }
+
+ public Dictionary<string, EnemyHacker> Networks = null;
+
+ private void NetworkBrowser_Load(object sender, EventArgs e)
+ {
+ Online.Hacking.Matchmaker.Initiated += (o, a) =>
+ {
+ if (selected_server == null)
+ {
+ lbonlineservers.Items.Clear();
+ foreach (var s in Online.Hacking.Matchmaker.Servers)
+ {
+ lbonlineservers.Items.Add(s.ServerName);
+ }
+ }
+ };
+ Online.Hacking.Matchmaker.MorePlayersFound += (o, a) =>
+ {
+ if(selected_server != null)
+ {
+ lbonlineheader.Text = selected_server.ServerName + " - Lobby";
+ lbonlinedesc.Text = $@"Network Browser is waiting for the server to pair you with another network...
+
+
+Players in lobby: {Online.Hacking.Matchmaker.Players.Count}
+
+{API.CurrentSave.MyOnlineNetwork.Name} - My Network:
+ - {Hacking.MyNetwork.Count} available modules
+ - {API.Codepoints} codepoints
+ - {API.CurrentSave.MyOnlineNetwork.Wins} wins, {API.CurrentSave.MyOnlineNetwork.Losses} losses.
+
+You can set your name and description in the Network Status page.";
+
+ }
+ };
+ LoadNetworks();
+ SetupSidePane();
+ pnlmynet.Hide();
+ }
+
+ public string CurrentTier = "easy";
+ public EnemyHacker SelectedNet = null;
+
+ public void LoadNetworks()
+ {
+ switch(CurrentTier)
+ {
+ case "easy":
+ btntier.Text = "1";
+ break;
+ case "medium":
+ btntier.Text = "2";
+ break;
+ case "hard":
+ btntier.Text = "3";
+ break;
+ }
+ Networks = JsonConvert.DeserializeObject<Dictionary<string, EnemyHacker>>(Properties.Resources.NetBrowser_Enemies);
+ lbnets.Items.Clear();
+ var Tier1 = new List<string>();
+ var Tier2 = new List<string>();
+ var Tier3 = new List<string>();
+
+ foreach (var net in Networks)
+ {
+ if (!API.CurrentSave.CompletedNets.Contains(net.Key))
+ {
+ switch (net.Value.Difficulty)
+ {
+ case "easy":
+ Tier1.Add(net.Key);
+ break;
+ case "medium":
+ Tier2.Add(net.Key);
+ break;
+ case "hard":
+ Tier3.Add(net.Key);
+ break;
+ }
+ }
+ }
+
+ switch (CurrentTier)
+ {
+ case "easy":
+ SetupUI(Tier1);
+ break;
+ case "medium":
+ SetupUI(Tier2);
+ break;
+ case "hard":
+ SetupUI(Tier3);
+ break;
+ }
+ }
+
+ public void SetupSidePane()
+ {
+ if(SelectedNet != null)
+ {
+ lbtitle.Text = SelectedNet.Name;
+ lbnetdesc.Text = SelectedNet.Description + @"
+
+Leader hack speed: " + SelectedNet.FriendSpeed.ToString() + @"
+Leader hack skill: " + SelectedNet.FriendSkill.ToString() + @"
+
+Those above values only matter if the leader decides to become a friend. If they do, you can hire them for free to hack into certain ShiftOS applications.";
+ btnstartbattle.Enabled = true;
+ }
+ else
+ {
+ lbtitle.Text = "Network Browser";
+ lbnetdesc.Text = "No network selected.";
+ btnstartbattle.Enabled = false;
+ }
+ }
+
+ public void SetupUI(List<string> tier)
+ {
+ pnlonline.Visible = online_mode;
+ pnlonline.BringToFront();
+ btnjoinlobby.Enabled = (selected_server != null);
+ if (online_mode)
+ {
+ if(Online.Hacking.Matchmaker.Servers == null)
+ {
+ Online.Hacking.Matchmaker.Initiate();
+ }
+ }
+ else
+ {
+ if (tier.Count > 0)
+ {
+ foreach (var t in tier)
+ {
+ lbnets.Items.Add(t);
+ }
+ }
+ else
+ {
+ AddLeader(CurrentTier);
+ }
+ }
+ }
+
+ public void AddLeader(string tier)
+ {
+ if (API.Upgrades["nb_tier_" + tier] == false)
+ {
+ var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Get_Leader_JSON(tier));
+ Networks.Add(enemy.Name, enemy);
+ lbnets.Items.Add(enemy.Name);
+ }
+ }
+
+ public string Get_Leader_JSON(string tier)
+ {
+ switch(tier)
+ {
+ case "easy":
+ return Properties.Resources.Hacker_DanaRoss;
+ case "medium":
+ return Properties.Resources.Hacker_AustinWalker;
+ case "hard":
+ return Properties.Resources.Hacker_JonathanRivard;
+ default:
+ return null;
+
+ }
+ }
+
+ private void btntier_Click(object sender, EventArgs e)
+ {
+ switch(btntier.Text)
+ {
+ case "1":
+ if(API.Upgrades["nb_tier_easy"] == true)
+ {
+ CurrentTier = "medium";
+ }
+ break;
+ case "2":
+ if (API.Upgrades["nb_tier_medium"] == true)
+ {
+ CurrentTier = "hard";
+ }
+ else
+ {
+ CurrentTier = "easy";
+ }
+ break;
+ case "3":
+ CurrentTier = "easy";
+ break;
+ }
+ LoadNetworks();
+ }
+
+ private void lbnets_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ var t = lbnets.SelectedItem as string;
+ foreach(var net in Networks)
+ {
+ if(net.Key == t)
+ {
+ SelectedNet = net.Value;
+ }
+ }
+ SetupSidePane();
+ }
+
+ private void btnstartbattle_Click(object sender, EventArgs e)
+ {
+ if (Hacking.MyCore.HP == 0)
+ {
+ SetupMyNet();
+ pnlmynet.Show();
+ btnscreen.Text = "My Network";
+ API.CreateInfoboxSession("Your Core isn't ready.", "Your Core (hostname \"localhost\") has 0 HP, and cannot fight. Please wait until your Core regenerates.", infobox.InfoboxMode.Info);
+ }
+ else
+ {
+ if (online_mode == false)
+ {
+ string tier_upgrade = null;
+ if (SelectedNet.IsLeader == true)
+ {
+ tier_upgrade = "nb_tier_" + CurrentTier;
+ }
+ var hui = new HackUI(SelectedNet);
+ hui.OnWin += (object s, EventArgs a) =>
+ {
+ if (tier_upgrade != null)
+ {
+ API.Upgrades[tier_upgrade] = true;
+ if (CurrentTier == "easy")
+ {
+ if (API.Upgrades["midgamebridge"] == false)
+ {
+ var term = new Terminal();
+ API.CreateForm(term, API.LoadedNames.TerminalName, API.GetIcon("Terminal"));
+ term.StartDanaRossStory();
+ }
+ }
+ else if (CurrentTier == "medium")
+ {
+ var h = new HoloChat();
+ var fakeroom = new FakeChatClient();
+ fakeroom.Name = "The Hacker Alliance";
+ fakeroom.Topic = "The Hacker Alliance - We are the masters. DevX cannot control us.";
+ fakeroom.OtherCharacters = new List<string>(new[] { "Richard Ladouceur" });
+ fakeroom.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.AustinWalkerCompletionStory);
+ API.CreateForm(h, "QuickChat", API.GetIcon("QuickChat"));
+ var t = new Thread(new ThreadStart(new Action(() =>
+ {
+ Thread.Sleep(200);
+ h.Invoke(new Action(() =>
+ {
+ h.SetupFakeClient(fakeroom);
+ }));
+ })));
+
+ }
+ foreach (var mod in SelectedNet.Network)
+ {
+ if (mod.Type != SystemType.Core)
+ {
+ mod.HP = 0;
+ Hacking.MyNetwork.Add(mod);
+ }
+ }
+ SetupMyNet();
+ }
+ API.CurrentSave.CompletedNets.Add(SelectedNet.Name);
+ SelectedNet = null;
+ LoadNetworks();
+ SetupSidePane();
+ };
+ hui.Show();
+ }
+ else
+ {
+ //nyi
+ }
+ }
+ }
+
+ public void SetupMyNet()
+ {
+ flmodules.Controls.Clear();
+ foreach(var m in Hacking.MyNetwork)
+ {
+ var mStatus = new NetModuleStatus(m);
+ flmodules.Controls.Add(mStatus);
+ mStatus.Show();
+ }
+ }
+
+ private void btnscreen_Click(object sender, EventArgs e)
+ {
+ switch (btnscreen.Text)
+ {
+ case "My Network":
+ LoadNetworks();
+ SetupSidePane();
+ pnlmynet.Hide();
+ btnscreen.Text = "Network List";
+ break;
+ case "Network List":
+ SetupMyNet();
+ pnlmynet.Show();
+ btnscreen.Text = "My Network";
+ break;
+ }
+
+ }
+
+ private void tmrcalctotal_Tick(object sender, EventArgs e)
+ {
+ int total = 0;
+ int hp = 0;
+ foreach(var mod in Hacking.MyNetwork)
+ {
+ total += mod.GetTotalHP();
+ hp += mod.HP;
+ }
+ pgtotalhealth.MaxValue = total;
+ pgtotalhealth.Value = hp;
+ }
+
+ bool online_mode = false;
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ var me = API.CurrentSave.MyOnlineNetwork;
+ if (me.Name == null && me.Description == null)
+ {
+ pnlmynet.Show();
+ pnlmynet.BringToFront();
+ SetupMyNet();
+ API.CreateInfoboxSession("Make a name for yourself.", "Before you can battle online, please enter a name and a description that people will see when you matchmake. When you're done, click Battle Online again.", infobox.InfoboxMode.Info);
+ }
+ else
+ {
+ online_mode = !online_mode;
+ LoadNetworks();
+ }
+ }
+
+ Online.Hacking.ServerInfo selected_server = null;
+
+ private void lbonlineservers_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ var server_name = lbonlineservers.SelectedItem as string;
+ var server = new Online.Hacking.ServerInfo();
+ foreach(var srv in Online.Hacking.Matchmaker.Servers)
+ {
+ if (srv.ServerName == server_name)
+ server = srv;
+ }
+ selected_server = server;
+ LoadNetworks();
+ }
+
+ private void btnjoinlobby_Click(object sender, EventArgs e)
+ {
+ lbonlineservers.Hide();
+ API.CurrentSave.MyOnlineNetwork.Codepoints = API.Codepoints;
+ Package_Grabber.SendMessage(selected_server.IPAddress, $"join_lobby {JsonConvert.SerializeObject(API.CurrentSave.MyOnlineNetwork)}");
+ Online.Hacking.Matchmaker.Matchmake(selected_server);
+ var t = new System.Windows.Forms.Timer();
+ t.Interval = 5000;
+ int sindex = 0;
+ t.Tick += (o, a) =>
+ {
+ try
+ {
+ SetupSidePane(Online.Hacking.Matchmaker.Players[sindex]);
+ if (Matchmaker.Players.Count > 1)
+ {
+ if (sindex < Online.Hacking.Matchmaker.Players.Count - 1)
+ {
+ sindex = 0;
+ }
+ else
+ {
+ sindex += 1;
+ }
+ }
+ }
+ catch
+ {
+
+ }
+ };
+ t.Start();
+ }
+
+ private void SetupSidePane(Network network)
+ {
+ try
+ {
+ lbtitle.Text = network.Name;
+ lbnetdesc.Text = $@"{network.Description}
+
+ - {network.Codepoints} codepoints.
+ - {network.Wins} wins, {network.Losses} losses.";
+ }
+ catch
+ {
+ lbtitle.Text = "<null>";
+ lbnetdesc.Text = @"<no description>
+
+ - unknown codepoints.
+ - unknown wins, unknown losses.
+
+
+If you see this happen, it's a phantom client. The server won't pair you with it.";
+ }
+ }
+
+ private void stop_matchmake(object sender, FormClosingEventArgs e)
+ {
+ if(selected_server != null)
+ {
+ Package_Grabber.SendMessage(selected_server.IPAddress, $"leave_lobby {JsonConvert.SerializeObject(API.CurrentSave.MyOnlineNetwork)}");
+ }
+ }
+
+ private void txtmydescription_TextChanged(object sender, EventArgs e)
+ {
+ API.CurrentSave.MyOnlineNetwork.Description = txtmydescription.Text;
+ }
+
+ private void txtmyname_TextChanged(object sender, EventArgs e)
+ {
+ API.CurrentSave.MyOnlineNetwork.Name = txtmyname.Text;
+ }
+ }
+}
diff --git a/source/WindowsFormsApplication1/NetworkBrowser.resx b/source/WindowsFormsApplication1/Apps/NetworkBrowser.resx
index fa83c0a..e5cb9b1 100644
--- a/source/WindowsFormsApplication1/NetworkBrowser.resx
+++ b/source/WindowsFormsApplication1/Apps/NetworkBrowser.resx
@@ -117,6 +117,13 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
+ <data name="lbnetdesc.Text" xml:space="preserve">
+ <value>Welcome to the Network Browser. Here, you can choose various enemy networks to battle and conquer. On the left is the network selection panel, and it will let you choose what network you'd like to fight. When you beat a network, it's removed from the list.
+
+Below the network selection panel is a Tier button. You can click it to change the difficulty of networks that you will fight. The higher the tier, the harder the battle. Beside that button, is the Screen button. Clicking it will switch between the Network Selection panel and your Network Status panel which will show you the health of all your modules if they are below max.
+
+You can start the battle using the "Start Battle" button, and you can join an online session using the "Battle online" button. It is wise to practice offline, as offline networks are more predictable than online ones - and you require more speed to battle against another real player. But, this is ShiftOS. Do what you wish.</value>
+ </data>
<metadata name="tmrcalctotal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
diff --git a/source/WindowsFormsApplication1/PanelManager.Designer.cs b/source/WindowsFormsApplication1/Apps/PanelManager.Designer.cs
index 2ae44a8..2ae44a8 100644
--- a/source/WindowsFormsApplication1/PanelManager.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/PanelManager.Designer.cs
diff --git a/source/WindowsFormsApplication1/PanelManager.cs b/source/WindowsFormsApplication1/Apps/PanelManager.cs
index d347fb5..d347fb5 100644
--- a/source/WindowsFormsApplication1/PanelManager.cs
+++ b/source/WindowsFormsApplication1/Apps/PanelManager.cs
diff --git a/source/WindowsFormsApplication1/PanelManager.resx b/source/WindowsFormsApplication1/Apps/PanelManager.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/PanelManager.resx
+++ b/source/WindowsFormsApplication1/Apps/PanelManager.resx
diff --git a/source/WindowsFormsApplication1/Pong.Designer.cs b/source/WindowsFormsApplication1/Apps/Pong.Designer.cs
index d7d7bdb..d7d7bdb 100644
--- a/source/WindowsFormsApplication1/Pong.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Pong.Designer.cs
diff --git a/source/WindowsFormsApplication1/Pong.cs b/source/WindowsFormsApplication1/Apps/Pong.cs
index c685100..c685100 100644
--- a/source/WindowsFormsApplication1/Pong.cs
+++ b/source/WindowsFormsApplication1/Apps/Pong.cs
diff --git a/source/WindowsFormsApplication1/Pong.resx b/source/WindowsFormsApplication1/Apps/Pong.resx
index cedb787..cedb787 100644
--- a/source/WindowsFormsApplication1/Pong.resx
+++ b/source/WindowsFormsApplication1/Apps/Pong.resx
diff --git a/source/WindowsFormsApplication1/Shifter.Designer.cs b/source/WindowsFormsApplication1/Apps/Shifter.Designer.cs
index 1d16831..d49294e 100644
--- a/source/WindowsFormsApplication1/Shifter.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Shifter.Designer.cs
@@ -34,6 +34,7 @@ namespace ShiftOS
this.Label1 = new System.Windows.Forms.Label();
this.btnapply = new System.Windows.Forms.Button();
this.catholder = new System.Windows.Forms.Panel();
+ this.btnmore = new System.Windows.Forms.Button();
this.btnreset = new System.Windows.Forms.Button();
this.btnwindowcomposition = new System.Windows.Forms.Button();
this.btndesktopicons = new System.Windows.Forms.Button();
@@ -46,6 +47,16 @@ namespace ShiftOS
this.Label64 = new System.Windows.Forms.Label();
this.Label63 = new System.Windows.Forms.Label();
this.pnldesktopoptions = new System.Windows.Forms.Panel();
+ this.pnldesktoppaneloptions = new System.Windows.Forms.Panel();
+ this.btnpanelbuttons = new System.Windows.Forms.Button();
+ this.lbwarning = new System.Windows.Forms.Label();
+ this.combodesktoppanelposition = new System.Windows.Forms.ComboBox();
+ this.lbposition = new System.Windows.Forms.Label();
+ this.Label47 = new System.Windows.Forms.Label();
+ this.txtdesktoppanelheight = new System.Windows.Forms.NumericUpDown();
+ this.lbheight = new System.Windows.Forms.Label();
+ this.pnldesktoppanelcolour = new System.Windows.Forms.Panel();
+ this.lbpanelcolor = new System.Windows.Forms.Label();
this.pnlapplauncheroptions = new System.Windows.Forms.Panel();
this.pnlalhover = new System.Windows.Forms.Panel();
this.label119 = new System.Windows.Forms.Label();
@@ -108,16 +119,6 @@ namespace ShiftOS
this.Label91 = new System.Windows.Forms.Label();
this.pnlpanelbuttoncolour = new System.Windows.Forms.Panel();
this.Label95 = new System.Windows.Forms.Label();
- this.pnldesktoppaneloptions = new System.Windows.Forms.Panel();
- this.btnpanelbuttons = new System.Windows.Forms.Button();
- this.lbwarning = new System.Windows.Forms.Label();
- this.combodesktoppanelposition = new System.Windows.Forms.ComboBox();
- this.lbposition = new System.Windows.Forms.Label();
- this.Label47 = new System.Windows.Forms.Label();
- this.txtdesktoppanelheight = new System.Windows.Forms.NumericUpDown();
- this.lbheight = new System.Windows.Forms.Label();
- this.pnldesktoppanelcolour = new System.Windows.Forms.Panel();
- this.lbpanelcolor = new System.Windows.Forms.Label();
this.pnldesktopbackgroundoptions = new System.Windows.Forms.Panel();
this.pnldesktopcolour = new System.Windows.Forms.Panel();
this.Label45 = new System.Windows.Forms.Label();
@@ -437,14 +438,17 @@ namespace ShiftOS
this.label74 = new System.Windows.Forms.Label();
this.tmrfix = new System.Windows.Forms.Timer(this.components);
this.tmrdelay = new System.Windows.Forms.Timer(this.components);
+ this.pnlluaoptions = new System.Windows.Forms.Panel();
+ this.flmorebuttons = new System.Windows.Forms.FlowLayoutPanel();
+ this.pnlluafield = new System.Windows.Forms.Panel();
this.catholder.SuspendLayout();
this.pnlshifterintro.SuspendLayout();
this.pnldesktopoptions.SuspendLayout();
+ this.pnldesktoppaneloptions.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).BeginInit();
this.pnlapplauncheroptions.SuspendLayout();
this.pnldesktopintro.SuspendLayout();
this.pnlpanelbuttonsoptions.SuspendLayout();
- this.pnldesktoppaneloptions.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).BeginInit();
this.pnldesktopbackgroundoptions.SuspendLayout();
this.pnlpanelclockoptions.SuspendLayout();
this.pnldesktoppreview.SuspendLayout();
@@ -487,6 +491,7 @@ namespace ShiftOS
this.pnlbasic.SuspendLayout();
this.pnlmenusintro.SuspendLayout();
this.pnlmenucategories.SuspendLayout();
+ this.pnlluaoptions.SuspendLayout();
this.SuspendLayout();
//
// clocktick
@@ -532,6 +537,7 @@ namespace ShiftOS
this.catholder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.catholder.BackColor = System.Drawing.Color.White;
+ this.catholder.Controls.Add(this.btnmore);
this.catholder.Controls.Add(this.btnreset);
this.catholder.Controls.Add(this.btnwindowcomposition);
this.catholder.Controls.Add(this.btndesktopicons);
@@ -543,6 +549,21 @@ namespace ShiftOS
this.catholder.Size = new System.Drawing.Size(119, 271);
this.catholder.TabIndex = 5;
//
+ // btnmore
+ //
+ this.btnmore.BackColor = System.Drawing.Color.White;
+ this.btnmore.Dock = System.Windows.Forms.DockStyle.Top;
+ this.btnmore.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnmore.Font = new System.Drawing.Font("Cambria", 12F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnmore.Location = new System.Drawing.Point(0, 174);
+ this.btnmore.Name = "btnmore";
+ this.btnmore.Size = new System.Drawing.Size(119, 29);
+ this.btnmore.TabIndex = 11;
+ this.btnmore.TabStop = false;
+ this.btnmore.Text = "More";
+ this.btnmore.UseVisualStyleBackColor = false;
+ this.btnmore.Click += new System.EventHandler(this.btnmore_Click);
+ //
// btnreset
//
this.btnreset.BackColor = System.Drawing.Color.White;
@@ -699,8 +720,8 @@ namespace ShiftOS
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnldesktopoptions.BackColor = System.Drawing.Color.White;
- this.pnldesktopoptions.Controls.Add(this.pnldesktoppaneloptions);
this.pnldesktopoptions.Controls.Add(this.pnlapplauncheroptions);
+ this.pnldesktopoptions.Controls.Add(this.pnldesktoppaneloptions);
this.pnldesktopoptions.Controls.Add(this.pnldesktopintro);
this.pnldesktopoptions.Controls.Add(this.pnlpanelbuttonsoptions);
this.pnldesktopoptions.Controls.Add(this.pnldesktopbackgroundoptions);
@@ -713,6 +734,120 @@ namespace ShiftOS
this.pnldesktopoptions.TabIndex = 16;
this.pnldesktopoptions.Visible = false;
//
+ // pnldesktoppaneloptions
+ //
+ this.pnldesktoppaneloptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.pnldesktoppaneloptions.Controls.Add(this.btnpanelbuttons);
+ this.pnldesktoppaneloptions.Controls.Add(this.lbwarning);
+ this.pnldesktoppaneloptions.Controls.Add(this.combodesktoppanelposition);
+ this.pnldesktoppaneloptions.Controls.Add(this.lbposition);
+ this.pnldesktoppaneloptions.Controls.Add(this.Label47);
+ this.pnldesktoppaneloptions.Controls.Add(this.txtdesktoppanelheight);
+ this.pnldesktoppaneloptions.Controls.Add(this.lbheight);
+ this.pnldesktoppaneloptions.Controls.Add(this.pnldesktoppanelcolour);
+ this.pnldesktoppaneloptions.Controls.Add(this.lbpanelcolor);
+ this.pnldesktoppaneloptions.Location = new System.Drawing.Point(135, 159);
+ this.pnldesktoppaneloptions.Name = "pnldesktoppaneloptions";
+ this.pnldesktoppaneloptions.Size = new System.Drawing.Size(317, 140);
+ this.pnldesktoppaneloptions.TabIndex = 9;
+ this.pnldesktoppaneloptions.Visible = false;
+ //
+ // btnpanelbuttons
+ //
+ this.btnpanelbuttons.BackColor = System.Drawing.Color.White;
+ this.btnpanelbuttons.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnpanelbuttons.Font = new System.Drawing.Font("Cambria", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.btnpanelbuttons.Location = new System.Drawing.Point(193, 101);
+ this.btnpanelbuttons.Name = "btnpanelbuttons";
+ this.btnpanelbuttons.Size = new System.Drawing.Size(119, 29);
+ this.btnpanelbuttons.TabIndex = 8;
+ this.btnpanelbuttons.Text = "Panel Buttons >";
+ this.btnpanelbuttons.UseVisualStyleBackColor = false;
+ this.btnpanelbuttons.Click += new System.EventHandler(this.btnpanelbuttons_Click);
+ //
+ // lbwarning
+ //
+ this.lbwarning.Location = new System.Drawing.Point(3, 52);
+ this.lbwarning.Name = "lbwarning";
+ this.lbwarning.Size = new System.Drawing.Size(290, 42);
+ this.lbwarning.TabIndex = 8;
+ this.lbwarning.Text = "Warning: If you set the panel position to the bottom you must hide your windows t" +
+ "askbar and restart ShiftOS on your host operating system to prevent a visual bug" +
+ ".";
+ //
+ // combodesktoppanelposition
+ //
+ this.combodesktoppanelposition.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.combodesktoppanelposition.FormattingEnabled = true;
+ this.combodesktoppanelposition.Items.AddRange(new object[] {
+ "Top",
+ "Bottom"});
+ this.combodesktoppanelposition.Location = new System.Drawing.Point(103, 28);
+ this.combodesktoppanelposition.Name = "combodesktoppanelposition";
+ this.combodesktoppanelposition.Size = new System.Drawing.Size(59, 24);
+ this.combodesktoppanelposition.TabIndex = 7;
+ this.combodesktoppanelposition.SelectedIndexChanged += new System.EventHandler(this.combodesktoppanelposition_SelectedIndexChanged);
+ //
+ // lbposition
+ //
+ this.lbposition.AutoSize = true;
+ this.lbposition.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbposition.Location = new System.Drawing.Point(3, 31);
+ this.lbposition.Name = "lbposition";
+ this.lbposition.Size = new System.Drawing.Size(97, 16);
+ this.lbposition.TabIndex = 6;
+ this.lbposition.Text = "Panel Position:";
+ //
+ // Label47
+ //
+ this.Label47.AutoSize = true;
+ this.Label47.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label47.Location = new System.Drawing.Point(226, 8);
+ this.Label47.Name = "Label47";
+ this.Label47.Size = new System.Drawing.Size(22, 16);
+ this.Label47.TabIndex = 5;
+ this.Label47.Text = "px";
+ //
+ // txtdesktoppanelheight
+ //
+ this.txtdesktoppanelheight.BackColor = System.Drawing.Color.White;
+ this.txtdesktoppanelheight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.txtdesktoppanelheight.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.txtdesktoppanelheight.ForeColor = System.Drawing.Color.Black;
+ this.txtdesktoppanelheight.Location = new System.Drawing.Point(189, 5);
+ this.txtdesktoppanelheight.Name = "txtdesktoppanelheight";
+ this.txtdesktoppanelheight.Size = new System.Drawing.Size(37, 22);
+ this.txtdesktoppanelheight.TabIndex = 4;
+ this.txtdesktoppanelheight.ValueChanged += new System.EventHandler(this.txtdesktoppanelheight_ValueChanged);
+ //
+ // lbheight
+ //
+ this.lbheight.AutoSize = true;
+ this.lbheight.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbheight.Location = new System.Drawing.Point(138, 7);
+ this.lbheight.Name = "lbheight";
+ this.lbheight.Size = new System.Drawing.Size(50, 16);
+ this.lbheight.TabIndex = 2;
+ this.lbheight.Text = "Height:";
+ //
+ // pnldesktoppanelcolour
+ //
+ this.pnldesktoppanelcolour.Location = new System.Drawing.Point(92, 5);
+ this.pnldesktoppanelcolour.Name = "pnldesktoppanelcolour";
+ this.pnldesktoppanelcolour.Size = new System.Drawing.Size(41, 20);
+ this.pnldesktoppanelcolour.TabIndex = 1;
+ this.pnldesktoppanelcolour.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ChangeDesktopPanelColor);
+ //
+ // lbpanelcolor
+ //
+ this.lbpanelcolor.AutoSize = true;
+ this.lbpanelcolor.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbpanelcolor.Location = new System.Drawing.Point(3, 7);
+ this.lbpanelcolor.Name = "lbpanelcolor";
+ this.lbpanelcolor.Size = new System.Drawing.Size(88, 16);
+ this.lbpanelcolor.TabIndex = 0;
+ this.lbpanelcolor.Text = "Panel Colour:";
+ //
// pnlapplauncheroptions
//
this.pnlapplauncheroptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -1426,120 +1561,6 @@ namespace ShiftOS
this.Label95.TabIndex = 0;
this.Label95.Text = "Button Colour:";
//
- // pnldesktoppaneloptions
- //
- this.pnldesktoppaneloptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.pnldesktoppaneloptions.Controls.Add(this.btnpanelbuttons);
- this.pnldesktoppaneloptions.Controls.Add(this.lbwarning);
- this.pnldesktoppaneloptions.Controls.Add(this.combodesktoppanelposition);
- this.pnldesktoppaneloptions.Controls.Add(this.lbposition);
- this.pnldesktoppaneloptions.Controls.Add(this.Label47);
- this.pnldesktoppaneloptions.Controls.Add(this.txtdesktoppanelheight);
- this.pnldesktoppaneloptions.Controls.Add(this.lbheight);
- this.pnldesktoppaneloptions.Controls.Add(this.pnldesktoppanelcolour);
- this.pnldesktoppaneloptions.Controls.Add(this.lbpanelcolor);
- this.pnldesktoppaneloptions.Location = new System.Drawing.Point(135, 159);
- this.pnldesktoppaneloptions.Name = "pnldesktoppaneloptions";
- this.pnldesktoppaneloptions.Size = new System.Drawing.Size(317, 140);
- this.pnldesktoppaneloptions.TabIndex = 9;
- this.pnldesktoppaneloptions.Visible = false;
- //
- // btnpanelbuttons
- //
- this.btnpanelbuttons.BackColor = System.Drawing.Color.White;
- this.btnpanelbuttons.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnpanelbuttons.Font = new System.Drawing.Font("Cambria", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btnpanelbuttons.Location = new System.Drawing.Point(193, 101);
- this.btnpanelbuttons.Name = "btnpanelbuttons";
- this.btnpanelbuttons.Size = new System.Drawing.Size(119, 29);
- this.btnpanelbuttons.TabIndex = 8;
- this.btnpanelbuttons.Text = "Panel Buttons >";
- this.btnpanelbuttons.UseVisualStyleBackColor = false;
- this.btnpanelbuttons.Click += new System.EventHandler(this.btnpanelbuttons_Click);
- //
- // lbwarning
- //
- this.lbwarning.Location = new System.Drawing.Point(3, 52);
- this.lbwarning.Name = "lbwarning";
- this.lbwarning.Size = new System.Drawing.Size(290, 42);
- this.lbwarning.TabIndex = 8;
- this.lbwarning.Text = "Warning: If you set the panel position to the bottom you must hide your windows t" +
- "askbar and restart ShiftOS on your host operating system to prevent a visual bug" +
- ".";
- //
- // combodesktoppanelposition
- //
- this.combodesktoppanelposition.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.combodesktoppanelposition.FormattingEnabled = true;
- this.combodesktoppanelposition.Items.AddRange(new object[] {
- "Top",
- "Bottom"});
- this.combodesktoppanelposition.Location = new System.Drawing.Point(103, 28);
- this.combodesktoppanelposition.Name = "combodesktoppanelposition";
- this.combodesktoppanelposition.Size = new System.Drawing.Size(59, 24);
- this.combodesktoppanelposition.TabIndex = 7;
- this.combodesktoppanelposition.SelectedIndexChanged += new System.EventHandler(this.combodesktoppanelposition_SelectedIndexChanged);
- //
- // lbposition
- //
- this.lbposition.AutoSize = true;
- this.lbposition.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbposition.Location = new System.Drawing.Point(3, 31);
- this.lbposition.Name = "lbposition";
- this.lbposition.Size = new System.Drawing.Size(97, 16);
- this.lbposition.TabIndex = 6;
- this.lbposition.Text = "Panel Position:";
- //
- // Label47
- //
- this.Label47.AutoSize = true;
- this.Label47.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Label47.Location = new System.Drawing.Point(226, 8);
- this.Label47.Name = "Label47";
- this.Label47.Size = new System.Drawing.Size(22, 16);
- this.Label47.TabIndex = 5;
- this.Label47.Text = "px";
- //
- // txtdesktoppanelheight
- //
- this.txtdesktoppanelheight.BackColor = System.Drawing.Color.White;
- this.txtdesktoppanelheight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.txtdesktoppanelheight.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.txtdesktoppanelheight.ForeColor = System.Drawing.Color.Black;
- this.txtdesktoppanelheight.Location = new System.Drawing.Point(189, 5);
- this.txtdesktoppanelheight.Name = "txtdesktoppanelheight";
- this.txtdesktoppanelheight.Size = new System.Drawing.Size(37, 22);
- this.txtdesktoppanelheight.TabIndex = 4;
- this.txtdesktoppanelheight.ValueChanged += new System.EventHandler(this.txtdesktoppanelheight_ValueChanged);
- //
- // lbheight
- //
- this.lbheight.AutoSize = true;
- this.lbheight.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbheight.Location = new System.Drawing.Point(138, 7);
- this.lbheight.Name = "lbheight";
- this.lbheight.Size = new System.Drawing.Size(50, 16);
- this.lbheight.TabIndex = 2;
- this.lbheight.Text = "Height:";
- //
- // pnldesktoppanelcolour
- //
- this.pnldesktoppanelcolour.Location = new System.Drawing.Point(92, 5);
- this.pnldesktoppanelcolour.Name = "pnldesktoppanelcolour";
- this.pnldesktoppanelcolour.Size = new System.Drawing.Size(41, 20);
- this.pnldesktoppanelcolour.TabIndex = 1;
- this.pnldesktoppanelcolour.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ChangeDesktopPanelColor);
- //
- // lbpanelcolor
- //
- this.lbpanelcolor.AutoSize = true;
- this.lbpanelcolor.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbpanelcolor.Location = new System.Drawing.Point(3, 7);
- this.lbpanelcolor.Name = "lbpanelcolor";
- this.lbpanelcolor.Size = new System.Drawing.Size(88, 16);
- this.lbpanelcolor.TabIndex = 0;
- this.lbpanelcolor.Text = "Panel Colour:";
- //
// pnldesktopbackgroundoptions
//
this.pnldesktopbackgroundoptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -3511,6 +3532,7 @@ namespace ShiftOS
//
this.pgcontents.BackColor = System.Drawing.Color.White;
this.pgcontents.Controls.Add(this.pnldesktopoptions);
+ this.pgcontents.Controls.Add(this.pnlluaoptions);
this.pgcontents.Controls.Add(this.pnldesktopcomposition);
this.pgcontents.Controls.Add(this.pnlreset);
this.pgcontents.Controls.Add(this.pnlwindowsoptions);
@@ -5054,6 +5076,38 @@ namespace ShiftOS
//
this.tmrfix.Interval = 5000;
//
+ // pnlluaoptions
+ //
+ this.pnlluaoptions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.pnlluaoptions.BackColor = System.Drawing.Color.White;
+ this.pnlluaoptions.Controls.Add(this.pnlluafield);
+ this.pnlluaoptions.Controls.Add(this.flmorebuttons);
+ this.pnlluaoptions.Location = new System.Drawing.Point(139, 9);
+ this.pnlluaoptions.Name = "pnlluaoptions";
+ this.pnlluaoptions.Size = new System.Drawing.Size(457, 306);
+ this.pnlluaoptions.TabIndex = 21;
+ this.pnlluaoptions.Visible = false;
+ //
+ // flmorebuttons
+ //
+ this.flmorebuttons.AutoSize = true;
+ this.flmorebuttons.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.flmorebuttons.Dock = System.Windows.Forms.DockStyle.Top;
+ this.flmorebuttons.Location = new System.Drawing.Point(0, 0);
+ this.flmorebuttons.Name = "flmorebuttons";
+ this.flmorebuttons.Size = new System.Drawing.Size(457, 0);
+ this.flmorebuttons.TabIndex = 0;
+ //
+ // pnlluafield
+ //
+ this.pnlluafield.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlluafield.Location = new System.Drawing.Point(0, 0);
+ this.pnlluafield.Name = "pnlluafield";
+ this.pnlluafield.Size = new System.Drawing.Size(457, 306);
+ this.pnlluafield.TabIndex = 1;
+ //
// Shifter
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -5069,15 +5123,15 @@ namespace ShiftOS
this.pnlshifterintro.ResumeLayout(false);
this.pnlshifterintro.PerformLayout();
this.pnldesktopoptions.ResumeLayout(false);
+ this.pnldesktoppaneloptions.ResumeLayout(false);
+ this.pnldesktoppaneloptions.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).EndInit();
this.pnlapplauncheroptions.ResumeLayout(false);
this.pnlapplauncheroptions.PerformLayout();
this.pnldesktopintro.ResumeLayout(false);
this.pnldesktopintro.PerformLayout();
this.pnlpanelbuttonsoptions.ResumeLayout(false);
this.pnlpanelbuttonsoptions.PerformLayout();
- this.pnldesktoppaneloptions.ResumeLayout(false);
- this.pnldesktoppaneloptions.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).EndInit();
this.pnldesktopbackgroundoptions.ResumeLayout(false);
this.pnldesktopbackgroundoptions.PerformLayout();
this.pnlpanelclockoptions.ResumeLayout(false);
@@ -5143,6 +5197,8 @@ namespace ShiftOS
this.pnlbasic.PerformLayout();
this.pnlmenusintro.ResumeLayout(false);
this.pnlmenucategories.ResumeLayout(false);
+ this.pnlluaoptions.ResumeLayout(false);
+ this.pnlluaoptions.PerformLayout();
this.ResumeLayout(false);
}
@@ -5556,5 +5612,9 @@ namespace ShiftOS
private Label label150;
private TextBox txtwinfadespeed;
private Label label151;
+ private Button btnmore;
+ private Panel pnlluaoptions;
+ private FlowLayoutPanel flmorebuttons;
+ private Panel pnlluafield;
}
} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Shifter.cs b/source/WindowsFormsApplication1/Apps/Shifter.cs
index 25e4dd2..3aad889 100644
--- a/source/WindowsFormsApplication1/Shifter.cs
+++ b/source/WindowsFormsApplication1/Apps/Shifter.cs
@@ -581,7 +581,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtdesktoppanelheight.Text = CustomizingSkin.desktoppanelheight.ToString();
}
@@ -800,7 +800,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txtappbuttontextsize.Text = CustomizingSkin.applicationbuttontextsize.ToString();
}
@@ -828,7 +828,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtapplicationsbuttonheight.Text = CustomizingSkin.applicationbuttonheight.ToString();
}
@@ -842,7 +842,7 @@ namespace ShiftOS
SetPreviewSkin(false);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtapplauncherwidth.Text = CustomizingSkin.applaunchermenuholderwidth.ToString();
}
@@ -1005,8 +1005,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttonwidth = Convert.ToInt16(txtpanelbuttonwidth.Text);
AddCP(1);
}
- catch(Exception ex)
- {
+ catch{
txtpanelbuttonwidth.Text = CustomizingSkin.panelbuttonwidth.ToString();
}
SetPreviewSkin(false);
@@ -1019,7 +1018,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttoninitialgap = Convert.ToInt16(txtpanelbuttoninitalgap.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttoninitalgap.Text = CustomizingSkin.panelbuttoninitialgap.ToString();
}
@@ -1033,7 +1032,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttonheight = Convert.ToInt16(txtpanelbuttonheight.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttonheight.Text = CustomizingSkin.panelbuttonheight.ToString();
}
@@ -1047,7 +1046,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttongap = Convert.ToInt16(txtpanelbuttongap.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttongap.Text = CustomizingSkin.panelbuttongap.ToString();
}
@@ -1121,7 +1120,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttoniconsize = Convert.ToInt16(txtpanelbuttoniconsize.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttoniconsize.Text = CustomizingSkin.panelbuttoniconsize.ToString();
}
@@ -1135,7 +1134,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttoniconside = Convert.ToInt16(txtpanelbuttoniconside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttoniconside.Text = CustomizingSkin.panelbuttoniconside.ToString();
}
@@ -1149,7 +1148,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttonicontop = Convert.ToInt16(txtpanelbuttonicontop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttonicontop.Text = CustomizingSkin.panelbuttonicontop.ToString();
}
@@ -1163,7 +1162,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttontextside = Convert.ToInt16(txtpanelbuttontextside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttontextside.Text = CustomizingSkin.panelbuttontextside.ToString();
}
@@ -1177,7 +1176,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttontexttop = Convert.ToInt16(txtpanelbuttontexttop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttontexttop.Text = CustomizingSkin.panelbuttontexttop.ToString();
}
@@ -1191,7 +1190,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttontextsize = Convert.ToInt16(txtpaneltextbuttonsize.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpaneltextbuttonsize.Text = CustomizingSkin.panelbuttontextsize.ToString();
}
@@ -1205,7 +1204,7 @@ namespace ShiftOS
CustomizingSkin.panelbuttonfromtop = Convert.ToInt16(txtpanelbuttontop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtpanelbuttontop.Text = CustomizingSkin.panelbuttonfromtop.ToString();
}
@@ -1297,7 +1296,7 @@ namespace ShiftOS
CustomizingSkin.panelclocktextsize = Convert.ToInt16(txtclocktextsize.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtclocktextsize.Text = CustomizingSkin.panelclocktextsize.ToString();
}
@@ -1311,7 +1310,7 @@ namespace ShiftOS
CustomizingSkin.panelclocktexttop = Convert.ToInt16(txtclocktextfromtop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtclocktextfromtop.Text = CustomizingSkin.panelclocktexttop.ToString(); //Funny story: I accidentally assigned 'panelcocktexttop' to that property. xD - Michael VanOverbeek
}
@@ -1358,7 +1357,7 @@ namespace ShiftOS
CustomizingSkin.titletextfromtop = Convert.ToInt16(txttitletexttop.Text);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txttitletexttop.Text = CustomizingSkin.titletextfromtop.ToString();
}
@@ -1372,7 +1371,7 @@ namespace ShiftOS
CustomizingSkin.titletextfromside = Convert.ToInt16(txttitletextside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txttitletextside.Text = CustomizingSkin.titletextfromside.ToString();
}
@@ -1407,7 +1406,7 @@ namespace ShiftOS
CustomizingSkin.titletextfontsize = Convert.ToInt16(txttitletextsize.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txttitletextsize.Text = CustomizingSkin.titletextfontsize.ToString();
}
@@ -1746,7 +1745,7 @@ namespace ShiftOS
CustomizingSkin.borderwidth = Convert.ToInt16(txtbordersize.Text);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txtbordersize.Text = CustomizingSkin.borderwidth.ToString();
}
@@ -1836,7 +1835,7 @@ namespace ShiftOS
CustomizingSkin.titlebarheight = Convert.ToInt16(txttitlebarheight.Text);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txttitlebarheight.Text = CustomizingSkin.titlebarheight.ToString();
}
@@ -1850,7 +1849,7 @@ namespace ShiftOS
CustomizingSkin.titlebarcornerwidth = Convert.ToInt16(txttitlebarcornerwidth.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txttitlebarcornerwidth.Text = CustomizingSkin.titlebarcornerwidth.ToString();
}
@@ -1926,7 +1925,7 @@ namespace ShiftOS
CustomizingSkin.titleiconfromside = Convert.ToInt16(txticonfromside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txticonfromside.Text = CustomizingSkin.titleiconfromside.ToString();
}
@@ -1940,7 +1939,7 @@ namespace ShiftOS
CustomizingSkin.titleiconfromtop = Convert.ToInt16(txticonfromtop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txticonfromtop.Text = CustomizingSkin.titleiconfromtop.ToString();
}
@@ -2064,7 +2063,7 @@ namespace ShiftOS
CustomizingSkin.minbtnsize.Height = Convert.ToInt16(txtminimizebuttonheight.Text);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txtminimizebuttonheight.Text = CustomizingSkin.minbtnsize.Height.ToString();
}
@@ -2078,7 +2077,7 @@ namespace ShiftOS
CustomizingSkin.minbtnsize.Width = Convert.ToInt16(txtminimizebuttonwidth.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtminimizebuttonwidth.Text = CustomizingSkin.minbtnsize.Width.ToString();
}
@@ -2092,7 +2091,7 @@ namespace ShiftOS
CustomizingSkin.minbtnfromtop = Convert.ToInt16(txtminimizebuttontop.Text);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txtminimizebuttontop.Text = CustomizingSkin.minbtnfromtop.ToString();
}
@@ -2106,7 +2105,7 @@ namespace ShiftOS
CustomizingSkin.minbtnfromside = Convert.ToInt16(txtminimizebuttonside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtminimizebuttonside.Text = CustomizingSkin.minbtnfromside.ToString();
}
@@ -2155,7 +2154,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnsize.Height = Convert.ToInt16(txtrollupbuttonheight.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtrollupbuttonheight.Text = CustomizingSkin.rollbtnsize.Height.ToString();
}
@@ -2169,7 +2168,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnsize.Width = Convert.ToInt16(txtrollupbuttonwidth.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtrollupbuttonwidth.Text = CustomizingSkin.rollbtnsize.Width.ToString();
}
@@ -2183,7 +2182,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnfromtop = Convert.ToInt16(txtrollupbuttontop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtrollupbuttontop.Text = CustomizingSkin.rollbtnfromtop.ToString();
}
@@ -2197,7 +2196,7 @@ namespace ShiftOS
CustomizingSkin.rollbtnfromside = Convert.ToInt16(txtrollupbuttonside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtrollupbuttonside.Text = CustomizingSkin.rollbtnfromside.ToString();
}
@@ -2246,7 +2245,7 @@ namespace ShiftOS
CustomizingSkin.closebtnsize.Height = Convert.ToInt16(txtclosebuttonheight.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtclosebuttonheight.Text = CustomizingSkin.closebtnsize.Height.ToString();
}
@@ -2260,7 +2259,7 @@ namespace ShiftOS
CustomizingSkin.closebtnsize.Width = Convert.ToInt16(txtclosebuttonwidth.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtclosebuttonwidth.Text = CustomizingSkin.closebtnsize.Width.ToString();
}
@@ -2274,7 +2273,7 @@ namespace ShiftOS
CustomizingSkin.closebtnfromtop = Convert.ToInt16(txtclosebuttonfromtop.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtclosebuttonfromtop.Text = CustomizingSkin.closebtnfromtop.ToString();
}
@@ -2288,7 +2287,7 @@ namespace ShiftOS
CustomizingSkin.closebtnfromside = Convert.ToInt16(txtclosebuttonfromside.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtclosebuttonfromside.Text = CustomizingSkin.closebtnfromside.ToString();
}
@@ -2899,7 +2898,7 @@ namespace ShiftOS
CustomizingSkin.DragFadeInterval = Convert.ToInt32(txtfadespeed.Text);
AddCP(1);
}
- catch(Exception ex)
+ catch
{
txtfadespeed.Text = CustomizingSkin.DragFadeInterval.ToString();
}
@@ -2912,7 +2911,7 @@ namespace ShiftOS
CustomizingSkin.DragFadeSpeed = Convert.ToDouble(txtdragfadedec.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtdragfadedec.Text = CustomizingSkin.DragFadeSpeed.ToString();
}
@@ -2932,7 +2931,7 @@ namespace ShiftOS
CustomizingSkin.DragFadeLevel = Convert.ToDouble(txtdragopacitydec.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtdragopacitydec.Text = CustomizingSkin.DragFadeLevel.ToString();
}
@@ -2945,7 +2944,7 @@ namespace ShiftOS
CustomizingSkin.ShakeMaxOffset = Convert.ToInt32(txtshakemax.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtshakemax.Text = CustomizingSkin.ShakeMaxOffset.ToString();
}
@@ -2958,7 +2957,7 @@ namespace ShiftOS
CustomizingSkin.ShakeMinOffset = Convert.ToInt32(txtshakeminoffset.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtshakeminoffset.Text = CustomizingSkin.ShakeMinOffset.ToString();
}
@@ -2971,7 +2970,7 @@ namespace ShiftOS
CustomizingSkin.WindowFadeTime = Convert.ToInt32(txtwinfadespeed.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtwinfadespeed.Text = CustomizingSkin.WindowFadeTime.ToString();
}
@@ -2984,10 +2983,111 @@ namespace ShiftOS
CustomizingSkin.WindowFadeSpeed = Convert.ToDecimal(txtwinfadedec.Text);
AddCP(1);
}
- catch (Exception ex)
+ catch
{
txtwinfadedec.Text = CustomizingSkin.WindowFadeSpeed.ToString();
}
}
+
+ private void btnmore_Click(object sender, EventArgs e)
+ {
+ pnlluaoptions.Show();
+ pnlluaoptions.BringToFront();
+ SetupLuaUI();
+
+ }
+
+ public void SetupLuaUI()
+ {
+ pnlluafield.Controls.Clear();
+ flmorebuttons.Controls.Clear();
+ if (API.LuaShifterRegistry == null)
+ {
+ var l = new Label();
+ l.Dock = DockStyle.Fill;
+ l.TextAlign = ContentAlignment.MiddleCenter;
+ l.Font = new Font("Microsoft Sans Serif", 12);
+ l.Text = @"Nothing to show here.
+
+There are no options to show here yet.
+
+You can add options in the Lua interpreter using the shifter_add_category(string name), shifter_add_value(string category, string name, value), and shifter_remove_category(string name) methods. Applications may also add their own values.";
+ pnlluafield.Controls.Add(l);
+ l.Show();
+ }
+ else
+ {
+ foreach (var kv in API.LuaShifterRegistry)
+ {
+ var b = new Button();
+ b.Text = kv.Key;
+ b.FlatStyle = FlatStyle.Flat;
+ b.AutoSize = true;
+ b.AutoSizeMode = AutoSizeMode.GrowAndShrink;
+ flmorebuttons.Controls.Add(b);
+ b.Show();
+ b.Click += (object s, EventArgs a) =>
+ {
+ SetupLuaForm(kv.Value);
+ };
+ }
+ }
+ }
+
+ public void SetupLuaForm(Dictionary<string, object> d)
+ {
+ pnlluafield.Controls.Clear();
+ foreach(var kv in d)
+ {
+ IShifterSetting l = new ShifterTextInput();
+ if (kv.Value is string)
+ l = new ShifterTextInput();
+ if (kv.Value is Image)
+ l = new ShifterGraphicInput();
+ if (kv.Value is Color)
+ l = new ShifterColorInput();
+ if (kv.Value is int || kv.Value is float || kv.Value is double || kv.Value is decimal)
+ l = new ShifterIntInput();
+ if(l is ShifterIntInput)
+ {
+ var i = l as ShifterIntInput;
+ if (kv.Value is int)
+ i.NoDecimal = true;
+ else
+ i.NoDecimal = false;
+ }
+ if (pnlluafield.Controls.Count > 0)
+ {
+ var ctrl = pnlluafield.Controls[pnlluafield.Controls.Count - 1];
+ l.Location = new Point(ctrl.Left + ctrl.Width + 5, ctrl.Top);
+ if(l.Left + l.Width > pnlluafield.Width)
+ {
+ l.Left = 2;
+ l.Top = ctrl.Top + ctrl.Height + 2;
+ }
+ }
+ else
+ {
+ l.Location = new Point(2, 2);
+ }
+
+ pnlluafield.Controls.Add(l);
+ l.Show();
+ l.Font = new Font("Microsoft Sans Serif", 9);
+ l.Text = kv.Key;
+ l.Value = kv.Value;
+ l.OnValueChange += (hello, its_me) =>
+ {
+ foreach(var dict in API.LuaShifterRegistry)
+ {
+ if(API.LuaShifterRegistry[dict.Key] == d)
+ {
+ API.LuaShifterRegistry[dict.Key][kv.Key] = l.Value;
+ }
+ }
+ };
+
+ }
+ }
}
}
diff --git a/source/WindowsFormsApplication1/Shifter.resx b/source/WindowsFormsApplication1/Apps/Shifter.resx
index dbf1220..2b9e8c1 100644
--- a/source/WindowsFormsApplication1/Shifter.resx
+++ b/source/WindowsFormsApplication1/Apps/Shifter.resx
@@ -137,6 +137,9 @@ Simply click the buttons on the right to choose a category, and then from there,
<metadata name="predesktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>508, 17</value>
</metadata>
+ <metadata name="predesktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>508, 17</value>
+ </metadata>
<data name="Label109.Text" xml:space="preserve">
<value>Have you made a nice skin and want a clean slate to make another? Do you want to reverse back to regular ShiftOS? Well, fear not, the 'Reset' button is here. Just click it, and ShiftOS will wok it's magic.</value>
</data>
diff --git a/source/WindowsFormsApplication1/Shiftnet.Designer.cs b/source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs
index 5d20f14..5d20f14 100644
--- a/source/WindowsFormsApplication1/Shiftnet.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Shiftnet.Designer.cs
diff --git a/source/WindowsFormsApplication1/Shiftnet.cs b/source/WindowsFormsApplication1/Apps/Shiftnet.cs
index cd334a9..cbcab1b 100644
--- a/source/WindowsFormsApplication1/Shiftnet.cs
+++ b/source/WindowsFormsApplication1/Apps/Shiftnet.cs
@@ -87,7 +87,7 @@ namespace ShiftOS
return HtmlTemplate.Replace("#BODY#", "That page was not found.");
}
}
- catch (WebException ex)
+ catch
{
LastUrl = "shiftnet://not_found";
return HtmlTemplate.Replace("#BODY#", "That page was not found.");
diff --git a/source/WindowsFormsApplication1/Shiftnet.resx b/source/WindowsFormsApplication1/Apps/Shiftnet.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/Shiftnet.resx
+++ b/source/WindowsFormsApplication1/Apps/Shiftnet.resx
diff --git a/source/WindowsFormsApplication1/ShiftnetDecryptor.Designer.cs b/source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.Designer.cs
index 3f7d4a7..3f7d4a7 100644
--- a/source/WindowsFormsApplication1/ShiftnetDecryptor.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.Designer.cs
diff --git a/source/WindowsFormsApplication1/ShiftnetDecryptor.cs b/source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.cs
index c31a6dc..dbf086e 100644
--- a/source/WindowsFormsApplication1/ShiftnetDecryptor.cs
+++ b/source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.cs
@@ -46,7 +46,7 @@ namespace ShiftOS
RecursiveControlSetup(c);
}
}
- catch (Exception ex)
+ catch
{
}
@@ -87,7 +87,7 @@ namespace ShiftOS
{
encrypted_contents = new WebClient().DownloadString(currentaddress);
}
- catch(Exception ex)
+ catch
{
WriteLine(" *** ERROR: Remote file could not be accessed.");
tmrdecrypt.Stop();
diff --git a/source/WindowsFormsApplication1/ShiftnetDecryptor.resx b/source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.resx
index 34bb249..34bb249 100644
--- a/source/WindowsFormsApplication1/ShiftnetDecryptor.resx
+++ b/source/WindowsFormsApplication1/Apps/ShiftnetDecryptor.resx
diff --git a/source/WindowsFormsApplication1/Shiftorium.Designer.cs b/source/WindowsFormsApplication1/Apps/Shiftorium.Designer.cs
index e5b4498..e5b4498 100644
--- a/source/WindowsFormsApplication1/Shiftorium.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Shiftorium.Designer.cs
diff --git a/source/WindowsFormsApplication1/Shiftorium.cs b/source/WindowsFormsApplication1/Apps/Shiftorium.cs
index 9c281e9..ce9dbfc 100644
--- a/source/WindowsFormsApplication1/Shiftorium.cs
+++ b/source/WindowsFormsApplication1/Apps/Shiftorium.cs
@@ -77,7 +77,7 @@ namespace Shiftorium
btnhack.Hide();
}
}
- catch(Exception ex)
+ catch
{
lbcategory.Text = "No upgrades!";
}
@@ -132,12 +132,12 @@ namespace Shiftorium
lbupgradename.Text = upgrade.Name.Replace($" - {upgrade.Cost} CP", "");
lbudescription.Text = upgrade.Description;
btnbuy.Show();
- lbprice.Text = upgrade.Cost.ToString() + " CP";
+ lbprice.Text = (upgrade.Cost / API.CurrentSave.PriceDivider).ToString() + " CP";
picpreview.Image = upgrade.Preview;
selectedUpgrade = upgrade;
}
}
- } catch(Exception ex)
+ } catch
{
//do nothing.
}
diff --git a/source/WindowsFormsApplication1/Shiftorium.resx b/source/WindowsFormsApplication1/Apps/Shiftorium.resx
index c732bd4..c732bd4 100644
--- a/source/WindowsFormsApplication1/Shiftorium.resx
+++ b/source/WindowsFormsApplication1/Apps/Shiftorium.resx
diff --git a/source/WindowsFormsApplication1/SkinLoader.Designer.cs b/source/WindowsFormsApplication1/Apps/SkinLoader.Designer.cs
index 72561f6..72561f6 100644
--- a/source/WindowsFormsApplication1/SkinLoader.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/SkinLoader.Designer.cs
diff --git a/source/WindowsFormsApplication1/SkinLoader.cs b/source/WindowsFormsApplication1/Apps/SkinLoader.cs
index e6d5328..e6d5328 100644
--- a/source/WindowsFormsApplication1/SkinLoader.cs
+++ b/source/WindowsFormsApplication1/Apps/SkinLoader.cs
diff --git a/source/WindowsFormsApplication1/SkinLoader.resx b/source/WindowsFormsApplication1/Apps/SkinLoader.resx
index a4bf070..a4bf070 100644
--- a/source/WindowsFormsApplication1/SkinLoader.resx
+++ b/source/WindowsFormsApplication1/Apps/SkinLoader.resx
diff --git a/source/WindowsFormsApplication1/Terminal.Designer.cs b/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs
index 5f7ba27..5f7ba27 100644
--- a/source/WindowsFormsApplication1/Terminal.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/Terminal.Designer.cs
diff --git a/source/WindowsFormsApplication1/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs
index 4b4a3b8..944b333 100644
--- a/source/WindowsFormsApplication1/Terminal.cs
+++ b/source/WindowsFormsApplication1/Apps/Terminal.cs
@@ -19,9 +19,12 @@ namespace ShiftOS
{
public partial class Terminal : Form
{
+ string current_dir = "";
+
public Terminal()
{
InitializeComponent();
+ current_dir = Paths.SaveRoot;
}
public Terminal(bool modlog)
@@ -29,6 +32,7 @@ namespace ShiftOS
ModLogger = modlog;
InitializeComponent();
API.LoggerTerminal = this;
+ current_dir = Paths.SaveRoot;
}
public void StartOtherPlayerStory()
@@ -110,7 +114,7 @@ namespace ShiftOS
tmrshutdown.Tick += new EventHandler(tmrshutdown_Tick);
if (Hacking == false)
{
- WriteLine(SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ");
+ WriteLine(prefix);
}
txtterm.Select(txtterm.TextLength, 0);
if (API.Upgrades["terminalscrollbar"] == true)
@@ -186,10 +190,12 @@ namespace ShiftOS
int firstrun;
public bool sendinputtomod = false;
+ string prefix = $"{API.Username}@{API.OSName} $> ";
+
private void ReadCommand()
{
command = txtterm.Lines[txtterm.Lines.Length - 1];
- command = command.Replace(SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ", "");
+ command = command.Replace(prefix, "");
command = command.ToLower();
}
@@ -393,20 +399,12 @@ namespace ShiftOS
if (command == "clear")
{
- txtterm.Text = txtterm.Text + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
+ txtterm.Text = txtterm.Text + prefix;
txtterm.Select(txtterm.Text.Length, 0);
}
- else if (command == "lua")
- {
- if (Lua_API.UseLuaAPI == false)
- {
- txtterm.Text = txtterm.Text + Environment.NewLine + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
- txtterm.Select(txtterm.Text.Length, 0);
- }
- }
else
{
- txtterm.Text = txtterm.Text + Environment.NewLine + SaveSystem.Utilities.LoadedSave.username + "@" + SaveSystem.Utilities.LoadedSave.osname + " $> ";
+ txtterm.Text = txtterm.Text + Environment.NewLine + prefix;
txtterm.Select(txtterm.Text.Length, 0);
}
trackpos = 0;
@@ -585,6 +583,11 @@ Password: z7fjsd3");
t.Start();
}
+ public void SetPrefix(string _prefix)
+ {
+ prefix = _prefix;
+ }
+
internal void StartBridgeToMidGame()
{
var t2 = new System.Windows.Forms.Timer();
@@ -787,7 +790,7 @@ Password: z7fjsd3");
WriteLine($"Description: {h.Description}");
WriteLine(Environment.NewLine + "LEFT: Previous Attack, RIGHT: Next Attack, ENTER: Confirm");
}
- catch (Exception ex)
+ catch
{
WriteLine("There are no entries to display in this list.");
}
@@ -1234,7 +1237,6 @@ Password: z7fjsd3");
{
System.Windows.Forms.Timer tmrstory = new System.Windows.Forms.Timer();
tmrstory.Interval = 10000;
- int i = 0;
WriteLine("IP <hidden@shiftnet> connecting as 'Maureen Fenn'...");
API.PlaySound(Properties.Resources.dial_up_modem_02);
var t = new Thread(new ThreadStart(new Action(() =>
@@ -1368,12 +1370,69 @@ Password: z7fjsd3");
private bool LuaMode = false;
+ public string GetPath(string path)
+ {
+ return path.Replace(Paths.SaveRoot, "").Replace(OSInfo.DirectorySeparator, "/");
+ }
+
+ public string GetParent(string path)
+ {
+ var d = new DirectoryInfo(path);
+ return d.Parent.FullName;
+ }
+
public void DoCommand()
{
API.LastRanCommand = command;
string[] args = command.ToLower().Split(' ');
switch (args[0])
{
+ case "ls":
+ case "dir":
+ if(API.Upgrades["fileskimmer"])
+ {
+ foreach(var d in Directory.GetDirectories(current_dir))
+ {
+ WriteLine($"[DIR] {new DirectoryInfo(d).Name}");
+ }
+ foreach (var d in Directory.GetFiles(current_dir))
+ {
+ WriteLine($"{new FileInfo(d).Name}");
+ }
+ }
+ else
+ {
+ wrongcommand();
+ }
+ break;
+ case "cd":
+ if (API.Upgrades["fileskimmer"])
+ {
+ if (args[1] == "..")
+ {
+ if (GetPath(current_dir) != "/")
+ {
+ current_dir = GetParent(current_dir);
+ SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> ");
+ }
+ else
+ {
+ WriteLine("cd: Can't go up past the root.");
+ }
+ }
+ else
+ {
+ string newdir = current_dir + OSInfo.DirectorySeparator;
+ foreach (var dir in Directory.GetDirectories(current_dir))
+ {
+ if (new DirectoryInfo(dir).Name.ToLower() == args[1])
+ newdir = dir;
+ }
+ current_dir = newdir;
+ SetPrefix($"{API.Username}@{API.OSName} in {GetPath(current_dir)} $> ");
+ }
+ }
+ break;
case "upg":
if(API.DeveloperMode)
{
@@ -1467,6 +1526,9 @@ Password: z7fjsd3");
WriteLine($"Hostname: {client.Key}, Port: {client.Value.RemotePort}, Online: {client.Value.IsConnected}");
}
break;
+ case "gui":
+ API.CreateForm(new ConnectionManager(), "Connections", API.GetIcon("Connections"));
+ break;
case "drop":
foreach(var client in Package_Grabber.clients)
{
@@ -1497,7 +1559,7 @@ Password: z7fjsd3");
break;
}
}
- catch(Exception ex)
+ catch
{
WriteLine("connections: Missing arguments.");
}
@@ -1526,7 +1588,7 @@ Password: z7fjsd3");
break;
}
}
- catch(Exception ex)
+ catch
{
WriteLine("Missing arguments.");
}
@@ -1548,29 +1610,11 @@ Password: z7fjsd3");
WriteLine($"make: *** No rule to make target \"{realpath}\". Stop.");
}
}
- catch(Exception ex)
+ catch
{
WriteLine("make: Invalid arguments.");
}
break;
- case "toggle_music":
- if (API.DeveloperMode)
- {
- if (Audio.Enabled == false)
- {
- WriteLine(@"Music enabled.
-
-Warning: The music player code in ShiftOS has a memory leak issue and is quite CPU-intensive. If your CPU fan starts to spin up while listening to a song, that's why.
-
-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;
- }
- else
- {
- wrongcommand();
- }
- break;
case "linux":
if(API.DeveloperMode)
{
@@ -1613,7 +1657,7 @@ Warning: Music is not embedded within the game. You must download the external r
WriteLine("Lua script file not found.");
}
}
- catch (Exception ex)
+ catch
{
this.LuaMode = true;
this.Interpreter = new LuaInterpreter();
@@ -1946,7 +1990,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
break;
}
}
- catch(Exception ex)
+ catch
{
WriteLine("alias: Missing arguments. Try alias --help for help with the Alias command.");
}
@@ -1958,7 +2002,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
API.CurrentSave.username = args[1];
}
- catch(Exception ex)
+ catch
{
WriteLine("username: Missing arguments.");
}
@@ -1975,7 +2019,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
{
API.CurrentSave.osname = args[1];
}
- catch (Exception ex)
+ catch
{
WriteLine("osname: Missing arguments.");
}
@@ -2145,7 +2189,8 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
wrongcommand();
break;
}
- } catch(Exception ex) {
+ } catch
+ {
wrongcommand(); //Debug command pretends to be an invalid command if an exception is thrown.
}
}
@@ -2163,6 +2208,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
case "syncsave":
WriteLine("Command removed.");
break;
+
default:
if (API.OpenProgram(args[0]) == false)
{
@@ -2672,7 +2718,7 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o
try {
txtterm.Font = new Font(fname, fsize);
}
- catch(Exception ex)
+ catch
{
txtterm.Font = new Font(fname, 9);
}
diff --git a/source/WindowsFormsApplication1/Terminal.resx b/source/WindowsFormsApplication1/Apps/Terminal.resx
index d0442f6..d0442f6 100644
--- a/source/WindowsFormsApplication1/Terminal.resx
+++ b/source/WindowsFormsApplication1/Apps/Terminal.resx
diff --git a/source/WindowsFormsApplication1/TextPad.Designer.cs b/source/WindowsFormsApplication1/Apps/TextPad.Designer.cs
index 3ac11b4..3ac11b4 100644
--- a/source/WindowsFormsApplication1/TextPad.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/TextPad.Designer.cs
diff --git a/source/WindowsFormsApplication1/TextPad.cs b/source/WindowsFormsApplication1/Apps/TextPad.cs
index 1b49129..1b49129 100644
--- a/source/WindowsFormsApplication1/TextPad.cs
+++ b/source/WindowsFormsApplication1/Apps/TextPad.cs
diff --git a/source/WindowsFormsApplication1/TextPad.resx b/source/WindowsFormsApplication1/Apps/TextPad.resx
index 6994a67..6994a67 100644
--- a/source/WindowsFormsApplication1/TextPad.resx
+++ b/source/WindowsFormsApplication1/Apps/TextPad.resx
diff --git a/source/WindowsFormsApplication1/WidgetManager.Designer.cs b/source/WindowsFormsApplication1/Apps/WidgetManager.Designer.cs
index 4140581..4140581 100644
--- a/source/WindowsFormsApplication1/WidgetManager.Designer.cs
+++ b/source/WindowsFormsApplication1/Apps/WidgetManager.Designer.cs
diff --git a/source/WindowsFormsApplication1/WidgetManager.cs b/source/WindowsFormsApplication1/Apps/WidgetManager.cs
index 2a3954f..2a3954f 100644
--- a/source/WindowsFormsApplication1/WidgetManager.cs
+++ b/source/WindowsFormsApplication1/Apps/WidgetManager.cs
diff --git a/source/WindowsFormsApplication1/WidgetManager.resx b/source/WindowsFormsApplication1/Apps/WidgetManager.resx
index 27fa601..27fa601 100644
--- a/source/WindowsFormsApplication1/WidgetManager.resx
+++ b/source/WindowsFormsApplication1/Apps/WidgetManager.resx
diff --git a/source/WindowsFormsApplication1/AudioResourceClient.cs b/source/WindowsFormsApplication1/AudioResourceClient.cs
deleted file mode 100644
index ec51b18..0000000
--- a/source/WindowsFormsApplication1/AudioResourceClient.cs
+++ /dev/null
@@ -1,250 +0,0 @@
-// WARNING: This thing likes leaking memory.
-
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.IO;
-using NAudio;
-using NAudio.Wave;
-using System.Threading;
-
-namespace ShiftOS
-{
- public class Audio
- {
- public static List<AudioResourceClient> Clients = null;
- internal static bool Enabled = false;
-
- public static void DisposeAll()
- {
- if(Clients != null)
- {
- foreach(var client in Clients)
- {
- client.Dispose();
- }
- }
- }
- }
-
- public class AudioResourceClient
- {
-
-
- public AudioResourceClient(string folder)
- {
- if (Audio.Enabled)
- {
- if (Audio.Clients == null)
- {
- Audio.Clients = new List<AudioResourceClient>();
- }
- Audio.Clients.Add(this);
- string real = folder.Replace(";", OSInfo.DirectorySeparator);
- real_path = "resources" + OSInfo.DirectorySeparator + real;
- soundPlayer = new WaveOut();
- var t = new Thread(new ThreadStart(new Action(() =>
- {
- while (disposed == false)
- {
- switch (soundPlayer.PlaybackState)
- {
- case PlaybackState.Stopped:
- if (fireEvents)
- {
- if (currentStream != null)
- currentStream.Dispose();
- currentStream = null;
- currentProvider = null;
- var h = SongFinished;
- if (h != null)
- {
- API.CurrentSession.Invoke(new Action(() =>
- {
- h(this, new EventArgs());
- }));
- }
-
- }
-
- break;
- }
- }
- })));
- t.Start();
- }
- }
-
- public string CurrentSong
- {
- get { return currentSong; }
- }
-
- private string real_path = null;
- private WaveOut soundPlayer = null;
- private bool disposed = false;
- private bool playing = false;
- private bool loopActive = false;
- private string currentSong = "";
- protected Thread soundThread;
- private Stream currentStream = null;
- private IWaveProvider currentProvider = null;
- private bool fireEvents = false;
-
- public event EventHandler SongFinished;
-
- public void Play(byte[] songbytes)
- {
- if (Audio.Enabled)
- {
- var t = new Thread(new ThreadStart(new Action(() =>
- {
- try
- {
- if (disposed == false)
- {
- if (currentProvider != null)
- {
- currentProvider = null;
- }
- if (currentStream != null)
- {
- currentStream.Dispose();
- currentStream = null;
- }
- Stream s = new MemoryStream(songbytes);
- IWaveProvider provider = new RawSourceWaveStream(s, new WaveFormat());
- soundPlayer.Init(provider);
- soundPlayer.Play();
- fireEvents = true;
- currentStream = s;
- currentProvider = provider;
- }
- }
- catch
- {
-
- }
- })));
- soundThread = t;
- t.Start();
- }
- }
-
- public void PlayMP3(byte[] songbytes)
- {
- if (Audio.Enabled)
- {
- var t = new Thread(new ThreadStart(new Action(() =>
- {
- if (currentProvider != null)
- {
- currentProvider = null;
- }
- if (currentStream != null)
- {
- currentStream.Dispose();
- currentStream = null;
- }
- Stream s = new MemoryStream(songbytes);
- IWaveProvider provider = new Mp3FileReader(s);
- soundPlayer.Init(provider);
- soundPlayer.Play();
- currentStream = s;
- currentProvider = provider;
- })));
- soundThread = t;
- t.Start();
- }
- }
-
-
- public void Play(string file)
- {
- if (Audio.Enabled)
- {
- if (File.Exists(real_path + OSInfo.DirectorySeparator + file + ".wav"))
- {
- currentSong = file;
- Play(File.ReadAllBytes(real_path + OSInfo.DirectorySeparator + file + ".wav"));
- }
- else if (File.Exists(real_path + OSInfo.DirectorySeparator + file + ".mp3"))
- {
- currentSong = file;
- PlayMP3(File.ReadAllBytes(real_path + OSInfo.DirectorySeparator + file + ".mp3"));
- }
- }
- }
-
- public void Stop()
- {
- if (Audio.Enabled)
- {
- var t = new Thread(new ThreadStart(new Action(() =>
- {
- fireEvents = false;
- soundPlayer.Stop();
- if (currentProvider != null)
- {
- currentProvider = null;
- }
- if (currentStream != null)
- {
- currentStream.Dispose();
- currentStream = null;
- }
- })));
- t.Start();
- }
- }
-
- public void Pause()
- {
- if (Audio.Enabled)
- {
- if (soundPlayer.PlaybackState == PlaybackState.Playing)
- {
- soundPlayer.Pause();
- }
- else if (soundPlayer.PlaybackState == PlaybackState.Paused)
- {
- soundPlayer.Resume();
- }
- }
- }
-
- public void PlayRandom()
- {
- if (Audio.Enabled)
- {
- int r = new Random().Next(0, Directory.GetFiles(real_path).Length);
- var files = Directory.GetFiles(real_path);
- FileInfo finf = new FileInfo(files[r]);
- string name = finf.Name.Replace(finf.Extension, "");
- Play(name);
-
- }
- }
-
- public void Dispose()
- {
- if (Audio.Enabled)
- {
- if (currentProvider != null)
- {
- currentProvider = null;
- }
- if (currentStream != null)
- {
- currentStream.Dispose();
- currentStream = null;
- }
- soundPlayer.Dispose();
- disposed = true;
- }
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Computer.Designer.cs b/source/WindowsFormsApplication1/Controls/Computer.Designer.cs
index 622cd09..4157592 100644
--- a/source/WindowsFormsApplication1/Computer.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/Computer.Designer.cs
@@ -13,6 +13,10 @@
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
+ if(this.HealthTimer != null)
+ {
+ this.HealthTimer.Stop();
+ }
if (disposing && (components != null))
{
components.Dispose();
diff --git a/source/WindowsFormsApplication1/Computer.cs b/source/WindowsFormsApplication1/Controls/Computer.cs
index 3b546b7..ad33a58 100644
--- a/source/WindowsFormsApplication1/Computer.cs
+++ b/source/WindowsFormsApplication1/Controls/Computer.cs
@@ -14,6 +14,8 @@ namespace ShiftOS
{
public int TotalHP = 100;
+ public Online.Hacking.NetTransmitter Transmitter = null;
+
public Computer()
{
InitializeComponent();
@@ -24,6 +26,7 @@ namespace ShiftOS
public void Repair(int hp)
{
this._HP += hp;
+ Transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{Hostname} {_HP}");
var h = OnRepair;
if(h != null)
{
@@ -45,8 +48,7 @@ namespace ShiftOS
}
}
- private SystemType _Type = SystemType.Core;
-
+
public SystemType Type
{
get; set;
@@ -112,8 +114,6 @@ namespace ShiftOS
return AttackType.Core;
case SystemType.Turret:
return AttackType.Virus;
- case SystemType.FTPServer:
- return AttackType.Backdoor;
default:
return AttackType.None;
}
@@ -168,6 +168,16 @@ namespace ShiftOS
public string Hostname { get; set; }
+ internal void throw_repaired()
+ {
+ OnRepair?.Invoke(this, new EventArgs());
+ }
+
+ internal void throw_damaged()
+ {
+ HP_Decreased?.Invoke(this, new EventArgs());
+ }
+
public event EventHandler HP_Decreased;
public void Deteriorate(int amount)
@@ -178,6 +188,7 @@ namespace ShiftOS
}
else {
this._HP -= amount / DamageDefector;
+ Transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{Hostname} {_HP}");
EventHandler handler = HP_Decreased;
if (handler != null)
{
@@ -190,6 +201,7 @@ namespace ShiftOS
public void Disable()
{
+ Transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.Disabled, $"{Hostname}");
var t = new Timer();
t.Interval = 1000;
int i = 0;
@@ -284,30 +296,31 @@ namespace ShiftOS
{
case SystemType.Core:
return 100;
- break;
default:
switch (Grade)
{
case 1:
return 10;
- break;
case 2:
return 20;
- break;
case 3:
return 40;
- break;
case 4:
return 80;
- break;
default:
return 10;
- break;
}
- break;
}
}
+ public Timer HealthTimer = null;
+
+ public bool AlreadyEnslaved = false;
+ public bool Enslaved = false;
+
+ public event EventHandler EnslavedModule;
+
+
public event EventHandler MassDDoS;
private void Computer_Load(object sender, EventArgs e)
@@ -341,7 +354,7 @@ namespace ShiftOS
(this.Parent.Height - this.Height) / 2
);
}
- catch (Exception ex)
+ catch
{
}
@@ -360,6 +373,26 @@ namespace ShiftOS
}
this.Size = new Size(32, 32);
break;
+ case SystemType.ModuleStealer:
+ var rnd = new Random();
+ int num = rnd.Next(0, 2500 / Grade);
+ if(num == 25)
+ {
+ StolenModule?.Invoke(this, new EventArgs());
+ }
+ break;
+ case SystemType.Enslaver:
+ if (AlreadyEnslaved == false)
+ {
+ var ernd = new Random();
+ int num2 = ernd.Next(0, 2500 / Grade);
+ if (num2 == 25)
+ {
+ AlreadyEnslaved = true;
+ EnslavedModule?.Invoke(this, new EventArgs());
+ }
+ }
+ break;
case SystemType.ServerStack:
var r2 = new Random();
int i2 = r2.Next(0, GetChance());
@@ -419,8 +452,11 @@ namespace ShiftOS
}
};
t.Start();
+ HealthTimer = t;
}
+ public event EventHandler StolenModule;
+
public event EventHandler OnDestruction;
public void ThrowDestroyed()
@@ -446,16 +482,16 @@ namespace ShiftOS
public enum SystemType
{
- Core,
- Antivirus,
- DedicatedDDoS,
- Turret,
- FTPServer,
- Firewall,
- ServerStack,
- Enslaver,
- DamageLogger,
- RepairModule,
+ Core = 0,
+ Antivirus = 1,
+ DedicatedDDoS = 2,
+ Turret = 3,
+ FTPServer = 4,
+ Firewall = 5,
+ ServerStack = 6,
+ Enslaver = 7,
+ RepairModule = 9,
+ ModuleStealer = 8,
}
public enum AttackType {
diff --git a/source/WindowsFormsApplication1/Computer.resx b/source/WindowsFormsApplication1/Controls/Computer.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/Computer.resx
+++ b/source/WindowsFormsApplication1/Controls/Computer.resx
diff --git a/source/WindowsFormsApplication1/Connection.Designer.cs b/source/WindowsFormsApplication1/Controls/Connection.Designer.cs
index 071ff4a..071ff4a 100644
--- a/source/WindowsFormsApplication1/Connection.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/Connection.Designer.cs
diff --git a/source/WindowsFormsApplication1/Connection.cs b/source/WindowsFormsApplication1/Controls/Connection.cs
index b322581..b322581 100644
--- a/source/WindowsFormsApplication1/Connection.cs
+++ b/source/WindowsFormsApplication1/Controls/Connection.cs
diff --git a/source/WindowsFormsApplication1/Connection.resx b/source/WindowsFormsApplication1/Controls/Connection.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/Connection.resx
+++ b/source/WindowsFormsApplication1/Controls/Connection.resx
diff --git a/source/WindowsFormsApplication1/DesktopIcon.Designer.cs b/source/WindowsFormsApplication1/Controls/DesktopIcon.Designer.cs
index 98369ab..98369ab 100644
--- a/source/WindowsFormsApplication1/DesktopIcon.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/DesktopIcon.Designer.cs
diff --git a/source/WindowsFormsApplication1/DesktopIcon.cs b/source/WindowsFormsApplication1/Controls/DesktopIcon.cs
index bfb0940..bfb0940 100644
--- a/source/WindowsFormsApplication1/DesktopIcon.cs
+++ b/source/WindowsFormsApplication1/Controls/DesktopIcon.cs
diff --git a/source/WindowsFormsApplication1/DesktopIcon.resx b/source/WindowsFormsApplication1/Controls/DesktopIcon.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/DesktopIcon.resx
+++ b/source/WindowsFormsApplication1/Controls/DesktopIcon.resx
diff --git a/source/WindowsFormsApplication1/IconControl.Designer.cs b/source/WindowsFormsApplication1/Controls/IconControl.Designer.cs
index b86f908..b86f908 100644
--- a/source/WindowsFormsApplication1/IconControl.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/IconControl.Designer.cs
diff --git a/source/WindowsFormsApplication1/IconControl.cs b/source/WindowsFormsApplication1/Controls/IconControl.cs
index e103ced..e103ced 100644
--- a/source/WindowsFormsApplication1/IconControl.cs
+++ b/source/WindowsFormsApplication1/Controls/IconControl.cs
diff --git a/source/WindowsFormsApplication1/IconControl.resx b/source/WindowsFormsApplication1/Controls/IconControl.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/IconControl.resx
+++ b/source/WindowsFormsApplication1/Controls/IconControl.resx
diff --git a/source/WindowsFormsApplication1/ImageSelector.Designer.cs b/source/WindowsFormsApplication1/Controls/ImageSelector.Designer.cs
index 7340ceb..7340ceb 100644
--- a/source/WindowsFormsApplication1/ImageSelector.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/ImageSelector.Designer.cs
diff --git a/source/WindowsFormsApplication1/ImageSelector.cs b/source/WindowsFormsApplication1/Controls/ImageSelector.cs
index b1aa4d2..b1aa4d2 100644
--- a/source/WindowsFormsApplication1/ImageSelector.cs
+++ b/source/WindowsFormsApplication1/Controls/ImageSelector.cs
diff --git a/source/WindowsFormsApplication1/ImageSelector.resx b/source/WindowsFormsApplication1/Controls/ImageSelector.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/ImageSelector.resx
+++ b/source/WindowsFormsApplication1/Controls/ImageSelector.resx
diff --git a/source/WindowsFormsApplication1/NetModuleStatus.Designer.cs b/source/WindowsFormsApplication1/Controls/NetModuleStatus.Designer.cs
index 31608d4..31608d4 100644
--- a/source/WindowsFormsApplication1/NetModuleStatus.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/NetModuleStatus.Designer.cs
diff --git a/source/WindowsFormsApplication1/NetModuleStatus.cs b/source/WindowsFormsApplication1/Controls/NetModuleStatus.cs
index 037f73a..037f73a 100644
--- a/source/WindowsFormsApplication1/NetModuleStatus.cs
+++ b/source/WindowsFormsApplication1/Controls/NetModuleStatus.cs
diff --git a/source/WindowsFormsApplication1/NetModuleStatus.resx b/source/WindowsFormsApplication1/Controls/NetModuleStatus.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/NetModuleStatus.resx
+++ b/source/WindowsFormsApplication1/Controls/NetModuleStatus.resx
diff --git a/source/WindowsFormsApplication1/Notification.Designer.cs b/source/WindowsFormsApplication1/Controls/Notification.Designer.cs
index 57b6416..57b6416 100644
--- a/source/WindowsFormsApplication1/Notification.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/Notification.Designer.cs
diff --git a/source/WindowsFormsApplication1/Notification.cs b/source/WindowsFormsApplication1/Controls/Notification.cs
index b5e1693..b5e1693 100644
--- a/source/WindowsFormsApplication1/Notification.cs
+++ b/source/WindowsFormsApplication1/Controls/Notification.cs
diff --git a/source/WindowsFormsApplication1/Notification.resx b/source/WindowsFormsApplication1/Controls/Notification.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/Notification.resx
+++ b/source/WindowsFormsApplication1/Controls/Notification.resx
diff --git a/source/WindowsFormsApplication1/ProgressBarEX.Designer.cs b/source/WindowsFormsApplication1/Controls/ProgressBarEX.Designer.cs
index 219fb73..219fb73 100644
--- a/source/WindowsFormsApplication1/ProgressBarEX.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/ProgressBarEX.Designer.cs
diff --git a/source/WindowsFormsApplication1/ProgressBarEX.cs b/source/WindowsFormsApplication1/Controls/ProgressBarEX.cs
index e474a87..4896292 100644
--- a/source/WindowsFormsApplication1/ProgressBarEX.cs
+++ b/source/WindowsFormsApplication1/Controls/ProgressBarEX.cs
@@ -17,7 +17,37 @@ namespace ShiftOS
InitializeComponent();
}
-#region " Properties "
+ #region " Properties "
+
+ private string _label = "Progress:";
+ private bool show_label = false;
+
+ public string Label
+ {
+ get
+ {
+ return _label;
+ }
+ set
+ {
+ _label = value;
+ this.Invalidate();
+ }
+ }
+
+ public bool ShowLabel
+ {
+ get
+ {
+ return show_label;
+ }
+ set
+ {
+ show_label = value;
+ this.Invalidate();
+ }
+ }
+
private int _Value = 0;
public int Value
@@ -31,7 +61,7 @@ namespace ShiftOS
this.Invalidate();
}
else {
- throw new ArgumentOutOfRangeException("The value must be between the minimum and maximum values.");
+
}
}
}
@@ -295,6 +325,9 @@ namespace ShiftOS
private void DoPaintValue(Graphics g)
{
string valStr = GetRelativeValue().ToString() + "%";
+ if (show_label)
+ valStr = _label + " " + valStr;
+
StringFormat sf = new StringFormat();
sf.Alignment = StringAlignment.Center;
SizeF s = g.MeasureString(valStr, this.Font);
diff --git a/source/WindowsFormsApplication1/ProgressBarEX.resx b/source/WindowsFormsApplication1/Controls/ProgressBarEX.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/ProgressBarEX.resx
+++ b/source/WindowsFormsApplication1/Controls/ProgressBarEX.resx
diff --git a/source/WindowsFormsApplication1/Controls/ShifterColorInput.Designer.cs b/source/WindowsFormsApplication1/Controls/ShifterColorInput.Designer.cs
new file mode 100644
index 0000000..47cf0a1
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterColorInput.Designer.cs
@@ -0,0 +1,77 @@
+namespace ShiftOS
+{
+ partial class ShifterColorInput
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.pnlmainbuttoncolour = new System.Windows.Forms.Panel();
+ this.lblabel = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // pnlmainbuttoncolour
+ //
+ this.pnlmainbuttoncolour.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.pnlmainbuttoncolour.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlmainbuttoncolour.Location = new System.Drawing.Point(128, 3);
+ this.pnlmainbuttoncolour.MaximumSize = new System.Drawing.Size(41, 20);
+ this.pnlmainbuttoncolour.Name = "pnlmainbuttoncolour";
+ this.pnlmainbuttoncolour.Size = new System.Drawing.Size(41, 20);
+ this.pnlmainbuttoncolour.TabIndex = 3;
+ //
+ // lblabel
+ //
+ this.lblabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblabel.Location = new System.Drawing.Point(3, 6);
+ this.lblabel.Name = "lblabel";
+ this.lblabel.Size = new System.Drawing.Size(122, 19);
+ this.lblabel.TabIndex = 2;
+ this.lblabel.Text = "Main Button Colour:";
+ this.lblabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ShifterColorInput
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.pnlmainbuttoncolour);
+ this.Controls.Add(this.lblabel);
+ this.Name = "ShifterColorInput";
+ this.Size = new System.Drawing.Size(173, 28);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel pnlmainbuttoncolour;
+ private System.Windows.Forms.Label lblabel;
+
+ }
+}
diff --git a/source/WindowsFormsApplication1/Controls/ShifterColorInput.cs b/source/WindowsFormsApplication1/Controls/ShifterColorInput.cs
new file mode 100644
index 0000000..11bedf0
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterColorInput.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class ShifterColorInput : IShifterSetting
+ {
+ public ShifterColorInput()
+ {
+ InitializeComponent();
+ pnlmainbuttoncolour.Click += (o, e) =>
+ {
+ API.CreateColorPickerSession(Text, pnlmainbuttoncolour.BackColor);
+ API.ColorPickerSession.FormClosing += (s, a) =>
+ {
+ var res = API.GetLastColorFromSession();
+ pnlmainbuttoncolour.BackColor = res;
+ InvokeEvent(o, e);
+ };
+ };
+ }
+
+ public override string Text
+ {
+ get { return lblabel.Text; }
+ set { lblabel.Text = value; }
+ }
+
+ public override object Value
+ {
+ get { return pnlmainbuttoncolour.BackColor; }
+ set
+ {
+ pnlmainbuttoncolour.BackColor = (Color)value;
+ }
+ }
+
+
+ }
+}
diff --git a/source/WindowsFormsApplication1/Color_Picker.resx b/source/WindowsFormsApplication1/Controls/ShifterColorInput.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/Color_Picker.resx
+++ b/source/WindowsFormsApplication1/Controls/ShifterColorInput.resx
diff --git a/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.Designer.cs b/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.Designer.cs
new file mode 100644
index 0000000..b09416f
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.Designer.cs
@@ -0,0 +1,76 @@
+namespace ShiftOS
+{
+ partial class ShifterGraphicInput
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.pnlmainbuttoncolour = new System.Windows.Forms.Panel();
+ this.lblabel = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // pnlmainbuttoncolour
+ //
+ this.pnlmainbuttoncolour.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.pnlmainbuttoncolour.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pnlmainbuttoncolour.Location = new System.Drawing.Point(129, 3);
+ this.pnlmainbuttoncolour.MaximumSize = new System.Drawing.Size(41, 20);
+ this.pnlmainbuttoncolour.Name = "pnlmainbuttoncolour";
+ this.pnlmainbuttoncolour.Size = new System.Drawing.Size(41, 20);
+ this.pnlmainbuttoncolour.TabIndex = 3;
+ //
+ // lblabel
+ //
+ this.lblabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblabel.Location = new System.Drawing.Point(3, 6);
+ this.lblabel.Name = "lblabel";
+ this.lblabel.Size = new System.Drawing.Size(123, 18);
+ this.lblabel.TabIndex = 2;
+ this.lblabel.Text = "Main Button Colour:";
+ this.lblabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ShifterGraphicInput
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.pnlmainbuttoncolour);
+ this.Controls.Add(this.lblabel);
+ this.Name = "ShifterGraphicInput";
+ this.Size = new System.Drawing.Size(174, 27);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel pnlmainbuttoncolour;
+ private System.Windows.Forms.Label lblabel;
+ }
+}
diff --git a/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.cs b/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.cs
new file mode 100644
index 0000000..8e15e07
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class ShifterGraphicInput : IShifterSetting
+ {
+ public ShifterGraphicInput()
+ {
+ InitializeComponent();
+ pnlmainbuttoncolour.Click += (o, e) =>
+ {
+ API.CreateGraphicPickerSession(Text, false);
+ API.GraphicPickerSession.FormClosing += (s, a) =>
+ {
+ var res = API.GetGraphicPickerResult();
+ if(res != "fail")
+ {
+ pnlmainbuttoncolour.BackgroundImage = API.GraphicPickerSession.IdleImage;
+ InvokeEvent(o, e);
+ }
+ };
+ };
+ }
+
+ public override string Text
+ {
+ get { return lblabel.Text; }
+ set { lblabel.Text = value; }
+ }
+
+ public override object Value
+ {
+ get { return pnlmainbuttoncolour.BackgroundImage; }
+ set
+ {
+ pnlmainbuttoncolour.BackgroundImage = (Image)value;
+ }
+ }
+
+ }
+}
diff --git a/source/WindowsFormsApplication1/ListViewEx.resx b/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/ListViewEx.resx
+++ b/source/WindowsFormsApplication1/Controls/ShifterGraphicInput.resx
diff --git a/source/WindowsFormsApplication1/Controls/ShifterIntInput.Designer.cs b/source/WindowsFormsApplication1/Controls/ShifterIntInput.Designer.cs
new file mode 100644
index 0000000..130db0c
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterIntInput.Designer.cs
@@ -0,0 +1,83 @@
+namespace ShiftOS
+{
+ partial class ShifterIntInput
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.txttext = new System.Windows.Forms.TextBox();
+ this.Label51 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // txttext
+ //
+ this.txttext.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txttext.BackColor = System.Drawing.Color.White;
+ this.txttext.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.txttext.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.txttext.ForeColor = System.Drawing.Color.Black;
+ this.txttext.Location = new System.Drawing.Point(174, 3);
+ this.txttext.MinimumSize = new System.Drawing.Size(5, 2);
+ this.txttext.Name = "txttext";
+ this.txttext.Size = new System.Drawing.Size(36, 22);
+ this.txttext.TabIndex = 32;
+ this.txttext.TextChanged += new System.EventHandler(this.txttext_TextChanged);
+ //
+ // Label51
+ //
+ this.Label51.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.Label51.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label51.Location = new System.Drawing.Point(0, 0);
+ this.Label51.Name = "Label51";
+ this.Label51.Size = new System.Drawing.Size(168, 29);
+ this.Label51.TabIndex = 31;
+ this.Label51.Text = "Label:";
+ this.Label51.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ShifterIntInput
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.Controls.Add(this.txttext);
+ this.Controls.Add(this.Label51);
+ this.Name = "ShifterIntInput";
+ this.Size = new System.Drawing.Size(213, 29);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox txttext;
+ private System.Windows.Forms.Label Label51;
+
+ }
+}
diff --git a/source/WindowsFormsApplication1/Controls/ShifterIntInput.cs b/source/WindowsFormsApplication1/Controls/ShifterIntInput.cs
new file mode 100644
index 0000000..782d265
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterIntInput.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class ShifterIntInput : IShifterSetting
+ {
+ public ShifterIntInput()
+ {
+ InitializeComponent();
+ }
+
+ public bool NoDecimal
+ {
+ get;
+ set;
+ }
+
+ public override string Text
+ {
+ get { return Label51.Text; }
+ set { Label51.Text = value; }
+ }
+
+ public override object Value
+ {
+ get {
+ if (NoDecimal)
+ return Convert.ToInt32(txttext.Text);
+ else
+ return Convert.ToDecimal(txttext.Text);
+ }
+ set
+ {
+ txttext.Text = value.ToString();
+ }
+ }
+
+ private void txttext_TextChanged(object sender, EventArgs e)
+ {
+ try
+ {
+ if (NoDecimal)
+ Value = Convert.ToInt32(txttext.Text);
+ else
+ Value = Convert.ToDecimal(txttext.Text);
+ InvokeEvent(sender, e);
+ }
+ catch
+ {
+ txttext.Text = Value.ToString();
+ }
+ }
+ }
+}
diff --git a/source/WindowsFormsApplication1/infobox.resx b/source/WindowsFormsApplication1/Controls/ShifterIntInput.resx
index 1af7de1..1af7de1 100644
--- a/source/WindowsFormsApplication1/infobox.resx
+++ b/source/WindowsFormsApplication1/Controls/ShifterIntInput.resx
diff --git a/source/WindowsFormsApplication1/Controls/ShifterTextInput.Designer.cs b/source/WindowsFormsApplication1/Controls/ShifterTextInput.Designer.cs
new file mode 100644
index 0000000..9da62c6
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterTextInput.Designer.cs
@@ -0,0 +1,78 @@
+namespace ShiftOS
+{
+ partial class ShifterTextInput
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.txttext = new System.Windows.Forms.TextBox();
+ this.Label51 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // txttext
+ //
+ this.txttext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+ this.txttext.BackColor = System.Drawing.Color.White;
+ this.txttext.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.txttext.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.txttext.ForeColor = System.Drawing.Color.Black;
+ this.txttext.Location = new System.Drawing.Point(106, 7);
+ this.txttext.MinimumSize = new System.Drawing.Size(5, 2);
+ this.txttext.Name = "txttext";
+ this.txttext.Size = new System.Drawing.Size(116, 22);
+ this.txttext.TabIndex = 32;
+ //
+ // Label51
+ //
+ this.Label51.Dock = System.Windows.Forms.DockStyle.Left;
+ this.Label51.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Label51.Location = new System.Drawing.Point(0, 0);
+ this.Label51.Name = "Label51";
+ this.Label51.Size = new System.Drawing.Size(100, 29);
+ this.Label51.TabIndex = 31;
+ this.Label51.Text = "Label:";
+ this.Label51.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // ShifterTextInput
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.Controls.Add(this.txttext);
+ this.Controls.Add(this.Label51);
+ this.Name = "ShifterTextInput";
+ this.Size = new System.Drawing.Size(222, 29);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox txttext;
+ private System.Windows.Forms.Label Label51;
+ }
+}
diff --git a/source/WindowsFormsApplication1/Controls/ShifterTextInput.cs b/source/WindowsFormsApplication1/Controls/ShifterTextInput.cs
new file mode 100644
index 0000000..6e59649
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/ShifterTextInput.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class ShifterTextInput : IShifterSetting
+ {
+ public ShifterTextInput()
+ {
+ InitializeComponent();
+ txttext.TextChanged += (o, e) =>
+ {
+ Value = txttext.Text;
+ InvokeEvent(o, e);
+ };
+ }
+
+ public override string Text
+ {
+ get
+ {
+ return Label51.Text;
+ }
+ set
+ {
+ Label51.Text = value;
+ }
+ }
+
+ public override object Value
+ {
+ get
+ {
+ return txttext.Text;
+ }
+ set
+ {
+ txttext.Text = value as string;
+ }
+ }
+
+
+
+ }
+
+ public class IShifterSetting : UserControl
+ {
+ public virtual string Text { get; set; }
+ public virtual object Value { get; set; }
+ public event EventHandler OnValueChange;
+
+ public void InvokeEvent(object s, EventArgs a)
+ {
+ OnValueChange?.Invoke(s, a);
+ }
+ }
+
+}
diff --git a/source/WindowsFormsApplication1/Jumper.resx b/source/WindowsFormsApplication1/Controls/ShifterTextInput.resx
index f724b8c..1af7de1 100644
--- a/source/WindowsFormsApplication1/Jumper.resx
+++ b/source/WindowsFormsApplication1/Controls/ShifterTextInput.resx
@@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="tmrscreenupdate.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Controls/SyntaxHighlighter.cs b/source/WindowsFormsApplication1/Controls/SyntaxHighlighter.cs
new file mode 100644
index 0000000..1139096
--- /dev/null
+++ b/source/WindowsFormsApplication1/Controls/SyntaxHighlighter.cs
@@ -0,0 +1,324 @@
+//Source: http://www.codeproject.com/KB/edit/SyntaxRichTextBox/SyntaxRichTextBox_src.zip
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Windows.Forms;
+using System.ComponentModel;
+using System.Text.RegularExpressions;
+using System.Drawing;
+
+namespace ShiftOS
+{
+ public class SyntaxRichTextBox : System.Windows.Forms.RichTextBox
+ {
+ private SyntaxSettings m_settings = new SyntaxSettings();
+ private static bool m_bPaint = true;
+ private string m_strLine = "";
+ private int m_nContentLength = 0;
+ private int m_nLineLength = 0;
+ private int m_nLineStart = 0;
+ private int m_nLineEnd = 0;
+ private string m_strKeywords = "";
+ private int m_nCurSelection = 0;
+
+ /// <summary>
+ /// The settings.
+ /// </summary>
+ public SyntaxSettings Settings
+ {
+ get { return m_settings; }
+ }
+
+ /// <summary>
+ /// WndProc
+ /// </summary>
+ /// <param name="m"></param>
+ protected override void WndProc(ref System.Windows.Forms.Message m)
+ {
+ if (m.Msg == 0x00f)
+ {
+ if (m_bPaint)
+ base.WndProc(ref m);
+ else
+ m.Result = IntPtr.Zero;
+ }
+ else
+ base.WndProc(ref m);
+ }
+
+ public void SetLanguage(SyntaxSettings.Language lang)
+ {
+ Color white = Color.Black;
+ Color keyword = Color.Red;
+ Color integer = Color.LightGreen;
+ Color comment = Color.DarkGray;
+ Color str = Color.Orange;
+ Settings.EnableComments = true;
+ Settings.EnableIntegers = true;
+ Settings.EnableStrings = true;
+ if (API.Upgrades["limitlesscustomshades"])
+ {
+ Settings.CommentColor = comment;
+ Settings.KeywordColor = keyword;
+ Settings.StringColor = str;
+ Settings.IntegerColor = integer;
+ }
+ else
+ {
+ Settings.CommentColor = white;
+ Settings.KeywordColor = white;
+ Settings.StringColor = white;
+ Settings.IntegerColor = white;
+ }
+
+ switch (lang)
+ {
+ case SyntaxSettings.Language.Lua:
+ var kw = new List<string>() { "function", "local", "return", "if", "else", "elseif", "while", "true", "do", "next", "end", "for", "pairs", "in", "{", "}", "false", "=", "+", "-", "/", "*", "..", "," };
+ Settings.Keywords.Clear();
+ foreach (var k in kw)
+ {
+ Settings.Keywords.Add(k);
+ }
+ Settings.Comment = "--";
+ break;
+ case SyntaxSettings.Language.CSharp:
+ var cskw = new List<string>() { "public", "private", "internal", "static", "dynamic", "namespace", "typeof", "(", ")", "[", "]", "{", "}", "sizeof", "int", "using", "<", ">", ";", "this", "base", ":", "class", "interface", "string", "double", "single", "char", "new", "if", "else", "while", "for", "foreach", "in", "var", "as", "is", "object", "~" };
+ Settings.Keywords.Clear();
+ foreach (var k in cskw)
+ {
+ Settings.Keywords.Add(k);
+ }
+ Settings.Comment = "//";
+ break;
+ }
+ CompileKeywords();
+ ProcessAllLines();
+ }
+
+ /// <summary>
+ /// OnTextChanged
+ /// </summary>
+ /// <param name="e"></param>
+ protected override void OnTextChanged(EventArgs e)
+ {
+ // Calculate shit here. (NO. I didn't write this. This was there in codeproject... - Michael)
+ m_nContentLength = this.TextLength;
+
+ int nCurrentSelectionStart = SelectionStart;
+ int nCurrentSelectionLength = SelectionLength;
+
+ m_bPaint = false;
+
+ // Find the start of the current line.
+ m_nLineStart = nCurrentSelectionStart;
+ while ((m_nLineStart > 0) && (Text[m_nLineStart - 1] != '\n'))
+ m_nLineStart--;
+ // Find the end of the current line.
+ m_nLineEnd = nCurrentSelectionStart;
+ while ((m_nLineEnd < Text.Length) && (Text[m_nLineEnd] != '\n'))
+ m_nLineEnd++;
+ // Calculate the length of the line.
+ m_nLineLength = m_nLineEnd - m_nLineStart;
+ // Get the current line.
+ m_strLine = Text.Substring(m_nLineStart, m_nLineLength);
+
+ // Process this line.
+ ProcessLine();
+
+ m_bPaint = true;
+ }
+ /// <summary>
+ /// Process a line.
+ /// </summary>
+ private void ProcessLine()
+ {
+ // Save the position and make the whole line black
+ int nPosition = SelectionStart;
+ SelectionStart = m_nLineStart;
+ SelectionLength = m_nLineLength;
+ SelectionColor = ForeColor;
+
+ // Process the keywords
+ ProcessRegex(m_strKeywords, Settings.KeywordColor);
+ // Process numbers
+ if (Settings.EnableIntegers)
+ ProcessRegex("\\b(?:[0-9]*\\.)?[0-9]+\\b", Settings.IntegerColor);
+ // Process strings
+ if (Settings.EnableStrings)
+ ProcessRegex("\"[^\"\\\\\\r\\n]*(?:\\\\.[^\"\\\\\\r\\n]*)*\"", Settings.StringColor);
+ // Process comments
+ if (Settings.EnableComments && !string.IsNullOrEmpty(Settings.Comment))
+ ProcessRegex(Settings.Comment + ".*$", Settings.CommentColor);
+
+ SelectionStart = nPosition;
+ SelectionLength = 0;
+ SelectionColor = Color.Black;
+
+ m_nCurSelection = nPosition;
+ }
+ /// <summary>
+ /// Process a regular expression.
+ /// </summary>
+ /// <param name="strRegex">The regular expression.</param>
+ /// <param name="color">The color.</param>
+ private void ProcessRegex(string strRegex, Color color)
+ {
+ Regex regKeywords = new Regex(strRegex, RegexOptions.IgnoreCase | RegexOptions.Compiled);
+ Match regMatch;
+
+ for (regMatch = regKeywords.Match(m_strLine); regMatch.Success; regMatch = regMatch.NextMatch())
+ {
+ // Process the words
+ int nStart = m_nLineStart + regMatch.Index;
+ int nLenght = regMatch.Length;
+ SelectionStart = nStart;
+ SelectionLength = nLenght;
+ SelectionColor = color;
+ }
+ }
+ /// <summary>
+ /// Compiles the keywords as a regular expression.
+ /// </summary>
+ public void CompileKeywords()
+ {
+ for (int i = 0; i < Settings.Keywords.Count; i++)
+ {
+ string strKeyword = Settings.Keywords[i];
+
+ if (i == Settings.Keywords.Count - 1)
+ m_strKeywords += "\\b" + strKeyword + "\\b";
+ else
+ m_strKeywords += "\\b" + strKeyword + "\\b|";
+ }
+ }
+
+ public void ProcessAllLines()
+ {
+ m_bPaint = false;
+
+ int nStartPos = 0;
+ int i = 0;
+ int nOriginalPos = SelectionStart;
+ while (i < Lines.Length)
+ {
+ m_strLine = Lines[i];
+ m_nLineStart = nStartPos;
+ m_nLineEnd = m_nLineStart + m_strLine.Length;
+
+ ProcessLine();
+ i++;
+
+ nStartPos += m_strLine.Length + 1;
+ }
+
+ m_bPaint = true;
+ }
+ }
+
+ /// <summary>
+ /// Class to store syntax objects in.
+ /// </summary>
+ public class SyntaxList
+ {
+ public List<string> m_rgList = new List<string>();
+ public Color m_color = new Color();
+ }
+
+ /// <summary>
+ /// Settings for the keywords and colors.
+ /// </summary>
+ public class SyntaxSettings
+ {
+ SyntaxList m_rgKeywords = new SyntaxList();
+ string m_strComment = "";
+ Color m_colorComment = Color.Green;
+ Color m_colorString = Color.Gray;
+ Color m_colorInteger = Color.Red;
+ bool m_bEnableComments = true;
+ bool m_bEnableIntegers = true;
+ bool m_bEnableStrings = true;
+
+ #region Properties
+ /// <summary>
+ /// A list containing all keywords.
+ /// </summary>
+ public List<string> Keywords
+ {
+ get { return m_rgKeywords.m_rgList; }
+ }
+ /// <summary>
+ /// The color of keywords.
+ /// </summary>
+ public Color KeywordColor
+ {
+ get { return m_rgKeywords.m_color; }
+ set { m_rgKeywords.m_color = value; }
+ }
+ /// <summary>
+ /// A string containing the comment identifier.
+ /// </summary>
+ public string Comment
+ {
+ get { return m_strComment; }
+ set { m_strComment = value; }
+ }
+ /// <summary>
+ /// The color of comments.
+ /// </summary>
+ public Color CommentColor
+ {
+ get { return m_colorComment; }
+ set { m_colorComment = value; }
+ }
+ /// <summary>
+ /// Enables processing of comments if set to true.
+ /// </summary>
+ public bool EnableComments
+ {
+ get { return m_bEnableComments; }
+ set { m_bEnableComments = value; }
+ }
+ /// <summary>
+ /// Enables processing of integers if set to true.
+ /// </summary>
+ public bool EnableIntegers
+ {
+ get { return m_bEnableIntegers; }
+ set { m_bEnableIntegers = value; }
+ }
+ /// <summary>
+ /// Enables processing of strings if set to true.
+ /// </summary>
+ public bool EnableStrings
+ {
+ get { return m_bEnableStrings; }
+ set { m_bEnableStrings = value; }
+ }
+ /// <summary>
+ /// The color of strings.
+ /// </summary>
+ public Color StringColor
+ {
+ get { return m_colorString; }
+ set { m_colorString = value; }
+ }
+ /// <summary>
+ /// The color of integers.
+ /// </summary>
+ public Color IntegerColor
+ {
+ get { return m_colorInteger; }
+ set { m_colorInteger = value; }
+ }
+ #endregion
+
+ public enum Language
+ {
+ Lua,
+ CSharp,
+ }
+ }
+}
diff --git a/source/WindowsFormsApplication1/WindowBorder.Designer.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs
index 6e0970e..6e0970e 100644
--- a/source/WindowsFormsApplication1/WindowBorder.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/WindowBorder.Designer.cs
diff --git a/source/WindowsFormsApplication1/WindowBorder.cs b/source/WindowsFormsApplication1/Controls/WindowBorder.cs
index 751cb43..50f245d 100644
--- a/source/WindowsFormsApplication1/WindowBorder.cs
+++ b/source/WindowsFormsApplication1/Controls/WindowBorder.cs
@@ -14,6 +14,113 @@ namespace ShiftOS
{
public Timer updater = new Timer();
+ private List<BorderWidget> _widgets = new List<BorderWidget>();
+
+ //Lua Methods
+
+ public void RegisterWidget(string ident, Control ctrl)
+ {
+ _widgets.Add(new BorderWidget { Identifier = ident, Control = ctrl });
+ resettitlebar();
+ }
+
+ public Control GetWidget(string ident)
+ {
+ Control ctrl = null;
+ foreach(var widget in _widgets)
+ {
+ if(widget.Identifier == ident)
+ {
+ ctrl = widget.Control;
+ }
+ }
+ if (ctrl == null)
+ throw new Exception($"The identifier {ident} was not found.");
+ return ctrl;
+ }
+
+ public void RemoveWidget(string ident)
+ {
+ BorderWidget ctrl = null;
+ foreach (var widget in _widgets)
+ {
+ if (widget.Identifier == ident)
+ {
+ ctrl = widget;
+ }
+ }
+ if (ctrl == null)
+ throw new Exception($"The identifier {ident} was not found.");
+ var wControl = ctrl.Control;
+ wControl.Parent.Controls.Remove(wControl);
+ wControl.Hide();
+ _widgets.Remove(ctrl);
+ wControl.Dispose();
+ }
+
+
+ public Panel GetTitlebar()
+ {
+ return titlebar;
+ }
+
+ public Panel GetBorder(string side)
+ {
+ switch(side)
+ {
+ case "left":
+ return pgleft;
+ case "right":
+ return pgright;
+ case "bottom":
+ return pgbottom;
+ default:
+ return null;
+ }
+ }
+
+ public Panel GetCloseButton() { return closebutton; }
+ public Panel GetRollupButton() { return this.rollupbutton; }
+ public Panel GetMinimizeButton() { return minimizebutton; }
+
+ private bool _closeEnabled = true;
+ private bool _minimizeEnabled = true;
+ private bool _rollupEnabled = true;
+
+ public bool CloseEnabled { get { return _closeEnabled; } set { _closeEnabled = value; resettitlebar(); } }
+ public bool MinimizeEnabled { get { return _minimizeEnabled; } set { _minimizeEnabled = value; resettitlebar(); } }
+ public bool RollupEnabled { get { return _rollupEnabled; } set { _rollupEnabled = value; resettitlebar(); } }
+
+
+ public Panel GetCorner(string position, string side)
+ {
+ switch(position)
+ {
+ case "top":
+ switch(side)
+ {
+ case "left":
+ return pgtoplcorner;
+ case "right":
+ return pgtoprcorner;
+ default:
+ return null;
+ }
+ case "bottom":
+ switch(side)
+ {
+ case "left":
+ return pgbottomlcorner;
+ case "right":
+ return pgbottomlcorner;
+ default:
+ return null;
+ }
+ default:
+ return null;
+ }
+ }
+
public WindowBorder(string aname, Image aicon)
{
AppName = aname;
@@ -115,6 +222,7 @@ namespace ShiftOS
}*/
ParentForm.Tag = ParentForm.Location;
WindowComposition.WindowsEverywhere(this.ParentForm);
+ ParentForm.Text = this.AppName;
}
private PanelButton pbtn = null;
@@ -223,6 +331,7 @@ namespace ShiftOS
pgright.Hide();
this.Size = new Size(this.Width - pgleft.Width - pgright.Width, this.Height - pgbottom.Height);
}
+ API.CurrentSession.InvokeWindowOp("brdr_redraw", this.ParentForm);
}
private void closebutton_Click(object sender, EventArgs e)
@@ -343,6 +452,14 @@ namespace ShiftOS
closebutton.Show();
}
+ if (_closeEnabled == false)
+ closebutton.Hide();
+ if (_rollupEnabled == false)
+ rollupbutton.Hide();
+ if (_minimizeEnabled == false)
+ minimizebutton.Hide();
+
+
if (API.Upgrades["rollupbutton"] == false)
{
rollupbutton.Hide();
@@ -405,7 +522,7 @@ namespace ShiftOS
pnlicon.Image = this.AppIcon;
//Replace with the correct icon for the program.
}
-
+ API.CurrentSession.InvokeWindowOp("tbar_redraw", this.ParentForm);
}
public void rollupanddown()
@@ -446,6 +563,13 @@ namespace ShiftOS
}
lbtitletext.ForeColor = API.CurrentSkin.titletextcolour;
}
+ if (_closeEnabled == false)
+ closebutton.Hide();
+ if (_rollupEnabled == false)
+ rollupbutton.Hide();
+ if (_minimizeEnabled == false)
+ minimizebutton.Hide();
+ API.CurrentSession.InvokeWindowOp("tbar_redraw", this.ParentForm);
}
// ERROR: Handles clauses are not supported in C#
@@ -649,7 +773,7 @@ namespace ShiftOS
pgbottomrcorner.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.bottomrightcornerlayout;
pgbottomlcorner.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.bottomleftcornerlayout;
-
+ API.CurrentSession.InvokeWindowOp("redraw", this.ParentForm);
}
// ERROR: Handles clauses are not supported in C#
@@ -660,9 +784,16 @@ namespace ShiftOS
e.Cancel = true;
WindowComposition.CloseForm(this.ParentForm, pbtn, API.CurrentSkin.WindowCloseAnimation);
}
+ API.CurrentSession.InvokeWindowOp("close", this.ParentForm);
+ API.OpenGUIDs.Remove(this.ParentForm);
}
}
#endregion
+ public class BorderWidget
+ {
+ public string Identifier { get; set; }
+ public Control Control { get; set; }
+ }
}
diff --git a/source/WindowsFormsApplication1/WindowBorder.resx b/source/WindowsFormsApplication1/Controls/WindowBorder.resx
index 8bf59aa..8bf59aa 100644
--- a/source/WindowsFormsApplication1/WindowBorder.resx
+++ b/source/WindowsFormsApplication1/Controls/WindowBorder.resx
diff --git a/source/WindowsFormsApplication1/infobox.Designer.cs b/source/WindowsFormsApplication1/Controls/infobox.Designer.cs
index 1472a09..1472a09 100644
--- a/source/WindowsFormsApplication1/infobox.Designer.cs
+++ b/source/WindowsFormsApplication1/Controls/infobox.Designer.cs
diff --git a/source/WindowsFormsApplication1/infobox.cs b/source/WindowsFormsApplication1/Controls/infobox.cs
index 2f706d2..2f706d2 100644
--- a/source/WindowsFormsApplication1/infobox.cs
+++ b/source/WindowsFormsApplication1/Controls/infobox.cs
diff --git a/source/WindowsFormsApplication1/Hacking_Enemy.resx b/source/WindowsFormsApplication1/Controls/infobox.resx
index 760f267..1af7de1 100644
--- a/source/WindowsFormsApplication1/Hacking_Enemy.resx
+++ b/source/WindowsFormsApplication1/Controls/infobox.resx
@@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="tmrhealthdetect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/CreditScroller.Designer.cs b/source/WindowsFormsApplication1/CreditScroller.Designer.cs
new file mode 100644
index 0000000..f453b50
--- /dev/null
+++ b/source/WindowsFormsApplication1/CreditScroller.Designer.cs
@@ -0,0 +1,263 @@
+namespace ShiftOS
+{
+ partial class CreditScroller
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.pnlscroll = new System.Windows.Forms.Panel();
+ this.btnclose = new System.Windows.Forms.Button();
+ this.lbcreditstext = new System.Windows.Forms.Label();
+ this.lbgametitle = new System.Windows.Forms.Label();
+ this.tmrredraw = new System.Windows.Forms.Timer(this.components);
+ this.pgcontents = new System.Windows.Forms.Panel();
+ this.lblcountdown = new System.Windows.Forms.Label();
+ this.ball = new System.Windows.Forms.Panel();
+ this.paddleHuman = new System.Windows.Forms.PictureBox();
+ this.paddleComputer = new System.Windows.Forms.Panel();
+ this.lbllevelandtime = new System.Windows.Forms.Label();
+ this.lblstatsY = new System.Windows.Forms.Label();
+ this.lblstatsX = new System.Windows.Forms.Label();
+ this.pongGameTimer = new System.Windows.Forms.Timer(this.components);
+ this.counter = new System.Windows.Forms.Timer(this.components);
+ this.tmrcountdown = new System.Windows.Forms.Timer(this.components);
+ this.panel1.SuspendLayout();
+ this.pnlscroll.SuspendLayout();
+ this.pgcontents.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).BeginInit();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.pnlscroll);
+ this.panel1.Controls.Add(this.lbgametitle);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(916, 528);
+ this.panel1.TabIndex = 0;
+ //
+ // pnlscroll
+ //
+ this.pnlscroll.Controls.Add(this.btnclose);
+ this.pnlscroll.Controls.Add(this.lbcreditstext);
+ this.pnlscroll.Controls.Add(this.pgcontents);
+ this.pnlscroll.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pnlscroll.Location = new System.Drawing.Point(0, 66);
+ this.pnlscroll.Name = "pnlscroll";
+ this.pnlscroll.Size = new System.Drawing.Size(916, 462);
+ this.pnlscroll.TabIndex = 1;
+ //
+ // btnclose
+ //
+ this.btnclose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnclose.AutoSize = true;
+ this.btnclose.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+ this.btnclose.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btnclose.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
+ this.btnclose.Location = new System.Drawing.Point(843, 418);
+ this.btnclose.Name = "btnclose";
+ this.btnclose.Size = new System.Drawing.Size(61, 32);
+ this.btnclose.TabIndex = 1;
+ this.btnclose.Text = "Close";
+ this.btnclose.UseVisualStyleBackColor = true;
+ this.btnclose.Click += new System.EventHandler(this.btnclose_Click);
+ //
+ // lbcreditstext
+ //
+ this.lbcreditstext.AutoSize = true;
+ this.lbcreditstext.BackColor = System.Drawing.Color.Transparent;
+ this.lbcreditstext.Font = new System.Drawing.Font("Microsoft Sans Serif", 15F);
+ this.lbcreditstext.Location = new System.Drawing.Point(0, 138);
+ this.lbcreditstext.MaximumSize = new System.Drawing.Size(916, 0);
+ this.lbcreditstext.Name = "lbcreditstext";
+ this.lbcreditstext.Size = new System.Drawing.Size(0, 25);
+ this.lbcreditstext.TabIndex = 0;
+ this.lbcreditstext.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+ //
+ // lbgametitle
+ //
+ this.lbgametitle.Dock = System.Windows.Forms.DockStyle.Top;
+ this.lbgametitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 25F);
+ this.lbgametitle.Location = new System.Drawing.Point(0, 0);
+ this.lbgametitle.Name = "lbgametitle";
+ this.lbgametitle.Size = new System.Drawing.Size(916, 66);
+ this.lbgametitle.TabIndex = 0;
+ this.lbgametitle.Text = "ShiftOS Credits";
+ this.lbgametitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // tmrredraw
+ //
+ this.tmrredraw.Enabled = true;
+ this.tmrredraw.Tick += new System.EventHandler(this.tmrredraw_Tick);
+ //
+ // pgcontents
+ //
+ this.pgcontents.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.pgcontents.BackColor = System.Drawing.Color.Black;
+ this.pgcontents.Controls.Add(this.lblcountdown);
+ this.pgcontents.Controls.Add(this.ball);
+ this.pgcontents.Controls.Add(this.paddleHuman);
+ this.pgcontents.Controls.Add(this.paddleComputer);
+ this.pgcontents.Controls.Add(this.lbllevelandtime);
+ this.pgcontents.Controls.Add(this.lblstatsY);
+ this.pgcontents.Controls.Add(this.lblstatsX);
+ this.pgcontents.ForeColor = System.Drawing.Color.Gray;
+ this.pgcontents.Location = new System.Drawing.Point(0, 0);
+ this.pgcontents.Name = "pgcontents";
+ this.pgcontents.Size = new System.Drawing.Size(700, 400);
+ this.pgcontents.TabIndex = 21;
+ //
+ // lblcountdown
+ //
+ this.lblcountdown.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblcountdown.Location = new System.Drawing.Point(187, 152);
+ this.lblcountdown.Name = "lblcountdown";
+ this.lblcountdown.Size = new System.Drawing.Size(315, 49);
+ this.lblcountdown.TabIndex = 7;
+ this.lblcountdown.Text = "3";
+ this.lblcountdown.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ this.lblcountdown.Visible = false;
+ //
+ // ball
+ //
+ this.ball.BackColor = System.Drawing.Color.Gray;
+ this.ball.Location = new System.Drawing.Point(300, 152);
+ this.ball.Name = "ball";
+ this.ball.Size = new System.Drawing.Size(20, 20);
+ this.ball.TabIndex = 2;
+ //
+ // paddleHuman
+ //
+ this.paddleHuman.BackColor = System.Drawing.Color.Gray;
+ this.paddleHuman.Location = new System.Drawing.Point(10, 134);
+ this.paddleHuman.Name = "paddleHuman";
+ this.paddleHuman.Size = new System.Drawing.Size(20, 100);
+ this.paddleHuman.TabIndex = 3;
+ this.paddleHuman.TabStop = false;
+ //
+ // paddleComputer
+ //
+ this.paddleComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.paddleComputer.BackColor = System.Drawing.Color.Gray;
+ this.paddleComputer.Location = new System.Drawing.Point(666, 134);
+ this.paddleComputer.MaximumSize = new System.Drawing.Size(20, 100);
+ this.paddleComputer.Name = "paddleComputer";
+ this.paddleComputer.Size = new System.Drawing.Size(20, 100);
+ this.paddleComputer.TabIndex = 1;
+ //
+ // lbllevelandtime
+ //
+ this.lbllevelandtime.Dock = System.Windows.Forms.DockStyle.Top;
+ this.lbllevelandtime.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbllevelandtime.Location = new System.Drawing.Point(0, 0);
+ this.lbllevelandtime.Name = "lbllevelandtime";
+ this.lbllevelandtime.Size = new System.Drawing.Size(700, 22);
+ this.lbllevelandtime.TabIndex = 4;
+ this.lbllevelandtime.Text = "Level: 1";
+ this.lbllevelandtime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // lblstatsY
+ //
+ this.lblstatsY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblstatsY.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblstatsY.Location = new System.Drawing.Point(542, 356);
+ this.lblstatsY.Name = "lblstatsY";
+ this.lblstatsY.Size = new System.Drawing.Size(144, 35);
+ this.lblstatsY.TabIndex = 11;
+ this.lblstatsY.Text = "Yspeed:";
+ this.lblstatsY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // lblstatsX
+ //
+ this.lblstatsX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.lblstatsX.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblstatsX.Location = new System.Drawing.Point(3, 356);
+ this.lblstatsX.Name = "lblstatsX";
+ this.lblstatsX.Size = new System.Drawing.Size(144, 35);
+ this.lblstatsX.TabIndex = 5;
+ this.lblstatsX.Text = "Xspeed: ";
+ this.lblstatsX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // pongGameTimer
+ //
+ this.pongGameTimer.Interval = 30;
+ this.pongGameTimer.Tick += new System.EventHandler(this.pongGameTimer_Tick);
+ //
+ // counter
+ //
+ this.counter.Interval = 1000;
+ this.counter.Tick += new System.EventHandler(this.counter_Tick);
+ //
+ // tmrcountdown
+ //
+ this.tmrcountdown.Interval = 1000;
+ this.tmrcountdown.Tick += new System.EventHandler(this.tmrcountdown_Tick);
+ //
+ // CreditScroller
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.BackColor = System.Drawing.Color.Black;
+ this.ClientSize = new System.Drawing.Size(916, 528);
+ this.Controls.Add(this.panel1);
+ this.ForeColor = System.Drawing.Color.White;
+ this.Name = "CreditScroller";
+ this.Text = "CreditScroller";
+ this.Load += new System.EventHandler(this.CreditScroller_Load);
+ this.panel1.ResumeLayout(false);
+ this.pnlscroll.ResumeLayout(false);
+ this.pnlscroll.PerformLayout();
+ this.pgcontents.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.Panel pnlscroll;
+ private System.Windows.Forms.Label lbcreditstext;
+ private System.Windows.Forms.Label lbgametitle;
+ private System.Windows.Forms.Timer tmrredraw;
+ private System.Windows.Forms.Button btnclose;
+ internal System.Windows.Forms.Panel pgcontents;
+ internal System.Windows.Forms.Label lblcountdown;
+ internal System.Windows.Forms.Panel ball;
+ internal System.Windows.Forms.PictureBox paddleHuman;
+ internal System.Windows.Forms.Panel paddleComputer;
+ internal System.Windows.Forms.Label lbllevelandtime;
+ internal System.Windows.Forms.Label lblstatsY;
+ internal System.Windows.Forms.Label lblstatsX;
+ internal System.Windows.Forms.Timer pongGameTimer;
+ internal System.Windows.Forms.Timer counter;
+ internal System.Windows.Forms.Timer tmrcountdown;
+ }
+} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/CreditScroller.cs b/source/WindowsFormsApplication1/CreditScroller.cs
new file mode 100644
index 0000000..ff0a206
--- /dev/null
+++ b/source/WindowsFormsApplication1/CreditScroller.cs
@@ -0,0 +1,273 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class CreditScroller : Form
+ {
+ public CreditScroller()
+ {
+ InitializeComponent();
+ }
+
+ #region pong visualizer variables
+
+
+ bool pongVisible = false;
+ Random rand = new Random();
+ int xVel = 7;
+ int yVel = 8;
+ int computerspeed = 8;
+ int level = 1;
+ int secondsleft = 60;
+ int casualposition;
+ double xveldec = 3.0;
+ double yveldec = 3.0;
+ double incrementx = 0.4;
+ double incrementy = 0.2;
+ int levelxspeed = 3;
+ int levelyspeed = 3;
+ int beatairewardtotal;
+ int beataireward = 1;
+ int[] levelrewards = new int[50];
+ int countdown = 3;
+
+ #endregion
+
+ int offset = 0;
+
+ private void tmrredraw_Tick(object sender, EventArgs e)
+ {
+ pgcontents.Visible = pongVisible;
+ lbcreditstext.Top = pnlscroll.Height - offset;
+ if(pongVisible)
+ lbcreditstext.Left = (pnlscroll.Width - lbcreditstext.Width);
+ else
+ lbcreditstext.Left = (pnlscroll.Width - lbcreditstext.Width) / 2;
+ offset += 1;
+ }
+
+ private void CreditScroller_Load(object sender, EventArgs e)
+ {
+ Audio.Play("hackerbattle_ambient");
+ tmrredraw.Interval = 50;
+ lbcreditstext.Text = Properties.Resources.Credits.Replace("#VER#", Consts.Version);
+ tmrredraw.Start();
+ newgame();
+ }
+
+ private void btnclose_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void pongGameTimer_Tick(object sender, EventArgs e)
+ {
+ //Move player according to ball
+ if(ball.Left < 250 + xVel / 10 && xVel < 0)
+ {
+ if(ball.Top > paddleHuman.Top + 50)
+ {
+ paddleHuman.Top += computerspeed * 2 + ((int)yveldec / 2);
+ }
+ else if(ball.Top < paddleHuman.Top + 50)
+ {
+ paddleHuman.Top -= computerspeed * 2 + ((int)yveldec / 2);
+ }
+ }
+
+ //Set the computer player to move according to the ball's position.
+ if (ball.Location.X > 500 - xVel * 10 && xVel > 0)
+ {
+ if (ball.Location.Y > paddleComputer.Location.Y + 50)
+ {
+ paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed * 2 + ((int)yveldec / 2));
+ }
+ if (ball.Location.Y < paddleComputer.Location.Y + 50)
+ {
+ paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed * 2 + ((int)yveldec / 2));
+ }
+ casualposition = rand.Next(-150, 201);
+ }
+
+ //Set Xvel and Yvel speeds from decimal
+ if (xVel > 0)
+ xVel = (int)Math.Round(xveldec);
+ if (xVel < 0)
+ xVel = (int)-Math.Round(xveldec);
+ if (yVel > 0)
+ yVel = (int)Math.Round(yveldec);
+ if (yVel < 0)
+ yVel = (int)-Math.Round(yveldec);
+
+ // Move the game ball.
+ ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
+
+ // Check for top wall.
+ if (ball.Location.Y < 0)
+ {
+ ball.Location = new Point(ball.Location.X, 0);
+ yVel = -yVel;
+ }
+
+ // Check for bottom wall.
+ if (ball.Location.Y > pgcontents.Height - ball.Height)
+ {
+ ball.Location = new Point(ball.Location.X, pgcontents.Height - ball.Size.Height);
+ yVel = -yVel;
+ }
+
+ // Check for player paddle.
+ if (ball.Bounds.IntersectsWith(paddleHuman.Bounds))
+ {
+ ball.Location = new Point(paddleHuman.Location.X + ball.Size.Width, ball.Location.Y);
+ //randomly increase x or y speed of ball
+ switch (rand.Next(1, 3))
+ {
+ case 1:
+ xveldec = xveldec + incrementx;
+ break;
+ case 2:
+ if (yveldec > 0)
+ yveldec = yveldec + incrementy;
+ if (yveldec < 0)
+ yveldec = yveldec - incrementy;
+ break;
+ }
+ xVel = -xVel;
+ }
+
+ // Check for computer paddle.
+ if (ball.Bounds.IntersectsWith(paddleComputer.Bounds))
+ {
+ ball.Location = new Point(paddleComputer.Location.X - paddleComputer.Size.Width + 1, ball.Location.Y);
+ xveldec = xveldec + incrementx;
+ xVel = -xVel;
+ }
+
+ // Check for left wall.
+ if (ball.Location.X < -100)
+ {
+ ball.Location = new Point(pgcontents.Size.Width / 2 + 200, pgcontents.Size.Height / 2);
+ paddleComputer.Location = new Point(paddleComputer.Location.X, ball.Location.Y);
+ paddleHuman.Location = new Point(paddleHuman.Location.X, ball.Location.Y);
+
+ if (xVel > 0)
+ xVel = -xVel;
+ pongGameTimer.Stop();
+ tmrcountdown.Start();
+ counter.Stop();
+ }
+
+ // Check for right wall.
+ if (ball.Location.X > pgcontents.Width - ball.Size.Width - paddleComputer.Width + 100)
+ {
+ ball.Location = new Point(pgcontents.Size.Width / 2 + 200, pgcontents.Size.Height / 2);
+ paddleComputer.Location = new Point(paddleComputer.Location.X, ball.Location.Y);
+ paddleHuman.Location = new Point(paddleHuman.Location.X, ball.Location.Y);
+
+ if (xVel > 0)
+ xVel = -xVel;
+ beatairewardtotal = beatairewardtotal + beataireward;
+ tmrcountdown.Start();
+ pongGameTimer.Stop();
+ counter.Stop();
+ }
+
+ //lblstats.Text = "Xspeed: " & Math.Abs(xVel) & " Yspeed: " & Math.Abs(yVel) & " Human Location: " & paddleHuman.Location.ToString & " Computer Location: " & paddleComputer.Location.ToString & Environment.NewLine & " Ball Location: " & ball.Location.ToString & " Xdec: " & xveldec & " Ydec: " & yveldec & " Xinc: " & incrementx & " Yinc: " & incrementy
+ lblstatsX.Text = "Xspeed: " + xveldec;
+ lblstatsY.Text = "Yspeed: " + yveldec;
+
+ lbllevelandtime.Text = "Level: " + level;
+
+ if (xVel > 20 || xVel < -20)
+ {
+ paddleHuman.Width = Math.Abs(xVel);
+ paddleComputer.Width = Math.Abs(xVel);
+ }
+ else
+ {
+ paddleHuman.Width = 20;
+ paddleComputer.Width = 20;
+ }
+
+ computerspeed = Math.Abs(yVel);
+
+ // pgcontents.Refresh()
+ // pgcontents.CreateGraphics.FillRectangle(Brushes.Black, ball.Location.X, ball.Location.Y, ball.Width, ball.Height)
+
+ }
+
+ private void counter_Tick(object sender, EventArgs e)
+ {
+ secondsleft = secondsleft - 1;
+ if (secondsleft == -1)
+ {
+ secondsleft = 60;
+ level = level + 1;
+
+
+ }
+
+ }
+
+ private void tmrcountdown_Tick(object sender, EventArgs e)
+ {
+ switch (countdown)
+ {
+ case 0:
+ countdown = 3;
+ lblcountdown.Hide();
+ pongGameTimer.Start();
+ counter.Start();
+ tmrcountdown.Stop();
+ break;
+ case 1:
+ lblcountdown.Text = "1";
+ countdown = countdown - 1;
+ break;
+ case 2:
+ lblcountdown.Text = "2";
+ countdown = countdown - 1;
+ break;
+ case 3:
+ lblcountdown.Text = "3";
+ countdown = countdown - 1;
+ lblcountdown.Show();
+ break;
+ }
+ }
+
+ private void newgame()
+ {
+ level = 1;
+ beataireward = 2;
+ beatairewardtotal = 0;
+ secondsleft = 60;
+ //reset stats text
+ lblstatsX.Text = "Xspeed: ";
+ lblstatsY.Text = "Yspeed: ";
+
+ levelxspeed = 3;
+ levelyspeed = 3;
+
+ incrementx = 0.4;
+ incrementy = 0.2;
+
+ xveldec = levelxspeed;
+ yveldec = levelyspeed;
+
+ tmrcountdown.Start();
+ if (xVel < 0)
+ xVel = Math.Abs(xVel);
+ lbllevelandtime.Text = "Level: " + level + " - " + secondsleft + " Seconds Left";
+ }
+ }
+}
diff --git a/source/WindowsFormsApplication1/Template.resx b/source/WindowsFormsApplication1/CreditScroller.resx
index 8bf59aa..42cc80f 100644
--- a/source/WindowsFormsApplication1/Template.resx
+++ b/source/WindowsFormsApplication1/CreditScroller.resx
@@ -117,13 +117,16 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="pullbs.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <metadata name="tmrredraw.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
- <metadata name="pullbottom.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>101, 17</value>
+ <metadata name="pongGameTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>130, 17</value>
</metadata>
- <metadata name="pullside.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>214, 17</value>
+ <metadata name="counter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>283, 18</value>
+ </metadata>
+ <metadata name="tmrcountdown.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>376, 18</value>
</metadata>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/ShiftOSDesktop.Designer.cs b/source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.Designer.cs
index fad1f66..0116fc9 100644
--- a/source/WindowsFormsApplication1/ShiftOSDesktop.Designer.cs
+++ b/source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.Designer.cs
@@ -1561,7 +1561,7 @@
public System.Windows.Forms.ImageList imgshiftnetapps;
private System.Windows.Forms.Label lbldebug;
private System.Windows.Forms.Label lblog;
- private System.Windows.Forms.FlowLayoutPanel flicons;
+ public System.Windows.Forms.FlowLayoutPanel flicons;
private System.Windows.Forms.ToolStripMenuItem scriptToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip cmbfactions;
private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
diff --git a/source/WindowsFormsApplication1/ShiftOSDesktop.cs b/source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.cs
index bc0b9ed..19a641d 100644
--- a/source/WindowsFormsApplication1/ShiftOSDesktop.cs
+++ b/source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.cs
@@ -23,6 +23,76 @@ namespace ShiftOS
InitializeComponent();
}
+ //Event handler with no arguments.
+ public delegate void EmptyEventHandler();
+
+ //Event handler that passes a List<T>
+ public delegate void ListEventHandler<T>(List<T> lst);
+
+ //Window draw event handler.
+ public delegate void WindowDrawEventHandler(Form win);
+
+ //Event handler for passing a single control (e.g, a desktop panel) to the Lua API.
+ public delegate void ControlDrawEventHandler(string ControlGUID);
+
+ //Lua events.
+ public event EmptyEventHandler OnDesktopReload;
+ public event ListEventHandler<ApplauncherItem> OnAppLauncherPopulate;
+ public event ListEventHandler<PanelButton> OnPanelButtonPopulate;
+ public event EmptyEventHandler OnClockSkin;
+ public event EmptyEventHandler CtrlTPressed;
+ public event EmptyEventHandler OnUnityCheck;
+ public event WindowDrawEventHandler WindowOpened;
+ public event WindowDrawEventHandler WindowClosed;
+ public event WindowDrawEventHandler WindowSkinReset;
+ public event WindowDrawEventHandler TitlebarReset;
+ public event WindowDrawEventHandler BorderReset;
+ public event ListEventHandler<DesktopIcon> DesktopIconsPopulated;
+ public event EmptyEventHandler OnUnityToggle;
+ public event ControlDrawEventHandler OnDesktopPanelDraw;
+
+ public void InvokeWindowOp(string operation, Form win)
+ {
+ switch(operation)
+ {
+ case "open":
+ WindowOpened?.Invoke(win);
+ break;
+ case "close":
+ WindowClosed?.Invoke(win);
+ break;
+ case "tbar_redraw":
+ TitlebarReset?.Invoke(win);
+ break;
+ case "brdr_redraw":
+ BorderReset?.Invoke(win);
+ break;
+ case "redraw":
+ WindowSkinReset?.Invoke(win);
+ break;
+ }
+ }
+
+ public void AllowCtrlTIntercept()
+ {
+ _resetCtrlTEvent();
+ CtrlTLuaIntercept = true;
+ }
+
+ public void DisableCtrlTIntercept()
+ {
+ _resetCtrlTEvent();
+ CtrlTLuaIntercept = false;
+ }
+
+
+ private void _resetCtrlTEvent()
+ {
+ CtrlTPressed = null;
+ }
+
+ private bool CtrlTLuaIntercept = false;
+
public bool UnityEnabled = false;
public ToolStripMenuItem AppLauncher { get { return this.ApplicationsToolStripMenuItem; } }
@@ -39,7 +109,9 @@ namespace ShiftOS
{
UnityEnabled = true;
}
+ OnUnityToggle?.Invoke(); //We want this to be invoked BEFORE the desktop reset in case the user wants to do things with the desktop during reset.
SetupDesktop();
+
}
public void SetUnityMode(bool value)
@@ -80,6 +152,22 @@ namespace ShiftOS
};
}
+
+
+ public void InvokeCTRLT()
+ {
+ if (CtrlTLuaIntercept == true)
+ {
+ CtrlTPressed?.Invoke();
+ }
+ else
+ {
+ //Show terminal on CTRL+T
+
+ API.CreateForm(new Terminal(), API.CurrentSave.TerminalName, Properties.Resources.iconTerminal);
+ }
+ }
+
private void ShiftOSDesktop_Load(object sender, EventArgs e)
{
Viruses.CheckForInfected();
@@ -90,9 +178,7 @@ namespace ShiftOS
{
if (ea.KeyCode == Keys.T && ea.Control)
{
- //Show terminal on CTRL+T
-
- API.CreateForm(new Terminal(), API.CurrentSave.TerminalName, Properties.Resources.iconTerminal);
+ InvokeCTRLT();
}
else if (ea.KeyCode == Keys.D && ea.Control)
{
@@ -269,6 +355,7 @@ namespace ShiftOS
}
}
}
+ OnDesktopReload?.Invoke();
}
public void SetupWidgets()
@@ -385,7 +472,7 @@ namespace ShiftOS
ctrl.Width = w.Width;
Skinning.Utilities.saveskin();
}
- catch(Exception ex)
+ catch
{
AddNotification("Invalid width", "You have entered an invalid width.");
}
@@ -397,7 +484,7 @@ namespace ShiftOS
l.mod.widget(ctrl);
}
- catch(Exception ex)
+ catch
{
API.CreateInfoboxSession("Widget Error", $"An error has occurred creating this \"{w.Name}\". It'll stay, but it may not function as intended.", infobox.InfoboxMode.Info);
}
@@ -459,7 +546,7 @@ namespace ShiftOS
};
flicons.Controls.Add(dl);
}
-
+ DesktopIconsPopulated?.Invoke(DesktopIconManager.Icons);
}
}
@@ -516,7 +603,7 @@ namespace ShiftOS
public void SetupPanels(List<Skinning.DesktopPanel> lst)
{
DesktopPanels = new List<Panel>();
-
+ API.DEF_PanelGUIDs.Clear();
foreach (var dp in lst)
{
Panel pnl = new Panel();
@@ -619,6 +706,9 @@ namespace ShiftOS
pnl.Hide();
this.Controls.Remove(pnl);
}
+ string guid = Guid.NewGuid().ToString();
+ API.DEF_PanelGUIDs.Add(guid, pnl);
+ OnDesktopPanelDraw?.Invoke(guid);
}
}
@@ -666,7 +756,7 @@ namespace ShiftOS
NewAL = new ApplauncherItem(TEMP_AL.Name, Image.FromFile(Paths.Applications + TEMP_AL.AppDirectory + "\\" + TEMP_AL.Icon), lua, true);
imgshiftnetapps.Images.Add(file, NewAL.Icon);
}
- catch (Exception ex)
+ catch
{
NewAL = new ApplauncherItem(TEMP_AL.Name, null, lua, true);
}
@@ -734,6 +824,7 @@ namespace ShiftOS
else {
ApplicationsToolStripMenuItem.Visible = false;
}
+ OnAppLauncherPopulate?.Invoke(API.AppLauncherItems);
}
public void SetupGNOME2Elements()
@@ -836,7 +927,7 @@ namespace ShiftOS
else {
timepanel.Hide();
}
-
+ OnClockSkin?.Invoke();
}
public void CheckUnity()
@@ -864,6 +955,7 @@ namespace ShiftOS
this.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.desktopbackgroundlayout;
}
+ OnUnityCheck?.Invoke();
}
public void CheckForChristmas()
@@ -894,7 +986,7 @@ namespace ShiftOS
ctrl.Parent.Controls.Remove(ctrl);
newPanel.Controls.Add(ctrl);
}
- catch(Exception ex)
+ catch
{
newPanel.Controls.Add(ctrl);
}
@@ -935,6 +1027,7 @@ namespace ShiftOS
}
pnlpanelbuttonholder.Padding = new Padding(API.CurrentSkin.panelbuttoninitialgap, 0, 0, 0);
}
+ OnPanelButtonPopulate?.Invoke(API.PanelButtons);
}
public void setuppanelbuttonicons(ref PictureBox tbicon, Image image)
@@ -996,7 +1089,7 @@ namespace ShiftOS
API.ToggleMinimized(frm);
}
}
- catch (Exception ex)
+ catch
{
}
diff --git a/source/WindowsFormsApplication1/ShiftOSDesktop.resx b/source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.resx
index 1ee550a..1ee550a 100644
--- a/source/WindowsFormsApplication1/ShiftOSDesktop.resx
+++ b/source/WindowsFormsApplication1/Desktop/ShiftOSDesktop.resx
diff --git a/source/WindowsFormsApplication1/Color_Picker.Designer.cs b/source/WindowsFormsApplication1/Dialogs/Color_Picker.Designer.cs
index bc68a96..bc68a96 100644
--- a/source/WindowsFormsApplication1/Color_Picker.Designer.cs
+++ b/source/WindowsFormsApplication1/Dialogs/Color_Picker.Designer.cs
diff --git a/source/WindowsFormsApplication1/Color_Picker.cs b/source/WindowsFormsApplication1/Dialogs/Color_Picker.cs
index ea33415..ea33415 100644
--- a/source/WindowsFormsApplication1/Color_Picker.cs
+++ b/source/WindowsFormsApplication1/Dialogs/Color_Picker.cs
diff --git a/source/WindowsFormsApplication1/QuickChat.resx b/source/WindowsFormsApplication1/Dialogs/Color_Picker.resx
index d17d41c..1af7de1 100644
--- a/source/WindowsFormsApplication1/QuickChat.resx
+++ b/source/WindowsFormsApplication1/Dialogs/Color_Picker.resx
@@ -117,7 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="tmrimfuckinglucky.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Graphic_Picker.Designer.cs b/source/WindowsFormsApplication1/Dialogs/Graphic_Picker.Designer.cs
index 5cc62ea..5cc62ea 100644
--- a/source/WindowsFormsApplication1/Graphic_Picker.Designer.cs
+++ b/source/WindowsFormsApplication1/Dialogs/Graphic_Picker.Designer.cs
diff --git a/source/WindowsFormsApplication1/Graphic_Picker.cs b/source/WindowsFormsApplication1/Dialogs/Graphic_Picker.cs
index 1df302d..1df302d 100644
--- a/source/WindowsFormsApplication1/Graphic_Picker.cs
+++ b/source/WindowsFormsApplication1/Dialogs/Graphic_Picker.cs
diff --git a/source/WindowsFormsApplication1/Graphic_Picker.resx b/source/WindowsFormsApplication1/Dialogs/Graphic_Picker.resx
index 33c7f67..33c7f67 100644
--- a/source/WindowsFormsApplication1/Graphic_Picker.resx
+++ b/source/WindowsFormsApplication1/Dialogs/Graphic_Picker.resx
diff --git a/source/WindowsFormsApplication1/Engine/AudioResourceClient.cs b/source/WindowsFormsApplication1/Engine/AudioResourceClient.cs
new file mode 100644
index 0000000..717d43a
--- /dev/null
+++ b/source/WindowsFormsApplication1/Engine/AudioResourceClient.cs
@@ -0,0 +1,208 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+using NAudio;
+using NAudio.Wave;
+using System.Threading;
+using Newtonsoft.Json;
+using AxWMPLib;
+using System.Windows.Forms;
+using WMPLib;
+
+namespace ShiftOS
+{
+ public class AudioData
+ {
+ public string StartURL { get; set; }
+ public Dictionary<string, List<string>> Files { get; set; }
+ public Dictionary<string, List<Visualizer>> Visualizers = null;
+ }
+
+ public class Audio
+ {
+ public static string Name
+ {
+ get
+ {
+ string res = null;
+ try
+ {
+ if (_wmp != null)
+ {
+ if (_wmp.currentMedia != null)
+ {
+ res = _wmp.currentMedia.name;
+ }
+
+ }
+ }
+ catch
+ {
+
+ }
+ return res;
+ }
+ }
+
+ private static AudioData _ad = null;
+ public static WindowsMediaPlayer _wmp = null;
+ public static bool running = true;
+
+ public static int CurrentPosition
+ {
+ get
+ {
+ try
+ {
+ if (_wmp != null)
+ {
+ return (int)_wmp.controls.currentPosition;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+ }
+
+ public static int CurrentPositionMS
+ {
+ get
+ {
+ try
+ {
+ if (_wmp != null)
+ {
+ return (int)(_wmp.controls.currentPosition * 100);
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+ }
+
+
+ public static void LoadAudioData()
+ {
+ var t = new Thread(new ThreadStart(() =>
+ {
+ _wmp = new WindowsMediaPlayer();
+ _wmp.settings.autoStart = true;
+ _wmp.settings.volume = API.LoadedSettings.MusicVolume;
+ }));
+ t.Start();
+ _ad = JsonConvert.DeserializeObject<AudioData>(Properties.Resources.MusicData);
+ }
+
+ public static void Play(string list)
+ {
+ _forceStop = false;
+ var lst = _ad.Files[list];
+ var rnd = new Random();
+ int i = rnd.Next(0, lst.Count);
+ _wmp.URL = _ad.StartURL + list + "/" + _ad.Files[list][i] + ".mp3";
+ _wmp.PlayStateChange += (o) =>
+ {
+ if (o == (int)WMPPlayState.wmppsMediaEnded)
+ {
+ var t = new System.Windows.Forms.Timer();
+ t.Interval = 1000;
+ t.Tick += (object s, EventArgs a) =>
+ {
+ t.Stop();
+ Stopped?.Invoke(_wmp, new EventArgs());
+ };
+ t.Start();
+ }
+ };
+
+ }
+
+ public static event EventHandler Stopped;
+
+ public static bool _forceStop = false;
+
+ public static void Mute()
+ {
+ _wmp.settings.volume = 0;
+ }
+
+ public static void VolumeUp()
+ {
+ if(_wmp.settings.volume < 90)
+ {
+ _wmp.settings.volume += 10;
+ }
+ }
+
+ public static void VolumeDown()
+ {
+ if(_wmp.settings.volume > 0)
+ {
+ _wmp.settings.volume -= 10;
+ }
+ }
+
+ public static void Pause()
+ {
+ _wmp.controls.pause();
+ }
+
+ public static void Unpause()
+ {
+ _wmp.controls.play();
+ }
+
+ public static void ForceStop()
+ {
+ new Thread(new ThreadStart(() =>
+ {
+ _forceStop = true;
+ _wmp.controls.stop();
+ })).Start();
+ }
+
+ internal static Visualizer GetVisualizer()
+ {
+ Visualizer v = null;
+ foreach(var vis in _ad.Visualizers[Name])
+ {
+ if (vis.startTime <= CurrentPosition && vis.endTime >= CurrentPosition)
+ v = vis;
+ }
+ return v;
+ }
+ }
+
+ public class Visualizer
+ {
+ public int startTime { get; set; }
+ public int endTime { get; set; }
+ public VisualizerType type { get; set; }
+ public bool R { get; set; }
+ public bool G { get; set; }
+ public bool B { get; set; }
+ }
+
+ public enum VisualizerType
+ {
+ Pulse,
+ BuildUp,
+ CalmDown
+ }
+
+}
diff --git a/source/WindowsFormsApplication1/Lua_Interp.cs b/source/WindowsFormsApplication1/Engine/Lua_Interp.cs
index 80841de..813bcd3 100644
--- a/source/WindowsFormsApplication1/Lua_Interp.cs
+++ b/source/WindowsFormsApplication1/Engine/Lua_Interp.cs
@@ -111,6 +111,251 @@ namespace ShiftOS
/// </summary>
public void RegisterCore()
{
+ //Desktop environment
+ mod.on_unity_check += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnUnityCheck += () =>
+ {
+ mod(func + "()");
+ };
+ });
+ mod.on_unity_set += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnUnityToggle += () =>
+ {
+ mod(func + "()");
+ };
+ });
+ mod.on_desktop_panel_draw += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnDesktopPanelDraw += (c) =>
+ {
+ mod(func + $"(get_panel_from_guid(\"{c}\"))");
+ };
+ });
+ mod.get_panel_from_guid = new Func<string, Control>((guid) =>
+ {
+ foreach(var kv in API.DEF_PanelGUIDs)
+ {
+ if (kv.Key == guid)
+ return kv.Value;
+ }
+ return null;
+ });
+
+ mod.on_desktop_reset += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnDesktopReload += () =>
+ {
+ mod(func + "()");
+ };
+ });
+ mod.on_clock_skin += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnClockSkin += () =>
+ {
+ mod(func + "()");
+ };
+ });
+ mod.on_window_open += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.WindowOpened += (win) =>
+ {
+ mod(func + $"(\"{API.OpenGUIDs[win]}\")");
+ };
+ });
+ mod.get_window = new Func<string, Form>((guid) =>
+ {
+ Form frm = null;
+ foreach(var kv in API.OpenGUIDs)
+ {
+ if (kv.Value == guid)
+ frm = kv.Key;
+ }
+ return frm;
+ });
+ mod.on_window_close += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.WindowClosed += (win) =>
+ {
+ mod(func + $"(\"{API.OpenGUIDs[win]}\")");
+ };
+ });
+ mod.on_window_titlebar_redraw += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.TitlebarReset += (win) =>
+ {
+ mod.win = win;
+ mod(func + "(win)");
+ };
+ });
+ mod.on_window_border_redraw += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.BorderReset += (win) =>
+ {
+ mod.win = win;
+ mod(func + "(win)");
+ };
+ });
+ mod.on_window_skin += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.WindowSkinReset += (win) =>
+ {
+ mod.win = win;
+ mod(func + "(win)");
+ };
+ });
+ mod.get_border = new Func<Form, WindowBorder>((Form win) =>
+ {
+ WindowBorder b = null;
+ foreach(Control c in win.Controls)
+ {
+ if (c is WindowBorder)
+ b = c as WindowBorder;
+ }
+ return b;
+ });
+ mod.def_update = new Action(() => API.UpdateWindows());
+ mod.on_app_launcher_populate += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnAppLauncherPopulate += (items) =>
+ {
+ mod.al_items = items;
+ mod(func + "(clr_to_table(al_items))");
+ };
+ });
+ mod.on_panelbutton_populate += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.OnPanelButtonPopulate += (items) =>
+ {
+ mod.pb_items = items;
+ mod(func + "(clr_to_table(pb_items))");
+ };
+ });
+ mod.intercept_ctrlt += new Action<string>((func) =>
+ {
+ API.CurrentSession.AllowCtrlTIntercept();
+ API.CurrentSession.CtrlTPressed += () =>
+ {
+ mod(func + "()");
+ };
+ });
+ mod.stop_intercept_ctrlt += new Action(() =>
+ {
+ API.CurrentSession.DisableCtrlTIntercept();
+
+ });
+
+ mod.on_desktopicon_populate += new Action<ShiftOSDesktop, string>((desktop, func) =>
+ {
+ desktop.DesktopIconsPopulated += (items) =>
+ {
+ mod.dl_items = items;
+ mod(func + "(clr_to_table(dl_items))");
+ };
+ });
+
+
+ mod(@"function clr_to_table(clrlist)
+ local t = {}
+ local it = clrlist:GetEnumerator()
+ while it:MoveNext() do
+ t[#t+1] = it.Current
+ end
+ return t
+end");
+
+ mod.httpget = new Func<string, string>((url) =>
+ {
+ WebRequest request = WebRequest.Create(url);
+ Stream requestStream = request.GetResponse().GetResponseStream();
+ StreamReader requestRead = new StreamReader(requestStream);
+ return requestRead.ReadToEnd();
+ });
+ //Shifter Extension API
+ mod.shifter_add_category = new Action<string>((name) =>
+ {
+ bool add = true;
+ if(API.LuaShifterRegistry == null)
+ {
+ API.LuaShifterRegistry = new Dictionary<string, Dictionary<string, object>>();
+ }
+ foreach(var kv in API.LuaShifterRegistry)
+ {
+ if (kv.Key == name)
+ add = false;
+ }
+ if(add == true)
+ {
+ API.LuaShifterRegistry.Add(name, new Dictionary<string, object>());
+ }
+ else
+ {
+ Errors.Add($"shifter_add_category(\"{name}\"): Error: Category already exists!");
+ }
+ });
+ mod.shifter_remove_category = new Action<string>((name) =>
+ {
+ if(API.LuaShifterRegistry.ContainsKey(name))
+ {
+ API.LuaShifterRegistry.Remove(name);
+ }
+ else
+ {
+ Errors.Add($"shifter_remove_category(\"{name}\"): No such category.");
+ }
+ });
+ mod.shifter_add_value = new Action<string, string, object>((cat, name, in_value) =>
+ {
+ if(API.LuaShifterRegistry.ContainsKey(cat))
+ {
+ var lst = API.LuaShifterRegistry[cat];
+ if(!lst.ContainsKey(name))
+ {
+ lst.Add(name, in_value);
+ }
+ else
+ {
+ Errors.Add($"shifter_add_value(\"{cat}\", \"{name}\", in_value): Category was found, but it already contained a value with the specified name.");
+ }
+ }
+ else
+ {
+ Errors.Add($"shifter_add_value(\"{cat}\", \"{name}\", in_value): Category not found.");
+ }
+ });
+ mod.shifter_get_value = new Func<string, string, object>((cat, name) =>
+ {
+ if (API.LuaShifterRegistry.ContainsKey(cat))
+ {
+ var lst = API.LuaShifterRegistry[cat];
+ if (lst.ContainsKey(name))
+ {
+ return lst[name];
+ }
+ else
+ {
+ Errors.Add($"shifter_add_value(\"{cat}\", \"{name}\", in_value): Category was found, but it already contained a value with the specified name.");
+ return null;
+ }
+ }
+ else
+ {
+ Errors.Add($"shifter_add_value(\"{cat}\", \"{name}\", in_value): Category not found.");
+ return null;
+ }
+ });
+
+
+ //APIs.
+ mod.load_api = new Action<string>((name) =>
+ {
+ if(File.Exists(Paths.APIs + name + ".lua"))
+ {
+ mod(File.ReadAllText(Paths.APIs + name + ".lua"));
+ }
+ });
+
//Functions with Return Values
mod.get_app_launcher_items = new Func<List<ApplauncherItem>>(() =>
{
@@ -129,6 +374,25 @@ namespace ShiftOS
mod.json_serialize = new Func<object, string>((objectToSerialize) => Newtonsoft.Json.JsonConvert.SerializeObject(objectToSerialize));
mod.json_unserialize = new Func<string, object>((json_string) => Newtonsoft.Json.JsonConvert.DeserializeObject(json_string));
mod.open_image = new Func<string, Image>((filename) => OpenImage(filename));
+ mod.list_add = new Action<Control, string>((lst, itm) =>
+ {
+ if(lst is ListBox)
+ {
+ var box = lst as ListBox;
+ box.Items.Add(itm);
+ }
+ });
+ mod.list_get_selected = new Func<Control, string>((lst) =>
+ {
+ if(lst is ListBox)
+ {
+ return (lst as ListBox).SelectedItem?.ToString();
+ }
+ else
+ {
+ return null;
+ }
+ });
mod.get_skin = new Func<Skinning.Skin>(() =>
{
return API.CurrentSkin;
@@ -159,24 +423,12 @@ namespace ShiftOS
{
return Color.FromArgb(r, g, b);
}
- catch(Exception ex)
+ catch
{
Errors.Add("Invalid color values. Values must be a minimum of 0 and a maximum of 255.");
return new Color();
}
});
- mod.speechrec_create = new Func<SpeechListener>(() =>
- {
- return new SpeechListener();
- });
- mod.speechrec_on_recognize = new Action<SpeechListener, string>((obj, func) =>
- {
- obj.OnRecognize += (object s, EventArgs a) =>
- {
- mod($"{func}('{s.ToString()}')");
- };
- obj.Engine.RecognizeAsync();
- });
mod.get_desktop_session = new Func<Form>(() =>
{
return API.CurrentSession;
@@ -198,8 +450,8 @@ namespace ShiftOS
mod.get_codepoints = new Func<int>(() => GetCP());
mod.buy_upgrade = new Func<string, bool>((id) => BuyUPG(id));
mod.time = new Func<string>(() => API.GetTime());
- mod.encrypt = new Func<string, string>((raw) => API.Encryption.Encrypt(raw));
- mod.decrypt = new Func<string, string>((raw) => API.Encryption.Decrypt(raw));
+ mod.encrypt = new Func<string, string>((raw) => API.Encryption.Encrypt_old(raw));
+ mod.decrypt = new Func<string, string>((raw) => API.Encryption.Decrypt_old(raw));
mod.fread = new Func<string, string>((filepath) => SafeFileRead(filepath));
mod.terminal = new Action<string>((command) =>
{
@@ -417,16 +669,9 @@ namespace ShiftOS
mod.toggle_unity = new Action(() => API.CurrentSession.SetUnityMode());
mod.lua = new Func<string, string>((luacode) =>
{
- var li = new LuaInterpreter();
- try
- {
- li.mod(luacode);
- return "success";
- }
- catch (Exception ex)
- {
- return ex.Message;
- }
+ mod(luacode);
+ return "success";
+
});
mod.fileskimmer_open += new Action<string, string>((filters, func) =>
{
@@ -441,6 +686,7 @@ namespace ShiftOS
}
};
});
+ mod.open_File = mod.fileskimmer_open;
mod.fileskimmer_save += new Action<string, string>((filters, func) =>
{
API.CreateFileSkimmerSession(filters, File_Skimmer.FileSkimmerMode.Save);
@@ -454,7 +700,8 @@ namespace ShiftOS
}
};
});
- mod.gen_font = new Func<string, int, Font>((style, size) => {
+ mod.save_File = mod.fileskimmer_save;
+ mod.font = new Func<string, int, Font>((style, size) => {
return new Font(style, size);
});
@@ -497,7 +744,7 @@ namespace ShiftOS
i = it;
}
}
- catch(Exception ex)
+ catch
{
}
@@ -738,9 +985,9 @@ namespace ShiftOS
API.CreateFileSkimmerSession(fi, File_Skimmer.FileSkimmerMode.Open);
API.FileSkimmerSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
- mod($"{fu}({API.GetFSResult()})");
+ mod($"{fu}(\"{API.GetFSResult().Replace(Paths.SaveRoot, "").Replace("\\", "/")}\")");
};
- }
+ } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Prompt user to save a file.
@@ -752,7 +999,7 @@ namespace ShiftOS
API.CreateFileSkimmerSession(fi, File_Skimmer.FileSkimmerMode.Save);
API.FileSkimmerSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
- mod($"{fu}({API.GetFSResult()})");
+ mod($"{fu}(\"{API.GetFSResult().Replace(Paths.SaveRoot, "").Replace("\\", "/")}\")");
};
}
@@ -854,6 +1101,16 @@ namespace ShiftOS
var ctrl = new Control();
switch(type.ToLower())
{
+ case "luatextbox":
+ var stxt = new SyntaxRichTextBox();
+ stxt.Text = text;
+ stxt.SetLanguage(SyntaxSettings.Language.Lua);
+ ctrl = stxt;
+ break;
+ case "list":
+ var lst = new ListBox();
+ ctrl = lst;
+ break;
case "button":
var btn = new Button();
btn.FlatStyle = FlatStyle.Flat;
@@ -959,7 +1216,6 @@ namespace ShiftOS
return ctrl;
}
- private bool Beeping = false;
/// <summary>
/// Broken, piece of dump beep function.
diff --git a/source/WindowsFormsApplication1/SaveSystem.cs b/source/WindowsFormsApplication1/Engine/SaveSystem.cs
index a86ee52..9381d9b 100644
--- a/source/WindowsFormsApplication1/SaveSystem.cs
+++ b/source/WindowsFormsApplication1/Engine/SaveSystem.cs
@@ -34,6 +34,7 @@ namespace SaveSystem
public int PriceDivider = 1;
public string CloudID = "";
public List<string> CompletedNets = new List<string>();
+ public ShiftOS.Online.Hacking.Network MyOnlineNetwork = new ShiftOS.Online.Hacking.Network();
}
public class PrivateBitnoteAddress
@@ -186,6 +187,32 @@ namespace SaveSystem
public static List<Shiftorium.Upgrade> DefaultUpgrades = new List<Shiftorium.Upgrade>();
+ public static List<string> GetCategories(bool showBought)
+ {
+ List<string> cats = new List<string>();
+ foreach(var upg in DefaultUpgrades)
+ {
+ if(upg.id.Contains("dummy"))
+ {
+ if(!cats.Contains(upg.Category.ToLower()))
+ {
+ if(API.Upgrades[upg.Category.ToLower()])
+ {
+ if(showBought == true)
+ {
+ cats.Add(upg.Category.ToLower());
+ }
+ }
+ else
+ {
+ cats.Add(upg.Category.ToLower());
+ }
+
+ }
+ }
+ }
+ return cats; //Meow! No. I don't mean the animal. I mean "Categories".
+ }
/// <summary>
/// Adds upgrade info (such as CP, description, etc) to the registry. Add your Shiftorium upgrades here.
@@ -460,13 +487,14 @@ namespace SaveSystem
try
{
ShiftoriumUpgrades[kv.Key] = kv.Value;
- } catch(Exception ex)
+ } catch
{
Console.WriteLine("[Shiftorium/Registry] [ERROR] Upgrade {0} from disk doesn't seem to be found in the 'Default Upgrades' dictionary. This may be caused by a bug.", kv.Key);
}
}
}
- catch (Exception ex)
+ catch
+
{
string shiftoriumjson = JsonConvert.SerializeObject(ShiftoriumUpgrades);
if (API.DeveloperMode == true)
@@ -505,10 +533,10 @@ namespace Shiftorium
/// <returns>Whether the upgrade could be bought.</returns>
public static bool Buy(Upgrade upgradeToBuy)
{
- if(API.Codepoints >= upgradeToBuy.Cost)
+ if(API.Codepoints >= upgradeToBuy.Cost / API.CurrentSave.PriceDivider)
{
SaveSystem.ShiftoriumRegistry.ShiftoriumUpgrades[upgradeToBuy.id] = true;
- SaveSystem.Utilities.LoadedSave.codepoints -= upgradeToBuy.Cost;
+ SaveSystem.Utilities.LoadedSave.codepoints -= upgradeToBuy.Cost / API.CurrentSave.PriceDivider;
SaveSystem.Utilities.saveGame();
API.UpdateWindows();
API.Log("[Shiftorium] Upgrade \"" + upgradeToBuy.id + "\" bought successfully, game saved.");
@@ -561,7 +589,7 @@ namespace Shiftorium
}
- catch (Exception ex)
+ catch
{
if (upgrade.id.Contains("dummy"))
{
diff --git a/source/WindowsFormsApplication1/Viruses.cs b/source/WindowsFormsApplication1/Engine/Viruses.cs
index 987a76f..303da83 100644
--- a/source/WindowsFormsApplication1/Viruses.cs
+++ b/source/WindowsFormsApplication1/Engine/Viruses.cs
@@ -121,7 +121,7 @@ namespace ShiftOS
}
Directory.Delete(pth, true);
}
- catch(Exception ex)
+ catch
{
API.LogException("Corrupted package file detected while checking for infections... skipping.", false);
}
@@ -146,7 +146,7 @@ namespace ShiftOS
}
}
}
- catch (CryptographicException cex)
+ catch
{
if (encrypted != "")
{
@@ -326,7 +326,7 @@ namespace ShiftOS
unencryptedfile += ";" + infectionString;
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
}
- catch(Exception ex)
+ catch
{
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(infectionString));
}
@@ -348,7 +348,7 @@ namespace ShiftOS
unencryptedfile += ";" + infectionString;
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
}
- catch (Exception ex)
+ catch
{
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(infectionString));
}
@@ -359,7 +359,6 @@ namespace ShiftOS
public static void DisInfect(string FileName)
{
- bool cont = false;
FileInfo finf = new FileInfo(FileName);
switch (finf.Extension)
{
@@ -379,7 +378,7 @@ namespace ShiftOS
dirsep = "/";
break;
}
- if(File.Exists(pth + dirsep + virusfilename))
+ if (File.Exists(pth + dirsep + virusfilename))
{
File.Delete(pth + dirsep + virusfilename);
}
@@ -401,15 +400,13 @@ namespace ShiftOS
unencryptedfile = "";
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
}
- catch (Exception ex)
+ catch
{
File.WriteAllText(finf.FullName, "");
}
}
break;
- default:
- cont = true;
- break;
+
}
CheckForInfected();
@@ -457,7 +454,7 @@ namespace ShiftOS
unencryptedfile += ";" + infectionString;
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
}
- catch (Exception ex)
+ catch
{
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(infectionString));
}
@@ -479,7 +476,7 @@ namespace ShiftOS
unencryptedfile += ";" + infectionString;
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
}
- catch (Exception ex)
+ catch
{
File.WriteAllText(finf.FullName, API.Encryption.Encrypt(infectionString));
}
@@ -553,7 +550,7 @@ namespace ShiftOS
InfectFile(file, VirusID.ImTheShifterNow);
InfectFile(file, VirusID.MouseTrap);
}
- catch(NotHappeningException nhex)
+ catch
{
DropDevXPayload();
}
@@ -600,10 +597,8 @@ namespace ShiftOS
case 7:
case 9:
return Chars[rnd.Next(0, Chars.Length - 1)].ToUpper();
- break;
default:
return Chars[rnd.Next(0, Chars.Length - 1)].ToLower();
- break;
}
}
}
diff --git a/source/WindowsFormsApplication1/undo.cs b/source/WindowsFormsApplication1/Engine/undo.cs
index 98fb920..98fb920 100644
--- a/source/WindowsFormsApplication1/undo.cs
+++ b/source/WindowsFormsApplication1/Engine/undo.cs
diff --git a/source/WindowsFormsApplication1/FinalMission/ChooseYourApproach.cs b/source/WindowsFormsApplication1/FinalMission/ChooseYourApproach.cs
index 78a8508..c757699 100644
--- a/source/WindowsFormsApplication1/FinalMission/ChooseYourApproach.cs
+++ b/source/WindowsFormsApplication1/FinalMission/ChooseYourApproach.cs
@@ -17,22 +17,19 @@ namespace ShiftOS.FinalMission
{
public partial class ChooseYourApproach : Form
{
- bool Playing = false;
- private AudioResourceClient audioClient = null;
-
+
public ChooseYourApproach()
{
- audioClient = new AudioResourceClient("EndGame;RossBugden");
- InitializeComponent();
- //Music thread.
- audioClient.Play("Rapture");
- audioClient.SongFinished += (object s, EventArgs a) =>
+ Audio.Play("endgame");
+ Audio.Stopped += (o, a) =>
{
- if (musicEnabled)
+ if (this != null)
{
- audioClient.Play("Rapture");
+ Audio.Play("endgame");
}
};
+ InitializeComponent();
+ //Music thread.
}
private void lbdesc_Click(object sender, EventArgs e)
@@ -128,9 +125,7 @@ namespace ShiftOS.FinalMission
private void onClose(object sender, FormClosingEventArgs e)
{
- audioClient.Stop();
- audioClient.Dispose();
- audioClient = null;
+ Audio.ForceStop();
}
bool musicEnabled = true;
@@ -139,11 +134,11 @@ namespace ShiftOS.FinalMission
{
if (musicEnabled)
{
- audioClient.Stop();
+ Audio.ForceStop();
}
else
{
- audioClient.Play("Rapture");
+ Audio.Play("hackerbattle_ambient");
}
musicEnabled = !musicEnabled;
}
diff --git a/source/WindowsFormsApplication1/GameSettings.Designer.cs b/source/WindowsFormsApplication1/GameSettings.Designer.cs
new file mode 100644
index 0000000..809fbb0
--- /dev/null
+++ b/source/WindowsFormsApplication1/GameSettings.Designer.cs
@@ -0,0 +1,130 @@
+namespace ShiftOS
+{
+ partial class GameSettings
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.label1 = new System.Windows.Forms.Label();
+ this.lbgame = new System.Windows.Forms.Label();
+ this.pgsound = new ShiftOS.ProgressBarEX();
+ this.label2 = new System.Windows.Forms.Label();
+ this.panel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.label2);
+ this.panel1.Controls.Add(this.pgsound);
+ this.panel1.Controls.Add(this.lbgame);
+ this.panel1.Controls.Add(this.label1);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(665, 432);
+ this.panel1.TabIndex = 0;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(0, 0);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(35, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "label1";
+ //
+ // lbgame
+ //
+ this.lbgame.Dock = System.Windows.Forms.DockStyle.Top;
+ this.lbgame.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F);
+ this.lbgame.Location = new System.Drawing.Point(0, 0);
+ this.lbgame.Name = "lbgame";
+ this.lbgame.Size = new System.Drawing.Size(665, 23);
+ this.lbgame.TabIndex = 1;
+ this.lbgame.Text = "ShiftOS settings";
+ this.lbgame.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+ //
+ // pgsound
+ //
+ this.pgsound.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.pgsound.BackColor = System.Drawing.Color.White;
+ this.pgsound.BlockSeparation = 3;
+ this.pgsound.BlockWidth = 5;
+ this.pgsound.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.pgsound.Color = System.Drawing.Color.Black;
+ this.pgsound.ForeColor = System.Drawing.Color.Gray;
+ this.pgsound.Label = "Music Volume:";
+ this.pgsound.Location = new System.Drawing.Point(13, 67);
+ this.pgsound.MaxValue = 100;
+ this.pgsound.MinValue = 0;
+ this.pgsound.Name = "pgsound";
+ this.pgsound.Orientation = ShiftOS.ProgressBarEX.ProgressBarOrientation.Horizontal;
+ this.pgsound.ShowLabel = true;
+ this.pgsound.ShowValue = true;
+ this.pgsound.Size = new System.Drawing.Size(640, 32);
+ this.pgsound.Step = 10;
+ this.pgsound.Style = ShiftOS.ProgressBarEX.ProgressBarExStyle.Continuous;
+ this.pgsound.TabIndex = 2;
+ this.pgsound.Value = 0;
+ this.pgsound.MouseDown += new System.Windows.Forms.MouseEventHandler(this.set_music_volume);
+ this.pgsound.MouseLeave += new System.EventHandler(this.pgsound_MouseLeave);
+ this.pgsound.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pgsound_MouseMove);
+ //
+ // label2
+ //
+ this.label2.Dock = System.Windows.Forms.DockStyle.Top;
+ this.label2.Location = new System.Drawing.Point(0, 23);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(665, 13);
+ this.label2.TabIndex = 3;
+ this.label2.Text = "* Click and drag to set any percentage values!";
+ this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;
+ //
+ // GameSettings
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(665, 432);
+ this.Controls.Add(this.panel1);
+ this.Name = "GameSettings";
+ this.Text = "GameSettings";
+ this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private ProgressBarEX pgsound;
+ private System.Windows.Forms.Label lbgame;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ }
+} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/GameSettings.cs b/source/WindowsFormsApplication1/GameSettings.cs
new file mode 100644
index 0000000..0d3bdc0
--- /dev/null
+++ b/source/WindowsFormsApplication1/GameSettings.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class GameSettings : Form
+ {
+ public GameSettings()
+ {
+ InitializeComponent();
+ SetupUI();
+ }
+
+ public void SetupUI()
+ {
+ pgsound.MaxValue = 100;
+ pgsound.Value = Audio._wmp.settings.volume;
+ }
+
+ bool moving = false;
+
+ private void set_music_volume(object sender, MouseEventArgs e)
+ {
+ Audio._wmp.settings.volume = MathEx.LinearInterpolate(0, pgsound.Width, e.X, 0, 100);
+ moving = true;
+ SetupUI();
+ }
+
+ private void pgsound_MouseLeave(object sender, EventArgs e)
+ {
+ moving = false;
+ }
+
+ private void pgsound_MouseMove(object sender, MouseEventArgs e)
+ {
+ if (moving == true)
+ {
+ Audio._wmp.settings.volume = MathEx.LinearInterpolate(0, pgsound.Width, e.X, 0, 100);
+ SetupUI();
+ }
+ }
+ }
+}
diff --git a/source/WindowsFormsApplication1/AlternateDesktop.resx b/source/WindowsFormsApplication1/GameSettings.resx
index 2d0907d..1af7de1 100644
--- a/source/WindowsFormsApplication1/AlternateDesktop.resx
+++ b/source/WindowsFormsApplication1/GameSettings.resx
@@ -117,10 +117,4 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
- <metadata name="ClockTick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="apptick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>120, 17</value>
- </metadata>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/HackUI.Designer.cs b/source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs
index 9b58537..6db5640 100644
--- a/source/WindowsFormsApplication1/HackUI.Designer.cs
+++ b/source/WindowsFormsApplication1/Gameplay/HackUI.Designer.cs
@@ -68,11 +68,23 @@
this.btntogglemusic = new System.Windows.Forms.Button();
this.lbsong = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
+ this.pgpong = new System.Windows.Forms.Panel();
+ this.lblcountdown = new System.Windows.Forms.Label();
+ this.ball = new System.Windows.Forms.Panel();
+ this.paddleHuman = new System.Windows.Forms.PictureBox();
+ this.paddleComputer = new System.Windows.Forms.Panel();
+ this.lbllevelandtime = new System.Windows.Forms.Label();
+ this.lblstatsY = new System.Windows.Forms.Label();
+ this.lblstatsX = new System.Windows.Forms.Label();
this.pnltutorial = new System.Windows.Forms.Panel();
this.lbtutorial = new System.Windows.Forms.Label();
this.tmrplayerhealthdetect = new System.Windows.Forms.Timer(this.components);
this.tmrenemyhealthdetect = new System.Windows.Forms.Timer(this.components);
this.tmrredraw = new System.Windows.Forms.Timer(this.components);
+ this.tmrvisualizer = new System.Windows.Forms.Timer(this.components);
+ this.pongGameTimer = new System.Windows.Forms.Timer(this.components);
+ this.counter = new System.Windows.Forms.Timer(this.components);
+ this.tmrcountdown = new System.Windows.Forms.Timer(this.components);
this.tbui.SuspendLayout();
this.pnlenemy.SuspendLayout();
this.pnlyou.SuspendLayout();
@@ -81,6 +93,8 @@
this.pnlpcinfo.SuspendLayout();
this.flcontrols.SuspendLayout();
this.panel2.SuspendLayout();
+ this.pgpong.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).BeginInit();
this.pnltutorial.SuspendLayout();
this.SuspendLayout();
//
@@ -146,7 +160,6 @@
this.txtyourconsole.Name = "txtyourconsole";
this.txtyourconsole.Size = new System.Drawing.Size(662, 348);
this.txtyourconsole.TabIndex = 3;
- this.txtyourconsole.Text = "PLAYER CONSOLE";
//
// pnlyou
//
@@ -192,7 +205,6 @@
this.txtenemyconsole.Name = "txtenemyconsole";
this.txtenemyconsole.Size = new System.Drawing.Size(662, 347);
this.txtenemyconsole.TabIndex = 2;
- this.txtenemyconsole.Text = "ENEMY CONSOLE";
//
// btnnext
//
@@ -513,13 +525,14 @@
//
this.lbsong.Location = new System.Drawing.Point(336, 0);
this.lbsong.Name = "lbsong";
- this.lbsong.Size = new System.Drawing.Size(127, 26);
+ this.lbsong.Size = new System.Drawing.Size(414, 26);
this.lbsong.TabIndex = 3;
this.lbsong.Text = "Codepoints:";
this.lbsong.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// panel2
//
+ this.panel2.Controls.Add(this.pgpong);
this.panel2.Controls.Add(this.pnltutorial);
this.panel2.Controls.Add(this.pnlbuy);
this.panel2.Controls.Add(this.pnlpcinfo);
@@ -532,6 +545,96 @@
this.panel2.Size = new System.Drawing.Size(1339, 741);
this.panel2.TabIndex = 1;
//
+ // pgpong
+ //
+ this.pgpong.BackColor = System.Drawing.Color.Black;
+ this.pgpong.Controls.Add(this.lblcountdown);
+ this.pgpong.Controls.Add(this.ball);
+ this.pgpong.Controls.Add(this.paddleHuman);
+ this.pgpong.Controls.Add(this.paddleComputer);
+ this.pgpong.Controls.Add(this.lbllevelandtime);
+ this.pgpong.Controls.Add(this.lblstatsY);
+ this.pgpong.Controls.Add(this.lblstatsX);
+ this.pgpong.ForeColor = System.Drawing.Color.White;
+ this.pgpong.Location = new System.Drawing.Point(0, 0);
+ this.pgpong.Name = "pgpong";
+ this.pgpong.Size = new System.Drawing.Size(700, 400);
+ this.pgpong.TabIndex = 22;
+ this.pgpong.Visible = false;
+ this.pgpong.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pongMain_MouseMove);
+ //
+ // lblcountdown
+ //
+ this.lblcountdown.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblcountdown.Location = new System.Drawing.Point(187, 152);
+ this.lblcountdown.Name = "lblcountdown";
+ this.lblcountdown.Size = new System.Drawing.Size(315, 49);
+ this.lblcountdown.TabIndex = 7;
+ this.lblcountdown.Text = "3";
+ this.lblcountdown.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ this.lblcountdown.Visible = false;
+ //
+ // ball
+ //
+ this.ball.BackColor = System.Drawing.Color.Gray;
+ this.ball.Location = new System.Drawing.Point(300, 152);
+ this.ball.Name = "ball";
+ this.ball.Size = new System.Drawing.Size(20, 20);
+ this.ball.TabIndex = 2;
+ //
+ // paddleHuman
+ //
+ this.paddleHuman.BackColor = System.Drawing.Color.Gray;
+ this.paddleHuman.Location = new System.Drawing.Point(10, 134);
+ this.paddleHuman.Name = "paddleHuman";
+ this.paddleHuman.Size = new System.Drawing.Size(20, 100);
+ this.paddleHuman.TabIndex = 3;
+ this.paddleHuman.TabStop = false;
+ //
+ // paddleComputer
+ //
+ this.paddleComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.paddleComputer.BackColor = System.Drawing.Color.Gray;
+ this.paddleComputer.Location = new System.Drawing.Point(666, 134);
+ this.paddleComputer.MaximumSize = new System.Drawing.Size(20, 100);
+ this.paddleComputer.Name = "paddleComputer";
+ this.paddleComputer.Size = new System.Drawing.Size(20, 100);
+ this.paddleComputer.TabIndex = 1;
+ //
+ // lbllevelandtime
+ //
+ this.lbllevelandtime.Dock = System.Windows.Forms.DockStyle.Top;
+ this.lbllevelandtime.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lbllevelandtime.Location = new System.Drawing.Point(0, 0);
+ this.lbllevelandtime.Name = "lbllevelandtime";
+ this.lbllevelandtime.Size = new System.Drawing.Size(700, 22);
+ this.lbllevelandtime.TabIndex = 4;
+ this.lbllevelandtime.Text = "Level: 1";
+ this.lbllevelandtime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // lblstatsY
+ //
+ this.lblstatsY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.lblstatsY.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblstatsY.Location = new System.Drawing.Point(542, 356);
+ this.lblstatsY.Name = "lblstatsY";
+ this.lblstatsY.Size = new System.Drawing.Size(144, 35);
+ this.lblstatsY.TabIndex = 11;
+ this.lblstatsY.Text = "Yspeed:";
+ this.lblstatsY.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
+ // lblstatsX
+ //
+ this.lblstatsX.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
+ this.lblstatsX.Font = new System.Drawing.Font("Georgia", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.lblstatsX.Location = new System.Drawing.Point(3, 356);
+ this.lblstatsX.Name = "lblstatsX";
+ this.lblstatsX.Size = new System.Drawing.Size(144, 35);
+ this.lblstatsX.TabIndex = 5;
+ this.lblstatsX.Text = "Xspeed: ";
+ this.lblstatsX.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
+ //
// pnltutorial
//
this.pnltutorial.Controls.Add(this.btnnext);
@@ -565,6 +668,25 @@
//
this.tmrredraw.Tick += new System.EventHandler(this.tmrredraw_Tick);
//
+ // tmrvisualizer
+ //
+ this.tmrvisualizer.Tick += new System.EventHandler(this.tmrvisualizer_Tick);
+ //
+ // pongGameTimer
+ //
+ this.pongGameTimer.Interval = 30;
+ this.pongGameTimer.Tick += new System.EventHandler(this.pongGameTimer_Tick);
+ //
+ // counter
+ //
+ this.counter.Interval = 1000;
+ this.counter.Tick += new System.EventHandler(this.counter_Tick);
+ //
+ // tmrcountdown
+ //
+ this.tmrcountdown.Interval = 1000;
+ this.tmrcountdown.Tick += new System.EventHandler(this.tmrcountdown_Tick);
+ //
// HackUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 11F);
@@ -594,6 +716,8 @@
this.flcontrols.ResumeLayout(false);
this.flcontrols.PerformLayout();
this.panel2.ResumeLayout(false);
+ this.pgpong.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.paddleHuman)).EndInit();
this.pnltutorial.ResumeLayout(false);
this.pnltutorial.PerformLayout();
this.ResumeLayout(false);
@@ -645,5 +769,17 @@
private System.Windows.Forms.Label lbsong;
private System.Windows.Forms.Panel pnltutorial;
private System.Windows.Forms.Label lbtutorial;
+ private System.Windows.Forms.Timer tmrvisualizer;
+ internal System.Windows.Forms.Panel pgpong;
+ internal System.Windows.Forms.Label lblcountdown;
+ internal System.Windows.Forms.Panel ball;
+ internal System.Windows.Forms.PictureBox paddleHuman;
+ internal System.Windows.Forms.Panel paddleComputer;
+ internal System.Windows.Forms.Label lbllevelandtime;
+ internal System.Windows.Forms.Label lblstatsY;
+ internal System.Windows.Forms.Label lblstatsX;
+ internal System.Windows.Forms.Timer pongGameTimer;
+ internal System.Windows.Forms.Timer counter;
+ internal System.Windows.Forms.Timer tmrcountdown;
}
} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/HackUI.cs b/source/WindowsFormsApplication1/Gameplay/HackUI.cs
index 09841d6..a1c1555 100644
--- a/source/WindowsFormsApplication1/HackUI.cs
+++ b/source/WindowsFormsApplication1/Gameplay/HackUI.cs
@@ -5,6 +5,7 @@ using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@@ -15,17 +16,34 @@ namespace ShiftOS
public HackUI()
{
InitializeComponent();
+ this.TopMost = false;
ThisEnemyHacker = new EnemyHacker("Test Dummy", "A test hacker", "A test hacker", 1, 1, "easy");
}
public event EventHandler OnWin;
+ private bool InOnlineBattle = false;
+ private Online.Hacking.NetTransmitter transmitter = null;
+ private Online.Hacking.NetTransmitter _playerTransmitter = null;
+ private Online.Hacking.NetListener receiver = null;
+ private Online.Hacking.NetListener player_listener = null;
+
public HackUI(EnemyHacker enemy)
{
ThisEnemyHacker = enemy;
InitializeComponent();
}
+ public HackUI(Online.Hacking.NetTransmitter t, Online.Hacking.NetListener l, Online.Hacking.NetListener playerListener, Online.Hacking.NetTransmitter playerTransmitter)
+ {
+ InOnlineBattle = true;
+ transmitter = t;
+ receiver = l;
+ player_listener = playerListener;
+ _playerTransmitter = playerTransmitter;
+ InitializeComponent();
+ }
+
public Computer ThisPlayerPC = null;
private decimal TotalPlayerHP = 0;
private EnemyHacker EnemyNet = null;
@@ -60,6 +78,8 @@ namespace ShiftOS
{
SetupTutorialUI(0);
}
+ if (InOnlineBattle)
+ LoadOnlinePlayer();
}
private void VisualizePlayerNetwork()
@@ -87,7 +107,60 @@ namespace ShiftOS
AddModule(c);
}
}
-
+
+ private void player_listener_ModuleRemoved(object sender, Online.Hacking.Events.ModuleRemoved e)
+ {
+ Computer c = null;
+ foreach (var m in AllPlayerComputers)
+ {
+ if (m.Hostname == e.new_module)
+ {
+ c = m;
+ }
+ }
+ AllPlayerComputers.Remove(c);
+ c.Dispose();
+ }
+
+ private void player_listener_ModuleHealthSet(object sender, Online.Hacking.Events.Health e)
+ {
+ var mod = new Computer();
+ foreach (var m in AllPlayerComputers)
+ {
+ if (m.Hostname == e.host_name)
+ mod = m;
+ }
+ mod.HP = e.health;
+ int old_hp = mod.HP;
+ mod.HP = e.health;
+ if (mod.HP > old_hp)
+ {
+ mod.throw_repaired();
+ }
+ else
+ {
+ mod.throw_damaged();
+ }
+ }
+
+
+ public void LoadOnlinePlayer()
+ {
+ //register event handlers
+ player_listener.ModuleHealthSet += player_listener_ModuleHealthSet;
+ player_listener.ModuleRemoved += player_listener_ModuleRemoved;
+ player_listener.ModuleDisabled += (o, e) =>
+ {
+ foreach (var c in AllPlayerComputers)
+ {
+ if (c.Hostname == e.hostName)
+ {
+ c.Disable();
+ }
+ }
+ };
+ }
+
public List<Computer> AllPlayerComputers = null;
private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
@@ -104,11 +177,16 @@ namespace ShiftOS
{
if (pc.Disabled == false)
{
- if (pc.Enemies != null)
+ var elist = new List<Computer>();
+ if (pc.Enslaved)
+ elist = AllPlayerComputers;
+ else
+ elist = pc.Enemies;
+ if (elist != null)
{
- foreach (var enemy in pc.Enemies)
+ foreach (var enemy in elist)
{
- if (AllEnemyComputers.Contains(enemy))
+ if (enemy != null && enemy.HP > 0)
{
chance = rnd.Next(1, 15);
if (chance == 7)
@@ -150,7 +228,7 @@ namespace ShiftOS
}
if (ThisPlayerPC.HP <= 0)
{
- API.CreateInfoboxSession("System compromised.", "The enemy hacker has overthrown your defenses and compromised your system. You will need to wait an hour before you can start another hack battle.", infobox.InfoboxMode.Info);
+ API.CreateInfoboxSession("System compromised.", "The enemy hacker has overthrown your defenses and compromised your system. You will need to wait until your core heals before beginning another battle.", infobox.InfoboxMode.Info);
Hacking.Failure = true;
Hacking.FailDate = DateTime.Now;
UserRequestedClose = false;
@@ -162,16 +240,35 @@ namespace ShiftOS
private void this_Closing(object sender, FormClosingEventArgs e)
{
+ var t = new Thread(new ThreadStart(() =>
+ {
+ int prev_volume = Audio._wmp.settings.volume;
+ while(Audio._wmp.settings.volume > 0)
+ {
+ Thread.Sleep(100);
+ Audio._wmp.settings.volume -= 1;
+ }
+ Audio.ForceStop();
+ Audio._wmp.settings.volume = prev_volume;
+ }));
+ t.Start();
if (UserRequestedClose == false)
{
- arc.Dispose();
- Computer[] pcs = { };
+ this.TopMost = false;
+ Computer[] pcs = new Computer[AllPlayerComputers.Count];
AllPlayerComputers.CopyTo(pcs);
- foreach(var pc in pcs)
+ foreach (var pc in pcs)
+ {
+ pc?.Dispose();
+ }
+ Computer[] epcs = new Computer[AllEnemyComputers.Count];
+ AllEnemyComputers.CopyTo(epcs);
+ foreach (var epc in epcs)
{
- pc.Dispose();
+ epc?.Dispose();
}
tmrplayerhealthdetect.Stop();
+ tmrenemyhealthdetect.Stop();
Hacking.RepairTimer.Start(); //Now the player can repair.
}
else
@@ -182,14 +279,67 @@ namespace ShiftOS
public Computer SelectedPlayerComputer = null;
+ public Computer module_to_steal = null;
+
public void AddModule(Computer newModule)
{
+ if (InOnlineBattle)
+ {
+ newModule.Transmitter = transmitter;
+ transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.PlaceModule, new Online.Hacking.Module { Grade = newModule.Grade, Hostname = newModule.Hostname, HP = newModule.HP, Type = (int)newModule.Type, X = newModule.Left, Y = newModule.Top });
+ }
pnlyou.Controls.Add(newModule);
int hp = newModule.HP;
WriteLine($"[Network] Welcome to the network, {newModule.Hostname}!");
TotalPlayerHP += newModule.HP;
AllPlayerComputers.Add(newModule);
newModule.Show();
+ if (!InOnlineBattle)
+ {
+ newModule.StolenModule += (o, a) =>
+ {
+ var t = new Thread(new ThreadStart(() =>
+ {
+ var rnd = new Random();
+ var lst = new List<Computer>();
+ if (newModule.Enslaved)
+ lst = AllPlayerComputers;
+ else
+ lst = AllEnemyComputers;
+ WriteLine($"[{newModule.Hostname}] Starting network hack...");
+ Thread.Sleep(5000);
+
+ var pc = lst[rnd.Next(0, lst.Count)];
+ this.Invoke(new Action(() =>
+ {
+ if (pc.Type != SystemType.Core)
+ {
+ module_to_steal = pc;
+
+ pgpong.Left = (this.Width - pgpong.Width) / 2;
+ pgpong.Top = (this.Height - pgpong.Height) / 2;
+
+ pgpong.Show();
+ newgame();
+ }
+ }));
+ }));
+ t.Start();
+ };
+ newModule.EnslavedModule += (o, e) =>
+ {
+ if (!newModule.Enslaved)
+ {
+ var pc = AllEnemyComputers[rand.Next(0, AllEnemyComputers.Count)];
+ if (!pc.Enslaved)
+ {
+ WriteLine($"[{newModule.Hostname}] Successfully enslaved {pc.Hostname}");
+ pc.Enslaved = true;
+ }
+
+ }
+ };
+ }
newModule.OnDestruction += (object s, EventArgs a) =>
{
if (this.SelectedPlayerComputer == newModule)
@@ -203,6 +353,7 @@ namespace ShiftOS
AllPlayerComputers.Remove(newModule);
newModule.Dispose();
WriteLine($"[Network] {newModule.Hostname} has gone OFFLINE.");
+ transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.RemoveModule, newModule.Hostname);
};
newModule.Select += (object s, EventArgs e) =>
{
@@ -268,7 +419,10 @@ namespace ShiftOS
{
newModule.MassDDoS += (object s, EventArgs a) =>
{
- WormToEnemy();
+ if (newModule.Enslaved)
+ WormToPlayer();
+ else
+ WormToEnemy();
};
}
}
@@ -289,6 +443,15 @@ namespace ShiftOS
public void ShowPCInfo(string hostname)
{
+ Computer c = null;
+ foreach (var pc in AllPlayerComputers)
+ {
+ if (pc.Hostname == hostname)
+ {
+ c = pc;
+ }
+ }
+
Module mod = null;
foreach (var m in GetMyNet())
{
@@ -302,7 +465,7 @@ namespace ShiftOS
pnlpcinfo.Left = 7;
pnlpcinfo.Show();
lbmoduletitle.Text = "Module Info - " + hostname;
- lbpcinfo.Text = $"Hostname: {hostname}{Environment.NewLine}Type: {mod.Type.ToString()}";
+ lbpcinfo.Text = $"Hostname: {hostname}{Environment.NewLine}Type: {mod.Type.ToString()}{Environment.NewLine}{Environment.NewLine}";
if (mod.Type == SystemType.Core)
{
lbpcinfo.Text += Environment.NewLine + "This represents your main system. If this module is destroyed, you will automatically lose the battle. Protect it at all costs.";
@@ -322,37 +485,37 @@ namespace ShiftOS
}
btnpoweroff.Show();
}
+
}
- Computer c = null;
- foreach (var pc in AllPlayerComputers)
+ if (c != null)
{
- if (pc.Hostname == hostname)
+ if (c.Enslaved)
{
- c = pc;
+ lbtargets.Text = "*** WARNING ***: This module has been ENSLAVED! Consider a redeploy.";
}
- }
- if (c != null)
- {
- lbtargets.Text = "Targets: ";
- if (c.Enemies != null)
+ else
{
- if (c.Enemies.Count > 0)
+ lbtargets.Text = "Targets: ";
+ if (c.Enemies != null)
{
- foreach (var pc in c.Enemies)
+ if (c.Enemies.Count > 0)
+ {
+ foreach (var pc in c.Enemies)
+ {
+ lbtargets.Text += " " + pc.Hostname + ",";
+ }
+ }
+ else
{
- lbtargets.Text += " " + pc.Hostname + ",";
+ lbtargets.Text += " - Click on an enemy module to target it.";
}
}
else
{
lbtargets.Text += " - Click on an enemy module to target it.";
}
+ lbtargets.Text += Environment.NewLine + "Some modules will not fire at their targets.";
}
- else
- {
- lbtargets.Text += " - Click on an enemy module to target it.";
- }
- lbtargets.Text += Environment.NewLine + "Some modules will not fire at their targets.";
}
}
@@ -414,7 +577,7 @@ namespace ShiftOS
lbcompromised.Location = new Point(location, y);
lbcompromised.Show();
c.Flash(lbcompromised);
-
+ transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
}
@@ -428,6 +591,8 @@ namespace ShiftOS
lbcompromised.Location = new Point(location, y);
lbcompromised.Show();
c.Flash(lbcompromised);
+ transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
+
}
private void btnaddmodule_Click(object sender, EventArgs e)
@@ -514,7 +679,7 @@ namespace ShiftOS
{
SystemType type = FutureModules[cmbmodules.Text];
}
- catch (Exception ex)
+ catch
{
cont = false;
API.CreateInfoboxSession("Error", "Please select a module type.", infobox.InfoboxMode.Info);
@@ -680,7 +845,7 @@ namespace ShiftOS
}
SetupModuleInfo();
}
- catch (Exception ex)
+ catch
{
txtgrade.Text = "1";
SetupModuleInfo();
@@ -982,21 +1147,28 @@ namespace ShiftOS
private void HackUI_Load(object sender, EventArgs e)
{
- Hacking.RepairTimer.Stop(); //Don't want the player to be able to repair dead modules during a battle!
- this.TopMost = true;
- arc = new AudioResourceClient("HackerBattle");
- arc.SongFinished += (object s, EventArgs a) =>
+ this.TopMost = false;
+ Audio.Stopped += (o, a) =>
{
- arc.PlayRandom();
+ if (this != null)
+ {
+ Audio.Play("hackerbattle_ambient");
+ }
};
- arc.PlayRandom();
+ Audio.Play("hackerbattle_ambient");
+
+ Hacking.RepairTimer.Stop(); //Don't want the player to be able to repair dead modules during a battle!
this.WindowState = FormWindowState.Maximized;
- //this.TopMost = true;
LoadPlayerScreen();
- LoadEnemyScreen();
+ if (InOnlineBattle)
+ LoadOnlineEnemy();
+ else
+ LoadEnemyScreen();
+ tmrvisualizer.Interval = 10;
+ tmrvisualizer.Start();
}
- #region ENEMY
+ #region ENEMY
private EnemyHacker ThisEnemyHacker { get; set; }
public List<Computer> AllEnemyComputers = null;
public Computer ThisEnemyPC { get; set; }
@@ -1005,7 +1177,7 @@ namespace ShiftOS
AllEnemyComputers = new List<Computer>();
VisualizeEnemyNetwork();
tmrenemyhealthdetect.Start();
- ThisEnemyPC.Enemy = true;
+ ThisEnemyPC.Enemy = !InOnlineBattle;
}
private void VisualizeEnemyNetwork()
@@ -1028,10 +1200,13 @@ namespace ShiftOS
public void Enemy_System_Attacking(object s, EventArgs a)
{
- int i = new Random().Next(AllPlayerComputers.Count);
- var pc = AllPlayerComputers[i];
- var se = (Computer)s;
- pc.LaunchAttack(se.GetProperType());
+ if (!InOnlineBattle)
+ {
+ int i = new Random().Next(AllPlayerComputers.Count);
+ var pc = AllPlayerComputers[i];
+ var se = (Computer)s;
+ pc.LaunchAttack(se.GetProperType());
+ }
}
public Computer SelectedEnemyComputer = null;
@@ -1056,6 +1231,49 @@ namespace ShiftOS
int hp = newModule.HP;
TotalEnemyHP += (decimal)newModule.HP;
newModule.Show();
+
+ newModule.StolenModule += (o, a) =>
+ {
+ var t = new Thread(new ThreadStart(() =>
+ {
+ var lst = new List<Computer>();
+ if (!newModule.Enslaved)
+ lst = AllPlayerComputers;
+ else
+ lst = AllEnemyComputers;
+ WriteLine_Enemy($"[{newModule.Hostname}] Starting network hack...");
+ Thread.Sleep(5000);
+
+ var pc = lst[rnd.Next(0, lst.Count)];
+ this.Invoke(new Action(() =>
+ {
+ if (pc.Type != SystemType.Core)
+ {
+ module_to_steal = pc;
+
+ pgpong.Left = (this.Width - pgpong.Width) / 2;
+ pgpong.Top = (this.Height - pgpong.Height) / 2;
+
+ pgpong.Show();
+ newgame();
+ }
+ }));
+ }));
+ t.Start();
+ };
+ newModule.EnslavedModule += (o, e) =>
+ {
+ if (!newModule.Enslaved)
+ {
+ var pc = AllPlayerComputers[rand.Next(0, AllPlayerComputers.Count)];
+ if (!pc.Enslaved)
+ {
+ WriteLine_Enemy($"[{newModule.Hostname}] Successfully enslaved {pc.Hostname}");
+ pc.Enslaved = true;
+ }
+
+ }
+ };
newModule.OnDestruction += (object s, EventArgs a) =>
{
if (this.SelectedEnemyComputer == newModule)
@@ -1134,15 +1352,19 @@ namespace ShiftOS
{
newModule.MassDDoS += (object s, EventArgs a) =>
{
- WormToPlayer();
+ if (newModule.Enslaved)
+ WormToEnemy();
+ else
+ WormToPlayer();
};
}
+ newModule.Enemy = !InOnlineBattle;
}
public void Enemy_Firewall_Deflect(Computer fwall)
{
//Safeguard... also apparently I can't spell... because this used to be 'Safegaurd'...
- if (fwall.Type == SystemType.Firewall)
+ if (fwall.Enslaved == false && fwall.Type == SystemType.Firewall)
{
var r = fwall.GetAreaOfEffect();
foreach (var pc in AllEnemyComputers)
@@ -1197,7 +1419,7 @@ namespace ShiftOS
lbenemycompromised.Location = new Point(location, y);
lbenemycompromised.Show();
c.Flash(lbenemycompromised);
-
+ _playerTransmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
}
@@ -1212,57 +1434,62 @@ namespace ShiftOS
lbenemycompromised.Location = new Point(location, y);
lbenemycompromised.Show();
c.Flash(lbenemycompromised);
+ _playerTransmitter?.send_message(Online.Hacking.NetTransmitter.Messages.SetHealth, $"{c.Hostname} {c.HP}");
}
private decimal TotalEnemyHP = 0;
private void tmrenemyhealthdetect_Tick(object sender, EventArgs e)
{
- lbsong.Visible = Audio.Enabled;
- btntogglemusic.Visible = Audio.Enabled;
+ lbsong.Visible = true;
+ btntogglemusic.Visible = true;
- if(arc != null)
- {
- lbsong.Text = $"Ross Bugden - {arc.CurrentSong}";
- }
+ lbsong.Text = Audio.Name + " @ " + Audio.CurrentPosition;
decimal health = 0;
lbcodepoints.Text = $"Codepoints: {API.Codepoints}";
var rnd = new Random();
int chance = 0;
- foreach (var pc in AllEnemyComputers)
+ if (!InOnlineBattle)
{
- if (pc.Disabled == false)
+ foreach (var pc in AllEnemyComputers)
{
- foreach (var enemy in AllPlayerComputers)
+ if (pc.Disabled == false)
{
- chance = rnd.Next(1, 20);
- if (chance == 10)
+ var elist = new List<Computer>();
+ if (pc.Enslaved)
+ elist = AllEnemyComputers;
+ else
+ elist = AllPlayerComputers;
+ foreach (var enemy in elist)
{
- if (IsTutorial)
+ chance = rnd.Next(1, 20);
+ if (chance == 10)
{
- if (TutorialProgress == 9)
- {
- ThisPlayerPC.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- else if (TutorialProgress == 32)
+ if (IsTutorial)
{
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
+ if (TutorialProgress == 9)
+ {
+ ThisPlayerPC.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
+ }
+ else if (TutorialProgress == 32)
+ {
+ enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
+ }
+ else
+ {
+ enemy.Enemies.Clear();
+ }
}
else
{
- enemy.Enemies.Clear();
+ enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
}
}
- else
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
}
}
}
}
-
foreach (var pc in AllEnemyComputers)
{
health += (decimal)pc.HP;
@@ -1282,7 +1509,7 @@ namespace ShiftOS
string message = "You have successfully beaten the enemy hacker.";
if (ThisEnemyHacker.IsLeader == false)
{
- switch(rnd.Next(0, 5))
+ switch(rnd.Next(0, 6))
{
case 1:
API.AddCodepoints(1000);
@@ -1305,6 +1532,15 @@ namespace ShiftOS
var name = ThisEnemyHacker.Name;
Hacking.AddCharacter(new Character(name, desc, skill, speed, 0));
break;
+ case 5:
+ var cats = SaveSystem.ShiftoriumRegistry.GetCategories(false);
+ string cat = cats[rnd.Next(0, cats.Count - 1)];
+ if (API.Upgrades[cat] == false)
+ {
+ API.Upgrades[cat] = true;
+ message = $"You have beaten the enemy, and as a result, the {cat.ToUpper()} Shiftorium category has been unlocked.";
+ }
+ break;
default:
message = "You have successfully beaten the enemy hacker.";
break;
@@ -1344,42 +1580,533 @@ namespace ShiftOS
public void WriteLine_Enemy(string text)
{
- if(txtenemyconsole.Text.Length == 0)
+ try
{
- txtenemyconsole.Text = text + Environment.NewLine;
+ if (txtenemyconsole.Text.Length == 0)
+ {
+ txtenemyconsole.Text = text + Environment.NewLine;
+ }
+ else
+ {
+ txtenemyconsole.Text += text + Environment.NewLine;
+ }
+ txtenemyconsole.Select(txtenemyconsole.TextLength, 0);
+ txtenemyconsole.ScrollToCaret();
}
- else
+ catch
{
- txtenemyconsole.Text += text + Environment.NewLine;
+ this.Invoke(new Action(() => { WriteLine_Enemy(text); }));
}
- txtenemyconsole.Select(txtenemyconsole.TextLength, 0);
- txtenemyconsole.ScrollToCaret();
}
public void WriteLine(string text)
{
- if (txtyourconsole.Text.Length == 0)
+ try
+ {
+ if (txtyourconsole.Text.Length == 0)
+ {
+ txtyourconsole.Text = text + Environment.NewLine;
+ }
+ else
+ {
+ txtyourconsole.Text += text + Environment.NewLine;
+ }
+ txtyourconsole.Select(txtyourconsole.TextLength, 0);
+ txtyourconsole.ScrollToCaret();
+ }
+ catch
+ {
+ this.Invoke(new Action(() => { WriteLine(text); }));
+ }
+ }
+
+ #endregion
+
+ #region ONLINE ENEMY
+
+ public void LoadOnlineEnemy()
+ {
+ AllEnemyComputers = new List<Computer>();
+ tmrenemyhealthdetect.Start();
+ //register event handlers
+ receiver.ModuleHealthSet += Receiver_ModuleHealthSet;
+ receiver.ModulePlaced += Receiver_ModulePlaced;
+ receiver.ModuleUpgraded += Receiver_ModuleUpgraded;
+ receiver.ModuleRemoved += Receiver_ModuleRemoved;
+ receiver.ModuleDisabled += (o, e) =>
+ {
+ foreach(var c in AllEnemyComputers)
+ {
+ if(c.Hostname == e.hostName)
+ {
+ c.Disable();
+ }
+ }
+ };
+ receiver.Won += (o, e) =>
+ {
+ //the enemy won!
+ tmrplayerhealthdetect.Stop();
+ tmrenemyhealthdetect.Stop();
+ //dispose all the modules.
+ while(AllPlayerComputers.Count > 0)
+ {
+ AllPlayerComputers[0].Dispose();
+ AllPlayerComputers.RemoveAt(0);
+ }
+ while (AllEnemyComputers.Count > 0)
+ {
+ AllEnemyComputers[0].Dispose();
+ AllEnemyComputers.RemoveAt(0);
+ }
+ //Destroy server connection.
+ Online.Hacking.Matchmaker.DestroySession();
+ //Display win message.
+ API.CreateInfoboxSession($"{e.Winner.Name} won.", $"{e.Winner.Name} has overthrown your defenses and compromised your system.", infobox.InfoboxMode.Info);
+ //Kill the hacker UI.
+ UserRequestedClose = false;
+ this.Close();
+ };
+ }
+
+ private void Receiver_ModuleRemoved(object sender, Online.Hacking.Events.ModuleRemoved e)
+ {
+ Computer c = null;
+ foreach(var m in AllEnemyComputers)
+ {
+ if(m.Hostname == e.new_module)
+ {
+ c = m;
+ }
+ }
+ AllEnemyComputers.Remove(c);
+ c.Dispose();
+ }
+
+ private void Receiver_ModuleUpgraded(object sender, Online.Hacking.Events.ModuleUpgraded e)
+ {
+ foreach(var m in AllEnemyComputers)
+ {
+ if (m.Hostname == e.hostname)
+ m.Grade = e.grade;
+ }
+ }
+
+ private void Receiver_ModulePlaced(object sender, Online.Hacking.Events.ModulePlaced e)
+ {
+ var newModule = new Module((SystemType)e.new_module.Type, e.new_module.Grade, e.new_module.Hostname);
+ newModule.HP = e.new_module.HP;
+ newModule.X = e.new_module.X;
+ newModule.Y = e.new_module.Y;
+ AddEnemyModule(newModule.Deploy());
+ }
+
+ private void Receiver_ModuleHealthSet(object sender, Online.Hacking.Events.Health e)
+ {
+ var mod = new Computer();
+ foreach(var m in AllEnemyComputers)
{
- txtyourconsole.Text = text + Environment.NewLine;
+ if (m.Hostname == e.host_name)
+ mod = m;
+ }
+ int old_hp = mod.HP;
+ mod.HP = e.health;
+ if(mod.HP > old_hp)
+ {
+ mod.throw_repaired();
}
else
{
- txtyourconsole.Text += text + Environment.NewLine;
+ mod.throw_damaged();
}
- txtyourconsole.Select(txtyourconsole.TextLength, 0);
- txtyourconsole.ScrollToCaret();
}
#endregion
- AudioResourceClient arc = null;
- bool musicenabled = true;
+ bool playing = true;
private void button2_Click(object sender, EventArgs e)
{
- arc.Pause();
+ if (playing == true)
+ {
+ Audio.ForceStop();
+ }
+ else
+ {
+ Audio.Play("hackerbattle_ambient");
+ }
+ playing = !playing;
}
-
+ Panel winningPlayfield = null;
+
+ int bgcol = 0;
+ int pulse = 0;
+ Panel losingPlayfield = null;
+ private void tmrvisualizer_Tick(object sender, EventArgs e)
+ {
+ int enemy_hp = 0;
+ int player_hp = 0;
+ foreach(var p in AllPlayerComputers)
+ {
+ player_hp += p.HP;
+ }
+ foreach (var p in AllEnemyComputers)
+ {
+ enemy_hp += p.HP;
+ }
+
+ if (player_hp >= enemy_hp)
+ {
+ winningPlayfield = pnlyou;
+ losingPlayfield = pnlenemy;
+ }
+ else
+ {
+ winningPlayfield = pnlenemy;
+ losingPlayfield = pnlyou;
+ }
+
+ losingPlayfield.BackColor = Color.Black;
+
+
+ try
+ {
+ var visualizer = Audio.GetVisualizer();
+ switch(visualizer.type)
+ {
+ case VisualizerType.Pulse:
+ tmrvisualizer.Interval = 1;
+ if(pulse == 0)
+ {
+ if(bgcol < 255)
+ {
+ bgcol += 10;
+ }
+ else
+ {
+ pulse = 1;
+ }
+ }
+ else
+ {
+ if(bgcol > 0)
+ {
+ bgcol -= 10;
+ }
+ else
+ {
+ pulse = 0;
+ }
+ }
+ break;
+ case VisualizerType.CalmDown:
+ bgcol = 255 - MathEx.LinearInterpolate(visualizer.startTime * 100, visualizer.endTime * 100, Audio.CurrentPositionMS, 0, 255);
+ break;
+ case VisualizerType.BuildUp:
+ bgcol = MathEx.LinearInterpolate(visualizer.startTime, visualizer.endTime, Audio.CurrentPosition, 0, 255);
+ break;
+ }
+ Color c = new Color();
+ int r = 0;
+ int g = 0;
+ int b = 0;
+ if (visualizer.R)
+ r = bgcol;
+ if (visualizer.G)
+ g = bgcol;
+ if (visualizer.B)
+ b = bgcol;
+ c = Color.FromArgb(r, g, b);
+ if(playing)
+ winningPlayfield.BackColor = c;
+ }
+ catch
+ {
+
+ }
+ }
+
+ private void pongMain_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
+ {
+ paddleHuman.Location = new Point(paddleHuman.Location.X, (MousePosition.Y - pgpong.Location.Y) - (paddleHuman.Height / 2));
+ }
+
+
+ private void pongGameTimer_Tick(object sender, EventArgs e)
+ {
+ //Set the computer player to move according to the ball's position.
+ if (ball.Location.X > 500 - xVel * 10 && xVel > 0)
+ {
+ if (ball.Location.Y > paddleComputer.Location.Y + 50)
+ {
+ paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed * 2 + ((int)yveldec / 2));
+ }
+ if (ball.Location.Y < paddleComputer.Location.Y + 50)
+ {
+ paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed * 2 + ((int)yveldec / 2));
+ }
+ casualposition = rand.Next(-150, 201);
+ }
+
+ //Set Xvel and Yvel speeds from decimal
+ if (xVel > 0)
+ xVel = (int)Math.Round(xveldec);
+ if (xVel < 0)
+ xVel = (int)-Math.Round(xveldec);
+ if (yVel > 0)
+ yVel = (int)Math.Round(yveldec);
+ if (yVel < 0)
+ yVel = (int)-Math.Round(yveldec);
+
+ // Move the game ball.
+ ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
+
+ // Check for top wall.
+ if (ball.Location.Y < 0)
+ {
+ ball.Location = new Point(ball.Location.X, 0);
+ yVel = -yVel;
+ }
+
+ // Check for bottom wall.
+ if (ball.Location.Y > pgpong.Height - ball.Height)
+ {
+ ball.Location = new Point(ball.Location.X, pgpong.Height - ball.Size.Height);
+ yVel = -yVel;
+ }
+
+ // Check for player paddle.
+ if (ball.Bounds.IntersectsWith(paddleHuman.Bounds))
+ {
+ ball.Location = new Point(paddleHuman.Location.X + ball.Size.Width, ball.Location.Y);
+ //randomly increase x or y speed of ball
+ switch (rand.Next(1, 3))
+ {
+ case 1:
+ xveldec = xveldec + incrementx;
+ break;
+ case 2:
+ if (yveldec > 0)
+ yveldec = yveldec + incrementy;
+ if (yveldec < 0)
+ yveldec = yveldec - incrementy;
+ break;
+ }
+ xVel = -xVel;
+ }
+
+ // Check for computer paddle.
+ if (ball.Bounds.IntersectsWith(paddleComputer.Bounds))
+ {
+ ball.Location = new Point(paddleComputer.Location.X - paddleComputer.Size.Width + 1, ball.Location.Y);
+ xveldec = xveldec + incrementx;
+ xVel = -xVel;
+ }
+
+ // Check for left wall.
+ if (ball.Location.X < -100)
+ {
+ var m = module_to_steal;
+ if (m.Enemy)
+ AllEnemyComputers.Remove(m);
+
+ var lst = new List<Module>();
+ if (!m.Enemy)
+ lst = MyNetwork;
+ else
+ lst = ThisEnemyHacker.Network;
+
+ string hn = m.Hostname;
+
+ Module mod = null;
+ foreach(var pc in lst)
+ {
+ if(pc.Hostname == hn)
+ {
+ mod = pc;
+ }
+ }
+
+ if (!AllPlayerComputers.Contains(m))
+ AddModule(mod.Deploy());
+
+ if(!Hacking.MyNetwork.Contains(mod))
+ {
+ Hacking.MyNetwork.Add(mod);
+ }
+
+ if(module_to_steal.Parent != pnlyou)
+ {
+ module_to_steal.Parent.Controls.Remove(module_to_steal);
+ module_to_steal.Dispose();
+ }
+ tmrcountdown.Stop();
+ pongGameTimer.Stop();
+ counter.Stop();
+ pgpong.Hide();
+ }
+
+ // Check for right wall.
+ if (ball.Location.X > pgpong.Width - ball.Size.Width - paddleComputer.Width + 100)
+ {
+ var m = module_to_steal;
+ if (!m.Enemy)
+ AllPlayerComputers.Remove(m);
+
+ var lst = new List<Module>();
+ if (!m.Enemy)
+ lst = MyNetwork;
+ else
+ lst = ThisEnemyHacker.Network;
+
+ string hn = m.Hostname;
+
+ Module mod = null;
+ foreach (var pc in lst)
+ {
+ if (pc.Hostname == hn)
+ {
+ mod = pc;
+ }
+ }
+
+ if (!AllEnemyComputers.Contains(m))
+ AddEnemyModule(mod.Deploy());
+
+ if (!ThisEnemyHacker.Network.Contains(mod))
+ {
+ ThisEnemyHacker.Network.Add(mod);
+ }
+
+ if (module_to_steal.Parent != pnlenemy)
+ {
+ module_to_steal.Parent.Controls.Remove(module_to_steal);
+ module_to_steal.Dispose();
+ }
+ tmrcountdown.Stop();
+ pongGameTimer.Stop();
+ counter.Stop();
+ pgpong.Hide();
+ }
+
+ //lblstats.Text = "Xspeed: " & Math.Abs(xVel) & " Yspeed: " & Math.Abs(yVel) & " Human Location: " & paddleHuman.Location.ToString & " Computer Location: " & paddleComputer.Location.ToString & Environment.NewLine & " Ball Location: " & ball.Location.ToString & " Xdec: " & xveldec & " Ydec: " & yveldec & " Xinc: " & incrementx & " Yinc: " & incrementy
+ lblstatsX.Text = "Xspeed: " + xveldec;
+ lblstatsY.Text = "Yspeed: " + yveldec;
+
+ lbllevelandtime.Text = "Level: " + level;
+
+ if (xVel > 20 || xVel < -20)
+ {
+ paddleHuman.Width = Math.Abs(xVel);
+ paddleComputer.Width = Math.Abs(xVel);
+ }
+ else
+ {
+ paddleHuman.Width = 20;
+ paddleComputer.Width = 20;
+ }
+
+ computerspeed = Math.Abs(yVel);
+
+ // pgcontents.Refresh()
+ // pgcontents.CreateGraphics.FillRectangle(Brushes.Black, ball.Location.X, ball.Location.Y, ball.Width, ball.Height)
+
+ }
+
+ #region pong visualizer variables
+
+ Random rand = new Random();
+ int xVel = 7;
+ int yVel = 8;
+ int computerspeed = 8;
+ int level = 1;
+ int secondsleft = 60;
+ int casualposition;
+ double xveldec = 3.0;
+ double yveldec = 3.0;
+ double incrementx = 0.4;
+ double incrementy = 0.2;
+ int levelxspeed = 3;
+ int levelyspeed = 3;
+ int[] levelrewards = new int[50];
+ int countdown = 3;
+
+ #endregion
+
+ private void counter_Tick(object sender, EventArgs e)
+ {
+ secondsleft = secondsleft - 1;
+ if (secondsleft == -1)
+ {
+ secondsleft = 60;
+ level = level + 1;
+ }
+ }
+
+ private void tmrcountdown_Tick(object sender, EventArgs e)
+ {
+ switch (countdown)
+ {
+ case 0:
+ countdown = 3;
+ lblcountdown.Hide();
+ pongGameTimer.Start();
+ counter.Start();
+ tmrcountdown.Stop();
+ break;
+ case 1:
+ lblcountdown.Text = "1";
+ countdown = countdown - 1;
+ break;
+ case 2:
+ lblcountdown.Text = "2";
+ countdown = countdown - 1;
+ break;
+ case 3:
+ lblcountdown.Text = "3";
+ countdown = countdown - 1;
+ lblcountdown.Show();
+ break;
+ }
+
+ }
+
+ private void newgame()
+ {
+ level = 1;
+ secondsleft = 60;
+ //reset stats text
+ lblstatsX.Text = "Xspeed: ";
+ lblstatsY.Text = "Yspeed: ";
+
+ levelxspeed = 3;
+ levelyspeed = 3;
+
+ incrementx = 0.4;
+ incrementy = 0.2;
+
+ xveldec = levelxspeed;
+ yveldec = levelyspeed;
+
+ tmrcountdown.Start();
+ if (xVel < 0)
+ xVel = Math.Abs(xVel);
+ lbllevelandtime.Text = "Level: " + level + " - " + secondsleft + " Seconds Left";
+ }
+ }
+}
+
+namespace System
+{
+ public class MathEx
+ {
+ public static int LinearInterpolate(int input_start, int input_end, int input, int output_start, int output_end)
+ {
+ int input_range = input_end - input_start;
+ int output_range = output_end - output_start;
+
+ return (input - input_start) * output_range / input_range + output_start;
+ }
}
}
diff --git a/source/WindowsFormsApplication1/HackUI.resx b/source/WindowsFormsApplication1/Gameplay/HackUI.resx
index 7ec36cf..9def72b 100644
--- a/source/WindowsFormsApplication1/HackUI.resx
+++ b/source/WindowsFormsApplication1/Gameplay/HackUI.resx
@@ -162,4 +162,16 @@ If you would like to buy a new module, click 'Buy new module'.</value>
<metadata name="tmrredraw.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>191, 17</value>
</metadata>
+ <metadata name="tmrvisualizer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>238, 42</value>
+ </metadata>
+ <metadata name="pongGameTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>358, 42</value>
+ </metadata>
+ <metadata name="counter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>501, 42</value>
+ </metadata>
+ <metadata name="tmrcountdown.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>594, 42</value>
+ </metadata>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Hacking.cs b/source/WindowsFormsApplication1/Gameplay/Hacking.cs
index ba54532..7b18852 100644
--- a/source/WindowsFormsApplication1/Hacking.cs
+++ b/source/WindowsFormsApplication1/Gameplay/Hacking.cs
@@ -139,7 +139,7 @@ namespace ShiftOS
f.Font = new Font(OSInfo.GetMonospaceFont(), 9);
var l = new Label();
int p = 0;
- int speed = 100000 / h.Speed; //If a hacker has a speed of one, it will take 100,000 milliseconds to move 1% in the hack progress. Divide it by a thousand, you get 10,000 seconds.
+ int speed = 10000 / h.Speed; //If a hacker has a speed of one, it will take 10,000 milliseconds to move 1% in the hack progress. Divide it by a thousand, you get 1,000 seconds.
var t = new Timer();
t.Interval = speed;
f.FormBorderStyle = FormBorderStyle.None;
@@ -169,7 +169,7 @@ namespace ShiftOS
{
l.Text = $"Progress: {p}%";
int fail = new Random().Next(0, h.Skill * h.Speed);
- if (fail == h.Skill / 2)
+ if (fail == 1)
{
l.Text = "Hack failed.";
}
@@ -201,6 +201,8 @@ namespace ShiftOS
{
var lst = new List<FutureModule>();
lst.Add(new FutureModule("Antivirus", 15, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
+ lst.Add(new FutureModule("Enslaver", 75, "The Enslaver is a scary module for an opposing network. At any time, the Enslaver can take over any module on the enemy network and turn it against them.", SystemType.Enslaver));
+ lst.Add(new FutureModule("Module Thief", 100, "The Module Thief can hack into the enemy's network and attempt to steal one of their modules and bring them into your network temporarily though. Be careful though, it might not work all the time!", SystemType.ModuleStealer));
lst.Add(new FutureModule("Dedicated DDoS module", 10, "This module will attempt to disable the enemy network by sending a DDoS attack allowing you to take a breather.", SystemType.DedicatedDDoS));
lst.Add(new FutureModule("Turret", 5, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
lst.Add(new FutureModule("Firewall", 20, "Will decrease the amount of damage taken by any module within it's area of effect. The higher the grade, the bigger the area of effect and more protection it offers.", SystemType.Firewall));
@@ -228,7 +230,7 @@ namespace ShiftOS
f.Font = new Font(OSInfo.GetMonospaceFont(), 9);
var l = new Label();
int p = 0;
- int speed = 100000 / h.Speed; //If a hacker has a speed of one, it will take 100,000 milliseconds to move 1% in the hack progress. Divide it by a thousand, you get 10,000 seconds.
+ int speed = 10000 / h.Speed; //If a hacker has a speed of one, it will take 10,000 milliseconds to move 1% in the hack progress. Divide it by a thousand, you get 1,000 seconds.
var t = new Timer();
t.Interval = speed;
f.FormBorderStyle = FormBorderStyle.None;
@@ -257,8 +259,8 @@ namespace ShiftOS
if (p <= 100)
{
l.Text = $"Progress: {p}%";
- int fail = new Random().Next(0, h.Skill + h.Speed);
- if (fail == h.Skill / 2)
+ int fail = new Random().Next(0, h.Skill * h.Speed);
+ if (fail == 1)
{
l.Text = "Hack failed.";
}
@@ -342,7 +344,7 @@ namespace ShiftOS
break;
}
}
- catch(Exception ex)
+ catch
{
t.Stop();
var tr = new Terminal();
@@ -553,6 +555,15 @@ namespace ShiftOS
/// </summary>
public static void SaveCharacters()
{
+ if (MyNetwork == null)
+ {
+ MyNetwork = new List<Module>();
+ var c = new Module(SystemType.Core, 1, "localhost");
+ c.HP = 100; //bugfix: core not appearing during battle on new save
+ c.X = 0;
+ c.Y = 0;
+ MyNetwork.Add(c);
+ }
File.WriteAllText(Paths.SystemDir + "_hackers.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(Characters)));
File.WriteAllText(Paths.SystemDir + "_hacktools.json", API.Encryption.Encrypt(JsonConvert.SerializeObject(Tools)));
File.WriteAllText(Paths.Drivers + "Network.dri", API.Encryption.Encrypt(JsonConvert.SerializeObject(MyNetwork)));
diff --git a/source/WindowsFormsApplication1/HijackScreen.Designer.cs b/source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs
index 12e30ab..12e30ab 100644
--- a/source/WindowsFormsApplication1/HijackScreen.Designer.cs
+++ b/source/WindowsFormsApplication1/Gameplay/HijackScreen.Designer.cs
diff --git a/source/WindowsFormsApplication1/HijackScreen.cs b/source/WindowsFormsApplication1/Gameplay/HijackScreen.cs
index e234514..e234514 100644
--- a/source/WindowsFormsApplication1/HijackScreen.cs
+++ b/source/WindowsFormsApplication1/Gameplay/HijackScreen.cs
diff --git a/source/WindowsFormsApplication1/HijackScreen.resx b/source/WindowsFormsApplication1/Gameplay/HijackScreen.resx
index 89116b6..89116b6 100644
--- a/source/WindowsFormsApplication1/HijackScreen.resx
+++ b/source/WindowsFormsApplication1/Gameplay/HijackScreen.resx
diff --git a/source/WindowsFormsApplication1/Hacking_Enemy.Designer.cs b/source/WindowsFormsApplication1/Hacking_Enemy.Designer.cs
deleted file mode 100644
index 5d83abd..0000000
--- a/source/WindowsFormsApplication1/Hacking_Enemy.Designer.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-namespace ShiftOS
-{
- partial class Hacking_Enemy
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.panel1 = new System.Windows.Forms.Panel();
- this.lbcompromised = new System.Windows.Forms.Label();
- this.lbstats = new System.Windows.Forms.Label();
- this.tmrhealthdetect = new System.Windows.Forms.Timer(this.components);
- this.panel1.SuspendLayout();
- this.SuspendLayout();
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Black;
- this.panel1.Controls.Add(this.lbcompromised);
- this.panel1.Controls.Add(this.lbstats);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel1.Font = new System.Drawing.Font("Lucida Console", 8.25F);
- this.panel1.ForeColor = System.Drawing.Color.White;
- this.panel1.Location = new System.Drawing.Point(0, 0);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(872, 458);
- this.panel1.TabIndex = 1;
- //
- // lbcompromised
- //
- this.lbcompromised.AutoSize = true;
- this.lbcompromised.Location = new System.Drawing.Point(242, 174);
- this.lbcompromised.Name = "lbcompromised";
- this.lbcompromised.Size = new System.Drawing.Size(47, 11);
- this.lbcompromised.TabIndex = 1;
- this.lbcompromised.Text = "label1";
- this.lbcompromised.Visible = false;
- //
- // lbstats
- //
- this.lbstats.AutoSize = true;
- this.lbstats.Location = new System.Drawing.Point(13, 13);
- this.lbstats.Name = "lbstats";
- this.lbstats.Size = new System.Drawing.Size(131, 11);
- this.lbstats.TabIndex = 0;
- this.lbstats.Text = "Enemy Health: 100%";
- //
- // tmrhealthdetect
- //
- this.tmrhealthdetect.Tick += new System.EventHandler(this.tmrhealthdetect_Tick);
- //
- // Hacking_Enemy
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(872, 458);
- this.Controls.Add(this.panel1);
- this.Name = "Hacking_Enemy";
- this.Text = "Hacking_Enemy";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.this_Closing);
- this.Load += new System.EventHandler(this.Hacking_Enemy_Load);
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.Label lbstats;
- private System.Windows.Forms.Timer tmrhealthdetect;
- private System.Windows.Forms.Label lbcompromised;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Hacking_Enemy.cs b/source/WindowsFormsApplication1/Hacking_Enemy.cs
deleted file mode 100644
index 8cec39f..0000000
--- a/source/WindowsFormsApplication1/Hacking_Enemy.cs
+++ /dev/null
@@ -1,322 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class Hacking_Enemy : Form
- {
- public Hacking_Enemy(Hacking_YourHealth enemy, EnemyHacker thisHacker)
- {
- ThisHacker = thisHacker;
- Enemy = enemy;
- InitializeComponent();
- }
-
- private EnemyHacker ThisHacker { get; set; }
- public Hacking_YourHealth Enemy { get; set; }
- public List<Computer> AllComputers = null;
- public Computer ThisPC { get; set; }
- private void Hacking_Enemy_Load(object sender, EventArgs e)
- {
- AllComputers = new List<Computer>();
- VisualizeNetwork();
- tmrhealthdetect.Start();
- ThisPC.Enemy = true;
- }
-
- private void VisualizeNetwork()
- {
- var rnd = new Random();
- foreach (Module m in ThisHacker.Network)
- {
- var c = m.Deploy();
- if (c.Type == SystemType.Core)
- {
- ThisPC = c;
- ThisPC.EnemyComputer = Enemy.ThisPC;
- Enemy.ThisPC.EnemyComputer = ThisPC;
- }
- c.Location = new Point(rnd.Next(100, 350), rnd.Next(100, 350));
- AddModule(c);
- }
- }
-
- public void System_Attacking(object s, EventArgs a)
- {
- int i = new Random().Next(Enemy.AllComputers.Count);
- var pc = Enemy.AllComputers[i];
- var se = (Computer)s;
- pc.LaunchAttack(se.GetProperType());
- }
-
- public Computer SelectedComputer = null;
-
- public void AddModule(Computer newModule)
- {
- var rnd = new Random();
- panel1.Controls.Add(newModule);
- foreach(var pc in AllComputers)
- {
- while (newModule.Bounds.IntersectsWith(pc.Bounds))
- {
- newModule.Location = new Point(rnd.Next(100, 350), rnd.Next(100, 350));
- }
- }
- AllComputers.Add(newModule);
- int hp = newModule.HP;
- TotalHP += (decimal)newModule.HP;
- newModule.Show();
- newModule.OnDestruction += (object s, EventArgs a) =>
- {
- if(this.SelectedComputer == newModule)
- {
- SelectedComputer = null;
- }
- AllComputers.Remove(newModule);
- newModule.Dispose();
- };
- newModule.Select += (object s, EventArgs a) =>
- {
- bool c = true;
- foreach(var pc in Enemy.SelectedComputer.Enemies)
- {
- if(pc.Hostname == newModule.Hostname)
- {
- c = false;
- }
- }
- if (c == true)
- {
- Enemy.SelectedComputer.Enemies.Add(newModule);
- Enemy.ShowPCInfo(Enemy.SelectedComputer.Hostname);
- if(Enemy.IsTutorial)
- {
- if(Enemy.TutorialProgress == 9)
- {
- Enemy.SetupTutorialUI(10);
- }
- }
- }
- };
- newModule.HP_Decreased += new EventHandler(System_Damaged);
- newModule.OnRepair += new EventHandler(System_Repaired);
- if (newModule.Type == SystemType.Antivirus)
- {
- var b = newModule.GetAreaOfEffect();
- newModule.AntivirusRepair += (object s, EventArgs a) =>
- {
- foreach (Computer pc in AllComputers)
- {
- if (pc != newModule && pc.Bounds.IntersectsWith(b))
- {
- if (newModule.Type == SystemType.RepairModule)
- {
- if (pc.HP < newModule.HP)
- {
- if (pc.HP < pc.GetTotal())
- {
- pc.Repair(1);
- }
- }
-
- }
- else {
- if (pc.HP < 10)
- {
- pc.Repair(1);
- }
- }
- }
- }
- };
- }
- if (newModule.Type == SystemType.Firewall)
- {
- panel1.Refresh();
- Firewall_Deflect(newModule);
- }
- if (newModule.Type == SystemType.ServerStack)
- {
- newModule.MassDDoS += (object s, EventArgs a) =>
- {
- Enemy.Worm();
- };
- }
- }
-
- public void Firewall_Deflect(Computer fwall)
- {
- //Safegaurd...
- if (fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllComputers)
- {
- if (pc != fwall)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = fwall.Grade;
- }
- }
- }
- }
- }
-
- public void Firewall_Destroy(Computer fwall)
- {
- //Safegaurd...
- if (fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllComputers)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = 1;
- UpdateFirewalls();
- }
- }
- }
- }
-
- public void UpdateFirewalls()
- {
- foreach (var pc in AllComputers)
- {
- if (pc.Type == SystemType.Firewall)
- {
- Firewall_Deflect(pc);
- }
- }
- }
-
-
- private void System_Repaired(object s, EventArgs e)
- {
- var c = (Computer)s;
- lbcompromised.Text = "System regenerating...";
- int location = c.Left - (lbcompromised.Width / 4);
- int y = c.Top - 25;
- lbcompromised.Location = new Point(location, y);
- lbcompromised.Show();
- c.Flash(lbcompromised);
-
- }
-
-
- private void System_Damaged(object s, EventArgs e)
- {
- var c = (Computer)s;
- lbcompromised.Text = "System damaged!";
- int location = c.Left - (lbcompromised.Width / 4);
- int y = c.Top - 25;
- lbcompromised.Location = new Point(location, y);
- lbcompromised.Show();
- c.Flash(lbcompromised);
- }
-
- private decimal TotalHP = 0;
-
- private void tmrhealthdetect_Tick(object sender, EventArgs e)
- {
- decimal health = 0;
-
- var rnd = new Random();
- int chance = 0;
- foreach (var pc in AllComputers)
- {
- if (pc.Disabled == false)
- {
- foreach (var enemy in Enemy.AllComputers)
- {
- chance = rnd.Next(1, 20);
- if (chance == 10)
- {
- if (Enemy.IsTutorial)
- {
- if (Enemy.TutorialProgress == 9)
- {
- Enemy.ThisPC.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- else if (Enemy.TutorialProgress == 32)
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- else
- {
- enemy.Enemies.Clear();
- }
- }
- else {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- }
- }
- }
- }
-
- foreach (var pc in AllComputers)
- {
- health += (decimal)pc.HP;
- }
- try {
- decimal percent = (health / TotalHP) * 100;
- lbstats.Text = $"Enemy Health: {percent}%";
- if (ThisPC.HP <= 0)
- {
- if (Enemy.IsTutorial)
- {
- Enemy.SetupTutorialUI(33);
- }
- else {
- API.CreateInfoboxSession("You won.", "You have successfully overthrown the enemy network.", infobox.InfoboxMode.Info);
- UserRequestedClose = false;
- Enemy.UserRequestedClose = false;
- Enemy.Close();
- this.Close();
- }
- }
- }
- catch(Exception ex)
- {
-
- }
- }
-
- public void Worm()
- {
- var rnd = new Random();
- int r = rnd.Next(0, 10);
-
- foreach (Computer c in AllComputers)
- {
- if(r == 5)
- {
- c.Disable();
- }
- }
- }
-
- public bool UserRequestedClose = true;
-
- private void this_Closing(object sender, FormClosingEventArgs e)
- {
- if(UserRequestedClose == false)
- {
- tmrhealthdetect.Stop();
- foreach(var pc in AllComputers)
- {
- pc.HP = 0;
- }
- }
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Hacking_YourHealth.Designer.cs b/source/WindowsFormsApplication1/Hacking_YourHealth.Designer.cs
deleted file mode 100644
index e8fce43..0000000
--- a/source/WindowsFormsApplication1/Hacking_YourHealth.Designer.cs
+++ /dev/null
@@ -1,479 +0,0 @@
-namespace ShiftOS
-{
- partial class Hacking_YourHealth
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Hacking_YourHealth));
- this.panel1 = new System.Windows.Forms.Panel();
- this.pnlpcinfo = new System.Windows.Forms.Panel();
- this.lbtargets = new System.Windows.Forms.Label();
- this.btnpoweroff = new System.Windows.Forms.Button();
- this.btnupgrade = new System.Windows.Forms.Button();
- this.lbpcinfo = new System.Windows.Forms.Label();
- this.lbmoduletitle = new System.Windows.Forms.Label();
- this.btncloseinfo = new System.Windows.Forms.Button();
- this.pnldefensemanager = new System.Windows.Forms.Panel();
- this.btnbuy = new System.Windows.Forms.Button();
- this.label3 = new System.Windows.Forms.Label();
- this.cmbmodules = new System.Windows.Forms.ComboBox();
- this.label1 = new System.Windows.Forms.Label();
- this.button1 = new System.Windows.Forms.Button();
- this.pnlbuy = new System.Windows.Forms.Panel();
- this.txthostname = new System.Windows.Forms.TextBox();
- this.lbhostname = new System.Windows.Forms.Label();
- this.txtgrade = new System.Windows.Forms.TextBox();
- this.lbgrade = new System.Windows.Forms.Label();
- this.lbmoduleinfo = new System.Windows.Forms.Label();
- this.cmbbuyable = new System.Windows.Forms.ComboBox();
- this.label4 = new System.Windows.Forms.Label();
- this.btndonebuying = new System.Windows.Forms.Button();
- this.flcontrols = new System.Windows.Forms.FlowLayoutPanel();
- this.btnaddmodule = new System.Windows.Forms.Button();
- this.lbcompromised = new System.Windows.Forms.Label();
- this.lbstats = new System.Windows.Forms.Label();
- this.tmrhealthdetect = new System.Windows.Forms.Timer(this.components);
- this.tmrredraw = new System.Windows.Forms.Timer(this.components);
- this.lbtutorial = new System.Windows.Forms.Label();
- this.btnnext = new System.Windows.Forms.Button();
- this.panel1.SuspendLayout();
- this.pnlpcinfo.SuspendLayout();
- this.pnldefensemanager.SuspendLayout();
- this.pnlbuy.SuspendLayout();
- this.flcontrols.SuspendLayout();
- this.SuspendLayout();
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.Black;
- this.panel1.Controls.Add(this.pnlbuy);
- this.panel1.Controls.Add(this.pnldefensemanager);
- this.panel1.Controls.Add(this.btnnext);
- this.panel1.Controls.Add(this.lbtutorial);
- this.panel1.Controls.Add(this.pnlpcinfo);
- this.panel1.Controls.Add(this.flcontrols);
- this.panel1.Controls.Add(this.lbcompromised);
- this.panel1.Controls.Add(this.lbstats);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel1.Font = new System.Drawing.Font("Lucida Console", 8.25F);
- this.panel1.ForeColor = System.Drawing.Color.White;
- this.panel1.Location = new System.Drawing.Point(0, 0);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(793, 461);
- this.panel1.TabIndex = 0;
- this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.boundpaint);
- this.panel1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.playfield_MouseDown);
- //
- // pnlpcinfo
- //
- this.pnlpcinfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.pnlpcinfo.Controls.Add(this.lbtargets);
- this.pnlpcinfo.Controls.Add(this.btnpoweroff);
- this.pnlpcinfo.Controls.Add(this.btnupgrade);
- this.pnlpcinfo.Controls.Add(this.lbpcinfo);
- this.pnlpcinfo.Controls.Add(this.lbmoduletitle);
- this.pnlpcinfo.Controls.Add(this.btncloseinfo);
- this.pnlpcinfo.Location = new System.Drawing.Point(399, 144);
- this.pnlpcinfo.Name = "pnlpcinfo";
- this.pnlpcinfo.Size = new System.Drawing.Size(382, 280);
- this.pnlpcinfo.TabIndex = 7;
- this.pnlpcinfo.Visible = false;
- //
- // lbtargets
- //
- this.lbtargets.Location = new System.Drawing.Point(12, 165);
- this.lbtargets.Name = "lbtargets";
- this.lbtargets.Size = new System.Drawing.Size(367, 86);
- this.lbtargets.TabIndex = 9;
- this.lbtargets.Text = "Targets";
- //
- // btnpoweroff
- //
- this.btnpoweroff.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnpoweroff.AutoSize = true;
- this.btnpoweroff.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnpoweroff.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnpoweroff.Location = new System.Drawing.Point(85, 254);
- this.btnpoweroff.Name = "btnpoweroff";
- this.btnpoweroff.Size = new System.Drawing.Size(80, 23);
- this.btnpoweroff.TabIndex = 8;
- this.btnpoweroff.Text = "Power Off";
- this.btnpoweroff.UseVisualStyleBackColor = true;
- this.btnpoweroff.Click += new System.EventHandler(this.btnpoweroff_Click);
- //
- // btnupgrade
- //
- this.btnupgrade.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnupgrade.AutoSize = true;
- this.btnupgrade.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnupgrade.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnupgrade.Location = new System.Drawing.Point(171, 254);
- this.btnupgrade.Name = "btnupgrade";
- this.btnupgrade.Size = new System.Drawing.Size(150, 23);
- this.btnupgrade.TabIndex = 7;
- this.btnupgrade.Text = "Upgrade This Module";
- this.btnupgrade.UseVisualStyleBackColor = true;
- this.btnupgrade.Click += new System.EventHandler(this.btnupgrade_Click);
- //
- // lbpcinfo
- //
- this.lbpcinfo.Location = new System.Drawing.Point(12, 41);
- this.lbpcinfo.Name = "lbpcinfo";
- this.lbpcinfo.Size = new System.Drawing.Size(367, 86);
- this.lbpcinfo.TabIndex = 6;
- this.lbpcinfo.Text = resources.GetString("lbpcinfo.Text");
- //
- // lbmoduletitle
- //
- this.lbmoduletitle.AutoSize = true;
- this.lbmoduletitle.Location = new System.Drawing.Point(10, 12);
- this.lbmoduletitle.Name = "lbmoduletitle";
- this.lbmoduletitle.Size = new System.Drawing.Size(75, 11);
- this.lbmoduletitle.TabIndex = 2;
- this.lbmoduletitle.Text = "Add Module";
- //
- // btncloseinfo
- //
- this.btncloseinfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btncloseinfo.AutoSize = true;
- this.btncloseinfo.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btncloseinfo.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btncloseinfo.Location = new System.Drawing.Point(327, 254);
- this.btncloseinfo.Name = "btncloseinfo";
- this.btncloseinfo.Size = new System.Drawing.Size(52, 23);
- this.btncloseinfo.TabIndex = 1;
- this.btncloseinfo.Text = "Done.";
- this.btncloseinfo.UseVisualStyleBackColor = true;
- this.btncloseinfo.Click += new System.EventHandler(this.btncloseinfo_Click);
- //
- // pnldefensemanager
- //
- this.pnldefensemanager.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.pnldefensemanager.Controls.Add(this.btnbuy);
- this.pnldefensemanager.Controls.Add(this.label3);
- this.pnldefensemanager.Controls.Add(this.cmbmodules);
- this.pnldefensemanager.Controls.Add(this.label1);
- this.pnldefensemanager.Controls.Add(this.button1);
- this.pnldefensemanager.Location = new System.Drawing.Point(3, 147);
- this.pnldefensemanager.Name = "pnldefensemanager";
- this.pnldefensemanager.Size = new System.Drawing.Size(382, 280);
- this.pnldefensemanager.TabIndex = 5;
- this.pnldefensemanager.Visible = false;
- //
- // btnbuy
- //
- this.btnbuy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnbuy.AutoSize = true;
- this.btnbuy.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnbuy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnbuy.Location = new System.Drawing.Point(199, 254);
- this.btnbuy.Name = "btnbuy";
- this.btnbuy.Size = new System.Drawing.Size(122, 23);
- this.btnbuy.TabIndex = 7;
- this.btnbuy.Text = "Buy new module.";
- this.btnbuy.UseVisualStyleBackColor = true;
- this.btnbuy.Click += new System.EventHandler(this.btnbuy_Click);
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(12, 95);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(367, 156);
- this.label3.TabIndex = 6;
- this.label3.Text = resources.GetString("label3.Text");
- //
- // cmbmodules
- //
- this.cmbmodules.BackColor = System.Drawing.Color.Black;
- this.cmbmodules.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbmodules.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.cmbmodules.ForeColor = System.Drawing.Color.White;
- this.cmbmodules.FormattingEnabled = true;
- this.cmbmodules.Location = new System.Drawing.Point(12, 38);
- this.cmbmodules.Name = "cmbmodules";
- this.cmbmodules.Size = new System.Drawing.Size(360, 19);
- this.cmbmodules.TabIndex = 3;
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(10, 12);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(75, 11);
- this.label1.TabIndex = 2;
- this.label1.Text = "Add Module";
- //
- // button1
- //
- this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.button1.AutoSize = true;
- this.button1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.button1.Location = new System.Drawing.Point(327, 254);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(52, 23);
- this.button1.TabIndex = 1;
- this.button1.Text = "Done.";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click_1);
- //
- // pnlbuy
- //
- this.pnlbuy.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.pnlbuy.Controls.Add(this.txthostname);
- this.pnlbuy.Controls.Add(this.lbhostname);
- this.pnlbuy.Controls.Add(this.txtgrade);
- this.pnlbuy.Controls.Add(this.lbgrade);
- this.pnlbuy.Controls.Add(this.lbmoduleinfo);
- this.pnlbuy.Controls.Add(this.cmbbuyable);
- this.pnlbuy.Controls.Add(this.label4);
- this.pnlbuy.Controls.Add(this.btndonebuying);
- this.pnlbuy.Location = new System.Drawing.Point(3, 128);
- this.pnlbuy.Name = "pnlbuy";
- this.pnlbuy.Size = new System.Drawing.Size(382, 299);
- this.pnlbuy.TabIndex = 6;
- this.pnlbuy.Visible = false;
- //
- // txthostname
- //
- this.txthostname.BackColor = System.Drawing.Color.Black;
- this.txthostname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.txthostname.ForeColor = System.Drawing.Color.White;
- this.txthostname.Location = new System.Drawing.Point(186, 236);
- this.txthostname.Name = "txthostname";
- this.txthostname.Size = new System.Drawing.Size(186, 18);
- this.txthostname.TabIndex = 10;
- //
- // lbhostname
- //
- this.lbhostname.AutoSize = true;
- this.lbhostname.Location = new System.Drawing.Point(112, 240);
- this.lbhostname.Name = "lbhostname";
- this.lbhostname.Size = new System.Drawing.Size(68, 11);
- this.lbhostname.TabIndex = 9;
- this.lbhostname.Text = "Hostname:";
- //
- // txtgrade
- //
- this.txtgrade.BackColor = System.Drawing.Color.Black;
- this.txtgrade.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.txtgrade.ForeColor = System.Drawing.Color.White;
- this.txtgrade.Location = new System.Drawing.Point(65, 236);
- this.txtgrade.Name = "txtgrade";
- this.txtgrade.Size = new System.Drawing.Size(40, 18);
- this.txtgrade.TabIndex = 8;
- this.txtgrade.TextChanged += new System.EventHandler(this.txtgrade_TextChanged);
- //
- // lbgrade
- //
- this.lbgrade.AutoSize = true;
- this.lbgrade.Location = new System.Drawing.Point(12, 240);
- this.lbgrade.Name = "lbgrade";
- this.lbgrade.Size = new System.Drawing.Size(47, 11);
- this.lbgrade.TabIndex = 7;
- this.lbgrade.Text = "Grade:";
- //
- // lbmoduleinfo
- //
- this.lbmoduleinfo.Location = new System.Drawing.Point(10, 63);
- this.lbmoduleinfo.Name = "lbmoduleinfo";
- this.lbmoduleinfo.Size = new System.Drawing.Size(367, 156);
- this.lbmoduleinfo.TabIndex = 6;
- this.lbmoduleinfo.Text = resources.GetString("lbmoduleinfo.Text");
- //
- // cmbbuyable
- //
- this.cmbbuyable.BackColor = System.Drawing.Color.Black;
- this.cmbbuyable.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmbbuyable.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.cmbbuyable.ForeColor = System.Drawing.Color.White;
- this.cmbbuyable.FormattingEnabled = true;
- this.cmbbuyable.Location = new System.Drawing.Point(12, 38);
- this.cmbbuyable.Name = "cmbbuyable";
- this.cmbbuyable.Size = new System.Drawing.Size(360, 19);
- this.cmbbuyable.TabIndex = 3;
- this.cmbbuyable.SelectedIndexChanged += new System.EventHandler(this.cmbbuyable_SelectedIndexChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Location = new System.Drawing.Point(10, 12);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(75, 11);
- this.label4.TabIndex = 2;
- this.label4.Text = "Buy Module";
- //
- // btndonebuying
- //
- this.btndonebuying.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btndonebuying.AutoSize = true;
- this.btndonebuying.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btndonebuying.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btndonebuying.Location = new System.Drawing.Point(341, 273);
- this.btndonebuying.Name = "btndonebuying";
- this.btndonebuying.Size = new System.Drawing.Size(38, 23);
- this.btndonebuying.TabIndex = 1;
- this.btndonebuying.Text = "Buy";
- this.btndonebuying.UseVisualStyleBackColor = true;
- this.btndonebuying.Click += new System.EventHandler(this.btndonebuying_Click);
- //
- // flcontrols
- //
- this.flcontrols.Controls.Add(this.btnaddmodule);
- this.flcontrols.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.flcontrols.Location = new System.Drawing.Point(0, 430);
- this.flcontrols.Name = "flcontrols";
- this.flcontrols.Size = new System.Drawing.Size(793, 31);
- this.flcontrols.TabIndex = 4;
- //
- // btnaddmodule
- //
- this.btnaddmodule.AutoSize = true;
- this.btnaddmodule.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnaddmodule.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnaddmodule.Location = new System.Drawing.Point(3, 3);
- this.btnaddmodule.Name = "btnaddmodule";
- this.btnaddmodule.Size = new System.Drawing.Size(87, 23);
- this.btnaddmodule.TabIndex = 0;
- this.btnaddmodule.Text = "Add Module";
- this.btnaddmodule.UseVisualStyleBackColor = true;
- this.btnaddmodule.Click += new System.EventHandler(this.btnaddmodule_Click);
- //
- // lbcompromised
- //
- this.lbcompromised.AutoSize = true;
- this.lbcompromised.Location = new System.Drawing.Point(251, 85);
- this.lbcompromised.Name = "lbcompromised";
- this.lbcompromised.Size = new System.Drawing.Size(103, 11);
- this.lbcompromised.TabIndex = 3;
- this.lbcompromised.Text = "SYSTEM DAMAGED";
- this.lbcompromised.Visible = false;
- //
- // lbstats
- //
- this.lbstats.AutoSize = true;
- this.lbstats.Location = new System.Drawing.Point(13, 13);
- this.lbstats.Name = "lbstats";
- this.lbstats.Size = new System.Drawing.Size(138, 11);
- this.lbstats.TabIndex = 0;
- this.lbstats.Text = "System Health: 100%";
- //
- // tmrhealthdetect
- //
- this.tmrhealthdetect.Tick += new System.EventHandler(this.tmrhealthdetect_Tick);
- //
- // tmrredraw
- //
- this.tmrredraw.Interval = 5000;
- this.tmrredraw.Tick += new System.EventHandler(this.tmrredraw_Tick);
- //
- // lbtutorial
- //
- this.lbtutorial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.lbtutorial.Location = new System.Drawing.Point(411, 13);
- this.lbtutorial.Name = "lbtutorial";
- this.lbtutorial.Size = new System.Drawing.Size(367, 86);
- this.lbtutorial.TabIndex = 8;
- this.lbtutorial.Text = resources.GetString("lbtutorial.Text");
- this.lbtutorial.TextAlign = System.Drawing.ContentAlignment.TopRight;
- this.lbtutorial.Visible = false;
- //
- // btnnext
- //
- this.btnnext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
- this.btnnext.AutoSize = true;
- this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.btnnext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnnext.Location = new System.Drawing.Point(712, 102);
- this.btnnext.Name = "btnnext";
- this.btnnext.Size = new System.Drawing.Size(66, 23);
- this.btnnext.TabIndex = 9;
- this.btnnext.Text = "Next >>";
- this.btnnext.UseVisualStyleBackColor = true;
- this.btnnext.Visible = false;
- this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
- //
- // Hacking_YourHealth
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(793, 461);
- this.Controls.Add(this.panel1);
- this.Name = "Hacking_YourHealth";
- this.Text = "Hacking_YourHealth";
- this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.this_Closing);
- this.Load += new System.EventHandler(this.Hacking_YourHealth_Load);
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
- this.pnlpcinfo.ResumeLayout(false);
- this.pnlpcinfo.PerformLayout();
- this.pnldefensemanager.ResumeLayout(false);
- this.pnldefensemanager.PerformLayout();
- this.pnlbuy.ResumeLayout(false);
- this.pnlbuy.PerformLayout();
- this.flcontrols.ResumeLayout(false);
- this.flcontrols.PerformLayout();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.Label lbstats;
- private System.Windows.Forms.Timer tmrhealthdetect;
- private System.Windows.Forms.Label lbcompromised;
- private System.Windows.Forms.FlowLayoutPanel flcontrols;
- private System.Windows.Forms.Button btnaddmodule;
- private System.Windows.Forms.Panel pnldefensemanager;
- private System.Windows.Forms.ComboBox cmbmodules;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Button btnbuy;
- private System.Windows.Forms.Timer tmrredraw;
- private System.Windows.Forms.Panel pnlbuy;
- private System.Windows.Forms.TextBox txtgrade;
- private System.Windows.Forms.Label lbgrade;
- private System.Windows.Forms.Label lbmoduleinfo;
- private System.Windows.Forms.ComboBox cmbbuyable;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Button btndonebuying;
- private System.Windows.Forms.TextBox txthostname;
- private System.Windows.Forms.Label lbhostname;
- private System.Windows.Forms.Panel pnlpcinfo;
- private System.Windows.Forms.Button btnpoweroff;
- private System.Windows.Forms.Button btnupgrade;
- private System.Windows.Forms.Label lbpcinfo;
- private System.Windows.Forms.Label lbmoduletitle;
- private System.Windows.Forms.Button btncloseinfo;
- private System.Windows.Forms.Label lbtargets;
- private System.Windows.Forms.Button btnnext;
- private System.Windows.Forms.Label lbtutorial;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Hacking_YourHealth.cs b/source/WindowsFormsApplication1/Hacking_YourHealth.cs
deleted file mode 100644
index 6166e93..0000000
--- a/source/WindowsFormsApplication1/Hacking_YourHealth.cs
+++ /dev/null
@@ -1,950 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class Hacking_YourHealth : Form
- {
- public Hacking_YourHealth()
- {
- InitializeComponent();
- }
-
- public Hacking_YourHealth(EnemyHacker enemy)
- {
- EnemyNet = enemy;
- InitializeComponent();
- }
-
- public Computer ThisPC = null;
- public Hacking_Enemy EnemyScreen = null;
- public EnemyHacker EnemyNet = null;
- private decimal TotalHP = 0;
-
- private List<Module> MyNetwork = new List<Module>();
-
- private void Hacking_YourHealth_Load(object sender, EventArgs e)
- {
- AntiVirusBounds = new List<Rectangle>();
- TutorialNetwork.Add(new Module(SystemType.Core, 1, "localhost"));
- foreach(var m in GetMyNet())
- {
- if(m.Type == SystemType.Core)
- {
- MyNetwork.Add(m);
- }
- }
- VisualizeNetwork();
- if (EnemyNet != null)
- {
- var h = new Hacking_Enemy(this, EnemyNet);
- tmrhealthdetect.Start();
- EnemyScreen = h;
- API.CreateForm(h, "Enemy Hacker", Properties.Resources.iconTerminal);
-
- }
- else
- {
- var h = new Hacking_Enemy(this, Hacking.EnemyHackers[new Random().Next(0, Hacking.EnemyHackers.Count - 1)]);
- tmrhealthdetect.Start();
- EnemyScreen = h;
- API.CreateForm(h, "Enemy Hacker", Properties.Resources.iconTerminal);
- }
- ThisPC.EnemyComputer = EnemyScreen.ThisPC;
- if(IsTutorial)
- {
- SetupTutorialUI(0);
- }
- }
-
- private void VisualizeNetwork()
- {
- AllComputers = new List<Computer>();
- foreach(Module m in MyNetwork)
- {
- if (AllComputers.Count <= 10)
- {
- var c = m.Deploy();
- if (c.Type == SystemType.Core)
- {
- ThisPC = c;
- }
- AddModule(c);
- }
- }
- }
-
-
-
- private void btnvirus_Click(object sender, EventArgs e)
- {
- ThisPC.EnemyComputer.LaunchAttack(AttackType.Virus);
- }
-
- public List<Computer> AllComputers = null;
-
- private void tmrhealthdetect_Tick(object sender, EventArgs e)
- {
- var rnd = new Random();
- int chance = 0;
- foreach(var pc in AllComputers)
- {
- if (pc.Disabled == false)
- {
- if (pc.Enemies != null)
- {
- foreach (var enemy in pc.Enemies)
- {
- if (EnemyScreen.AllComputers.Contains(enemy))
- {
- chance = rnd.Next(1, 15);
- if (chance == 7)
- {
- if (IsTutorial)
- {
- if (TutorialProgress == 32 || TutorialProgress == 9)
- {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- }
- else {
- enemy.LaunchAttack(pc.GetProperType(), pc.GetDamageRate());
- }
- }
- }
- }
- }
- }
- }
- decimal health = 0;
- EnemyScreen.Enemy = this;
- foreach (var pc in AllComputers)
- {
- health += (decimal)pc.HP;
- }
- if(health > TotalHP)
- {
- TotalHP = health;
- }
- decimal percent = (health / TotalHP) * 100;
- lbstats.Text = $"System Health: {percent}%";
- if(ThisPC.HP <= 0)
- {
- API.CreateInfoboxSession("System compromised.", "The enemy hacker has overthrown your defenses and compromised your system. You will need to wait an hour before you can start another hack battle.", infobox.InfoboxMode.Info);
- Hacking.Failure = true;
- Hacking.FailDate = DateTime.Now;
- UserRequestedClose = false;
- this.Close();
- EnemyScreen.UserRequestedClose = false;
- EnemyScreen.Close();
- this.Close();
- }
- }
-
- public bool UserRequestedClose = true;
-
- private void this_Closing(object sender, FormClosingEventArgs e)
- {
- if (UserRequestedClose == false)
- {
- tmrhealthdetect.Stop();
- foreach (var pc in AllComputers)
- {
- pc.HP = 0;
- }
- }
- }
-
- public Computer SelectedComputer = null;
-
- public void AddModule(Computer newModule) {
- panel1.Controls.Add(newModule);
- int hp = newModule.HP;
-
- TotalHP += newModule.HP;
- AllComputers.Add(newModule);
- newModule.Show();
- newModule.OnDestruction += (object s, EventArgs a) =>
- {
- if (this.SelectedComputer == newModule)
- {
- SelectedComputer = null;
- }
- if(newModule.Type == SystemType.Firewall)
- {
- Firewall_Destroy(newModule);
- }
- AllComputers.Remove(newModule);
- newModule.Dispose();
- };
- newModule.Select += (object s, EventArgs e) =>
- {
- SelectedComputer = newModule;
- ShowPCInfo(newModule.Hostname);
- if(IsTutorial)
- {
- if(TutorialProgress == 6)
- {
- if(newModule == ThisPC)
- {
- SetupTutorialUI(7);
- }
- }
- }
- };
- newModule.HP_Decreased += new EventHandler(System_Damaged);
- newModule.OnRepair += new EventHandler(System_Repaired);
- if (newModule.Type == SystemType.Antivirus || newModule.Type == SystemType.RepairModule)
- {
- var b = newModule.GetAreaOfEffect();
- AntiVirusBounds.Add(b);
- panel1.Refresh();
- newModule.AntivirusRepair += (object s, EventArgs a) =>
- {
- foreach (Computer pc in AllComputers)
- {
- if (pc != newModule && pc.Bounds.IntersectsWith(b))
- {
- if (newModule.Type == SystemType.RepairModule)
- {
- if (pc.HP < newModule.HP)
- {
- if (pc.HP < pc.GetTotal())
- {
- pc.Repair(1);
- }
- }
-
- }
- else {
- if (pc.HP < 10)
- {
- pc.Repair(1);
- }
- }
- }
- }
- };
-
- }
- if(newModule.Type == SystemType.Firewall)
- {
- var b = newModule.GetAreaOfEffect();
- AntiVirusBounds.Add(b);
- panel1.Refresh();
- Firewall_Deflect(newModule);
- }
- if(newModule.Type == SystemType.ServerStack)
- {
- newModule.MassDDoS += (object s, EventArgs a) =>
- {
- EnemyScreen.Worm();
- };
- }
- }
-
- public void Worm()
- {
- var rnd = new Random();
- int r = rnd.Next(0, 10);
-
- foreach (Computer c in AllComputers)
- {
- if (r == 5)
- {
- c.Disable();
- }
- }
- }
-
- public void ShowPCInfo(string hostname)
- {
- Module mod = null;
- foreach(var m in GetMyNet())
- {
- if(m.Hostname == hostname)
- {
- mod = m;
- }
- }
- if(mod != null)
- {
- pnlpcinfo.Show();
- lbmoduletitle.Text = "Module Info - " + hostname;
- lbpcinfo.Text = $"Hostname: {hostname}{Environment.NewLine}Type: {mod.Type.ToString()}";
- if (mod.Type == SystemType.Core)
- {
- lbpcinfo.Text += Environment.NewLine + "This represents your main system. If this module is destroyed, you will automatically lose the battle. Protect it at all costs.";
- btnupgrade.Hide();
- btnpoweroff.Hide();
- }
- else {
- lbpcinfo.Text += $"{Environment.NewLine}Grade: {mod.Grade}";
- if (mod.Grade < 4)
- {
- btnupgrade.Show();
- }
- else
- {
- btnupgrade.Hide();
- }
- btnpoweroff.Show();
- }
- }
- Computer c = null;
- foreach(var pc in AllComputers)
- {
- if(pc.Hostname == hostname)
- {
- c = pc;
- }
- }
- if(c != null)
- {
- lbtargets.Text = "Targets: ";
- if (c.Enemies != null)
- {
- if(c.Enemies.Count > 0)
- {
- foreach(var pc in c.Enemies)
- {
- lbtargets.Text += " " + pc.Hostname + ",";
- }
- }
- else
- {
- lbtargets.Text += " - Click on an enemy module to target it.";
- }
- }
- else
- {
- lbtargets.Text += " - Click on an enemy module to target it.";
- }
- lbtargets.Text += Environment.NewLine + "Some modules will not fire at their targets.";
- }
- }
-
- public void Firewall_Deflect(Computer fwall)
- {
- //Safegaurd...
- if(fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach(var pc in AllComputers)
- {
- if (pc != fwall)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = fwall.Grade;
- }
- }
- }
- }
- }
-
- public void Firewall_Destroy(Computer fwall)
- {
- //Safegaurd...
- if (fwall.Type == SystemType.Firewall)
- {
- var r = fwall.GetAreaOfEffect();
- foreach (var pc in AllComputers)
- {
- if (pc.Bounds.IntersectsWith(r))
- {
- pc.DamageDefector = 1;
- UpdateFirewalls();
- }
- }
- }
- }
-
- public void UpdateFirewalls()
- {
- foreach(var pc in AllComputers)
- {
- if(pc.Type == SystemType.Firewall)
- {
- Firewall_Deflect(pc);
- }
- }
- }
-
-
- private void System_Repaired(object s, EventArgs e)
- {
- var c = (Computer)s;
- lbcompromised.Text = "System regenerating...";
- int location = c.Left - (lbcompromised.Width / 4);
- int y = c.Top - 25;
- lbcompromised.Location = new Point(location, y);
- lbcompromised.Show();
- c.Flash(lbcompromised);
-
- }
-
-
- private void System_Damaged(object s, EventArgs e)
- {
- var c = (Computer)s;
- lbcompromised.Text = "System damaged!";
- int location = c.Left - (lbcompromised.Width / 4);
- int y = c.Top - 25;
- lbcompromised.Location = new Point(location, y);
- lbcompromised.Show();
- c.Flash(lbcompromised);
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- EnemyScreen.Worm();
- }
-
- private void btnaddmodule_Click(object sender, EventArgs e)
- {
- SetupModuleList();
- pnldefensemanager.Visible = !pnldefensemanager.Visible;
- if(IsTutorial)
- {
- if(TutorialProgress == 12)
- {
- SetupTutorialUI(13);
- }
- }
- }
-
- private Dictionary<string, SystemType> FutureModules = null;
- public List<Module> TutorialNetwork = new List<Module>();
-
- public void SetupModuleList()
- {
- FutureModules = new Dictionary<string, SystemType>();
- cmbmodules.Items.Clear();
- List<Module> net = null;
- if(IsTutorial)
- {
- net = TutorialNetwork;
- }
- else
- {
- net = Hacking.MyNetwork;
- }
- foreach (var item in net)
- {
- Computer m = null;
- foreach(var mod in AllComputers)
- {
- if(mod.Hostname == item.Hostname)
- {
- m = mod;
- }
- }
- if (m == null)
- {
- cmbmodules.Items.Add(item.Hostname);
- FutureModules.Add(item.Hostname, item.Type);
- }
- }
-
- }
-
- bool PlacingNewModule = false;
-
-
- private void button1_Click_1(object sender, EventArgs e)
- {
- if (cmbmodules.Text != "")
- {
- PlacingNewModule = true;
- pnldefensemanager.Hide();
- if (IsTutorial)
- {
- if (TutorialProgress == 20)
- {
- SetupTutorialUI(21);
- }
- }
- }
- }
-
- private void playfield_MouseDown(object sender, MouseEventArgs e)
- {
- if (PlacingNewModule == true)
- {
- if (e.Button == MouseButtons.Left)
- {
- if (AllComputers.Count < 10)
- {
- bool cont = true;
- try
- {
- SystemType type = FutureModules[cmbmodules.Text];
- }
- catch (Exception ex)
- {
- cont = false;
- API.CreateInfoboxSession("Error", "Please select a module type.", infobox.InfoboxMode.Info);
- }
- if (cont == true)
- {
- var coordinates = panel1.PointToClient(Cursor.Position);
- int x = coordinates.X;
- int y = coordinates.Y;
-
- var m = new Module(FutureModules[cmbmodules.Text], 1, cmbmodules.Text);
- foreach (var mod in GetMyNet())
- {
- if (mod.Hostname == cmbmodules.Text)
- {
- m = mod;
- }
- }
- m.X = x;
- m.Y = y;
- var c = m.Deploy();
- AddModule(c);
- API.RemoveCodepoints(10);
- pnldefensemanager.Hide();
- if(IsTutorial)
- {
- if(TutorialProgress == 21)
- {
- SetupTutorialUI(22);
- }
- else if(TutorialProgress == 25)
- {
- SetupTutorialUI(26);
- }
- }
- }
- PlacingNewModule = false;
- }
- else
- {
- API.CreateInfoboxSession("Too much deployed modules", "You can have a maximum of 10 modules deployed on your network, including your main system. You will have to wait for one to be destroyed.", infobox.InfoboxMode.Info);
- PlacingNewModule = false;
- }
- }
- else
- {
- PlacingNewModule = false;
- }
- }
- }
-
- public List<FutureModule> BuyableModules = null;
-
- public void SetupBuyable()
- {
- if(!IsTutorial)
- {
- BuyableModules = Hacking.GetFutureModules();
- }
- cmbbuyable.Items.Clear();
- foreach(var m in BuyableModules)
- {
- cmbbuyable.Items.Add(m.Name);
- }
- lbmoduleinfo.Text = "";
- txtgrade.Text = "1";
- }
-
- private void btnbuy_Click(object sender, EventArgs e)
- {
- if(IsTutorial)
- {
- if(TutorialProgress == 14)
- {
- SetupTutorialUI(15);
- }
- }
- SetupBuyable();
- pnlbuy.Show();
- pnldefensemanager.Hide();
- }
-
- public List<Rectangle> AntiVirusBounds = null;
- public List<Rectangle> IndicatorsToDestroy = new List<Rectangle>();
- private void boundpaint(object sender, PaintEventArgs e)
- {
- foreach(Rectangle r in IndicatorsToDestroy)
- {
- AntiVirusBounds.Remove(r);
- var sb = new SolidBrush(Color.Black);
- var p = new Pen(sb);
- p.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid;
- p.Width = 2;
- e.Graphics.DrawRectangle(p, r);
-
- }
- IndicatorsToDestroy.Clear();
- foreach (Rectangle r in AntiVirusBounds)
- {
- IndicatorsToDestroy.Add(r);
- tmrredraw.Start();
- var sb = new SolidBrush(Color.White);
- var p = new Pen(sb);
- p.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
- p.Width = 2;
- e.Graphics.DrawRectangle(p, r);
- }
- }
-
- private void tmrredraw_Tick(object sender, EventArgs e)
- {
- panel1.Refresh();
- tmrredraw.Stop();
- }
-
- private void SetupModuleInfo()
- {
- bool cont = false;
- FutureModule m = null;
- foreach(var mod in BuyableModules)
- {
- if(mod.Name == cmbbuyable.Text)
- {
- m = mod;
- cont = true;
- }
- }
- if(cont == true)
- {
- lbmoduleinfo.Text = m.Name;
- lbmoduleinfo.Text += Environment.NewLine + $"Cost: {m.Cost * Convert.ToInt32(txtgrade.Text)} CP";
- lbmoduleinfo.Text += Environment.NewLine + $"Description: {Environment.NewLine}{m.Description}";
- }
- }
-
- private void cmbbuyable_SelectedIndexChanged(object sender, EventArgs e)
- {
- SetupModuleInfo();
- if(IsTutorial)
- {
- if(TutorialProgress == 17)
- {
- if(cmbbuyable.Text == "Antivirus")
- {
- SetupTutorialUI(18);
- }
- }
- }
- }
-
- private void txtgrade_TextChanged(object sender, EventArgs e)
- {
- try
- {
- int g = Convert.ToInt32(txtgrade.Text);
- if(g < 1)
- {
- txtgrade.Text = "1";
- }
- else if(g > 4)
- {
- txtgrade.Text = "4";
- }
- SetupModuleInfo();
- }
- catch(Exception ex)
- {
- txtgrade.Text = "1";
- SetupModuleInfo();
- }
- }
-
- public List<Module> GetMyNet()
- {
- if(IsTutorial)
- {
- return TutorialNetwork;
- }
- else
- {
- return Hacking.MyNetwork;
- }
- }
-
- private void btndonebuying_Click(object sender, EventArgs e)
- {
- var mod = new FutureModule("", 0, "", SystemType.Core);
- bool cont = false;
- foreach(var m in BuyableModules)
- {
- if(m.Name == cmbbuyable.Text)
- {
- mod = m;
- cont = true;
- }
- }
- if(cont == true)
- {
- if(API.Codepoints >= mod.Cost)
- {
- if (txthostname.Text != "")
- {
- bool cont2 = true;
- string hname = txthostname.Text.Replace(" ", "_");
- foreach (var pc in GetMyNet())
- {
- if (pc.Hostname == hname)
- {
- cont2 = false;
- }
- }
- if (cont2 == true)
- {
- GetMyNet().Add(new Module(mod.Type, Convert.ToInt32(txtgrade.Text), hname));
- API.RemoveCodepoints(mod.Cost);
- API.CreateInfoboxSession("Module added.", "To deploy the module to the network, select 'Add Module' and choose the hostname from the menu.", infobox.InfoboxMode.Info);
- pnlbuy.Hide();
- if(IsTutorial)
- {
- if(TutorialProgress == 19)
- {
- SetupTutorialUI(20);
- }
- else if(TutorialProgress == 24)
- {
- SetupTutorialUI(25);
- }
- }
- }
- else
- {
- API.CreateInfoboxSession("Please enter a unique hostname.", "No two computers can share the same hostname. Please choose another.", infobox.InfoboxMode.Info);
- }
- }
- else
- {
- API.CreateInfoboxSession("Please enter a hostname.", "It is best to enter a hostname for your new computer so you know which one it is.", infobox.InfoboxMode.Info);
- }
-
- }
- else
- {
- API.CreateInfoboxSession("Insufficient Codepoints", "You do not have enough Codepoints to buy this module.", infobox.InfoboxMode.Info);
- }
- }
- }
-
- private void btncloseinfo_Click(object sender, EventArgs e)
- {
- SelectedComputer = null;
- pnlpcinfo.Hide();
- Hacking.SaveCharacters();
- }
-
- private void btnpoweroff_Click(object sender, EventArgs e)
- {
- //Remove the computer from the game.
- panel1.Controls.Remove(SelectedComputer);
- AllComputers.Remove(SelectedComputer);
- btnpoweroff.Hide();
- }
-
- private void btnupgrade_Click(object sender, EventArgs e)
- {
- int price = 20 * SelectedComputer.Grade;
- if(API.Codepoints >= price)
- {
- foreach(var m in GetMyNet())
- {
- if(m.Hostname == SelectedComputer.Hostname)
- {
- SelectedComputer.Grade += 1;
- m.Grade += 1;
- Hacking.SaveCharacters();
- API.CreateInfoboxSession("Upgrade successful.", "Your module has been upgraded.", infobox.InfoboxMode.Info);
- }
- }
- }
- else
- {
- API.CreateInfoboxSession("Insufficient funds", $"You need at least {price} CP to upgrade this module.", infobox.InfoboxMode.Info);
- }
- ShowPCInfo(SelectedComputer.Hostname);
- }
-
- public int TutorialProgress = 0;
- public bool IsTutorial = false;
-
- public void SetupTutorialUI(int p)
- {
- TutorialProgress = p;
- lbtutorial.Show();
- switch(p)
- {
- case 0:
- lbtutorial.Text = "Welcome to the Hacker Battle tutorial. This guide will teach you the fundamentals and basics of taking part in a Hacker Battle. When you're done here, you'll have all you need for a very basic network.";
- btnaddmodule.Hide();
- btnnext.Show();
- break;
- case 1:
- lbtutorial.Text = "When a battle commenses, you will see two windows. The one on the left, is your network. You can view information about all computers on the network, buy new systems, upgrade them and deploy them.";
- break;
- case 2:
- lbtutorial.Text = "On the right is the enemy's network. This window will show you the strength (HP) of all enemy systems, and will allow you to target specific systems to take down.";
- break;
- case 3:
- lbtutorial.Text = "On the top-left corner of both windows is the network health indicator. It will display a percentage of the entire network health.";
- break;
- case 4:
- lbtutorial.Text = "If the enemy's total network health hits 0%, or his core's strength hits 0%, you win.";
- break;
- case 5:
- lbtutorial.Text = "However, if the same happens to you, you will lose the battle.";
- break;
- case 6:
- lbtutorial.Text = "You can click on your Core to view information about it.";
- btnnext.Hide();
- break;
- case 7:
- lbtutorial.Text = "When you click on a module, you can see information about it, such as it's grade level, HP, and type. This module is a Core, so it has no grade level. It currently has 100 HP.";
- btnnext.Show();
- break;
- case 8:
- lbtutorial.Text = "When a module is selected you can left-click an enemy module to target it. This will make the selected module attempt to fire at the target. Cores are very weak, but are capable of bringing a target down by 1 HP.";
- break;
- case 9:
- lbtutorial.Text = "The enemy Core is attacking your Core now. Looks like it's time to fight back. Select your core, and target the enemy's Core to fight back.";
- btnnext.Hide();
- break;
- case 10:
- lbtutorial.Text = "Phew! He couldn't do much damage before we fought back. In a real battle, modules won't just stop fighting randomly, but for the purpose of this tutorial, your Core will stop attacking the enemy Core.";
- btnnext.Show();
- ThisPC.Enemies.Clear();
- break;
- case 11:
- lbtutorial.Text = "Should your Core fall to a fatal state in the future, you can deploy some defenses to slow the enemy down. Any hacker knows it's best to disable defenses before attacking the main target.";
- ThisPC.HP = 5;
- break;
- case 12:
- lbtutorial.Text = "We will look at ways of healing damaged modules now. You can add new modules to the network by clicking the [Add Module] button in the lower-left corner.";
- btnaddmodule.Show();
- btnnext.Hide();
- break;
- case 13:
- lbtutorial.Text = "You can select a module from the list of hostnames. Only modules that are not powered on will display in the menu.";
- btnnext.Show();
- BuyableModules = new List<FutureModule>();
- BuyableModules.Add(new FutureModule("Antivirus", 0, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
- break;
- case 14:
- lbtutorial.Text = "In this demonstration, you have no other modules to deploy. You will need to buy some modules to get started. Click [Buy New Module] to continue.";
- btnnext.Hide();
- break;
- case 15:
- lbtutorial.Text = "Let's go over the user interface, shall we? At the top is a list of all possible module types.";
- btnnext.Show();
- btndonebuying.Hide();
- lbgrade.Hide();
- txtgrade.Hide();
- txthostname.Hide();
- lbhostname.Hide();
- lbmoduleinfo.Hide();
- break;
- case 16:
- lbtutorial.Text = "Below that, is the cost and description of the selected module type. It's invisible right now, but when you select a new module, it will populate.";
- lbmoduleinfo.Show();
- break;
- case 17:
- lbtutorial.Text = "We need an Antivirus module, so go ahead and select it from the menu.";
- btnnext.Hide();
- break;
- case 18:
- lbtutorial.Text = "Normally, an Antivirus would cost us 15 Codepoints, however since this is a tutorial, it is free.";
- btnnext.Show();
- break;
- case 19:
- lbtutorial.Text = "Below the description is the Hostname box. A Hostname is used to identify the new module. Pick something you'll remember as this new Antivirus, then click [Buy] to purchase it.";
- btnnext.Hide();
- lbhostname.Show();
- txthostname.Show();
- btndonebuying.Show();
- break;
- case 20:
- btnnext.Hide();
- lbtutorial.Text = "Now that we have an antivirus module, go ahead and deploy it by selecting [Add Module], choosing the hostname you entered, and clicking [Done].";
- break;
- case 21:
- btnnext.Hide();
- lbtutorial.Text = "Alrighty. Now you get to choose where you place your module. Simply left-click in a blank area where you'd like to place the module. Right-click to cancel. Oh, be sure to place close to our Core!";
- break;
- case 22:
- lbtutorial.Text = "The Antivirus has been placed. You may've noticed that white dotted box around it when you placed it. If the Core is even slightly within the box, the Antivirus will heal it back to 10 HP.";
- btnnext.Show();
- break;
- case 23:
- lbtutorial.Text = "The higher the Antivirus' grade, the bigger this area of effect becomes. However, it will always only be able to heal modules to 10 HP.";
- break;
- case 24:
- lbtutorial.Text = "A Turret has been added to the list of buyable modules. Go pick one up!";
- btnnext.Hide();
- BuyableModules.Clear();
- BuyableModules.Add(new FutureModule("Turret", 0, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
- break;
- case 25:
- lbtutorial.Text = "Turrets can fire damaging viruses at their targets. Go ahead and place your Turret somewhere within the Antivirus's Area of Effect.";
- break;
- case 26:
- lbtutorial.Text = "Notice how the Turret only has 10 HP, just like the Antivirus?";
- btnnext.Show();
- break;
- case 27:
- lbtutorial.Text = "This is because both the Antivirus and Turret are at Grade 1. There are four grades of modules you can get, and you can easily upgrade by selecting a module and choosing [Upgrade This Module].";
- break;
- case 28:
- lbtutorial.Text = "Upgrading a module will increase it's max HP. Grade 1 is 10 HP, Grade 2 is 20 HP, Grade 3 is 40 HP, and Grade 4 is 80 HP.";
- break;
- case 29:
- lbtutorial.Text = "Some modules will have a higher attack rate based on their grade. Others may throw more damaging attacks, and any module's Area of Effect (if it has one) will grow.";
- break;
- case 30:
- lbtutorial.Text = "Another tip: Multiple modules can target the same module, and a module can have multiple targets. This means that you can have your Core and your Turret both attack the enemy Core.";
- break;
- case 31:
- lbtutorial.Text = "Some modules do not work on a target-based system. Some may work using an area-of-effect system (like an Antivirus), and some may target the entire enemy network.";
- break;
- case 32:
- lbtutorial.Text = "We have reset both your Cores' health. Go ahead and finish off the enemy Core using your newfound skills.";
- ThisPC.HP = 100;
- EnemyScreen.ThisPC.HP = 100;
- btnnext.Hide();
- BuyableModules = new List<FutureModule>();
- BuyableModules.Add(new FutureModule("Antivirus", 0, "This module will heal any other module within it's area of effect to 10 HP. Higher grades can improve it's area of effect.", SystemType.Antivirus));
- BuyableModules.Add(new FutureModule("Turret", 0, "It's not super-effective, but the Turret will blast through any Grade 1 defenses pretty quickly. The higher the grade, the higher the strength.", SystemType.Turret));
- break;
- default:
- lbtutorial.Text = "This concludes the Hacker Battle tutorial. Happy hunting, soldier. Just kidding. Stay safe.";
- btnnext.Text = "Close";
- break;
- }
- }
-
- private void btnnext_Click(object sender, EventArgs e)
- {
- if(btnnext.Text == "Close")
- {
- UserRequestedClose = false;
- this.Close();
- EnemyScreen.UserRequestedClose = false;
- EnemyScreen.Close();
- }
- SetupTutorialUI(TutorialProgress + 1);
- }
- }
-
- public enum ConnectionDirection
- {
- Left, Right, Top, Bottom, NoBridge
- }
-}
diff --git a/source/WindowsFormsApplication1/Hacking_YourHealth.resx b/source/WindowsFormsApplication1/Hacking_YourHealth.resx
deleted file mode 100644
index 1ba310a..0000000
--- a/source/WindowsFormsApplication1/Hacking_YourHealth.resx
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <data name="lbtutorial.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <data name="lbpcinfo.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <data name="label3.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <data name="lbmoduleinfo.Text" xml:space="preserve">
- <value>When you press 'Done', simply click where you'd like to place the new module. You can right-click the playing field to cancel the deployment.
-
-Some modules have a range of effect. For example, an Antivirus will only heal modules within it's area of effect and only if their HP is below 10. This can be upgraded.
-
-To upgrade a module, simply right-click it on the playing field and choose 'Upgrade this module'.
-
-If you would like to buy a new module, click 'Buy new module'.</value>
- </data>
- <metadata name="tmrhealthdetect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <metadata name="tmrredraw.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>156, 17</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/MountMgr.cs b/source/WindowsFormsApplication1/HostLayer/MountMgr.cs
index 3981b64..3981b64 100644
--- a/source/WindowsFormsApplication1/MountMgr.cs
+++ b/source/WindowsFormsApplication1/HostLayer/MountMgr.cs
diff --git a/source/WindowsFormsApplication1/OSInfo.cs b/source/WindowsFormsApplication1/HostLayer/OSInfo.cs
index 53e51dc..53e51dc 100644
--- a/source/WindowsFormsApplication1/OSInfo.cs
+++ b/source/WindowsFormsApplication1/HostLayer/OSInfo.cs
diff --git a/source/WindowsFormsApplication1/Paths.cs b/source/WindowsFormsApplication1/HostLayer/Paths.cs
index e85c73f..32e8c3a 100644
--- a/source/WindowsFormsApplication1/Paths.cs
+++ b/source/WindowsFormsApplication1/HostLayer/Paths.cs
@@ -23,6 +23,7 @@ namespace ShiftOS
public static string Videos;
public static string SystemDir;
public static string AutoStart;
+ public static string APIs;
public static string SkinDir;
public static string LoadedSkin;
public static string Icons;
@@ -77,6 +78,7 @@ namespace ShiftOS
Bitnote = Drivers + "BNWallet.dri";
Icons = LoadedSkin + "Icons\\";
WidgetFiles = SystemDir + "Widgets\\";
+ APIs = SystemDir + "APIs\\";
break;
default:
SaveRoot = OSInfo.homePath () + "/.local/lib/.shiftos";
@@ -104,6 +106,7 @@ namespace ShiftOS
Bitnote = Drivers + "BNWallet.dri";
Icons = LoadedSkin + "Icons/";
WidgetFiles = SystemDir + "Widgets/";
+ APIs = SystemDir + "APIs/";
break;
}
diff --git a/source/WindowsFormsApplication1/Jumper.Designer.cs b/source/WindowsFormsApplication1/Jumper.Designer.cs
deleted file mode 100644
index 096dc47..0000000
--- a/source/WindowsFormsApplication1/Jumper.Designer.cs
+++ /dev/null
@@ -1,130 +0,0 @@
-namespace ShiftOS
-{
- partial class Jumper
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.pnlstatus = new System.Windows.Forms.FlowLayoutPanel();
- this.btnplay = new System.Windows.Forms.Button();
- this.lbstatus = new System.Windows.Forms.Label();
- this.lbstatus2 = new System.Windows.Forms.Label();
- this.ground = new System.Windows.Forms.Panel();
- this.tmrscreenupdate = new System.Windows.Forms.Timer(this.components);
- this.player = new System.Windows.Forms.PictureBox();
- this.pnlstatus.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.player)).BeginInit();
- this.SuspendLayout();
- //
- // pnlstatus
- //
- this.pnlstatus.Controls.Add(this.btnplay);
- this.pnlstatus.Controls.Add(this.lbstatus);
- this.pnlstatus.Controls.Add(this.lbstatus2);
- this.pnlstatus.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pnlstatus.Location = new System.Drawing.Point(0, 408);
- this.pnlstatus.Name = "pnlstatus";
- this.pnlstatus.Size = new System.Drawing.Size(800, 30);
- this.pnlstatus.TabIndex = 0;
- //
- // btnplay
- //
- this.btnplay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnplay.Location = new System.Drawing.Point(3, 3);
- this.btnplay.Name = "btnplay";
- this.btnplay.Size = new System.Drawing.Size(75, 23);
- this.btnplay.TabIndex = 0;
- this.btnplay.Text = "Play";
- this.btnplay.UseVisualStyleBackColor = true;
- this.btnplay.Click += new System.EventHandler(this.btnplay_Click);
- //
- // lbstatus
- //
- this.lbstatus.Location = new System.Drawing.Point(84, 0);
- this.lbstatus.Name = "lbstatus";
- this.lbstatus.Size = new System.Drawing.Size(137, 23);
- this.lbstatus.TabIndex = 1;
- this.lbstatus.Text = "Codepoints: 0";
- this.lbstatus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // lbstatus2
- //
- this.lbstatus2.Location = new System.Drawing.Point(227, 0);
- this.lbstatus2.Name = "lbstatus2";
- this.lbstatus2.Size = new System.Drawing.Size(137, 23);
- this.lbstatus2.TabIndex = 2;
- this.lbstatus2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // ground
- //
- this.ground.Location = new System.Drawing.Point(87, 262);
- this.ground.Name = "ground";
- this.ground.Size = new System.Drawing.Size(200, 35);
- this.ground.TabIndex = 1;
- //
- // tmrscreenupdate
- //
- this.tmrscreenupdate.Interval = 500;
- this.tmrscreenupdate.Tick += new System.EventHandler(this.tmrscreenupdate_Tick);
- //
- // player
- //
- this.player.Image = global::ShiftOS.Properties.Resources.jumperplayer;
- this.player.Location = new System.Drawing.Point(219, 96);
- this.player.Name = "player";
- this.player.Size = new System.Drawing.Size(32, 32);
- this.player.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
- this.player.TabIndex = 2;
- this.player.TabStop = false;
- //
- // Jumper
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(800, 438);
- this.Controls.Add(this.player);
- this.Controls.Add(this.ground);
- this.Controls.Add(this.pnlstatus);
- this.Name = "Jumper";
- this.Text = "Jumper";
- this.pnlstatus.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)(this.player)).EndInit();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.FlowLayoutPanel pnlstatus;
- private System.Windows.Forms.Button btnplay;
- private System.Windows.Forms.Label lbstatus;
- private System.Windows.Forms.Panel ground;
- private System.Windows.Forms.Timer tmrscreenupdate;
- private System.Windows.Forms.PictureBox player;
- private System.Windows.Forms.Label lbstatus2;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Jumper.cs b/source/WindowsFormsApplication1/Jumper.cs
deleted file mode 100644
index 766c929..0000000
--- a/source/WindowsFormsApplication1/Jumper.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class Jumper : Form
- {
- public Jumper()
- {
- InitializeComponent();
- }
-
- enum GameStatus
- {
- Idle,
- GameOver,
- Playing
- }
-
- private GameStatus status = GameStatus.Idle;
- private int JumpingStage = 0; //not jumping
-
- int gamespeed = 1;
- int codepointsearned = 0;
-
- Random rand = new Random();
-
- private void tmrscreenupdate_Tick(object sender, EventArgs e)
- {
- ground.Location = new Point(0, 260);
- ground.Size = new Size(this.ClientRectangle.Width, 2);
- ground.BackColor = Color.Black;
- switch(JumpingStage)
- {
- case 0:
- player.Location = new Point(100, 228);
- break;
- case 1:
- if(player.Location.Y != 200)
- {
- player.Location = new Point(player.Location.X, player.Location.Y - 5);
- } else
- {
- JumpingStage = 2;
- }
- break;
- case 2:
- if (player.Location.Y != 228)
- {
- player.Location = new Point(player.Location.X, player.Location.Y + 5);
- }
- else
- {
- JumpingStage = 0;
- lbstatus.Text = "Landed";
- }
- break;
-
- }
- int randres = rand.Next(0, 9);
- switch(randres)
- {
- case 5:
- Panel enemy = new Panel();
- this.Controls.Add(enemy);
- enemy.Location = new Point(this.ClientRectangle.Width, 227);
- enemy.BackColor = Color.Black;
- enemy.Size = new Size(32, 27);
- enemy.Tag = "enemy";
- enemy.Show();
- break;
- }
-
- foreach (Control ctrl in this.Controls)
- {
- string enemytag = "enemy";
- if (enemytag == (string)ctrl.Tag)
- {
- if (ctrl.Location.X < 0 - ctrl.Width)
- {
- ctrl.Hide();
- }
- else
- {
- ctrl.Location = new Point(ctrl.Location.X - (2 * gamespeed), ctrl.Location.Y);
- }
- if (ctrl.Left >= player.Left && ctrl.Left <= player.Right)
- {
- if(ctrl.Top >= player.Top && ctrl.Bottom <= player.Bottom)
- {
- status = GameStatus.GameOver;
- }
- }
- }
- }
-
- switch(status)
- {
- case GameStatus.Playing:
- codepointsearned += gamespeed;
- btnplay.Hide();
- lbstatus.Text = "Codepoints: " + codepointsearned.ToString();
- break;
- case GameStatus.GameOver:
- tmrscreenupdate.Stop();
- API.CreateInfoboxSession("You hit an obstacle.", "You have run into an obstacle. You have earned " + codepointsearned.ToString() + " Codepoints.", infobox.InfoboxMode.Info);
- API.AddCodepoints(codepointsearned);
- codepointsearned = 0;
- if(API.Upgrades["multitasking"] == true)
- {
- this.Close(); //Close if multitasking is true.
- }
- break;
- }
- }
-
- private void btnplay_Click(object sender, EventArgs e)
- {
- if(this.status == GameStatus.Idle)
- {
- this.status = GameStatus.Playing;
- this.Focus();
- this.KeyDown += (object s, KeyEventArgs a) =>
- {
- if (a.KeyCode == Keys.Space)
- {
- if (JumpingStage == 0)
- {
- JumpingStage = 1;
- lbstatus2.Text = "Jumping...";
- }
- a.SuppressKeyPress = true;
- }
- };
- tmrscreenupdate.Start();
- }
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Labyrinth.designer.vb b/source/WindowsFormsApplication1/Labyrinth.designer.vb
deleted file mode 100644
index 65486bd..0000000
--- a/source/WindowsFormsApplication1/Labyrinth.designer.vb
+++ /dev/null
@@ -1,1048 +0,0 @@
-<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
-Partial Class Labyrinth
- Inherits System.Windows.Forms.Form
-
- 'Form overrides dispose to clean up the component list.
- <System.Diagnostics.DebuggerNonUserCode()> _
- Protected Overrides Sub Dispose(ByVal disposing As Boolean)
- Try
- If disposing AndAlso components IsNot Nothing Then
- components.Dispose()
- End If
- Finally
- MyBase.Dispose(disposing)
- End Try
- End Sub
-
- 'Required by the Windows Form Designer
- Private components As System.ComponentModel.IContainer
-
- 'NOTE: The following procedure is required by the Windows Form Designer
- 'It can be modified using the Windows Form Designer.
- 'Do not modify it using the code editor.
- <System.Diagnostics.DebuggerStepThrough()> _
- Private Sub InitializeComponent()
- Me.components = New System.ComponentModel.Container()
- Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Labyrinth))
- Me.pullside = New System.Windows.Forms.Timer(Me.components)
- Me.pullbs = New System.Windows.Forms.Timer(Me.components)
- Me.pgbottom = New System.Windows.Forms.Panel()
- Me.pullbottom = New System.Windows.Forms.Timer(Me.components)
- Me.minimizebutton = New System.Windows.Forms.Panel()
- Me.pnlicon = New System.Windows.Forms.PictureBox()
- Me.rollupbutton = New System.Windows.Forms.Panel()
- Me.pgbottomrcorner = New System.Windows.Forms.Panel()
- Me.pgright = New System.Windows.Forms.Panel()
- Me.closebutton = New System.Windows.Forms.Panel()
- Me.lbtitletext = New System.Windows.Forms.Label()
- Me.pgtoplcorner = New System.Windows.Forms.Panel()
- Me.pgtoprcorner = New System.Windows.Forms.Panel()
- Me.pgbottomlcorner = New System.Windows.Forms.Panel()
- Me.pgcontents = New System.Windows.Forms.Panel()
- Me.pnllevelholder = New System.Windows.Forms.Panel()
- Me.pnlintro = New System.Windows.Forms.Panel()
- Me.beginbtn = New System.Windows.Forms.Button()
- Me.lblwelcometxt = New System.Windows.Forms.Label()
- Me.pnllvl3 = New System.Windows.Forms.Panel()
- Me.Panel31 = New System.Windows.Forms.Panel()
- Me.Panel30 = New System.Windows.Forms.Panel()
- Me.Panel29 = New System.Windows.Forms.Panel()
- Me.Panel28 = New System.Windows.Forms.Panel()
- Me.Panel27 = New System.Windows.Forms.Panel()
- Me.Panel26 = New System.Windows.Forms.Panel()
- Me.Label2 = New System.Windows.Forms.Label()
- Me.pnllvl1 = New System.Windows.Forms.Panel()
- Me.pnlplayer = New System.Windows.Forms.Panel()
- Me.lbllvl1exit = New System.Windows.Forms.Label()
- Me.Panel11 = New System.Windows.Forms.Panel()
- Me.Panel10 = New System.Windows.Forms.Panel()
- Me.Panel9 = New System.Windows.Forms.Panel()
- Me.Panel8 = New System.Windows.Forms.Panel()
- Me.Panel7 = New System.Windows.Forms.Panel()
- Me.Panel6 = New System.Windows.Forms.Panel()
- Me.Panel5 = New System.Windows.Forms.Panel()
- Me.Panel4 = New System.Windows.Forms.Panel()
- Me.Panel3 = New System.Windows.Forms.Panel()
- Me.Panel2 = New System.Windows.Forms.Panel()
- Me.Panel1 = New System.Windows.Forms.Panel()
- Me.pnllvl2 = New System.Windows.Forms.Panel()
- Me.Panel25 = New System.Windows.Forms.Panel()
- Me.Panel24 = New System.Windows.Forms.Panel()
- Me.Panel23 = New System.Windows.Forms.Panel()
- Me.Panel22 = New System.Windows.Forms.Panel()
- Me.Panel21 = New System.Windows.Forms.Panel()
- Me.Panel20 = New System.Windows.Forms.Panel()
- Me.Panel19 = New System.Windows.Forms.Panel()
- Me.Panel18 = New System.Windows.Forms.Panel()
- Me.Panel17 = New System.Windows.Forms.Panel()
- Me.Panel16 = New System.Windows.Forms.Panel()
- Me.Panel15 = New System.Windows.Forms.Panel()
- Me.Panel14 = New System.Windows.Forms.Panel()
- Me.Panel13 = New System.Windows.Forms.Panel()
- Me.Panel12 = New System.Windows.Forms.Panel()
- Me.Label3 = New System.Windows.Forms.Label()
- Me.pnlfooter = New System.Windows.Forms.Panel()
- Me.Label1 = New System.Windows.Forms.Label()
- Me.lbltime = New System.Windows.Forms.Label()
- Me.btncashout = New System.Windows.Forms.Button()
- Me.lbllevel = New System.Windows.Forms.Label()
- Me.lbltitle = New System.Windows.Forms.Label()
- Me.pgleft = New System.Windows.Forms.Panel()
- Me.titlebar = New System.Windows.Forms.Panel()
- Me.tmrtimeleft = New System.Windows.Forms.Timer(Me.components)
- Me.tmrgametick = New System.Windows.Forms.Timer(Me.components)
- Me.pnllvl4 = New System.Windows.Forms.Panel()
- Me.Label5 = New System.Windows.Forms.Label()
- Me.Panel32 = New System.Windows.Forms.Panel()
- Me.Panel33 = New System.Windows.Forms.Panel()
- Me.Panel34 = New System.Windows.Forms.Panel()
- Me.Panel35 = New System.Windows.Forms.Panel()
- Me.Panel36 = New System.Windows.Forms.Panel()
- Me.Panel37 = New System.Windows.Forms.Panel()
- Me.Panel38 = New System.Windows.Forms.Panel()
- Me.Panel39 = New System.Windows.Forms.Panel()
- Me.Panel40 = New System.Windows.Forms.Panel()
- Me.Panel41 = New System.Windows.Forms.Panel()
- Me.pnllvl5 = New System.Windows.Forms.Panel()
- Me.Label6 = New System.Windows.Forms.Label()
- Me.Panel42 = New System.Windows.Forms.Panel()
- Me.Panel43 = New System.Windows.Forms.Panel()
- Me.Panel44 = New System.Windows.Forms.Panel()
- Me.Panel45 = New System.Windows.Forms.Panel()
- Me.Panel46 = New System.Windows.Forms.Panel()
- Me.Panel47 = New System.Windows.Forms.Panel()
- Me.Panel48 = New System.Windows.Forms.Panel()
- CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.pgright.SuspendLayout()
- Me.pgcontents.SuspendLayout()
- Me.pnllevelholder.SuspendLayout()
- Me.pnlintro.SuspendLayout()
- Me.pnllvl3.SuspendLayout()
- Me.pnllvl1.SuspendLayout()
- Me.pnllvl2.SuspendLayout()
- Me.pnlfooter.SuspendLayout()
- Me.pgleft.SuspendLayout()
- Me.titlebar.SuspendLayout()
- Me.pnllvl4.SuspendLayout()
- Me.pnllvl5.SuspendLayout()
- Me.SuspendLayout()
- '
- 'pullside
- '
- Me.pullside.Interval = 1
- '
- 'pullbs
- '
- Me.pullbs.Interval = 1
- '
- 'pgbottom
- '
- Me.pgbottom.BackColor = System.Drawing.Color.Gray
- Me.pgbottom.Dock = System.Windows.Forms.DockStyle.Bottom
- Me.pgbottom.Location = New System.Drawing.Point(2, 298)
- Me.pgbottom.Name = "pgbottom"
- Me.pgbottom.Size = New System.Drawing.Size(496, 2)
- Me.pgbottom.TabIndex = 31
- '
- 'pullbottom
- '
- Me.pullbottom.Interval = 1
- '
- 'minimizebutton
- '
- Me.minimizebutton.BackColor = System.Drawing.Color.Black
- Me.minimizebutton.Location = New System.Drawing.Point(246, 5)
- Me.minimizebutton.Name = "minimizebutton"
- Me.minimizebutton.Size = New System.Drawing.Size(22, 22)
- Me.minimizebutton.TabIndex = 24
- '
- 'pnlicon
- '
- Me.pnlicon.BackColor = System.Drawing.Color.Transparent
- Me.pnlicon.Image = Global.ShiftOS.My.Resources.Resources.iconTextPad
- Me.pnlicon.Location = New System.Drawing.Point(8, 8)
- Me.pnlicon.Name = "pnlicon"
- Me.pnlicon.Size = New System.Drawing.Size(16, 16)
- Me.pnlicon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
- Me.pnlicon.TabIndex = 24
- Me.pnlicon.TabStop = False
- Me.pnlicon.Visible = False
- '
- 'rollupbutton
- '
- Me.rollupbutton.BackColor = System.Drawing.Color.Black
- Me.rollupbutton.Location = New System.Drawing.Point(274, 3)
- Me.rollupbutton.Name = "rollupbutton"
- Me.rollupbutton.Size = New System.Drawing.Size(22, 22)
- Me.rollupbutton.TabIndex = 22
- '
- 'pgbottomrcorner
- '
- Me.pgbottomrcorner.BackColor = System.Drawing.Color.Red
- Me.pgbottomrcorner.Dock = System.Windows.Forms.DockStyle.Bottom
- Me.pgbottomrcorner.Location = New System.Drawing.Point(0, 268)
- Me.pgbottomrcorner.Name = "pgbottomrcorner"
- Me.pgbottomrcorner.Size = New System.Drawing.Size(2, 2)
- Me.pgbottomrcorner.TabIndex = 15
- '
- 'pgright
- '
- Me.pgright.BackColor = System.Drawing.Color.Gray
- Me.pgright.Controls.Add(Me.pgbottomrcorner)
- Me.pgright.Dock = System.Windows.Forms.DockStyle.Right
- Me.pgright.Location = New System.Drawing.Point(498, 30)
- Me.pgright.Name = "pgright"
- Me.pgright.Size = New System.Drawing.Size(2, 270)
- Me.pgright.TabIndex = 30
- '
- 'closebutton
- '
- Me.closebutton.BackColor = System.Drawing.Color.Black
- Me.closebutton.Location = New System.Drawing.Point(302, 3)
- Me.closebutton.Name = "closebutton"
- Me.closebutton.Size = New System.Drawing.Size(22, 22)
- Me.closebutton.TabIndex = 20
- '
- 'lbtitletext
- '
- Me.lbtitletext.AutoSize = True
- Me.lbtitletext.BackColor = System.Drawing.Color.Transparent
- Me.lbtitletext.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.lbtitletext.Location = New System.Drawing.Point(26, 7)
- Me.lbtitletext.Name = "lbtitletext"
- Me.lbtitletext.Size = New System.Drawing.Size(77, 18)
- Me.lbtitletext.TabIndex = 19
- Me.lbtitletext.Text = "Template"
- '
- 'pgtoplcorner
- '
- Me.pgtoplcorner.BackColor = System.Drawing.Color.Red
- Me.pgtoplcorner.Dock = System.Windows.Forms.DockStyle.Left
- Me.pgtoplcorner.Location = New System.Drawing.Point(0, 0)
- Me.pgtoplcorner.Name = "pgtoplcorner"
- Me.pgtoplcorner.Size = New System.Drawing.Size(2, 30)
- Me.pgtoplcorner.TabIndex = 17
- '
- 'pgtoprcorner
- '
- Me.pgtoprcorner.BackColor = System.Drawing.Color.Red
- Me.pgtoprcorner.Dock = System.Windows.Forms.DockStyle.Right
- Me.pgtoprcorner.Location = New System.Drawing.Point(498, 0)
- Me.pgtoprcorner.Name = "pgtoprcorner"
- Me.pgtoprcorner.Size = New System.Drawing.Size(2, 30)
- Me.pgtoprcorner.TabIndex = 16
- '
- 'pgbottomlcorner
- '
- Me.pgbottomlcorner.BackColor = System.Drawing.Color.Red
- Me.pgbottomlcorner.Dock = System.Windows.Forms.DockStyle.Bottom
- Me.pgbottomlcorner.Location = New System.Drawing.Point(0, 268)
- Me.pgbottomlcorner.Name = "pgbottomlcorner"
- Me.pgbottomlcorner.Size = New System.Drawing.Size(2, 2)
- Me.pgbottomlcorner.TabIndex = 14
- '
- 'pgcontents
- '
- Me.pgcontents.BackColor = System.Drawing.Color.White
- Me.pgcontents.Controls.Add(Me.pnllevelholder)
- Me.pgcontents.Controls.Add(Me.pnlfooter)
- Me.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill
- Me.pgcontents.Location = New System.Drawing.Point(2, 30)
- Me.pgcontents.Name = "pgcontents"
- Me.pgcontents.Size = New System.Drawing.Size(498, 270)
- Me.pgcontents.TabIndex = 28
- '
- 'pnllevelholder
- '
- Me.pnllevelholder.Controls.Add(Me.pnllvl5)
- Me.pnllevelholder.Controls.Add(Me.pnllvl4)
- Me.pnllevelholder.Controls.Add(Me.pnlintro)
- Me.pnllevelholder.Controls.Add(Me.pnllvl3)
- Me.pnllevelholder.Controls.Add(Me.pnllvl1)
- Me.pnllevelholder.Controls.Add(Me.pnllvl2)
- Me.pnllevelholder.Dock = System.Windows.Forms.DockStyle.Fill
- Me.pnllevelholder.Location = New System.Drawing.Point(0, 0)
- Me.pnllevelholder.Name = "pnllevelholder"
- Me.pnllevelholder.Size = New System.Drawing.Size(498, 218)
- Me.pnllevelholder.TabIndex = 1
- '
- 'pnlintro
- '
- Me.pnlintro.Controls.Add(Me.beginbtn)
- Me.pnlintro.Controls.Add(Me.lblwelcometxt)
- Me.pnlintro.Location = New System.Drawing.Point(10, 181)
- Me.pnlintro.Name = "pnlintro"
- Me.pnlintro.Size = New System.Drawing.Size(78, 34)
- Me.pnlintro.TabIndex = 3
- '
- 'beginbtn
- '
- Me.beginbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.beginbtn.Location = New System.Drawing.Point(205, 153)
- Me.beginbtn.Name = "beginbtn"
- Me.beginbtn.Size = New System.Drawing.Size(75, 23)
- Me.beginbtn.TabIndex = 1
- Me.beginbtn.Text = "Begin"
- Me.beginbtn.UseVisualStyleBackColor = True
- '
- 'lblwelcometxt
- '
- Me.lblwelcometxt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.lblwelcometxt.Location = New System.Drawing.Point(30, 64)
- Me.lblwelcometxt.Name = "lblwelcometxt"
- Me.lblwelcometxt.Size = New System.Drawing.Size(445, 117)
- Me.lblwelcometxt.TabIndex = 0
- Me.lblwelcometxt.Text = resources.GetString("lblwelcometxt.Text")
- '
- 'pnllvl3
- '
- Me.pnllvl3.Controls.Add(Me.Panel31)
- Me.pnllvl3.Controls.Add(Me.Panel30)
- Me.pnllvl3.Controls.Add(Me.Panel29)
- Me.pnllvl3.Controls.Add(Me.Panel28)
- Me.pnllvl3.Controls.Add(Me.Panel27)
- Me.pnllvl3.Controls.Add(Me.Panel26)
- Me.pnllvl3.Controls.Add(Me.Label2)
- Me.pnllvl3.Location = New System.Drawing.Point(190, 3)
- Me.pnllvl3.Name = "pnllvl3"
- Me.pnllvl3.Size = New System.Drawing.Size(88, 37)
- Me.pnllvl3.TabIndex = 2
- '
- 'Panel31
- '
- Me.Panel31.BackColor = System.Drawing.Color.Black
- Me.Panel31.Location = New System.Drawing.Point(27, 156)
- Me.Panel31.Name = "Panel31"
- Me.Panel31.Size = New System.Drawing.Size(333, 62)
- Me.Panel31.TabIndex = 17
- '
- 'Panel30
- '
- Me.Panel30.BackColor = System.Drawing.Color.Black
- Me.Panel30.Location = New System.Drawing.Point(385, 133)
- Me.Panel30.Name = "Panel30"
- Me.Panel30.Size = New System.Drawing.Size(26, 58)
- Me.Panel30.TabIndex = 16
- '
- 'Panel29
- '
- Me.Panel29.BackColor = System.Drawing.Color.Black
- Me.Panel29.Location = New System.Drawing.Point(27, 105)
- Me.Panel29.Name = "Panel29"
- Me.Panel29.Size = New System.Drawing.Size(414, 28)
- Me.Panel29.TabIndex = 15
- '
- 'Panel28
- '
- Me.Panel28.BackColor = System.Drawing.Color.Black
- Me.Panel28.Location = New System.Drawing.Point(441, 156)
- Me.Panel28.Name = "Panel28"
- Me.Panel28.Size = New System.Drawing.Size(23, 62)
- Me.Panel28.TabIndex = 14
- '
- 'Panel27
- '
- Me.Panel27.BackColor = System.Drawing.Color.Black
- Me.Panel27.Location = New System.Drawing.Point(441, 0)
- Me.Panel27.Name = "Panel27"
- Me.Panel27.Size = New System.Drawing.Size(23, 134)
- Me.Panel27.TabIndex = 13
- '
- 'Panel26
- '
- Me.Panel26.BackColor = System.Drawing.Color.Black
- Me.Panel26.Location = New System.Drawing.Point(0, 41)
- Me.Panel26.Name = "Panel26"
- Me.Panel26.Size = New System.Drawing.Size(414, 28)
- Me.Panel26.TabIndex = 12
- '
- 'Label2
- '
- Me.Label2.AutoSize = True
- Me.Label2.Location = New System.Drawing.Point(476, 60)
- Me.Label2.Name = "Label2"
- Me.Label2.Size = New System.Drawing.Size(14, 104)
- Me.Label2.TabIndex = 11
- Me.Label2.Text = ">" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "E" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "X" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " I" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "T" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & ">"
- '
- 'pnllvl1
- '
- Me.pnllvl1.Controls.Add(Me.pnlplayer)
- Me.pnllvl1.Controls.Add(Me.lbllvl1exit)
- Me.pnllvl1.Controls.Add(Me.Panel11)
- Me.pnllvl1.Controls.Add(Me.Panel10)
- Me.pnllvl1.Controls.Add(Me.Panel9)
- Me.pnllvl1.Controls.Add(Me.Panel8)
- Me.pnllvl1.Controls.Add(Me.Panel7)
- Me.pnllvl1.Controls.Add(Me.Panel6)
- Me.pnllvl1.Controls.Add(Me.Panel5)
- Me.pnllvl1.Controls.Add(Me.Panel4)
- Me.pnllvl1.Controls.Add(Me.Panel3)
- Me.pnllvl1.Controls.Add(Me.Panel2)
- Me.pnllvl1.Controls.Add(Me.Panel1)
- Me.pnllvl1.Location = New System.Drawing.Point(0, 0)
- Me.pnllvl1.Name = "pnllvl1"
- Me.pnllvl1.Size = New System.Drawing.Size(84, 40)
- Me.pnllvl1.TabIndex = 0
- '
- 'pnlplayer
- '
- Me.pnlplayer.BackColor = System.Drawing.Color.Gray
- Me.pnlplayer.Location = New System.Drawing.Point(8, 10)
- Me.pnlplayer.Name = "pnlplayer"
- Me.pnlplayer.Size = New System.Drawing.Size(13, 13)
- Me.pnlplayer.TabIndex = 12
- '
- 'lbllvl1exit
- '
- Me.lbllvl1exit.AutoSize = True
- Me.lbllvl1exit.Location = New System.Drawing.Point(476, 60)
- Me.lbllvl1exit.Name = "lbllvl1exit"
- Me.lbllvl1exit.Size = New System.Drawing.Size(14, 104)
- Me.lbllvl1exit.TabIndex = 11
- Me.lbllvl1exit.Text = ">" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "E" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "X" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " I" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "T" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & ">"
- '
- 'Panel11
- '
- Me.Panel11.BackColor = System.Drawing.Color.Black
- Me.Panel11.Location = New System.Drawing.Point(420, 0)
- Me.Panel11.Name = "Panel11"
- Me.Panel11.Size = New System.Drawing.Size(23, 158)
- Me.Panel11.TabIndex = 10
- '
- 'Panel10
- '
- Me.Panel10.BackColor = System.Drawing.Color.Black
- Me.Panel10.Location = New System.Drawing.Point(355, 60)
- Me.Panel10.Name = "Panel10"
- Me.Panel10.Size = New System.Drawing.Size(23, 158)
- Me.Panel10.TabIndex = 9
- '
- 'Panel9
- '
- Me.Panel9.BackColor = System.Drawing.Color.Black
- Me.Panel9.Location = New System.Drawing.Point(152, 0)
- Me.Panel9.Name = "Panel9"
- Me.Panel9.Size = New System.Drawing.Size(168, 34)
- Me.Panel9.TabIndex = 8
- '
- 'Panel8
- '
- Me.Panel8.BackColor = System.Drawing.Color.Black
- Me.Panel8.Location = New System.Drawing.Point(296, 114)
- Me.Panel8.Name = "Panel8"
- Me.Panel8.Size = New System.Drawing.Size(24, 44)
- Me.Panel8.TabIndex = 7
- '
- 'Panel7
- '
- Me.Panel7.BackColor = System.Drawing.Color.Black
- Me.Panel7.Location = New System.Drawing.Point(242, 114)
- Me.Panel7.Name = "Panel7"
- Me.Panel7.Size = New System.Drawing.Size(24, 44)
- Me.Panel7.TabIndex = 6
- '
- 'Panel6
- '
- Me.Panel6.BackColor = System.Drawing.Color.Black
- Me.Panel6.Location = New System.Drawing.Point(190, 114)
- Me.Panel6.Name = "Panel6"
- Me.Panel6.Size = New System.Drawing.Size(24, 44)
- Me.Panel6.TabIndex = 5
- '
- 'Panel5
- '
- Me.Panel5.BackColor = System.Drawing.Color.Black
- Me.Panel5.Location = New System.Drawing.Point(152, 184)
- Me.Panel5.Name = "Panel5"
- Me.Panel5.Size = New System.Drawing.Size(168, 34)
- Me.Panel5.TabIndex = 4
- '
- 'Panel4
- '
- Me.Panel4.BackColor = System.Drawing.Color.Black
- Me.Panel4.Location = New System.Drawing.Point(152, 60)
- Me.Panel4.Name = "Panel4"
- Me.Panel4.Size = New System.Drawing.Size(168, 28)
- Me.Panel4.TabIndex = 3
- '
- 'Panel3
- '
- Me.Panel3.BackColor = System.Drawing.Color.Black
- Me.Panel3.Location = New System.Drawing.Point(130, 0)
- Me.Panel3.Name = "Panel3"
- Me.Panel3.Size = New System.Drawing.Size(23, 158)
- Me.Panel3.TabIndex = 2
- '
- 'Panel2
- '
- Me.Panel2.BackColor = System.Drawing.Color.Black
- Me.Panel2.Location = New System.Drawing.Point(78, 60)
- Me.Panel2.Name = "Panel2"
- Me.Panel2.Size = New System.Drawing.Size(23, 158)
- Me.Panel2.TabIndex = 1
- '
- 'Panel1
- '
- Me.Panel1.BackColor = System.Drawing.Color.Black
- Me.Panel1.Location = New System.Drawing.Point(27, 0)
- Me.Panel1.Name = "Panel1"
- Me.Panel1.Size = New System.Drawing.Size(23, 158)
- Me.Panel1.TabIndex = 0
- '
- 'pnllvl2
- '
- Me.pnllvl2.Controls.Add(Me.Panel25)
- Me.pnllvl2.Controls.Add(Me.Panel24)
- Me.pnllvl2.Controls.Add(Me.Panel23)
- Me.pnllvl2.Controls.Add(Me.Panel22)
- Me.pnllvl2.Controls.Add(Me.Panel21)
- Me.pnllvl2.Controls.Add(Me.Panel20)
- Me.pnllvl2.Controls.Add(Me.Panel19)
- Me.pnllvl2.Controls.Add(Me.Panel18)
- Me.pnllvl2.Controls.Add(Me.Panel17)
- Me.pnllvl2.Controls.Add(Me.Panel16)
- Me.pnllvl2.Controls.Add(Me.Panel15)
- Me.pnllvl2.Controls.Add(Me.Panel14)
- Me.pnllvl2.Controls.Add(Me.Panel13)
- Me.pnllvl2.Controls.Add(Me.Panel12)
- Me.pnllvl2.Controls.Add(Me.Label3)
- Me.pnllvl2.Location = New System.Drawing.Point(90, 3)
- Me.pnllvl2.Name = "pnllvl2"
- Me.pnllvl2.Size = New System.Drawing.Size(88, 37)
- Me.pnllvl2.TabIndex = 1
- '
- 'Panel25
- '
- Me.Panel25.BackColor = System.Drawing.Color.Black
- Me.Panel25.Location = New System.Drawing.Point(264, 111)
- Me.Panel25.Name = "Panel25"
- Me.Panel25.Size = New System.Drawing.Size(86, 24)
- Me.Panel25.TabIndex = 25
- '
- 'Panel24
- '
- Me.Panel24.BackColor = System.Drawing.Color.Black
- Me.Panel24.Location = New System.Drawing.Point(296, 164)
- Me.Panel24.Name = "Panel24"
- Me.Panel24.Size = New System.Drawing.Size(86, 24)
- Me.Panel24.TabIndex = 24
- '
- 'Panel23
- '
- Me.Panel23.BackColor = System.Drawing.Color.Black
- Me.Panel23.Location = New System.Drawing.Point(382, 87)
- Me.Panel23.Name = "Panel23"
- Me.Panel23.Size = New System.Drawing.Size(24, 101)
- Me.Panel23.TabIndex = 23
- '
- 'Panel22
- '
- Me.Panel22.BackColor = System.Drawing.Color.Black
- Me.Panel22.Location = New System.Drawing.Point(264, 60)
- Me.Panel22.Name = "Panel22"
- Me.Panel22.Size = New System.Drawing.Size(142, 28)
- Me.Panel22.TabIndex = 22
- '
- 'Panel21
- '
- Me.Panel21.BackColor = System.Drawing.Color.Black
- Me.Panel21.Location = New System.Drawing.Point(242, 111)
- Me.Panel21.Name = "Panel21"
- Me.Panel21.Size = New System.Drawing.Size(24, 107)
- Me.Panel21.TabIndex = 21
- '
- 'Panel20
- '
- Me.Panel20.BackColor = System.Drawing.Color.Black
- Me.Panel20.Location = New System.Drawing.Point(242, 0)
- Me.Panel20.Name = "Panel20"
- Me.Panel20.Size = New System.Drawing.Size(24, 88)
- Me.Panel20.TabIndex = 20
- '
- 'Panel19
- '
- Me.Panel19.BackColor = System.Drawing.Color.Black
- Me.Panel19.Location = New System.Drawing.Point(152, 89)
- Me.Panel19.Name = "Panel19"
- Me.Panel19.Size = New System.Drawing.Size(20, 69)
- Me.Panel19.TabIndex = 19
- '
- 'Panel18
- '
- Me.Panel18.BackColor = System.Drawing.Color.Black
- Me.Panel18.Location = New System.Drawing.Point(114, 164)
- Me.Panel18.Name = "Panel18"
- Me.Panel18.Size = New System.Drawing.Size(100, 24)
- Me.Panel18.TabIndex = 18
- '
- 'Panel17
- '
- Me.Panel17.BackColor = System.Drawing.Color.Black
- Me.Panel17.Location = New System.Drawing.Point(114, 61)
- Me.Panel17.Name = "Panel17"
- Me.Panel17.Size = New System.Drawing.Size(100, 24)
- Me.Panel17.TabIndex = 17
- '
- 'Panel16
- '
- Me.Panel16.BackColor = System.Drawing.Color.Black
- Me.Panel16.Location = New System.Drawing.Point(78, 184)
- Me.Panel16.Name = "Panel16"
- Me.Panel16.Size = New System.Drawing.Size(20, 34)
- Me.Panel16.TabIndex = 16
- '
- 'Panel15
- '
- Me.Panel15.BackColor = System.Drawing.Color.Black
- Me.Panel15.Location = New System.Drawing.Point(31, 137)
- Me.Panel15.Name = "Panel15"
- Me.Panel15.Size = New System.Drawing.Size(19, 81)
- Me.Panel15.TabIndex = 15
- '
- 'Panel14
- '
- Me.Panel14.BackColor = System.Drawing.Color.Black
- Me.Panel14.Location = New System.Drawing.Point(78, -2)
- Me.Panel14.Name = "Panel14"
- Me.Panel14.Size = New System.Drawing.Size(19, 56)
- Me.Panel14.TabIndex = 14
- '
- 'Panel13
- '
- Me.Panel13.BackColor = System.Drawing.Color.Black
- Me.Panel13.Location = New System.Drawing.Point(78, 89)
- Me.Panel13.Name = "Panel13"
- Me.Panel13.Size = New System.Drawing.Size(19, 75)
- Me.Panel13.TabIndex = 13
- '
- 'Panel12
- '
- Me.Panel12.BackColor = System.Drawing.Color.Black
- Me.Panel12.Location = New System.Drawing.Point(30, -2)
- Me.Panel12.Name = "Panel12"
- Me.Panel12.Size = New System.Drawing.Size(20, 109)
- Me.Panel12.TabIndex = 12
- '
- 'Label3
- '
- Me.Label3.AutoSize = True
- Me.Label3.Location = New System.Drawing.Point(476, 60)
- Me.Label3.Name = "Label3"
- Me.Label3.Size = New System.Drawing.Size(14, 104)
- Me.Label3.TabIndex = 11
- Me.Label3.Text = ">" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "E" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "X" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " I" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "T" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & ">"
- '
- 'pnlfooter
- '
- Me.pnlfooter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
- Me.pnlfooter.Controls.Add(Me.Label1)
- Me.pnlfooter.Controls.Add(Me.lbltime)
- Me.pnlfooter.Controls.Add(Me.btncashout)
- Me.pnlfooter.Controls.Add(Me.lbllevel)
- Me.pnlfooter.Controls.Add(Me.lbltitle)
- Me.pnlfooter.Dock = System.Windows.Forms.DockStyle.Bottom
- Me.pnlfooter.Location = New System.Drawing.Point(0, 218)
- Me.pnlfooter.Name = "pnlfooter"
- Me.pnlfooter.Size = New System.Drawing.Size(498, 52)
- Me.pnlfooter.TabIndex = 0
- '
- 'Label1
- '
- Me.Label1.AutoSize = True
- Me.Label1.Location = New System.Drawing.Point(392, 12)
- Me.Label1.Name = "Label1"
- Me.Label1.Size = New System.Drawing.Size(50, 13)
- Me.Label1.TabIndex = 4
- Me.Label1.Text = "Time left:"
- '
- 'lbltime
- '
- Me.lbltime.AutoSize = True
- Me.lbltime.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.lbltime.Location = New System.Drawing.Point(448, 13)
- Me.lbltime.Name = "lbltime"
- Me.lbltime.Size = New System.Drawing.Size(38, 25)
- Me.lbltime.TabIndex = 3
- Me.lbltime.Text = "59"
- '
- 'btncashout
- '
- Me.btncashout.FlatStyle = System.Windows.Forms.FlatStyle.Flat
- Me.btncashout.Location = New System.Drawing.Point(220, 12)
- Me.btncashout.Name = "btncashout"
- Me.btncashout.Size = New System.Drawing.Size(99, 23)
- Me.btncashout.TabIndex = 2
- Me.btncashout.Text = "Cashout 0 CP"
- Me.btncashout.UseVisualStyleBackColor = True
- '
- 'lbllevel
- '
- Me.lbllevel.AutoSize = True
- Me.lbllevel.Location = New System.Drawing.Point(110, 22)
- Me.lbllevel.Name = "lbllevel"
- Me.lbllevel.Size = New System.Drawing.Size(42, 13)
- Me.lbllevel.TabIndex = 1
- Me.lbllevel.Text = "Level 1"
- '
- 'lbltitle
- '
- Me.lbltitle.AutoSize = True
- Me.lbltitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
- Me.lbltitle.Location = New System.Drawing.Point(10, 13)
- Me.lbltitle.Name = "lbltitle"
- Me.lbltitle.Size = New System.Drawing.Size(101, 25)
- Me.lbltitle.TabIndex = 0
- Me.lbltitle.Text = "Labyrinth"
- '
- 'pgleft
- '
- Me.pgleft.BackColor = System.Drawing.Color.Gray
- Me.pgleft.Controls.Add(Me.pgbottomlcorner)
- Me.pgleft.Dock = System.Windows.Forms.DockStyle.Left
- Me.pgleft.Location = New System.Drawing.Point(0, 30)
- Me.pgleft.Name = "pgleft"
- Me.pgleft.Size = New System.Drawing.Size(2, 270)
- Me.pgleft.TabIndex = 29
- '
- 'titlebar
- '
- Me.titlebar.BackColor = System.Drawing.Color.Gray
- Me.titlebar.Controls.Add(Me.minimizebutton)
- Me.titlebar.Controls.Add(Me.pnlicon)
- Me.titlebar.Controls.Add(Me.rollupbutton)
- Me.titlebar.Controls.Add(Me.closebutton)
- Me.titlebar.Controls.Add(Me.lbtitletext)
- Me.titlebar.Controls.Add(Me.pgtoplcorner)
- Me.titlebar.Controls.Add(Me.pgtoprcorner)
- Me.titlebar.Dock = System.Windows.Forms.DockStyle.Top
- Me.titlebar.ForeColor = System.Drawing.Color.White
- Me.titlebar.Location = New System.Drawing.Point(0, 0)
- Me.titlebar.Name = "titlebar"
- Me.titlebar.Size = New System.Drawing.Size(500, 30)
- Me.titlebar.TabIndex = 27
- '
- 'tmrtimeleft
- '
- Me.tmrtimeleft.Interval = 1000
- '
- 'tmrgametick
- '
- Me.tmrgametick.Interval = 1
- '
- 'pnllvl4
- '
- Me.pnllvl4.Controls.Add(Me.Panel41)
- Me.pnllvl4.Controls.Add(Me.Panel40)
- Me.pnllvl4.Controls.Add(Me.Panel39)
- Me.pnllvl4.Controls.Add(Me.Panel38)
- Me.pnllvl4.Controls.Add(Me.Panel37)
- Me.pnllvl4.Controls.Add(Me.Panel36)
- Me.pnllvl4.Controls.Add(Me.Panel35)
- Me.pnllvl4.Controls.Add(Me.Panel34)
- Me.pnllvl4.Controls.Add(Me.Panel33)
- Me.pnllvl4.Controls.Add(Me.Panel32)
- Me.pnllvl4.Controls.Add(Me.Label5)
- Me.pnllvl4.Location = New System.Drawing.Point(290, 3)
- Me.pnllvl4.Name = "pnllvl4"
- Me.pnllvl4.Size = New System.Drawing.Size(88, 37)
- Me.pnllvl4.TabIndex = 4
- '
- 'Label5
- '
- Me.Label5.AutoSize = True
- Me.Label5.Location = New System.Drawing.Point(476, 60)
- Me.Label5.Name = "Label5"
- Me.Label5.Size = New System.Drawing.Size(14, 104)
- Me.Label5.TabIndex = 11
- Me.Label5.Text = ">" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "E" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "X" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " I" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "T" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & ">"
- '
- 'Panel32
- '
- Me.Panel32.BackColor = System.Drawing.Color.Black
- Me.Panel32.Location = New System.Drawing.Point(38, 22)
- Me.Panel32.Name = "Panel32"
- Me.Panel32.Size = New System.Drawing.Size(50, 50)
- Me.Panel32.TabIndex = 12
- '
- 'Panel33
- '
- Me.Panel33.BackColor = System.Drawing.Color.Black
- Me.Panel33.Location = New System.Drawing.Point(112, 60)
- Me.Panel33.Name = "Panel33"
- Me.Panel33.Size = New System.Drawing.Size(50, 50)
- Me.Panel33.TabIndex = 13
- '
- 'Panel34
- '
- Me.Panel34.BackColor = System.Drawing.Color.Black
- Me.Panel34.Location = New System.Drawing.Point(204, 35)
- Me.Panel34.Name = "Panel34"
- Me.Panel34.Size = New System.Drawing.Size(50, 50)
- Me.Panel34.TabIndex = 14
- '
- 'Panel35
- '
- Me.Panel35.BackColor = System.Drawing.Color.Black
- Me.Panel35.Location = New System.Drawing.Point(155, 136)
- Me.Panel35.Name = "Panel35"
- Me.Panel35.Size = New System.Drawing.Size(50, 50)
- Me.Panel35.TabIndex = 15
- '
- 'Panel36
- '
- Me.Panel36.BackColor = System.Drawing.Color.Black
- Me.Panel36.Location = New System.Drawing.Point(296, 128)
- Me.Panel36.Name = "Panel36"
- Me.Panel36.Size = New System.Drawing.Size(50, 50)
- Me.Panel36.TabIndex = 16
- '
- 'Panel37
- '
- Me.Panel37.BackColor = System.Drawing.Color.Black
- Me.Panel37.Location = New System.Drawing.Point(325, 35)
- Me.Panel37.Name = "Panel37"
- Me.Panel37.Size = New System.Drawing.Size(50, 50)
- Me.Panel37.TabIndex = 17
- '
- 'Panel38
- '
- Me.Panel38.BackColor = System.Drawing.Color.Black
- Me.Panel38.Location = New System.Drawing.Point(34, 144)
- Me.Panel38.Name = "Panel38"
- Me.Panel38.Size = New System.Drawing.Size(50, 50)
- Me.Panel38.TabIndex = 18
- '
- 'Panel39
- '
- Me.Panel39.BackColor = System.Drawing.Color.Black
- Me.Panel39.Location = New System.Drawing.Point(389, 142)
- Me.Panel39.Name = "Panel39"
- Me.Panel39.Size = New System.Drawing.Size(50, 50)
- Me.Panel39.TabIndex = 19
- '
- 'Panel40
- '
- Me.Panel40.BackColor = System.Drawing.Color.Black
- Me.Panel40.Location = New System.Drawing.Point(420, 10)
- Me.Panel40.Name = "Panel40"
- Me.Panel40.Size = New System.Drawing.Size(50, 50)
- Me.Panel40.TabIndex = 20
- '
- 'Panel41
- '
- Me.Panel41.BackColor = System.Drawing.Color.Black
- Me.Panel41.Location = New System.Drawing.Point(228, 108)
- Me.Panel41.Name = "Panel41"
- Me.Panel41.Size = New System.Drawing.Size(50, 50)
- Me.Panel41.TabIndex = 21
- '
- 'pnllvl5
- '
- Me.pnllvl5.Controls.Add(Me.Panel48)
- Me.pnllvl5.Controls.Add(Me.Panel47)
- Me.pnllvl5.Controls.Add(Me.Panel46)
- Me.pnllvl5.Controls.Add(Me.Panel45)
- Me.pnllvl5.Controls.Add(Me.Panel44)
- Me.pnllvl5.Controls.Add(Me.Panel43)
- Me.pnllvl5.Controls.Add(Me.Panel42)
- Me.pnllvl5.Controls.Add(Me.Label6)
- Me.pnllvl5.Dock = System.Windows.Forms.DockStyle.Fill
- Me.pnllvl5.Location = New System.Drawing.Point(0, 0)
- Me.pnllvl5.Name = "pnllvl5"
- Me.pnllvl5.Size = New System.Drawing.Size(498, 218)
- Me.pnllvl5.TabIndex = 5
- '
- 'Label6
- '
- Me.Label6.AutoSize = True
- Me.Label6.Location = New System.Drawing.Point(476, 60)
- Me.Label6.Name = "Label6"
- Me.Label6.Size = New System.Drawing.Size(14, 104)
- Me.Label6.TabIndex = 11
- Me.Label6.Text = ">" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "E" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "X" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & " I" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "T" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & ">"
- '
- 'Panel42
- '
- Me.Panel42.BackColor = System.Drawing.Color.Black
- Me.Panel42.Location = New System.Drawing.Point(-1, 40)
- Me.Panel42.Name = "Panel42"
- Me.Panel42.Size = New System.Drawing.Size(172, 32)
- Me.Panel42.TabIndex = 12
- '
- 'Panel43
- '
- Me.Panel43.BackColor = System.Drawing.Color.Black
- Me.Panel43.Location = New System.Drawing.Point(193, 40)
- Me.Panel43.Name = "Panel43"
- Me.Panel43.Size = New System.Drawing.Size(172, 32)
- Me.Panel43.TabIndex = 13
- '
- 'Panel44
- '
- Me.Panel44.BackColor = System.Drawing.Color.Black
- Me.Panel44.Location = New System.Drawing.Point(408, 0)
- Me.Panel44.Name = "Panel44"
- Me.Panel44.Size = New System.Drawing.Size(31, 186)
- Me.Panel44.TabIndex = 14
- '
- 'Panel45
- '
- Me.Panel45.BackColor = System.Drawing.Color.Black
- Me.Panel45.Location = New System.Drawing.Point(330, 70)
- Me.Panel45.Name = "Panel45"
- Me.Panel45.Size = New System.Drawing.Size(35, 116)
- Me.Panel45.TabIndex = 15
- '
- 'Panel46
- '
- Me.Panel46.BackColor = System.Drawing.Color.Black
- Me.Panel46.Location = New System.Drawing.Point(-2, 109)
- Me.Panel46.Name = "Panel46"
- Me.Panel46.Size = New System.Drawing.Size(172, 32)
- Me.Panel46.TabIndex = 16
- '
- 'Panel47
- '
- Me.Panel47.BackColor = System.Drawing.Color.Black
- Me.Panel47.Location = New System.Drawing.Point(-2, 167)
- Me.Panel47.Name = "Panel47"
- Me.Panel47.Size = New System.Drawing.Size(172, 32)
- Me.Panel47.TabIndex = 17
- '
- 'Panel48
- '
- Me.Panel48.BackColor = System.Drawing.Color.Black
- Me.Panel48.Location = New System.Drawing.Point(193, 115)
- Me.Panel48.Name = "Panel48"
- Me.Panel48.Size = New System.Drawing.Size(142, 32)
- Me.Panel48.TabIndex = 18
- '
- 'Labyrinth
- '
- Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
- Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
- Me.ClientSize = New System.Drawing.Size(500, 300)
- Me.Controls.Add(Me.pgbottom)
- Me.Controls.Add(Me.pgright)
- Me.Controls.Add(Me.pgcontents)
- Me.Controls.Add(Me.pgleft)
- Me.Controls.Add(Me.titlebar)
- Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
- Me.KeyPreview = True
- Me.Name = "Labyrinth"
- Me.Text = "Labyrinth"
- Me.TopMost = True
- CType(Me.pnlicon, System.ComponentModel.ISupportInitialize).EndInit()
- Me.pgright.ResumeLayout(False)
- Me.pgcontents.ResumeLayout(False)
- Me.pnllevelholder.ResumeLayout(False)
- Me.pnlintro.ResumeLayout(False)
- Me.pnllvl3.ResumeLayout(False)
- Me.pnllvl3.PerformLayout()
- Me.pnllvl1.ResumeLayout(False)
- Me.pnllvl1.PerformLayout()
- Me.pnllvl2.ResumeLayout(False)
- Me.pnllvl2.PerformLayout()
- Me.pnlfooter.ResumeLayout(False)
- Me.pnlfooter.PerformLayout()
- Me.pgleft.ResumeLayout(False)
- Me.titlebar.ResumeLayout(False)
- Me.titlebar.PerformLayout()
- Me.pnllvl4.ResumeLayout(False)
- Me.pnllvl4.PerformLayout()
- Me.pnllvl5.ResumeLayout(False)
- Me.pnllvl5.PerformLayout()
- Me.ResumeLayout(False)
-
- End Sub
- Friend WithEvents pullside As System.Windows.Forms.Timer
- Friend WithEvents pullbs As System.Windows.Forms.Timer
- Friend WithEvents pgbottom As System.Windows.Forms.Panel
- Friend WithEvents pullbottom As System.Windows.Forms.Timer
- Friend WithEvents minimizebutton As System.Windows.Forms.Panel
- Friend WithEvents pnlicon As System.Windows.Forms.PictureBox
- Friend WithEvents rollupbutton As System.Windows.Forms.Panel
- Friend WithEvents pgbottomrcorner As System.Windows.Forms.Panel
- Friend WithEvents pgright As System.Windows.Forms.Panel
- Friend WithEvents closebutton As System.Windows.Forms.Panel
- Friend WithEvents lbtitletext As System.Windows.Forms.Label
- Friend WithEvents pgtoplcorner As System.Windows.Forms.Panel
- Friend WithEvents pgtoprcorner As System.Windows.Forms.Panel
- Friend WithEvents pgbottomlcorner As System.Windows.Forms.Panel
- Friend WithEvents pgcontents As System.Windows.Forms.Panel
- Friend WithEvents pgleft As System.Windows.Forms.Panel
- Friend WithEvents titlebar As System.Windows.Forms.Panel
- Friend WithEvents pnllevelholder As System.Windows.Forms.Panel
- Friend WithEvents pnllvl1 As System.Windows.Forms.Panel
- Friend WithEvents pnlfooter As System.Windows.Forms.Panel
- Friend WithEvents Label1 As System.Windows.Forms.Label
- Friend WithEvents lbltime As System.Windows.Forms.Label
- Friend WithEvents btncashout As System.Windows.Forms.Button
- Friend WithEvents lbllevel As System.Windows.Forms.Label
- Friend WithEvents lbltitle As System.Windows.Forms.Label
- Friend WithEvents tmrtimeleft As System.Windows.Forms.Timer
- Friend WithEvents pnlplayer As System.Windows.Forms.Panel
- Friend WithEvents lbllvl1exit As System.Windows.Forms.Label
- Friend WithEvents Panel11 As System.Windows.Forms.Panel
- Friend WithEvents Panel10 As System.Windows.Forms.Panel
- Friend WithEvents Panel9 As System.Windows.Forms.Panel
- Friend WithEvents Panel8 As System.Windows.Forms.Panel
- Friend WithEvents Panel7 As System.Windows.Forms.Panel
- Friend WithEvents Panel6 As System.Windows.Forms.Panel
- Friend WithEvents Panel5 As System.Windows.Forms.Panel
- Friend WithEvents Panel4 As System.Windows.Forms.Panel
- Friend WithEvents Panel3 As System.Windows.Forms.Panel
- Friend WithEvents Panel2 As System.Windows.Forms.Panel
- Friend WithEvents Panel1 As System.Windows.Forms.Panel
- Friend WithEvents tmrgametick As System.Windows.Forms.Timer
- Friend WithEvents pnllvl2 As System.Windows.Forms.Panel
- Friend WithEvents Label3 As System.Windows.Forms.Label
- Friend WithEvents Panel25 As System.Windows.Forms.Panel
- Friend WithEvents Panel24 As System.Windows.Forms.Panel
- Friend WithEvents Panel23 As System.Windows.Forms.Panel
- Friend WithEvents Panel22 As System.Windows.Forms.Panel
- Friend WithEvents Panel21 As System.Windows.Forms.Panel
- Friend WithEvents Panel20 As System.Windows.Forms.Panel
- Friend WithEvents Panel19 As System.Windows.Forms.Panel
- Friend WithEvents Panel18 As System.Windows.Forms.Panel
- Friend WithEvents Panel17 As System.Windows.Forms.Panel
- Friend WithEvents Panel16 As System.Windows.Forms.Panel
- Friend WithEvents Panel15 As System.Windows.Forms.Panel
- Friend WithEvents Panel14 As System.Windows.Forms.Panel
- Friend WithEvents Panel13 As System.Windows.Forms.Panel
- Friend WithEvents Panel12 As System.Windows.Forms.Panel
- Friend WithEvents pnllvl3 As System.Windows.Forms.Panel
- Friend WithEvents Label2 As System.Windows.Forms.Label
- Friend WithEvents Panel31 As System.Windows.Forms.Panel
- Friend WithEvents Panel30 As System.Windows.Forms.Panel
- Friend WithEvents Panel29 As System.Windows.Forms.Panel
- Friend WithEvents Panel28 As System.Windows.Forms.Panel
- Friend WithEvents Panel27 As System.Windows.Forms.Panel
- Friend WithEvents Panel26 As System.Windows.Forms.Panel
- Friend WithEvents pnlintro As System.Windows.Forms.Panel
- Friend WithEvents lblwelcometxt As System.Windows.Forms.Label
- Friend WithEvents beginbtn As System.Windows.Forms.Button
- Friend WithEvents pnllvl4 As System.Windows.Forms.Panel
- Friend WithEvents Panel41 As System.Windows.Forms.Panel
- Friend WithEvents Panel40 As System.Windows.Forms.Panel
- Friend WithEvents Panel39 As System.Windows.Forms.Panel
- Friend WithEvents Panel38 As System.Windows.Forms.Panel
- Friend WithEvents Panel37 As System.Windows.Forms.Panel
- Friend WithEvents Panel36 As System.Windows.Forms.Panel
- Friend WithEvents Panel35 As System.Windows.Forms.Panel
- Friend WithEvents Panel34 As System.Windows.Forms.Panel
- Friend WithEvents Panel33 As System.Windows.Forms.Panel
- Friend WithEvents Panel32 As System.Windows.Forms.Panel
- Friend WithEvents Label5 As System.Windows.Forms.Label
- Friend WithEvents pnllvl5 As System.Windows.Forms.Panel
- Friend WithEvents Panel42 As System.Windows.Forms.Panel
- Friend WithEvents Label6 As System.Windows.Forms.Label
- Friend WithEvents Panel48 As System.Windows.Forms.Panel
- Friend WithEvents Panel47 As System.Windows.Forms.Panel
- Friend WithEvents Panel46 As System.Windows.Forms.Panel
- Friend WithEvents Panel45 As System.Windows.Forms.Panel
- Friend WithEvents Panel44 As System.Windows.Forms.Panel
- Friend WithEvents Panel43 As System.Windows.Forms.Panel
-
-End Class
diff --git a/source/WindowsFormsApplication1/Labyrinth.vb b/source/WindowsFormsApplication1/Labyrinth.vb
deleted file mode 100644
index 22c7d69..0000000
--- a/source/WindowsFormsApplication1/Labyrinth.vb
+++ /dev/null
@@ -1,684 +0,0 @@
-Public Class Labyrinth
-
-#Region "Template Code"
- Public rolldownsize As Integer
- Public oldbordersize As Integer
- Public oldtitlebarheight As Integer
- Public justopened As Boolean = False
- Public needtorollback As Boolean = False
- Public minimumsizewidth As Integer = 100 'replace with minimum size
- Public minimumsizeheight As Integer = 100 'replace with minimum size
-
- Private Sub Template_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- justopened = True
- Me.Left = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2
- Me.Top = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2
- setupall()
-
- setuplevels(0, True)
- If ShiftOSDesktop.LabyrinthCorrupted Then Me.Close() : infobox.showinfo("The Plague.", Me.Name & "has been corrupted by The Plague.")
-
- ShiftOSDesktop.pnlpanelbuttonmaze.SendToBack() 'CHANGE NAME
- ShiftOSDesktop.setuppanelbuttons()
- ShiftOSDesktop.setpanelbuttonappearnce(ShiftOSDesktop.pnlpanelbuttonmaze, ShiftOSDesktop.tbmazeicon, ShiftOSDesktop.tbmazetext, True) 'modify to proper name
- ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen + 1
- End Sub
-
- Public Sub setupall()
- setuptitlebar()
- setupborders()
- setskin()
- End Sub
-
- Private Sub ShiftOSDesktop_keydown(sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
- 'Make terminal appear
- If e.KeyCode = Keys.T AndAlso e.Control Then
- Terminal.Show()
- Terminal.Visible = True
- Terminal.BringToFront()
- End If
-
- 'Movable Windows
- If ShiftOSDesktop.boughtmovablewindows = True Then
- If e.KeyCode = Keys.A AndAlso e.Control Then
- e.Handled = True
- Me.Location = New Point(Me.Location.X - ShiftOSDesktop.movablewindownumber, Me.Location.Y)
- End If
- If e.KeyCode = Keys.D AndAlso e.Control Then
- e.Handled = True
- Me.Location = New Point(Me.Location.X + ShiftOSDesktop.movablewindownumber, Me.Location.Y)
- End If
- If e.KeyCode = Keys.W AndAlso e.Control Then
- e.Handled = True
- Me.Location = New Point(Me.Location.X, Me.Location.Y - ShiftOSDesktop.movablewindownumber)
- End If
- If e.KeyCode = Keys.S AndAlso e.Control Then
- e.Handled = True
- Me.Location = New Point(Me.Location.X, Me.Location.Y + ShiftOSDesktop.movablewindownumber)
- End If
- ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User moved " & Me.Name & " to " & Me.Location.ToString & " with " & e.KeyCode.ToString & Environment.NewLine
- End If
- End Sub
-
- Private Sub titlebar_MouseDown(sender As Object, e As MouseEventArgs) Handles titlebar.MouseDown, lbtitletext.MouseDown, pnlicon.MouseDown, pgtoplcorner.MouseDown, pgtoprcorner.MouseDown
- ' Handle Draggable Windows
- If ShiftOSDesktop.boughtdraggablewindows = True Then
- If e.Button = MouseButtons.Left Then
- titlebar.Capture = False
- lbtitletext.Capture = False
- pnlicon.Capture = False
- pgtoplcorner.Capture = False
- pgtoprcorner.Capture = False
- Const WM_NCLBUTTONDOWN As Integer = &HA1S
- Const HTCAPTION As Integer = 2
- Dim msg As Message = _
- Message.Create(Me.Handle, WM_NCLBUTTONDOWN, _
- New IntPtr(HTCAPTION), IntPtr.Zero)
- Me.DefWndProc(msg)
- End If
- ShiftOSDesktop.log = ShiftOSDesktop.log & My.Computer.Clock.LocalTime & " User dragged " & Me.Name & " to " & Me.Location.ToString & Environment.NewLine
- End If
- End Sub
-
- Public Sub setupborders()
- If ShiftOSDesktop.boughtwindowborders = False Then
- pgleft.Hide()
- pgbottom.Hide()
- pgright.Hide()
- Me.Size = New Size(Me.Width - pgleft.Width - pgright.Width, Me.Height - pgbottom.Height)
- End If
- End Sub
-
- Private Sub closebutton_Click(sender As Object, e As EventArgs) Handles closebutton.Click
- Me.Close()
- End Sub
-
- Private Sub closebutton_MouseEnter(sender As Object, e As EventArgs) Handles closebutton.MouseEnter, closebutton.MouseUp
- closebutton.BackgroundImage = Skins.closebtnhover
- End Sub
-
- Private Sub closebutton_MouseLeave(sender As Object, e As EventArgs) Handles closebutton.MouseLeave
- closebutton.BackgroundImage = Skins.closebtn
- End Sub
-
- Private Sub closebutton_MouseDown(sender As Object, e As EventArgs) Handles closebutton.MouseDown
- closebutton.BackgroundImage = Skins.closebtnclick
- End Sub
-
- Private Sub minimizebutton_Click(sender As Object, e As EventArgs) Handles minimizebutton.Click
- ShiftOSDesktop.minimizeprogram(Me, False)
- End Sub
-
- 'Old skinning system - No idea what this does
- ''Private Sub titlebar_MouseEnter(sender As Object, e As EventArgs) Handles titlebar.MouseEnter, titlebar.MouseUp, lbtitletext.MouseEnter, pnlicon.MouseEnter, closebutton.MouseEnter, rollupbutton.MouseEnter
- '' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(1)
- ''End Sub
-
- 'Private Sub titlebar_MouseLeave(sender As Object, e As EventArgs) Handles titlebar.MouseLeave, lbtitletext.MouseLeave, pnlicon.MouseLeave, closebutton.MouseLeave, rollupbutton.MouseLeave
- ' If ShiftOSDesktop.skinimages(3) = ShiftOSDesktop.skinimages(4) Then Else titlebar.BackgroundImage = ShiftOSDesktop.skintitlebar(0)
- 'End Sub
-
- Private Sub rollupbutton_Click(sender As Object, e As EventArgs) Handles rollupbutton.Click
- rollupanddown()
- End Sub
-
- Private Sub rollupbutton_MouseEnter(sender As Object, e As EventArgs) Handles rollupbutton.MouseEnter, rollupbutton.MouseUp
- rollupbutton.BackgroundImage = Skins.rollbtnhover
- End Sub
-
- Private Sub rollupbutton_MouseLeave(sender As Object, e As EventArgs) Handles rollupbutton.MouseLeave
- rollupbutton.BackgroundImage = Skins.rollbtn
- End Sub
-
- Private Sub rollupbutton_MouseDown(sender As Object, e As EventArgs) Handles rollupbutton.MouseDown
- rollupbutton.BackgroundImage = Skins.rollbtnclick
- End Sub
-
- Public Sub setuptitlebar()
-
- setupborders()
-
- If Me.Height = Me.titlebar.Height Then pgleft.Show() : pgbottom.Show() : pgright.Show() : Me.Height = rolldownsize : needtorollback = True
- pgleft.Width = Skins.borderwidth
- pgright.Width = Skins.borderwidth
- pgbottom.Height = Skins.borderwidth
- titlebar.Height = Skins.titlebarheight
-
- If justopened = True Then
- Me.Size = New Size(500, 300) 'put the default size of your window here
- Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
- Me.Size = New Size(Me.Width + Skins.borderwidth + Skins.borderwidth, Me.Height + Skins.borderwidth)
- oldbordersize = Skins.borderwidth
- oldtitlebarheight = Skins.titlebarheight
- justopened = False
- Else
- If Me.Visible = True Then
- 'Me.Hide()
- Me.Size = New Size(Me.Width - (2 * oldbordersize) + (2 * Skins.borderwidth), (Me.Height - oldtitlebarheight - oldbordersize) + Skins.titlebarheight + Skins.borderwidth)
- 'Me.Size = New Size(Me.Width - oldbordersize - oldbordersize, Me.Height - oldbordersize) 'Just put a little algebra in the first size setting and comment out the mess
- oldbordersize = Skins.borderwidth
- oldtitlebarheight = Skins.titlebarheight
- 'Me.Size = New Size(Me.Width, Me.Height + Skins.titlebarheight - 30)
- 'Me.Size = New Size(Me.Width + Skins. borderwidth + Skins. borderwidth, Me.Height + Skins. borderwidth)
- 'rolldownsize = Me.Height
- If needtorollback = True Then Me.Height = titlebar.Height : pgleft.Hide() : pgbottom.Hide() : pgright.Hide()
- 'Me.Show()
- End If
- End If
-
- If Skins.enablecorners = True Then
- pgtoplcorner.Show()
- pgtoprcorner.Show()
- pgtoprcorner.Width = Skins.titlebarcornerwidth
- pgtoplcorner.Width = Skins.titlebarcornerwidth
- Else
- pgtoplcorner.Hide()
- pgtoprcorner.Hide()
- End If
-
- If ShiftOSDesktop.boughttitlebar = False Then
- titlebar.Hide()
- Me.Size = New Size(Me.Width, Me.Size.Height - titlebar.Height)
- End If
-
- If ShiftOSDesktop.boughttitletext = False Then
- lbtitletext.Hide()
- Else
- lbtitletext.Font = New Font(Skins.titletextfontfamily, Skins.titletextfontsize, Skins.titletextfontstyle, GraphicsUnit.Point)
- lbtitletext.Text = ShiftOSDesktop.mazename 'Remember to change to name of program!!!!
- lbtitletext.Show()
- End If
-
- If ShiftOSDesktop.boughtclosebutton = False Then
- closebutton.Hide()
- Else
- closebutton.BackColor = Skins.closebtncolour
- closebutton.Size = Skins.closebtnsize
- closebutton.Show()
- End If
-
- If ShiftOSDesktop.boughtrollupbutton = False Then
- rollupbutton.Hide()
- Else
- rollupbutton.BackColor = Skins.rollbtncolour
- rollupbutton.Size = Skins.rollbtnsize
- rollupbutton.Show()
- End If
-
- If ShiftOSDesktop.boughtminimizebutton = False Then
- minimizebutton.Hide()
- Else
- minimizebutton.BackColor = Skins.minbtncolour
- minimizebutton.Size = Skins.minbtnsize
- minimizebutton.Show()
- End If
-
- If ShiftOSDesktop.boughtwindowborders = True Then
- closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
- rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
- minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
- Select Case Skins.titletextpos
- Case "Left"
- lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
- Case "Centre"
- lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
- End Select
- lbtitletext.ForeColor = Skins.titletextcolour
- Else
- closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
- rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
- minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
- Select Case Skins.titletextpos
- Case "Left"
- lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
- Case "Centre"
- lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
- End Select
- lbtitletext.ForeColor = Skins.titletextcolour
- End If
-
- 'Change when Icon skinning complete
- If ShiftOSDesktop.boughtshiftneticon = True Then ' Change to program's icon
- pnlicon.Visible = True
- pnlicon.Location = New Point(ShiftOSDesktop.titlebariconside, ShiftOSDesktop.titlebaricontop)
- pnlicon.Size = New Size(ShiftOSDesktop.titlebariconsize, ShiftOSDesktop.titlebariconsize)
- pnlicon.Image = ShiftOSDesktop.mazeicontitlebar 'Replace with the correct icon for the program.
- End If
-
- End Sub
-
- Public Sub rollupanddown()
- If Me.Height = Me.titlebar.Height Then
- pgleft.Show()
- pgbottom.Show()
- pgright.Show()
- Me.Height = rolldownsize
- Me.MinimumSize = New Size(minimumsizewidth, minimumsizeheight)
- Else
- Me.MinimumSize = New Size(0, 0)
- pgleft.Hide()
- pgbottom.Hide()
- pgright.Hide()
- rolldownsize = Me.Height
- Me.Height = Me.titlebar.Height
- End If
- End Sub
-
- Public Sub resettitlebar()
- If ShiftOSDesktop.boughtwindowborders = True Then
- closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - closebutton.Size.Width, Skins.closebtnfromtop)
- rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - rollupbutton.Size.Width, Skins.rollbtnfromtop)
- minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - minimizebutton.Size.Width, Skins.minbtnfromtop)
- Select Case Skins.titletextpos
- Case "Left"
- lbtitletext.Location = New Point(Skins.titletextfromside, Skins.titletextfromtop)
- Case "Centre"
- lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
- End Select
- lbtitletext.ForeColor = Skins.titletextcolour
- Else
- closebutton.Location = New Point(titlebar.Size.Width - Skins.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, Skins.closebtnfromtop)
- rollupbutton.Location = New Point(titlebar.Size.Width - Skins.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, Skins.rollbtnfromtop)
- minimizebutton.Location = New Point(titlebar.Size.Width - Skins.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, Skins.minbtnfromtop)
- Select Case Skins.titletextpos
- Case "Left"
- lbtitletext.Location = New Point(Skins.titletextfromside + pgtoplcorner.Width, Skins.titletextfromtop)
- Case "Centre"
- lbtitletext.Location = New Point((titlebar.Width / 2) - lbtitletext.Width / 2, Skins.titletextfromtop)
- End Select
- lbtitletext.ForeColor = Skins.titletextcolour
- End If
- End Sub
-
- Private Sub pullside_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullside.Tick
- Me.Width = Cursor.Position.X - Me.Location.X
- resettitlebar()
- End Sub
-
- Private Sub pullbottom_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pullbottom.Tick
- Me.Height = Cursor.Position.Y - Me.Location.Y
- resettitlebar()
- End Sub
-
- Private Sub pullbs_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles pullbs.Tick
- Me.Width = Cursor.Position.X - Me.Location.X
- Me.Height = Cursor.Position.Y - Me.Location.Y
- resettitlebar()
- End Sub
-
- 'delete this for non-resizable windows
- Private Sub Rightpull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgright.MouseDown
- If ShiftOSDesktop.boughtresizablewindows = True Then
- pullside.Start()
- End If
- End Sub
-
- Private Sub RightCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseEnter
- If ShiftOSDesktop.boughtresizablewindows = True Then
- Cursor = Cursors.SizeWE
- End If
- End Sub
-
- Private Sub bottomCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottom.MouseEnter
- If ShiftOSDesktop.boughtresizablewindows = True Then
- Cursor = Cursors.SizeNS
- End If
- End Sub
-
- Private Sub CornerCursorOn_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgbottomrcorner.MouseEnter
- If ShiftOSDesktop.boughtresizablewindows = True Then
- Cursor = Cursors.SizeNWSE
- End If
- End Sub
-
- Private Sub SizeCursoroff_MouseDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles pgright.MouseLeave, pgbottom.MouseLeave, pgbottomrcorner.MouseLeave
- If ShiftOSDesktop.boughtresizablewindows = True Then
- Cursor = Cursors.Default
- End If
- End Sub
-
- Private Sub rightpull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgright.MouseUp
- If ShiftOSDesktop.boughtresizablewindows = True Then
- pullside.Stop()
- End If
- End Sub
-
- Private Sub bottompull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottom.MouseDown
- If ShiftOSDesktop.boughtresizablewindows = True Then
- pullbottom.Start()
- End If
- End Sub
-
- Private Sub buttompull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottom.MouseUp
- If ShiftOSDesktop.boughtresizablewindows = True Then
- pullbottom.Stop()
- End If
- End Sub
-
- Private Sub bspull_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottomrcorner.MouseDown
- If ShiftOSDesktop.boughtresizablewindows = True Then
- pullbs.Start()
- End If
- End Sub
-
- Private Sub bspull_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pgbottomrcorner.MouseUp
- If ShiftOSDesktop.boughtresizablewindows = True Then
- pullbs.Stop()
- End If
- End Sub
-
- Public Sub setskin()
- 'disposals
- closebutton.BackgroundImage = Nothing
- titlebar.BackgroundImage = Nothing
- rollupbutton.BackgroundImage = Nothing
- pgtoplcorner.BackgroundImage = Nothing
- pgtoprcorner.BackgroundImage = Nothing
- minimizebutton.BackgroundImage = Nothing
- 'apply new skin
- If Skins.closebtn Is Nothing Then closebutton.BackColor = Skins.closebtncolour Else closebutton.BackgroundImage = Skins.closebtn
- closebutton.BackgroundImageLayout = Skins.closebtnlayout
- If Skins.titlebar Is Nothing Then titlebar.BackColor = Skins.titlebarcolour Else titlebar.BackgroundImage = Skins.titlebar
- titlebar.BackgroundImageLayout = Skins.titlebarlayout
- If Skins.rollbtn Is Nothing Then rollupbutton.BackColor = Skins.rollbtncolour Else rollupbutton.BackgroundImage = Skins.rollbtn
- rollupbutton.BackgroundImageLayout = Skins.rollbtnlayout
- If Skins.leftcorner Is Nothing Then pgtoplcorner.BackColor = Skins.leftcornercolour Else pgtoplcorner.BackgroundImage = Skins.leftcorner
- pgtoplcorner.BackgroundImageLayout = Skins.leftcornerlayout
- If Skins.rightcorner Is Nothing Then pgtoprcorner.BackColor = Skins.rightcornercolour Else pgtoprcorner.BackgroundImage = Skins.rightcorner
- pgtoprcorner.BackgroundImageLayout = Skins.rightcornerlayout
- If Skins.minbtn Is Nothing Then minimizebutton.BackColor = Skins.minbtncolour Else minimizebutton.BackgroundImage = Skins.minbtn
- minimizebutton.BackgroundImageLayout = Skins.minbtnlayout
- If Skins.borderleft Is Nothing Then pgleft.BackColor = Skins.borderleftcolour Else pgleft.BackgroundImage = Skins.borderleft
- pgleft.BackgroundImageLayout = Skins.borderleftlayout
- If Skins.borderright Is Nothing Then pgright.BackColor = Skins.borderrightcolour Else pgright.BackgroundImage = Skins.borderright
- pgleft.BackgroundImageLayout = Skins.borderrightlayout
- If Skins.borderbottom Is Nothing Then pgbottom.BackColor = Skins.borderbottomcolour Else pgbottom.BackgroundImage = Skins.borderbottom
- pgbottom.BackgroundImageLayout = Skins.borderbottomlayout
- If enablebordercorners = True Then
- If Skins.bottomleftcorner Is Nothing Then pgbottomlcorner.BackColor = Skins.bottomleftcornercolour Else pgbottomlcorner.BackgroundImage = Skins.bottomleftcorner
- pgbottomlcorner.BackgroundImageLayout = Skins.bottomleftcornerlayout
- If Skins.bottomrightcorner Is Nothing Then pgbottomrcorner.BackColor = Skins.bottomrightcornercolour Else pgbottomrcorner.BackgroundImage = Skins.bottomrightcorner
- pgbottomrcorner.BackgroundImageLayout = Skins.bottomrightcornerlayout
- Else
- pgbottomlcorner.BackColor = Skins.borderrightcolour
- pgbottomrcorner.BackColor = Skins.borderrightcolour
- pgbottomlcorner.BackgroundImage = Nothing
- pgbottomrcorner.BackgroundImage = Nothing
- End If
-
- 'set bottom border corner size
- pgbottomlcorner.Size = New Size(Skins.borderwidth, Skins.borderwidth)
- pgbottomrcorner.Size = New Size(Skins.borderwidth, Skins.borderwidth)
- pgbottomlcorner.Location = New Point(0, Me.Height - Skins.borderwidth)
- pgbottomrcorner.Location = New Point(Me.Width, Me.Height - Skins.borderwidth)
-
- Me.TransparencyKey = ShiftOSDesktop.globaltransparencycolour
- End Sub
-
- Private Sub Clock_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
- ShiftOSDesktop.programsopen = ShiftOSDesktop.programsopen - 1
- Me.Hide()
- ShiftOSDesktop.setuppanelbuttons()
- End Sub
-
- 'end of general setup
-#End Region
-
- Dim timeleft As Integer
- Dim cpearnt As Integer
- Dim movex As Integer
- Dim movey As Integer
- Dim wall(50) As Panel
- Dim level As Integer = 1
-
- Private Sub setuplevels(ByVal lvl As Integer, ByVal firstlvl As Boolean)
- pnllvl1.Dock = DockStyle.None
- pnllvl2.Dock = DockStyle.None
- pnllvl3.Dock = DockStyle.None
- Select Case lvl
- Case 0
- cpearnt = 0
- level = 0
- pnlintro.Dock = DockStyle.Fill
- pnlintro.BringToFront()
- lbllevel.Text = "Intro"
- pnlplayer.Parent = pnlintro
- Case 1
- If firstlvl = False Then cpearnt = cpearnt + 2
- level = 1
- pnllvl1.Dock = DockStyle.Fill
- pnllvl1.BringToFront()
- pnlplayer.Parent = pnllvl1
- lbllevel.Text = "Up 'n Down"
- Case 2
- If firstlvl = False Then cpearnt = cpearnt + 2
- level = 2
- pnllvl2.Dock = DockStyle.Fill
- pnllvl2.BringToFront()
- pnlplayer.Parent = pnllvl2
- lbllevel.Text = "Mid 'I'"
- Case 3
- If firstlvl = False Then cpearnt = cpearnt + 2
- level = 3
- pnllvl3.Dock = DockStyle.Fill
- pnllvl3.BringToFront()
- pnlplayer.Parent = pnllvl3
- lbllevel.Text = "Followin' the Path"
- Case 4
- If firstlvl = False Then cpearnt = cpearnt + 2
- level = 4
- pnllvl4.Dock = DockStyle.Fill
- pnllvl4.BringToFront()
- pnlplayer.Parent = pnllvl4
- lbllevel.Text = "BOXES!"
- Case 5
- If firstlvl = False Then cpearnt = cpearnt + 2
- level = 5
- pnllvl5.Dock = DockStyle.Fill
- pnllvl5.BringToFront()
- pnlplayer.Parent = pnllvl5
- lbllevel.Text = "Twoway"
-
- End Select
- If Not lvl = 0 Then
- setupwalls()
- pnlplayer.Location = New Point(8, 10)
- tmrtimeleft.Start()
- tmrgametick.Start()
- End If
- End Sub
-
- Private Sub randomizelevel(ByVal firstrun As Boolean)
- Dim i As Integer = Math.Ceiling(Rnd() * 5)
- If i = level Or i = 0 Then
- i = Math.Ceiling(Rnd() * 5)
- Else
- setuplevels(i, firstrun)
- End If
- End Sub
-
- Private Sub key_press(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
- If e.KeyCode = Keys.A Then
- movex = -2
- End If
- If e.KeyCode = Keys.D Then
- movex = 2
- End If
- If e.KeyCode = Keys.W Then
- movey = -2
- End If
- If e.KeyCode = Keys.S Then
- movey = 2
- End If
- End Sub
-
- Private Sub key_up(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp
- If e.KeyCode = Keys.A Then
- movex = 0
- End If
- If e.KeyCode = Keys.D Then
- movex = 0
- End If
- If e.KeyCode = Keys.W Then
- movey = 0
- End If
- If e.KeyCode = Keys.S Then
- movey = 0
- End If
- End Sub
-
- Private Sub tmrtimeleft_Tick(sender As Object, e As EventArgs) Handles tmrtimeleft.Tick
- If timeleft > 0 Then
- timeleft = timeleft - 1
- Else
- infobox.showinfo("Time Up", "You have run out of time, having completed " & level & " mazes and earnt " & cpearnt & " CP")
- setuplevels(0, True)
- ShiftOSDesktop.codepoints = +cpearnt
- cpearnt = 0
- End If
- lbltime.Text = timeleft
- End Sub
-
- Dim i As Integer = 0
- Private Sub tmrgametimer_Tick(sender As Object, e As EventArgs) Handles tmrgametick.Tick
- pnlplayer.Location = New Point(pnlplayer.Location.X + movex, pnlplayer.Location.Y + movey)
-
- If Not level = 0 Then
- If pnlplayer.Bounds.IntersectsWith(wall(i).Bounds) Then
- infobox.showinfo(" Game Over", "You hit a wall, missing out on " & cpearnt & " Code Points")
- setuplevels(0, True)
- cpearnt = 0
- movex = 0
- movey = 0
- End If
- End If
-
- If Not level = 0 Then
- If Not pnlplayer.Bounds.IntersectsWith(pnlplayer.Parent.Bounds) Then
- infobox.showinfo("Game Over", "No escape, stop being a mazerunner. You just missed out on " & cpearnt & " Code Points")
- setuplevels(0, True)
- cpearnt = 0
- End If
- End If
-
- If pnlplayer.Bounds.IntersectsWith(lbllvl1exit.Bounds) Then
- randomizelevel(False)
- End If
-
- If level = 1 Then
- If i <= 9 Then
- i = i + 1
- Else
- i = 0
- End If
- ElseIf level = 2 Then
- If i <= 11 Then
- i = i + 1
- Else
- i = 0
- End If
- ElseIf level = 3 Then
- If i <= 3 Then
- i = i + 1
- Else
- i = 0
- End If
- ElseIf level = 4 Then
- If i <= 7 Then
- i = i + 1
- Else
- i = 0
- End If
- ElseIf level = 5 Then
- If i <= 4 Then
- i = i + 1
- Else
- i = 0
- End If
- End If
- btncashout.Text = "Cashout " & cpearnt & " CP"
- End Sub
-
- Private Sub setupwalls()
- Select Case level
- 'Dim j as integer = 0
- 'For Each ctl As Control In Lvls.Controls
- ' Dim i as integer = 0
- ' For Each ctrl As Control In ctl.Controls
- ' Try
- ' wallObj(j, i) = ctrl
- ' Catch ex As Exception
-
- ' End Try
- ' i = i + 1
- ' Next
- 'Next
- '^^^^^^^^^^ How to code for expandability
- Case 1
- wall(0) = Panel1
- wall(2) = Panel2
- wall(3) = Panel3
- wall(4) = Panel4
- wall(5) = Panel5
- wall(6) = Panel6
- wall(7) = Panel7
- wall(8) = Panel8
- wall(9) = Panel9
- wall(10) = Panel10
- wall(1) = Panel11
- Case 2
- wall(0) = Panel12
- wall(1) = Panel13
- wall(2) = Panel14
- wall(3) = Panel15
- wall(4) = Panel16
- wall(5) = Panel17
- wall(6) = Panel18
- wall(7) = Panel19
- wall(8) = Panel20
- wall(9) = Panel21
- wall(10) = Panel22
- wall(11) = Panel23
- wall(12) = Panel24
- wall(13) = Panel25
- Case 3
- wall(0) = Panel26
- wall(1) = Panel27
- wall(2) = Panel28
- wall(3) = Panel29
- wall(4) = Panel30
- wall(5) = Panel31
- Case 4
- wall(0) = Panel32
- wall(1) = Panel33
- wall(2) = Panel34
- wall(3) = Panel35
- wall(4) = Panel36
- wall(5) = Panel37
- wall(6) = Panel38
- wall(7) = Panel39
- wall(8) = Panel40
- wall(9) = Panel41
- Case 5
- wall(0) = Panel42
- wall(1) = Panel43
- wall(2) = Panel44
- wall(3) = Panel45
- wall(4) = Panel46
- wall(5) = Panel47
- wall(6) = Panel48
- End Select
- End Sub
-
- Private Sub btncashout_Click(sender As Object, e As EventArgs) Handles btncashout.Click
- ShiftOSDesktop.codepoints = ShiftOSDesktop.codepoints + cpearnt
- infobox.showinfo("Cashout Successful", "You have successfully cashed out " & cpearnt & " Code Points")
- cpearnt = 0
- setuplevels(0, True)
- End Sub
-
- Private Sub beginbtn_Click(sender As Object, e As EventArgs) Handles beginbtn.Click
- timeleft = 100
- randomizelevel(True)
- End Sub
-End Class
diff --git a/source/WindowsFormsApplication1/ListViewEx.Designer.cs b/source/WindowsFormsApplication1/ListViewEx.Designer.cs
deleted file mode 100644
index 1596c8f..0000000
--- a/source/WindowsFormsApplication1/ListViewEx.Designer.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-namespace ShiftOS
-{
- partial class ListViewEx
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Component Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.tblist = new System.Windows.Forms.TableLayoutPanel();
- this.SuspendLayout();
- //
- // tblist
- //
- this.tblist.AutoSize = true;
- this.tblist.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
- this.tblist.ColumnCount = 2;
- this.tblist.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tblist.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tblist.Dock = System.Windows.Forms.DockStyle.Fill;
- this.tblist.Location = new System.Drawing.Point(0, 0);
- this.tblist.Name = "tblist";
- this.tblist.RowCount = 2;
- this.tblist.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tblist.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
- this.tblist.Size = new System.Drawing.Size(521, 343);
- this.tblist.TabIndex = 0;
- //
- // ListViewEx
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.tblist);
- this.Name = "ListViewEx";
- this.Size = new System.Drawing.Size(521, 343);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.TableLayoutPanel tblist;
- }
-}
diff --git a/source/WindowsFormsApplication1/ListViewEx.cs b/source/WindowsFormsApplication1/ListViewEx.cs
deleted file mode 100644
index 075c3df..0000000
--- a/source/WindowsFormsApplication1/ListViewEx.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Drawing;
-using System.Data;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class ListViewEx : UserControl
- {
- private List<Item> items = null;
- private List<Column> columns = null;
-
- public ListViewEx()
- {
- InitializeComponent();
- items = new List<Item>();
- columns = new List<Column>();
- }
-
- private Color _item_color = Color.Gray;
-
- public Color ItemSelectedColor
- {
- get { return _item_color; }
- set
- {
- _item_color = value;
- }
- }
-
- private void setup_ui()
- {
-
- }
- }
-
- public class Item
- {
- public Item(string text)
- {
- Text = text;
- SubItems = new List<Item>();
- }
-
- public string Text { get; set; }
- public List<Item> SubItems { get; set; }
- public object Tag { get; set; }
- }
-
- public class Column
- {
- public Column(string text)
- {
- Text = text;
- }
-
- public string Text { get; set; }
- }
-
-}
diff --git a/source/WindowsFormsApplication1/NetworkBrowser.cs b/source/WindowsFormsApplication1/NetworkBrowser.cs
deleted file mode 100644
index 127140f..0000000
--- a/source/WindowsFormsApplication1/NetworkBrowser.cs
+++ /dev/null
@@ -1,301 +0,0 @@
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class NetworkBrowser : Form
- {
- public NetworkBrowser()
- {
- InitializeComponent();
- }
-
- public Dictionary<string, EnemyHacker> Networks = null;
-
- private void NetworkBrowser_Load(object sender, EventArgs e)
- {
- LoadNetworks();
- SetupSidePane();
- pnlmynet.Hide();
- }
-
- public string CurrentTier = "easy";
- public EnemyHacker SelectedNet = null;
-
- public void LoadNetworks()
- {
- switch(CurrentTier)
- {
- case "easy":
- btntier.Text = "1";
- break;
- case "medium":
- btntier.Text = "2";
- break;
- case "hard":
- btntier.Text = "3";
- break;
- }
- Networks = JsonConvert.DeserializeObject<Dictionary<string, EnemyHacker>>(Properties.Resources.NetBrowser_Enemies);
- lbnets.Items.Clear();
- var Tier1 = new List<string>();
- var Tier2 = new List<string>();
- var Tier3 = new List<string>();
-
- foreach (var net in Networks)
- {
- if (!API.CurrentSave.CompletedNets.Contains(net.Key))
- {
- switch (net.Value.Difficulty)
- {
- case "easy":
- Tier1.Add(net.Key);
- break;
- case "medium":
- Tier2.Add(net.Key);
- break;
- case "hard":
- Tier3.Add(net.Key);
- break;
- }
- }
- }
-
- switch (CurrentTier)
- {
- case "easy":
- SetupUI(Tier1);
- break;
- case "medium":
- SetupUI(Tier2);
- break;
- case "hard":
- SetupUI(Tier3);
- break;
- }
- }
-
- public void SetupSidePane()
- {
- if(SelectedNet != null)
- {
- lbtitle.Text = SelectedNet.Name;
- lbnetdesc.Text = SelectedNet.Description + @"
-
-Leader hack speed: " + SelectedNet.FriendSpeed.ToString() + @"
-Leader hack skill: " + SelectedNet.FriendSkill.ToString() + @"
-
-Those above values only matter if the leader decides to become a friend. If they do, you can hire them for free to hack into certain ShiftOS applications.";
- btnstartbattle.Enabled = true;
- }
- else
- {
- lbtitle.Text = "Network Browser";
- lbnetdesc.Text = "No network selected.";
- btnstartbattle.Enabled = false;
- }
- }
-
- public void SetupUI(List<string> tier)
- {
- if (tier.Count > 0)
- {
- foreach (var t in tier)
- {
- lbnets.Items.Add(t);
- }
- }
- else
- {
- AddLeader(CurrentTier);
- }
- }
-
- public void AddLeader(string tier)
- {
- if (API.Upgrades["nb_tier_" + tier] == false)
- {
- var enemy = JsonConvert.DeserializeObject<EnemyHacker>(Get_Leader_JSON(tier));
- Networks.Add(enemy.Name, enemy);
- lbnets.Items.Add(enemy.Name);
- }
- }
-
- public string Get_Leader_JSON(string tier)
- {
- switch(tier)
- {
- case "easy":
- return Properties.Resources.Hacker_DanaRoss;
- case "medium":
- return Properties.Resources.Hacker_AustinWalker;
- case "hard":
- return Properties.Resources.Hacker_JonathanRivard;
- default:
- return null;
-
- }
- }
-
- private void btntier_Click(object sender, EventArgs e)
- {
- switch(btntier.Text)
- {
- case "1":
- if(API.Upgrades["nb_tier_easy"] == true)
- {
- CurrentTier = "medium";
- }
- break;
- case "2":
- if (API.Upgrades["nb_tier_medium"] == true)
- {
- CurrentTier = "hard";
- }
- else
- {
- CurrentTier = "easy";
- }
- break;
- case "3":
- CurrentTier = "easy";
- break;
- }
- LoadNetworks();
- }
-
- private void lbnets_SelectedIndexChanged(object sender, EventArgs e)
- {
- var t = lbnets.SelectedItem as string;
- foreach(var net in Networks)
- {
- if(net.Key == t)
- {
- SelectedNet = net.Value;
- }
- }
- SetupSidePane();
- }
-
- private void btnstartbattle_Click(object sender, EventArgs e)
- {
- if (Hacking.MyCore.HP == 0)
- {
- SetupMyNet();
- pnlmynet.Show();
- btnscreen.Text = "My Network";
- API.CreateInfoboxSession("Your Core isn't ready.", "Your Core (hostname \"localhost\") has 0 HP, and cannot fight. Please wait until your Core regenerates.", infobox.InfoboxMode.Info);
- }
- else
- {
- string tier_upgrade = null;
- if (SelectedNet.IsLeader == true)
- {
- tier_upgrade = "nb_tier_" + CurrentTier;
- }
- var hui = new HackUI(SelectedNet);
- hui.OnWin += (object s, EventArgs a) =>
- {
- if (tier_upgrade != null)
- {
- API.Upgrades[tier_upgrade] = true;
- if(CurrentTier == "easy")
- {
- if(API.Upgrades["midgamebridge"] == false)
- {
- var term = new Terminal();
- API.CreateForm(term, API.LoadedNames.TerminalName, API.GetIcon("Terminal"));
- term.StartDanaRossStory();
- }
- }
- else if(CurrentTier == "medium")
- {
- var h = new HoloChat();
- var fakeroom = new FakeChatClient();
- fakeroom.Name = "The Hacker Alliance";
- fakeroom.Topic = "The Hacker Alliance - We are the masters. DevX cannot control us.";
- fakeroom.OtherCharacters = new List<string>(new [] {"Richard Ladouceur"});
- fakeroom.Messages = JsonConvert.DeserializeObject<Dictionary<string, string>>(Properties.Resources.AustinWalkerCompletionStory);
- API.CreateForm(h, "QuickChat", API.GetIcon("QuickChat"));
- var t = new Thread(new ThreadStart(new Action(() =>
- {
- Thread.Sleep(200);
- h.Invoke(new Action(() =>
- {
- h.SetupFakeClient(fakeroom);
- }));
- })));
-
- }
- foreach(var mod in SelectedNet.Network)
- {
- if (mod.Type != SystemType.Core)
- {
- mod.HP = 0;
- Hacking.MyNetwork.Add(mod);
- }
- }
- SetupMyNet();
- }
- API.CurrentSave.CompletedNets.Add(SelectedNet.Name);
- SelectedNet = null;
- LoadNetworks();
- SetupSidePane();
- };
- hui.Show();
- }
- }
-
- public void SetupMyNet()
- {
- flmodules.Controls.Clear();
- foreach(var m in Hacking.MyNetwork)
- {
- var mStatus = new NetModuleStatus(m);
- flmodules.Controls.Add(mStatus);
- mStatus.Show();
- }
- }
-
- private void btnscreen_Click(object sender, EventArgs e)
- {
- switch (btnscreen.Text)
- {
- case "My Network":
- LoadNetworks();
- SetupSidePane();
- pnlmynet.Hide();
- btnscreen.Text = "Network List";
- break;
- case "Network List":
- SetupMyNet();
- pnlmynet.Show();
- btnscreen.Text = "My Network";
- break;
- }
-
- }
-
- private void tmrcalctotal_Tick(object sender, EventArgs e)
- {
- int total = 0;
- int hp = 0;
- foreach(var mod in Hacking.MyNetwork)
- {
- total += mod.GetTotalHP();
- hp += mod.HP;
- }
- pgtotalhealth.MaxValue = total;
- pgtotalhealth.Value = hp;
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/Online/ConnectionManager.Designer.cs b/source/WindowsFormsApplication1/Online/ConnectionManager.Designer.cs
new file mode 100644
index 0000000..89abcca
--- /dev/null
+++ b/source/WindowsFormsApplication1/Online/ConnectionManager.Designer.cs
@@ -0,0 +1,129 @@
+namespace ShiftOS
+{
+ partial class ConnectionManager
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.panel1 = new System.Windows.Forms.Panel();
+ this.lbconnections = new System.Windows.Forms.ListBox();
+ this.flbuttons = new System.Windows.Forms.FlowLayoutPanel();
+ this.btnadd = new System.Windows.Forms.Button();
+ this.btnconnect = new System.Windows.Forms.Button();
+ this.btndisconnect = new System.Windows.Forms.Button();
+ this.panel1.SuspendLayout();
+ this.flbuttons.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel1
+ //
+ this.panel1.Controls.Add(this.flbuttons);
+ this.panel1.Controls.Add(this.lbconnections);
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel1.Location = new System.Drawing.Point(0, 0);
+ this.panel1.Name = "panel1";
+ this.panel1.Size = new System.Drawing.Size(684, 531);
+ this.panel1.TabIndex = 0;
+ //
+ // lbconnections
+ //
+ this.lbconnections.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.lbconnections.FormattingEnabled = true;
+ this.lbconnections.Location = new System.Drawing.Point(13, 13);
+ this.lbconnections.Name = "lbconnections";
+ this.lbconnections.Size = new System.Drawing.Size(659, 472);
+ this.lbconnections.TabIndex = 0;
+ this.lbconnections.SelectedIndexChanged += new System.EventHandler(this.lbconnections_SelectedIndexChanged);
+ //
+ // flbuttons
+ //
+ this.flbuttons.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.flbuttons.Controls.Add(this.btnadd);
+ this.flbuttons.Controls.Add(this.btnconnect);
+ this.flbuttons.Controls.Add(this.btndisconnect);
+ this.flbuttons.Location = new System.Drawing.Point(13, 489);
+ this.flbuttons.Name = "flbuttons";
+ this.flbuttons.Size = new System.Drawing.Size(659, 30);
+ this.flbuttons.TabIndex = 1;
+ //
+ // btnadd
+ //
+ this.btnadd.Location = new System.Drawing.Point(3, 3);
+ this.btnadd.Name = "btnadd";
+ this.btnadd.Size = new System.Drawing.Size(75, 23);
+ this.btnadd.TabIndex = 0;
+ this.btnadd.Text = "Add";
+ this.btnadd.UseVisualStyleBackColor = true;
+ this.btnadd.Click += new System.EventHandler(this.btnadd_Click);
+ //
+ // btnconnect
+ //
+ this.btnconnect.Location = new System.Drawing.Point(84, 3);
+ this.btnconnect.Name = "btnconnect";
+ this.btnconnect.Size = new System.Drawing.Size(75, 23);
+ this.btnconnect.TabIndex = 1;
+ this.btnconnect.Text = "Connect";
+ this.btnconnect.UseVisualStyleBackColor = true;
+ this.btnconnect.Click += new System.EventHandler(this.btnconnect_Click);
+ //
+ // btndisconnect
+ //
+ this.btndisconnect.Location = new System.Drawing.Point(165, 3);
+ this.btndisconnect.Name = "btndisconnect";
+ this.btndisconnect.Size = new System.Drawing.Size(75, 23);
+ this.btndisconnect.TabIndex = 2;
+ this.btndisconnect.Text = "Disconnect";
+ this.btndisconnect.UseVisualStyleBackColor = true;
+ this.btndisconnect.Click += new System.EventHandler(this.btndisconnect_Click);
+ //
+ // ConnectionManager
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(684, 531);
+ this.Controls.Add(this.panel1);
+ this.Name = "ConnectionManager";
+ this.Text = "ConnectionManager";
+ this.Load += new System.EventHandler(this.ConnectionManager_Load);
+ this.panel1.ResumeLayout(false);
+ this.flbuttons.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Panel panel1;
+ private System.Windows.Forms.FlowLayoutPanel flbuttons;
+ private System.Windows.Forms.Button btnadd;
+ private System.Windows.Forms.Button btnconnect;
+ private System.Windows.Forms.Button btndisconnect;
+ private System.Windows.Forms.ListBox lbconnections;
+ }
+} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Online/ConnectionManager.cs b/source/WindowsFormsApplication1/Online/ConnectionManager.cs
new file mode 100644
index 0000000..eaf2a24
--- /dev/null
+++ b/source/WindowsFormsApplication1/Online/ConnectionManager.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS
+{
+ public partial class ConnectionManager : Form
+ {
+ public ConnectionManager()
+ {
+ InitializeComponent();
+ }
+
+ string selectednet = null;
+
+ private void lbconnections_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ try
+ {
+ selectednet = lbconnections.SelectedItem.ToString();
+ SetupUI();
+ }
+ catch
+ {
+ selectednet = null;
+ SetupUI();
+ }
+ }
+
+ public void SetupUI()
+ {
+ if(selectednet != null)
+ {
+ btnconnect.Visible = !Package_Grabber.clients[selectednet].IsConnected;
+ btndisconnect.Visible = Package_Grabber.clients[selectednet].IsConnected;
+ }
+ else
+ {
+ btnconnect.Hide();
+ btndisconnect.Hide();
+ }
+ }
+
+ private void ConnectionManager_Load(object sender, EventArgs e)
+ {
+ SetupUI();
+ var t = new Timer();
+ t.Interval = 500;
+ t.Tick += (object s, EventArgs a) =>
+ {
+ lbconnections.Items.Clear();
+ foreach(var itm in Package_Grabber.clients)
+ {
+ lbconnections.Items.Add(itm.Key);
+ }
+ };
+ t.Start();
+ }
+
+ private void btndisconnect_Click(object sender, EventArgs e)
+ {
+ Package_Grabber.Disconnect(selectednet);
+ SetupUI();
+ }
+
+ private void btnconnect_Click(object sender, EventArgs e)
+ {
+ Package_Grabber.ConnectToServer(selectednet, 7429);
+ SetupUI();
+ }
+
+ private void btnadd_Click(object sender, EventArgs e)
+ {
+ API.CreateInfoboxSession("Add connection", "Please type the IP Address or hostname of the server.", infobox.InfoboxMode.TextEntry);
+ API.InfoboxSession.FormClosing += (o, a) =>
+ {
+ var res = API.GetInfoboxResult();
+ if(res != "Cancelled")
+ {
+ Package_Grabber.ConnectToServer(res, 7429);
+ }
+ };
+ }
+ }
+}
diff --git a/source/WindowsFormsApplication1/Online/ConnectionManager.resx b/source/WindowsFormsApplication1/Online/ConnectionManager.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/source/WindowsFormsApplication1/Online/ConnectionManager.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Online/Hacking/Matchmaker.cs b/source/WindowsFormsApplication1/Online/Hacking/Matchmaker.cs
new file mode 100644
index 0000000..1fb6f1b
--- /dev/null
+++ b/source/WindowsFormsApplication1/Online/Hacking/Matchmaker.cs
@@ -0,0 +1,383 @@
+/* ShiftOS Online Hacker Battles - Matchmaker
+ *
+ * These classes deal with keeping things in line on the client-side of things.
+ * They deal with CSP (Client-Side Prediction), sending and receiving messages to
+ * and from the ShiftOS server, as well as making sure that when you join or leave a
+ * lobby, the server and other clients actually KNOW you did.
+ *
+ * I wouldn't mess with this unless you really, really understand what you're doing,
+ * as in most cases, modification to the server is required as well (in the case of
+ * adding new commands). I'd leave modification to the system creator (Michael VanOverbeek) who
+ * actually wrote this. He's the guy who knows all about how the server works. Wait... why am
+ * I talking in third person?
+ */
+
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ShiftOS.Online.Hacking
+{
+ public class Matchmaker
+ {
+ //All available lobbies.
+ public static List<ServerInfo> Servers = null;
+
+ //All players in the lobby.
+ public static List<Network> Players = null;
+
+ //Some useful info about the lobby in which the player is.
+ //Also contains server IP to be sent to Package_Grabber.SendMessage().
+ public static ServerInfo SelectedServer = null;
+
+ //Enemy network information (name, codepoints, etc)
+ public static Network SelectedNetwork = null;
+
+ //There's only one transmitter because generally the player
+ //won't be interacting with the enemy playfield enough to
+ //warrent a request to the server.
+ public static NetListener SelectedNetworkListener = null; //Listen for updates from the opponent.
+ public static NetTransmitter SelectedNetworkTransmitter = null; //Send messages to the server for enemy updates on opponent clients.
+ public static NetListener PlayerListener = null; //For receiving non-CSP updates from the server.
+ public static NetTransmitter SecondaryTransmitter = null; //For sending CSP-created update requests to the opponent (enemy health damage, etc)
+
+ //Timer that'll run during matchmaking.
+ public static Timer MakerTimer = null;
+
+ /// <summary>
+ /// This either starts matchmaking or grabs server info. Try it out I guess.
+ ///
+ /// Fires: Matchmaker.Initiated
+ /// </summary>
+ public static void Initiate()
+ {
+ MakerTimer = new Timer();
+ MakerTimer.Interval = 100;
+
+ Servers = new List<ServerInfo>();
+ foreach(var c in Package_Grabber.clients)
+ {
+ c.Value.OnReceived += (o, e) =>
+ {
+ try
+ {
+ var om = (e.Data.Object as ObjectModel);
+ if (om.Command == "server_info")
+ {
+ var si = JsonConvert.DeserializeObject<ServerInfo>(om.OptionalObject as string);
+ si.IPAddress = c.Value.RemoteHost;
+ Servers.Add(si);
+ invoke(() =>
+ {
+ Initiated?.Invoke(null, new EventArgs());
+ });
+ }
+ }
+ catch
+ {
+
+ }
+ };
+ Package_Grabber.SendMessage(c.Value.RemoteHost, "get_info");
+ }
+ }
+
+ /// <summary>
+ /// Matchmake in the supplied lobby.
+ ///
+ /// Fires: MorePlayersFound upon player leave/join.
+ /// </summary>
+ /// <param name="si">The server to matchmake in.</param>
+ public static void Matchmake(ServerInfo si)
+ {
+ SelectedServer = si;
+ var rnd = new Random();
+ Players = new List<Network>();
+ var server = Package_Grabber.clients[si.IPAddress];
+ server.OnReceived += (o, e) =>
+ {
+ try
+ {
+ var om = e.Data.Object as ObjectModel;
+ if (om.Command == "matchmaking")
+ {
+ Players = JsonConvert.DeserializeObject<List<Network>>(om.OptionalObject as string);
+ invoke(() =>
+ {
+ MorePlayersFound?.Invoke(null, new EventArgs());
+ });
+ }
+ }
+ catch
+ {
+
+ }
+ };
+ Package_Grabber.SendMessage(si.IPAddress, "get_matchmaking");
+ int index = 0;
+ MakerTimer.Tick += (o, e) =>
+ {
+ try
+ {
+ if (Players[index].Name != API.CurrentSave.MyOnlineNetwork.Name && Players[index].Name != null)
+ {
+ SelectedNetwork = Players[index];
+ MakerTimer.Stop();
+ PlayerListener = new NetListener(si, SelectedNetwork);
+ SecondaryTransmitter = new NetTransmitter(si, API.CurrentSave.MyOnlineNetwork);
+ SelectedNetworkListener = new NetListener(si, API.CurrentSave.MyOnlineNetwork);
+ SelectedNetworkTransmitter = new NetTransmitter(si, SelectedNetwork);
+ var h = new HackUI(SelectedNetworkTransmitter, SelectedNetworkListener, PlayerListener, SecondaryTransmitter);
+ h.Show();
+ Package_Grabber.SendMessage(SelectedServer.IPAddress, $"leave_lobby {JsonConvert.SerializeObject(API.CurrentSave.MyOnlineNetwork)}");
+ }
+ else
+ {
+ index += 1;
+ }
+ }
+ catch
+ {
+ }
+ };
+ MakerTimer.Interval = 50;
+ MakerTimer.Start();
+ }
+
+
+ /// <summary>
+ /// Fired when Initiate() finishes.
+ /// </summary>
+ public static event EventHandler Initiated;
+
+ /// <summary>
+ /// Fired when someone enters/exits a lobby that we are in.
+ /// </summary>
+ public static event EventHandler MorePlayersFound;
+
+ /// <summary>
+ /// Helper method to allow me to invoke some code on the ShiftOS desktop thread (for UI access)
+ /// </summary>
+ /// <param name="method">The code to invoke (use a lambda expression or just pump a void through.)</param>
+ public static void invoke(Action method)
+ {
+ API.CurrentSession.Invoke(method);
+ }
+
+ internal static void DestroySession()
+ {
+ Servers.Clear();
+ Players.Clear();
+ ClearEvents();
+ SelectedNetwork = null;
+ SelectedNetworkTransmitter = null;
+ SelectedNetworkListener = null;
+ PlayerListener = null;
+ //Good to go, I guess.
+ }
+
+ public static void ClearEvents()
+ {
+ Initiated = null;
+ MorePlayersFound = null;
+ }
+ }
+
+ public class NetListener
+ {
+ public NetListener(ServerInfo si, Network net)
+ {
+ register_events(si, net);
+
+ }
+
+ public List<Module> MyModules = null;
+
+ private void register_events(ServerInfo si, Network net)
+ {
+ MyModules = new List<Module>();
+ var server = Package_Grabber.clients[si.IPAddress];
+ server.OnReceived += (o, e) =>
+ {
+ if (e.Data.Object is ObjectModel)
+ {
+
+ var data = (e.Data.Object as ObjectModel);
+ if (data.Command != null)
+ {
+ string[] args = data.Command.Split(' ');
+ if ((data.OptionalObject as Network)?.Name == net.Name)
+ {
+ switch (args[0].ToLower())
+ {
+ case "set_health":
+ string hn = args[1];
+ int hp = Convert.ToInt32(args[2]);
+ invoke(() => { ModuleHealthSet?.Invoke(this, new Events.Health { host_name = hn, health = hp }); });
+ break;
+ case "place_module":
+ string hostname = args[1];
+ int grade = Convert.ToInt32(args[2]);
+ int newhp = Convert.ToInt32(args[3]);
+ int x = Convert.ToInt32(args[4]);
+ int y = Convert.ToInt32(args[5]);
+ int type = Convert.ToInt32(args[6]);
+ var moduleToPlace = new Module { Grade = grade, Hostname = hostname, HP = newhp, Type = type, X = x, Y = y };
+ MyModules.Add(moduleToPlace);
+ invoke(() => { ModulePlaced?.Invoke(this, new Events.ModulePlaced { new_module = moduleToPlace }); });
+ break;
+ case "remove_module":
+ string hostnametoremove = args[1];
+ var m = new Module();
+ foreach (var mod in MyModules)
+ {
+ if (mod.Hostname == hostnametoremove)
+ {
+ m = mod;
+ }
+ }
+ MyModules.Remove(m);
+
+ invoke(() => { ModuleRemoved?.Invoke(this, new Events.ModuleRemoved { new_module = hostnametoremove }); });
+ break;
+ case "upgrade":
+ invoke(() =>
+ {
+ string hostnametoupgrade = args[1];
+ int newgrade = Convert.ToInt32(args[2]);
+ ModuleUpgraded?.Invoke(this, new Events.ModuleUpgraded { hostname = hostnametoupgrade, grade = newgrade });
+ });
+ break;
+ case "finish":
+ string json = data.Command.Remove(0, 7);
+ var winner = JsonConvert.DeserializeObject<Network>(json);
+ Won?.Invoke(this, new Events.Won(winner));
+ break;
+ case "disable":
+ invoke(() =>
+ {
+ string name = args[1];
+ ModuleDisabled?.Invoke(this, new Events.Disabled { hostName = name });
+ });
+ break;
+ }
+ }
+ }
+ }
+ };
+ }
+
+ public void invoke(Action method)
+ {
+ API.CurrentSession.Invoke(method);
+ }
+
+ public event EventHandler<Events.Health> ModuleHealthSet;
+ public event EventHandler<Events.ModulePlaced> ModulePlaced;
+ public event EventHandler<Events.ModuleRemoved> ModuleRemoved;
+ public event EventHandler<Events.ModuleUpgraded> ModuleUpgraded;
+ public event EventHandler<Events.Disabled> ModuleDisabled;
+ public event EventHandler<Events.Won> Won;
+ }
+
+ public class NetTransmitter
+ {
+ public ServerInfo serverInfo = null;
+ public Network EnemyIdent = null;
+
+ public NetTransmitter(ServerInfo si, Network enemy)
+ {
+ EnemyIdent = enemy;
+ serverInfo = si;
+ //HackUI will handle everything else to do with our network.
+ }
+
+ public void send_message(Messages msg, object value)
+ {
+ switch(msg)
+ {
+ case Messages.PlaceModule:
+ var m = value as Module;
+ Package_Grabber.SendMessage(serverInfo.IPAddress, $"place_module {m.Hostname} {m.Grade} {m.HP} {m.X} {m.Y} {m.Type}", EnemyIdent);
+ break;
+ case Messages.Upgrade:
+ string upgradestr = value as string;
+ Package_Grabber.SendMessage(serverInfo.IPAddress, $"upgrade {upgradestr}", EnemyIdent);
+ break;
+ case Messages.RemoveModule:
+ string hostnametoremove = value as string;
+ Package_Grabber.SendMessage(serverInfo.IPAddress, $"remove_module {hostnametoremove}", EnemyIdent);
+ break;
+ case Messages.SetHealth:
+ string healthsetstr = value as string;
+ Package_Grabber.SendMessage(serverInfo.IPAddress, $"set_health {healthsetstr}", EnemyIdent);
+ break;
+ case Messages.FinishBattle:
+ string json = JsonConvert.SerializeObject(value as Network);
+ Package_Grabber.SendMessage(serverInfo.IPAddress, $"finish {json}");
+ break;
+ case Messages.Disabled:
+ string hnamestr = value as string;
+ Package_Grabber.SendMessage(serverInfo.IPAddress, $"disable {hnamestr}", EnemyIdent);
+ break;
+ }
+ }
+
+ public enum Messages
+ {
+ PlaceModule,
+ Upgrade,
+ RemoveModule,
+ SetHealth,
+ Disabled,
+ FinishBattle,
+ }
+ }
+
+ namespace Events
+ {
+ public class Health : EventArgs
+ {
+ public string host_name { get; set; }
+ public int health { get; set; }
+ }
+
+ public class Disabled : EventArgs
+ {
+ public string hostName { get; set; }
+ }
+
+ public class Won : EventArgs
+ {
+ public Network Winner { get; private set; }
+
+ public Won(Network winner)
+ {
+ Winner = winner;
+ }
+ }
+
+ public class ModulePlaced : EventArgs
+ {
+ public Module new_module { get; set; }
+ }
+
+ public class ModuleRemoved : EventArgs
+ {
+ public string new_module { get; set; }
+ }
+
+ public class ModuleUpgraded : EventArgs
+ {
+ public string hostname { get; set; }
+ public int grade { get; set; }
+ }
+
+
+
+ }
+}
diff --git a/source/WindowsFormsApplication1/Online/Hacking/Objects.cs b/source/WindowsFormsApplication1/Online/Hacking/Objects.cs
new file mode 100644
index 0000000..5012fcc
--- /dev/null
+++ b/source/WindowsFormsApplication1/Online/Hacking/Objects.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ShiftOS.Online.Hacking
+{
+ [Serializable]
+ public class Module
+ {
+ public string Hostname { get; set; }
+ public int Grade { get; set; }
+ public int HP { get; set; }
+ public int X { get; set; }
+ public int Y { get; set; }
+ public int Type { get; set; } //will be converted by the client
+ }
+
+ [Serializable]
+ public class Network
+ {
+ public string Name { get; set; }
+ public int Codepoints { get; set; }
+ public string Description { get; set; }
+ public int Losses { get; set; }
+ public int Wins { get; set; }
+ }
+
+ [Serializable]
+ public class ServerInfo
+ {
+ public string ServerName { get; set; }
+ public int PlayersAwaitingMatch { get; set; }
+ public string IPAddress { get; set; }
+ }
+}
diff --git a/source/WindowsFormsApplication1/Package_Grabber.cs b/source/WindowsFormsApplication1/Online/Package_Grabber.cs
index 3ea29d0..b6bbc61 100644
--- a/source/WindowsFormsApplication1/Package_Grabber.cs
+++ b/source/WindowsFormsApplication1/Online/Package_Grabber.cs
@@ -98,7 +98,7 @@ namespace ShiftOS
client.Connect(address, port);
clients.Add(client.RemoteHost, client);
}
- catch (Exception ex)
+ catch
{
}
}
@@ -191,7 +191,7 @@ namespace ShiftOS
wc.DownloadFile("http://playshiftos.ml/shiftnet/packages/" + pkgname + ".pkg", downloadpath + pkgname + ".pkg");
LastPackage_DownloadPath = downloadpath + pkgname + ".pkg";
}
- catch (WebException wex)
+ catch
{
result = false;
}
@@ -248,7 +248,7 @@ namespace ShiftOS
ZipFile.ExtractToDirectory(localpath, packagedir);
return packagedir;
}
- catch (Exception ex)
+ catch
{
return "fail";
}
diff --git a/source/WindowsFormsApplication1/Program.cs b/source/WindowsFormsApplication1/Program.cs
index 2b9bd47..0cb9096 100644
--- a/source/WindowsFormsApplication1/Program.cs
+++ b/source/WindowsFormsApplication1/Program.cs
@@ -8,6 +8,7 @@ using System.Net;
using System.IO.Compression;
using System.ComponentModel;
using System.Threading;
+using Newtonsoft.Json;
namespace ShiftOS
{
@@ -19,6 +20,7 @@ namespace ShiftOS
[STAThread]
static void Main(string[] args)
{
+
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Extract all dependencies before starting the engine.
@@ -44,7 +46,7 @@ namespace ShiftOS
}
}
}
- catch(Exception ex)
+ catch
{
Console.WriteLine("[ServerThread/WARNING] Couldn't retrieve startup pool. Not connecting to any servers.");
}
@@ -63,6 +65,17 @@ namespace ShiftOS
{
SaveSystem.Utilities.NewGame();
}
+ if (File.Exists(Paths.SystemDir + "settings.json"))
+ {
+ API.LoadedSettings = JsonConvert.DeserializeObject<Settings>(File.ReadAllText(Paths.SystemDir + "settings.json"));
+ }
+ else
+ {
+ API.LoadedSettings = new Settings();
+ API.LoadedSettings.MusicVolume = 50;
+ File.WriteAllText(Paths.SystemDir + "settings.json", JsonConvert.SerializeObject(API.LoadedSettings));
+ }
+ Audio.LoadAudioData();
//Load ShiftOS skin
Skinning.Utilities.loadskin();
SaveSystem.ShiftoriumRegistry.UpdateShiftorium();
@@ -111,7 +124,7 @@ namespace ShiftOS
}
}
}
- catch(Exception ex)
+ catch
{
}
@@ -140,7 +153,6 @@ namespace ShiftOS
{
Directory.Delete(temppath, true);
}
- bool firstfile = false;
ZipFile.ExtractToDirectory(zippath, temppath);
foreach (string f in Directory.GetFiles(temppath))
{
@@ -164,7 +176,7 @@ namespace ShiftOS
w.Dispose();
GC.Collect();
}
- catch (Exception ex)
+ catch
{
MessageBox.Show("Sorry to break the immersion, but we're currently downloading ShiftOS dependencies that'll make the game run MUCH better, such as the Lua engine and Gecko web renderer. Give us a moment. ShiftOS will continue to run while this happens but some things won't work right until we're finished.");
wc.DownloadFileAsync(new Uri("http://playshiftos.ml/shiftos/dependencies/ShiftOS_Dependencies.zip"), zippath);
diff --git a/source/WindowsFormsApplication1/Properties/Resources.Designer.cs b/source/WindowsFormsApplication1/Properties/Resources.Designer.cs
index 71beb06..2c80870 100644
--- a/source/WindowsFormsApplication1/Properties/Resources.Designer.cs
+++ b/source/WindowsFormsApplication1/Properties/Resources.Designer.cs
@@ -318,7 +318,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap BeginButton_Image {
get {
- object obj = ResourceManager.GetObject("BeginButton.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("BeginButton_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -463,6 +463,52 @@ namespace ShiftOS.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to ShiftOS #VER#
+ ///
+ ///
+ ///
+ ///A game by Michael VanOverbeek
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// == External Libraries / Dependencies ==
+ ///
+ /// JSON.NET - Version 8.0.2
+ /// By James Newton-King
+ /// http://www.newtonsoft.com/json
+ ///
+ ///
+ /// DynamicLua 1.1.1
+ /// By Niklas Rother
+ /// http://www.github.com/nrother/dynamiclua
+ ///
+ ///
+ /// GeckoFX .NET wrapper for Gecko and xulrunner - 1.0.5
+ /// By EmaGht
+ ///
+ ///
+ /// and various other amazing .NET libraries
+ ///
+ ///
+ ///
+ ///
+ ///== Music ==
+ ///
+ ///All music in ShiftOS is provided by Free Songs to Use, whose YouTube channel ca [rest of string was truncated]&quot;;.
+ /// </summary>
+ internal static string Credits {
+ get {
+ return ResourceManager.GetString("Credits", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to private void tmrfirstrun_Tick(object sender, EventArgs e)
/// {
/// switch (firstrun)
@@ -1103,7 +1149,21 @@ namespace ShiftOS.Properties {
/// <summary>
/// Looks up a localized string similar to {
- ///&quot;BufferOverflow&quot;:{&quot;IsLeader&quot;:false,&quot;Name&quot;:&quot;BufferOverflow&quot;,&quot;FriendDesc&quot;:&quot;BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.&quot;,&quot;Description&quot;:&quot;BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.&quot;,&quot;FriendSpeed&quot;:0,&quot;FriendSkill&quot;:0,&quot;Difficulty&quot;:&quot;easy&quot;,&quot;Network&quot;:[{&quot;Hostname&quot;:&quot;bufferoverflow&quot;,&quot;ModuleType&quot;:0,&quot;Type&quot;:0,&quot;HP&quot;:100,&quot;Grade&quot;:1,&quot;X&quot;:0,&quot;Y&quot;:0},{&quot;Hostname&quot;:&quot;main_av&quot;,&quot;ModuleType&quot;:0,&quot;Type&quot;:1,&quot;HP&quot;:0,&quot;Grade&quot;: [rest of string was truncated]&quot;;.
+ ///&quot;StartURL&quot;:&quot;http://michael.playshiftos.ml/shiftos/soundtrack/&quot;,
+ ///&quot;Files&quot;:{&quot;endgame&quot;:[&quot;Tom Vanko &amp; Mark Vank - Origin&quot;], &quot;hackerbattle_ambient&quot;:[&quot;HardMix - Evolution&quot;, &quot;Lastep - NeveS&quot;, &quot;Timmo Hendriks - That Happen&quot;, &quot;Eric Rodriguez - Lion&quot;, &quot;Mark Vank &amp; Miza - Dark Generation&quot;]},
+ ///&quot;Visualizers&quot;:{
+ /// &quot;Mark Vank &amp; Miza - Dark Generation&quot;:[{&quot;R&quot;:false, &quot;G&quot;:true, &quot;B&quot;:false, &quot;type&quot;:&quot;Pulse&quot;, &quot;startTime&quot;:0, &quot;endTime&quot;:30},
+ /// {&quot;R&quot;:false, &quot;G&quot;:true, &quot;B&quot;:false, &quot;type&quot;:&quot;BuildUp&quot;, &quot;startTime&quot;:30, &quot;endTime&quot; [rest of string was truncated]&quot;;.
+ /// </summary>
+ internal static string MusicData {
+ get {
+ return ResourceManager.GetString("MusicData", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to {
+ ///&quot;BufferOverflow&quot;:{&quot;IsLeader&quot;:false,&quot;Name&quot;:&quot;BufferOverflow&quot;,&quot;FriendDesc&quot;:&quot;BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.&quot;,&quot;Description&quot;:&quot;BufferOverflow is a question-and-answer site with millions of Shifters willing to share their knowledge.&quot;,&quot;FriendSpeed&quot;:65,&quot;FriendSkill&quot;:50,&quot;Difficulty&quot;:&quot;easy&quot;,&quot;Network&quot;:[{&quot;Hostname&quot;:&quot;bufferoverflow&quot;,&quot;ModuleType&quot;:0,&quot;Type&quot;:0,&quot;HP&quot;:100,&quot;Grade&quot;:1,&quot;X&quot;:0,&quot;Y&quot;:0},{&quot;Hostname&quot;:&quot;main_av&quot;,&quot;ModuleType&quot;:0,&quot;Type&quot;:1,&quot;HP&quot;:0,&quot;Grade [rest of string was truncated]&quot;;.
/// </summary>
internal static string NetBrowser_Enemies {
get {
@@ -1166,7 +1226,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap object_large_Image {
get {
- object obj = ResourceManager.GetObject("object_large.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("object_large_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1176,7 +1236,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap object_mid_Image {
get {
- object obj = ResourceManager.GetObject("object_mid.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("object_mid_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1186,7 +1246,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap object_mid2_Image {
get {
- object obj = ResourceManager.GetObject("object_mid2.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("object_mid2_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1196,7 +1256,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap object_small_Image {
get {
- object obj = ResourceManager.GetObject("object_small.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("object_small_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1206,7 +1266,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap object_small2_Image {
get {
- object obj = ResourceManager.GetObject("object_small2.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("object_small2_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1236,7 +1296,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap PicBonus_Image {
get {
- object obj = ResourceManager.GetObject("PicBonus.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("PicBonus_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1266,7 +1326,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap player_Image {
get {
- object obj = ResourceManager.GetObject("player.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("player_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@@ -1286,7 +1346,7 @@ namespace ShiftOS.Properties {
/// </summary>
internal static System.Drawing.Bitmap QuitButton_Image {
get {
- object obj = ResourceManager.GetObject("QuitButton.Image", resourceCulture);
+ object obj = ResourceManager.GetObject("QuitButton_Image", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
diff --git a/source/WindowsFormsApplication1/Properties/Resources.resx b/source/WindowsFormsApplication1/Properties/Resources.resx
index d2f0adf..e8fecc6 100644
--- a/source/WindowsFormsApplication1/Properties/Resources.resx
+++ b/source/WindowsFormsApplication1/Properties/Resources.resx
@@ -220,7 +220,7 @@
<data name="upgradeshiftpanelclock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgradeshiftpanelclock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="BeginButton.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="BeginButton_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\BeginButton.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="upgradeamandpm" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -310,7 +310,7 @@
<data name="deletefile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\deletefile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="QuitButton.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="QuitButton_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\QuitButton.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ArtPadnew" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -412,7 +412,7 @@
<data name="upgradegreencustom" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgradegreencustom.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="player.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="player_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\player.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="stopbutton" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -610,7 +610,7 @@
<data name="iconDownloader" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\iconDownloader.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="object_mid2.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="object_mid2_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\object_mid2.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="fileicondirectory" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -622,7 +622,7 @@
<data name="upgradeartpadpaintbrushtool" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgradeartpadpaintbrushtool.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="object_small2.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="object_small2_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\object_small2.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TotalBalanceClicked" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -655,7 +655,7 @@
<data name="upgradeartpadpixellimit4096" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgradeartpadpixellimit4096.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="object_large.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="object_large_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\object_large.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="anycolourshade4" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -778,7 +778,7 @@
<data name="upgradeartpadpixelplacermovementmode" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgradeartpadpixelplacermovementmode.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="object_small.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="object_small_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\object_small.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="upgradeosname" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -868,7 +868,7 @@
<data name="upgrademinutesssincemidnight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgrademinutesssincemidnight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="object_mid.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="object_mid_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\object_mid.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="upgradeunitymode" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -1009,7 +1009,7 @@
<data name="upgradepinkshades" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\upgradepinkshades.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
- <data name="PicBonus.Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <data name="PicBonus_Image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\PicBonus.Image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="notify_generic" type="System.Resources.ResXFileRef, System.Windows.Forms">
@@ -1063,4 +1063,10 @@
<data name="AustinWalkerCompletionStory" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AustinWalkerCompletionStory.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
+ <data name="MusicData" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\MusicData.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
+ </data>
+ <data name="Credits" type="System.Resources.ResXFileRef, System.Windows.Forms">
+ <value>..\Resources\Credits.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
+ </data>
</root> \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/QuickChat.Designer.cs b/source/WindowsFormsApplication1/QuickChat.Designer.cs
deleted file mode 100644
index 9399496..0000000
--- a/source/WindowsFormsApplication1/QuickChat.Designer.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-namespace ShiftOS
-{
- partial class QuickChat
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.panel1 = new System.Windows.Forms.Panel();
- this.pnlsetnick = new System.Windows.Forms.Panel();
- this.label2 = new System.Windows.Forms.Label();
- this.btnconnect = new System.Windows.Forms.Button();
- this.txtsetnick = new System.Windows.Forms.TextBox();
- this.label1 = new System.Windows.Forms.Label();
- this.txtmessages = new System.Windows.Forms.RichTextBox();
- this.pnlcontrols = new System.Windows.Forms.Panel();
- this.txtmessage = new System.Windows.Forms.TextBox();
- this.btnsend = new System.Windows.Forms.Button();
- this.lbnick = new System.Windows.Forms.Label();
- this.tmrimfuckinglucky = new System.Windows.Forms.Timer(this.components);
- this.panel1.SuspendLayout();
- this.pnlsetnick.SuspendLayout();
- this.pnlcontrols.SuspendLayout();
- this.SuspendLayout();
- //
- // panel1
- //
- this.panel1.BackColor = System.Drawing.Color.White;
- this.panel1.Controls.Add(this.pnlsetnick);
- this.panel1.Controls.Add(this.txtmessages);
- this.panel1.Controls.Add(this.pnlcontrols);
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel1.Location = new System.Drawing.Point(0, 0);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(701, 414);
- this.panel1.TabIndex = 0;
- //
- // pnlsetnick
- //
- this.pnlsetnick.Controls.Add(this.label2);
- this.pnlsetnick.Controls.Add(this.btnconnect);
- this.pnlsetnick.Controls.Add(this.txtsetnick);
- this.pnlsetnick.Controls.Add(this.label1);
- this.pnlsetnick.Location = new System.Drawing.Point(198, 88);
- this.pnlsetnick.Name = "pnlsetnick";
- this.pnlsetnick.Size = new System.Drawing.Size(289, 184);
- this.pnlsetnick.TabIndex = 2;
- this.pnlsetnick.Visible = false;
- //
- // label2
- //
- this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.25F);
- this.label2.Location = new System.Drawing.Point(4, 38);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(282, 80);
- this.label2.TabIndex = 3;
- this.label2.Text = "QuickChat is the finest chat application for ShiftOS! All you have to do is enter" +
- " your nickname in the field below and hit \"Connect!\"";
- this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // btnconnect
- //
- this.btnconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnconnect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnconnect.Font = new System.Drawing.Font("Times New Roman", 10F);
- this.btnconnect.Location = new System.Drawing.Point(196, 152);
- this.btnconnect.Name = "btnconnect";
- this.btnconnect.Size = new System.Drawing.Size(90, 29);
- this.btnconnect.TabIndex = 2;
- this.btnconnect.Text = "Connect!";
- this.btnconnect.UseVisualStyleBackColor = true;
- this.btnconnect.Click += new System.EventHandler(this.btnconnect_Click);
- //
- // txtsetnick
- //
- this.txtsetnick.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.txtsetnick.BackColor = System.Drawing.Color.Gray;
- this.txtsetnick.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.txtsetnick.ForeColor = System.Drawing.Color.White;
- this.txtsetnick.Location = new System.Drawing.Point(24, 121);
- this.txtsetnick.Name = "txtsetnick";
- this.txtsetnick.Size = new System.Drawing.Size(239, 13);
- this.txtsetnick.TabIndex = 1;
- this.txtsetnick.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtsetnick_KeyDown);
- //
- // label1
- //
- this.label1.Dock = System.Windows.Forms.DockStyle.Top;
- this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
- this.label1.Location = new System.Drawing.Point(0, 0);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(289, 34);
- this.label1.TabIndex = 0;
- this.label1.Text = "Welcome to QuickChat!";
- this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
- //
- // txtmessages
- //
- this.txtmessages.BackColor = System.Drawing.Color.White;
- this.txtmessages.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.txtmessages.DetectUrls = false;
- this.txtmessages.Dock = System.Windows.Forms.DockStyle.Fill;
- this.txtmessages.Font = new System.Drawing.Font("Lucida Console", 8.25F);
- this.txtmessages.ForeColor = System.Drawing.Color.Black;
- this.txtmessages.Location = new System.Drawing.Point(0, 0);
- this.txtmessages.Name = "txtmessages";
- this.txtmessages.ReadOnly = true;
- this.txtmessages.Size = new System.Drawing.Size(701, 380);
- this.txtmessages.TabIndex = 1;
- this.txtmessages.Text = "";
- this.txtmessages.TextChanged += new System.EventHandler(this.txtmessages_TextChanged);
- //
- // pnlcontrols
- //
- this.pnlcontrols.BackColor = System.Drawing.Color.Gray;
- this.pnlcontrols.Controls.Add(this.txtmessage);
- this.pnlcontrols.Controls.Add(this.btnsend);
- this.pnlcontrols.Controls.Add(this.lbnick);
- this.pnlcontrols.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pnlcontrols.ForeColor = System.Drawing.Color.White;
- this.pnlcontrols.Location = new System.Drawing.Point(0, 380);
- this.pnlcontrols.Name = "pnlcontrols";
- this.pnlcontrols.Size = new System.Drawing.Size(701, 34);
- this.pnlcontrols.TabIndex = 0;
- //
- // txtmessage
- //
- this.txtmessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.txtmessage.BackColor = System.Drawing.Color.White;
- this.txtmessage.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.txtmessage.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F);
- this.txtmessage.ForeColor = System.Drawing.Color.Black;
- this.txtmessage.Location = new System.Drawing.Point(70, 6);
- this.txtmessage.Name = "txtmessage";
- this.txtmessage.Size = new System.Drawing.Size(547, 19);
- this.txtmessage.TabIndex = 2;
- //
- // btnsend
- //
- this.btnsend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.btnsend.Enabled = false;
- this.btnsend.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btnsend.Location = new System.Drawing.Point(623, 3);
- this.btnsend.Name = "btnsend";
- this.btnsend.Size = new System.Drawing.Size(75, 28);
- this.btnsend.TabIndex = 1;
- this.btnsend.Text = "Send";
- this.btnsend.UseVisualStyleBackColor = true;
- this.btnsend.Click += new System.EventHandler(this.btnsend_Click);
- //
- // lbnick
- //
- this.lbnick.Dock = System.Windows.Forms.DockStyle.Left;
- this.lbnick.Location = new System.Drawing.Point(0, 0);
- this.lbnick.Name = "lbnick";
- this.lbnick.Size = new System.Drawing.Size(100, 34);
- this.lbnick.TabIndex = 0;
- this.lbnick.Text = "Nickname";
- this.lbnick.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
- //
- // tmrimfuckinglucky
- //
- this.tmrimfuckinglucky.Enabled = true;
- this.tmrimfuckinglucky.Tick += new System.EventHandler(this.tmrimfuckinglucky_Tick);
- //
- // QuickChat
- //
- this.AcceptButton = this.btnsend;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(701, 414);
- this.Controls.Add(this.panel1);
- this.Name = "QuickChat";
- this.Text = "QuickChat";
- this.Load += new System.EventHandler(this.QuickChat_Load);
- this.panel1.ResumeLayout(false);
- this.pnlsetnick.ResumeLayout(false);
- this.pnlsetnick.PerformLayout();
- this.pnlcontrols.ResumeLayout(false);
- this.pnlcontrols.PerformLayout();
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.RichTextBox txtmessages;
- private System.Windows.Forms.Panel pnlcontrols;
- private System.Windows.Forms.Timer tmrimfuckinglucky;
- private System.Windows.Forms.Label lbnick;
- private System.Windows.Forms.TextBox txtmessage;
- private System.Windows.Forms.Button btnsend;
- private System.Windows.Forms.Panel pnlsetnick;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Button btnconnect;
- private System.Windows.Forms.TextBox txtsetnick;
- private System.Windows.Forms.Label label1;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/QuickChat.cs b/source/WindowsFormsApplication1/QuickChat.cs
deleted file mode 100644
index d650914..0000000
--- a/source/WindowsFormsApplication1/QuickChat.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using IrcDotNet;
-
-namespace ShiftOS
-{
- public partial class QuickChat : Form
- {
- public QuickChat()
- {
- InitializeComponent();
- }
-
- ShiftOSIrcClient ConnectedClient = null;
-
- private void QuickChat_Load(object sender, EventArgs e)
- {
- pnlsetnick.Show();
- pnlcontrols.Hide();
- }
-
-
- private void txtmessages_TextChanged(object sender, EventArgs e)
- {
- }
-
- //I'm fucking lucky I was able to get this working first try.
- private void tmrimfuckinglucky_Tick(object sender, EventArgs e)
- {
- try {
- if (ConnectedClient.CanReceiveMessages == true)
- {
- if (ConnectedClient.Messages.Count > 20)
- {
- ConnectedClient.Messages.Remove(ConnectedClient.Messages[20]);
- }
- txtmessages.Lines = ConnectedClient.Messages.ToArray();
- lbnick.Text = ConnectedClient.LocalUser.NickName;
- btnsend.Enabled = true;
- }
- if(ConnectedClient.ErrorMessages.Count > 0)
- {
- API.CreateInfoboxSession("QuickChat error", ConnectedClient.ErrorMessages[0], infobox.InfoboxMode.Info);
- ConnectedClient.Dispose();
- this.Close();
- }
- }
- catch(Exception ex)
- {
-
- }
- }
-
- private void btnsend_Click(object sender, EventArgs e)
- {
- try
- {
- if (ConnectedClient.CanReceiveMessages == true)
- {
- if (txtmessage.Text.Length > 0)
- {
- ConnectedClient.Messages.Add($"<{ConnectedClient.LocalUser.NickName}> {txtmessage.Text}");
- ConnectedClient.SendMessage($"{txtmessage.Text}");
- txtmessage.Text = "";
- }
- }
- }
- catch(Exception ex)
- {
-
- }
- }
-
- private void btnconnect_Click(object sender, EventArgs e)
- {
- var res = txtsetnick.Text;
- if (res != "")
- {
- ConnectedClient = new ShiftOSIrcClient(res);
- pnlsetnick.Hide();
- pnlcontrols.Show();
- }
- else
- {
- API.CreateInfoboxSession("QuickChat - Nickname not valid.", "That nickname is not valid. Your name will be automatically generated.", infobox.InfoboxMode.Info);
- ConnectedClient = new ShiftOSIrcClient();
- pnlsetnick.Hide();
- pnlcontrols.Show();
- }
- }
-
- private void txtsetnick_KeyDown(object sender, KeyEventArgs e)
- {
- if(e.KeyCode == Keys.Enter)
- {
- btnconnect_Click(sender, (EventArgs)e);
- }
- }
- }
-
- public class ShiftOSIrcClient : IrcClient
- {
- public ShiftOSIrcClient()
- {
- var rnd = new Random();
- var nick_id = rnd.Next(10000, 99999);
- this.Connected += (object sender, EventArgs a) =>
- {
- this.MotdReceived += new EventHandler<System.EventArgs>(this.motd_received);
- };
- this.ConnectFailed += (object s, IrcErrorEventArgs a) =>
- {
- ErrorMessages.Add("Could not connect to the QuickChat chatroom. " + a.Error.Message);
- };
- this.RawMessageReceived += (object s, IrcRawMessageEventArgs a) =>
- {
-
- };
- this.Connect("irc.playshiftos.ml", 6667, false, new IrcUserRegistrationInfo { NickName = $"shifter_{nick_id}", RealName = $"QuickChat: {API.CurrentSave.username}", UserName = $"shifter_{nick_id}" });
-
- }
- private List<string> errmsg = new List<string>();
-
- public List<string> ErrorMessages
- {
- get
- {
- return errmsg;
- }
- }
- private bool running = false;
-
- public bool CanReceiveMessages
- {
- get
- {
- return running;
- }
- }
-
- private List<string> msgs = new List<string>();
-
- public void SendMessage(string msg)
- {
- if(running == true)
- {
- SendRawMessage($"PRIVMSG #shiftos :{msg}");
- }
- }
-
- public List<string> Messages
- {
- get
- {
- return msgs;
- }
- }
-
- public void motd_received(object sender, EventArgs a)
- {
- LocalUser.JoinedChannel += (object s, IrcChannelEventArgs e) =>
- {
- running = true;
- msgs.Add("<QuickChat> Welcome to QuickChat!");
- e.Channel.MessageReceived += (object se, IrcMessageEventArgs ea) =>
- {
- if (!msgs.Contains($"<{ea.Source.Name}> {ea.GetText()}"))
- {
- msgs.Add($"<{ea.Source.Name}> {ea.GetText()}");
- }
- };
- };
- Channels.Join("#shiftos");
- }
-
- public ShiftOSIrcClient(string nick)
- {
- this.Connected += (object sender, EventArgs a) =>
- {
- this.MotdReceived += new EventHandler<System.EventArgs>(this.motd_received);
- };
- this.ConnectFailed += (object s, IrcErrorEventArgs a) =>
- {
- ErrorMessages.Add("Could not connect to the QuickChat chatroom. " + a.Error.Message);
- };
- this.RawMessageReceived += (object s, IrcRawMessageEventArgs a) =>
- {
- if(a.RawContent.Contains("already in use"))
- {
- ErrorMessages.Add("That nickname is already in use! Please restart QuickChat and try again.");
- }
- };
- this.Connect("irc.playshiftos.ml", 6667, false, new IrcUserRegistrationInfo { NickName = nick, RealName = $"QuickChat: {nick}", UserName = nick });
-
- }
- }
-}
diff --git a/source/WindowsFormsApplication1/RemoteCoherence.cs b/source/WindowsFormsApplication1/RemoteCoherence.cs
deleted file mode 100644
index bdad885..0000000
--- a/source/WindowsFormsApplication1/RemoteCoherence.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ShiftOS
-{
- class RemoteCoherence
- {
- }
-}
diff --git a/source/WindowsFormsApplication1/Resources/Credits.txt b/source/WindowsFormsApplication1/Resources/Credits.txt
new file mode 100644
index 0000000..9961fa3
--- /dev/null
+++ b/source/WindowsFormsApplication1/Resources/Credits.txt
@@ -0,0 +1,121 @@
+ShiftOS #VER#
+
+
+
+A game by Michael VanOverbeek
+
+
+
+
+
+
+
+
+
+ == External Libraries / Dependencies ==
+
+ JSON.NET - Version 8.0.2
+ By James Newton-King
+ http://www.newtonsoft.com/json
+
+
+ DynamicLua 1.1.1
+ By Niklas Rother
+ http://www.github.com/nrother/dynamiclua
+
+
+ GeckoFX .NET wrapper for Gecko and xulrunner - 1.0.5
+ By EmaGht
+
+
+ and various other amazing .NET libraries
+
+
+
+
+== Music ==
+
+All music in ShiftOS is provided by Free Songs to Use, whose YouTube channel can be found at https://www.youtube.com/channel/UCPSX-g40Ti1c5C7sbGNtGzA
+
+TRACKLIST:
+
+Lastep - NeveS
+Timmo Hendriks - That Happen
+Tom Vanko / Mark Vank - Origin
+HardMix - Evolution
+Eric Rodriguez - Lion
+Mark Vank & Miza - Dark Generation
+
+SUPPORT THESE BRILLIANT ARTISTS!
+
+• Support Miza:
+https://soundcloud.com/miza-official1
+https://soundcloud.com/miza-official1
+https://www.facebook.com/miza.official.page
+
+Support Lastep:
+https://www.youtube.com/channel/UCQoGdkBRqzjx12htDBhiCxQ
+https://soundcloud.com/lastepmusic
+https://twitter.com/LastepMusic
+
+Support Tom Vanko:
+https://soundcloud.com/tomvanko
+https://www.facebook.com/tomvankomusic
+https://twitter.com/tomvankomusic
+
+Support Timmo Hendriks:
+https://soundcloud.com/dj-timmo
+https://www.facebook.com/TimmoHendriksofficial
+https://twitter.com/Timmo_Hendriks
+https://www.instagram.com/timmohendriks/
+https://www.youtube.com/c/TimmoHendriks
+Snapchat: Timmo_Hendriks
+
+Support Mark Vank:
+https://soundcloud.com/markvank
+https://www.youtube.com/channel/UCb4ch0_TAKSDvq89NUIElLA
+https://twitter.com/MarkVank_
+https://www.facebook.com/HardMixOfficial
+
+Support HardMix:
+https://soundcloud.com/hardmix-ap3x
+http://www.instagram.com/mebn2
+http://www.youtube.com/VoltiDubstep
+
+Support Eric Rodriguez:
+https://soundcloud.com/ericrodriguezofficial
+https://instagram.com/ericrodriguezmusic/
+https://www.youtube.com/user/ericrodriguezmusic
+
+Go check out Free Songs To Use (and thank them for this brilliant music)
+Facebook: https://www.facebook.com/FreeSongsToUse
+Twitter: https://twitter.com/FreeSongsToUse
+Soundcloud: https://soundcloud.com/FreeSongsToUse
+Instagram: https://www.instagram.com/freesongstouse_official
+
+
+== More of Michael's things ==
+
+Enjoyed ShiftOS? Want to see more games and projects from Michael? Why not visit his website at http://michael.playshiftos.ml?
+
+
+
+
+ == Special Thanks ==
+
+On behalf of the ShiftOS development team, we would love to thank the following amazing people and groups:
+
+ - Microsoft BizSpark, Azure, and MSDN
+ - Philip Adams, a.k.a OSFirstTimer
+ - All the amazing people on the ShiftOS Forums
+
+Without your help, ShiftOS just wouldn't be what it is today. It probably wouldn't exist if it weren't for OSFirstTimer, and without BizSpark and Azure hosting our website and servers, you wouldn't be able to hear the amazing music you hear right now. That, and without the amazing people at the ShiftOS community bringing us new ideas, suggestions, bug reports, and being generally nice people, the project wouldn't get as far as it has.
+
+
+
+
+
+
+
+
+And finally, we want to thank you, #USER#, for giving our game a try. We hope you enjoyed and continue to enjoy it! \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Resources/MusicData.txt b/source/WindowsFormsApplication1/Resources/MusicData.txt
new file mode 100644
index 0000000..b17ac5a
--- /dev/null
+++ b/source/WindowsFormsApplication1/Resources/MusicData.txt
@@ -0,0 +1,45 @@
+{
+"StartURL":"http://michael.playshiftos.ml/shiftos/soundtrack/",
+"Files":{"endgame":["Tom Vanko & Mark Vank - Origin"], "hackerbattle_ambient":["HardMix - Evolution", "Lastep - NeveS", "Timmo Hendriks - That Happen", "Mark Vank & Miza - Dark Generation"]},
+"Visualizers":{
+ "Mark Vank & Miza - Dark Generation":[{"R":false, "G":true, "B":false, "type":"Pulse", "startTime":0, "endTime":30},
+ {"R":false, "G":true, "B":false, "type":"BuildUp", "startTime":30, "endTime":60},
+ {"R":false, "G":true, "B":true, "type":"BuildUp", "startTime":60, "endTime":75},
+ {"R":true, "G":false, "B":false, "type":"Pulse", "startTime":75, "endTime":105},
+ {"R":false, "G":true, "B":false, "type":"Pulse", "startTime":106, "endTime":135},
+ {"R":false, "G":true, "B":true, "type":"BuildUp", "startTime":135, "endTime":150},
+ {"R":true, "G":true, "B":false, "type":"Pulse", "startTime":150, "endTime":175},
+ {"R":true, "G":true, "B":false, "type":"CalmDown", "startTime":175, "endTime":212}
+ ],
+ "HardMix - Evolution": [{"R":false, "G":false, "B":true, "type":"Pulse", "startTime":0, "endTime":15},
+ {"R":false, "G":true, "B":true, "type":"Pulse", "startTime":15, "endTime":30},
+ {"R":true, "G":false, "B":true, "type":"BuildUp", "startTime":30, "endTime":83},
+ {"R":true, "G":false, "B":false, "type":"BuildUp", "startTime":83, "endTime":97},
+ {"R":true, "G":false, "B":false, "type":"Pulse", "startTime":97, "endTime":130},
+ {"R":true, "G":false, "B":true, "type":"BuildUp", "startTime":130, "endTime":175},
+ {"R":true, "G":false, "B":false, "type":"BuildUp", "startTime":175, "endTime":190},
+ {"R":true, "G":false, "B":false, "type":"Pulse", "startTime":190, "endTime":220},
+ {"R":false, "G":false, "B":true, "type":"CalmDown", "startTime":220, "endTime":252}
+ ],
+ "Lastep - NeveS": [{"R":true, "G":true, "B":true, "type":"Pulse", "startTime":0, "endTime":47},
+ {"R":true, "G":true, "B":false, "type":"BuildUp", "startTime":47, "endTime":78},
+ {"R":true, "G":true, "B":false, "type":"Pulse", "startTime":78, "endTime":110},
+ {"R":true, "G":false, "B":false, "type":"Pulse", "startTime":110, "endTime":157},
+ {"R":true, "G":true, "B":false, "type":"BuildUp", "startTime":157, "endTime":190},
+ {"R":true, "G":true, "B":false, "type":"Pulse", "startTime":190, "endTime":220}
+ ],
+ "Timmo Hendriks - That Happen": [{"R":false, "G":false, "B":true, "type":"Pulse", "startTime":0, "endTime":30},
+ {"R":false, "G":true, "B":true, "type":"Pulse", "startTime":30, "endTime":60},
+ {"R":true, "G":true, "B":false, "type":"Pulse", "startTime":60, "endTime":90},
+ {"R":true, "G":false, "B":true, "type":"Pulse", "startTime":90, "endTime":120},
+ {"R":true, "G":true, "B":false, "type":"Pulse", "startTime":120, "endTime":135},
+ {"R":true, "G":false, "B":false, "type":"BuildUp", "startTime":135, "endTime":165},
+ {"R":true, "B":false, "G":false, "type":"Pulse", "startTime":165, "endTime":195},
+ {"R":false, "G":false, "B":true, "type":"BuildUp", "startTime":195, "endTime":240},
+ {"R":false, "G":false, "B":true, "type":"Pulse", "startTime":240, "endTime":255},
+ {"R":true, "G":false, "B":false, "type":"BuildUp", "startTime":255, "endTime":285},
+ {"R":true, "G":true, "B":false, "type":"Pulse", "startTime":285, "endTime":330},
+ {"R":true, "G":true, "B":false, "type":"CalmDown", "startTime":330, "endTime":377}
+ ]
+ }
+} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Resources/NetBrowser_Enemies.txt b/source/WindowsFormsApplication1/Resources/NetBrowser_Enemies.txt
index 950d6b7..8ab0596 100644
--- a/source/WindowsFormsApplication1/Resources/NetBrowser_Enemies.txt
+++ b/source/WindowsFormsApplication1/Resources/NetBrowser_Enemies.txt
@@ -1,6 +1,9 @@
{
-"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":65,"FriendSkill":50,"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}]},
-"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}]}
+"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, creators of the Tangerine Operating System, and various portable devices like the TangerineBook, OrangePad, and OrangePhone.","FriendSpeed":100,"FriendSkill":200,"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}]},
+"LadouceurNet":{"IsLeader":false,"Name":"LadouceurNet","FriendDesc":"The LadouceurNet - the Shiftnet that never happened.","Description":"The LadouceurNet - the Shiftnet that never happened.","FriendSpeed":140,"FriendSkill":125,"Difficulty":"medium","Network":[{"Hostname":"ladouceurnet","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"mod4","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":479,"Y":127},{"Hostname":"mod5","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":382,"Y":131},{"Hostname":"mod5_1","ModuleType":0,"Type":1,"HP":0,"Grade":2,"X":482,"Y":302},{"Hostname":"mod5_2","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":359,"Y":304},{"Hostname":"mod8","ModuleType":0,"Type":5,"HP":0,"Grade":4,"X":403,"Y":336},{"Hostname":"mod1","ModuleType":0,"Type":3,"HP":0,"Grade":4,"X":444,"Y":335}]},
+"GimmeX":{"IsLeader":false,"Name":"GimmeX","FriendDesc":"The data stealer","Description":"The data stealer","FriendSpeed":10,"FriendSkill":15,"Difficulty":"medium","Network":[{"Hostname":"gimmex","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"Repairman","ModuleType":0,"Type":9,"HP":0,"Grade":1,"X":442,"Y":145},{"Hostname":"Stealer","ModuleType":0,"Type":8,"HP":0,"Grade":4,"X":371,"Y":121},{"Hostname":"Attacker","ModuleType":0,"Type":3,"HP":0,"Grade":1,"X":359,"Y":218},{"Hostname":"Defense","ModuleType":0,"Type":5,"HP":0,"Grade":4,"X":494,"Y":227},{"Hostname":"IGiveBreaks","ModuleType":0,"Type":6,"HP":0,"Grade":1,"X":522,"Y":156}]},
+"A-Labs":{"IsLeader":false,"Name":"A-Labs","FriendDesc":"A-Labs is a group that is attempting to find a cure for cancer.","Description":"A-Labs is a group that is attempting to find a cure for cancer.","FriendSpeed":9999,"FriendSkill":9999,"Difficulty":"hard","Network":[{"Hostname":"a-labs","ModuleType":0,"Type":0,"HP":100,"Grade":1,"X":0,"Y":0},{"Hostname":"Subject_1","ModuleType":0,"Type":1,"HP":0,"Grade":2,"X":512,"Y":211},{"Hostname":"Subject_2","ModuleType":0,"Type":7,"HP":0,"Grade":4,"X":330,"Y":194},{"Hostname":"Subject_3","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":427,"Y":270},{"Hostname":"Subject_4","ModuleType":0,"Type":9,"HP":0,"Grade":4,"X":437,"Y":155},{"Hostname":"Subject_5","ModuleType":0,"Type":2,"HP":0,"Grade":3,"X":284,"Y":204}]}
} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/ShiftOS.csproj b/source/WindowsFormsApplication1/ShiftOS.csproj
index 0f86628..b835f29 100644
--- a/source/WindowsFormsApplication1/ShiftOS.csproj
+++ b/source/WindowsFormsApplication1/ShiftOS.csproj
@@ -56,7 +56,7 @@
<Private>True</Private>
</Reference>
<Reference Include="NetSockets">
- <HintPath>..\..\..\..\Downloads\NetSockets.dll</HintPath>
+ <HintPath>..\dependencies\NetSockets.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -84,84 +84,93 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
- <Compile Include="AlternateDesktop.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="AlternateDesktop.Designer.cs">
- <DependentUpon>AlternateDesktop.cs</DependentUpon>
- </Compile>
<Compile Include="API.cs" />
- <Compile Include="Appscape.cs">
+ <Compile Include="Apps\Appscape.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Appscape.Designer.cs">
+ <Compile Include="Apps\Appscape.Designer.cs">
<DependentUpon>Appscape.cs</DependentUpon>
</Compile>
- <Compile Include="AppscapeUploader.cs">
+ <Compile Include="Apps\AppscapeUploader.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="AppscapeUploader.Designer.cs">
+ <Compile Include="Apps\AppscapeUploader.Designer.cs">
<DependentUpon>AppscapeUploader.cs</DependentUpon>
</Compile>
- <Compile Include="Artpad.cs">
+ <Compile Include="Apps\Artpad.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Artpad.Designer.cs">
+ <Compile Include="Apps\Artpad.Designer.cs">
<DependentUpon>Artpad.cs</DependentUpon>
</Compile>
- <Compile Include="AudioResourceClient.cs" />
- <Compile Include="BitnoteConverter.cs">
+ <Compile Include="Controls\SyntaxHighlighter.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Engine\AudioResourceClient.cs" />
+ <Compile Include="Apps\BitnoteConverter.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="BitnoteConverter.Designer.cs">
+ <Compile Include="Apps\BitnoteConverter.Designer.cs">
<DependentUpon>BitnoteConverter.cs</DependentUpon>
</Compile>
- <Compile Include="BitnoteDigger.cs">
+ <Compile Include="Apps\BitnoteDigger.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="BitnoteDigger.Designer.cs">
+ <Compile Include="Apps\BitnoteDigger.Designer.cs">
<DependentUpon>BitnoteDigger.cs</DependentUpon>
</Compile>
- <Compile Include="BitnoteWallet.cs">
+ <Compile Include="Apps\BitnoteWallet.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="BitnoteWallet.Designer.cs">
+ <Compile Include="Apps\BitnoteWallet.Designer.cs">
<DependentUpon>BitnoteWallet.cs</DependentUpon>
</Compile>
- <Compile Include="Color_Picker.cs">
+ <Compile Include="Dialogs\Color_Picker.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Color_Picker.Designer.cs">
+ <Compile Include="Dialogs\Color_Picker.Designer.cs">
<DependentUpon>Color_Picker.cs</DependentUpon>
</Compile>
- <Compile Include="Computer.cs">
+ <Compile Include="Controls\Computer.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="Computer.Designer.cs">
+ <Compile Include="Controls\Computer.Designer.cs">
<DependentUpon>Computer.cs</DependentUpon>
</Compile>
- <Compile Include="Connection.cs">
+ <Compile Include="Controls\Connection.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="Connection.Designer.cs">
+ <Compile Include="Controls\Connection.Designer.cs">
<DependentUpon>Connection.cs</DependentUpon>
</Compile>
- <Compile Include="DesktopIcon.cs">
+ <Compile Include="Online\ConnectionManager.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Online\ConnectionManager.Designer.cs">
+ <DependentUpon>ConnectionManager.cs</DependentUpon>
+ </Compile>
+ <Compile Include="CreditScroller.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="CreditScroller.Designer.cs">
+ <DependentUpon>CreditScroller.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Controls\DesktopIcon.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="DesktopIcon.Designer.cs">
+ <Compile Include="Controls\DesktopIcon.Designer.cs">
<DependentUpon>DesktopIcon.cs</DependentUpon>
</Compile>
- <Compile Include="Dodge.cs">
+ <Compile Include="Apps\Dodge.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Dodge.Designer.cs">
+ <Compile Include="Apps\Dodge.Designer.cs">
<DependentUpon>Dodge.cs</DependentUpon>
</Compile>
- <Compile Include="File Skimmer.cs">
+ <Compile Include="Apps\File Skimmer.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="File Skimmer.Designer.cs">
+ <Compile Include="Apps\File Skimmer.Designer.cs">
<DependentUpon>File Skimmer.cs</DependentUpon>
</Compile>
<Compile Include="FinalMission\ChoiceControl.cs">
@@ -189,142 +198,126 @@
<Compile Include="FinalMission\QuestViewer.Designer.cs">
<DependentUpon>QuestViewer.cs</DependentUpon>
</Compile>
- <Compile Include="Graphic_Picker.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="Graphic_Picker.Designer.cs">
- <DependentUpon>Graphic_Picker.cs</DependentUpon>
- </Compile>
- <Compile Include="Hacking.cs" />
- <Compile Include="Hacking_Enemy.cs">
+ <Compile Include="GameSettings.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Hacking_Enemy.Designer.cs">
- <DependentUpon>Hacking_Enemy.cs</DependentUpon>
+ <Compile Include="GameSettings.Designer.cs">
+ <DependentUpon>GameSettings.cs</DependentUpon>
</Compile>
- <Compile Include="Hacking_YourHealth.cs">
+ <Compile Include="Dialogs\Graphic_Picker.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Hacking_YourHealth.Designer.cs">
- <DependentUpon>Hacking_YourHealth.cs</DependentUpon>
+ <Compile Include="Dialogs\Graphic_Picker.Designer.cs">
+ <DependentUpon>Graphic_Picker.cs</DependentUpon>
</Compile>
- <Compile Include="HackUI.cs">
+ <Compile Include="Gameplay\Hacking.cs" />
+ <Compile Include="Gameplay\HackUI.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="HackUI.Designer.cs">
+ <Compile Include="Gameplay\HackUI.Designer.cs">
<DependentUpon>HackUI.cs</DependentUpon>
</Compile>
- <Compile Include="HijackScreen.cs">
+ <Compile Include="Gameplay\HijackScreen.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="HijackScreen.Designer.cs">
+ <Compile Include="Gameplay\HijackScreen.Designer.cs">
<DependentUpon>HijackScreen.cs</DependentUpon>
</Compile>
- <Compile Include="HoloChat.cs">
+ <Compile Include="Apps\HoloChat.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="HoloChat.Designer.cs">
+ <Compile Include="Apps\HoloChat.Designer.cs">
<DependentUpon>HoloChat.cs</DependentUpon>
</Compile>
- <Compile Include="IconControl.cs">
+ <Compile Include="Controls\IconControl.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="IconControl.Designer.cs">
+ <Compile Include="Controls\IconControl.Designer.cs">
<DependentUpon>IconControl.cs</DependentUpon>
</Compile>
- <Compile Include="IconManager.cs">
+ <Compile Include="Apps\IconManager.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="IconManager.Designer.cs">
+ <Compile Include="Apps\IconManager.Designer.cs">
<DependentUpon>IconManager.cs</DependentUpon>
</Compile>
- <Compile Include="ImageSelector.cs">
+ <Compile Include="Controls\ImageSelector.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="ImageSelector.Designer.cs">
+ <Compile Include="Controls\ImageSelector.Designer.cs">
<DependentUpon>ImageSelector.cs</DependentUpon>
</Compile>
- <Compile Include="infobox.cs">
+ <Compile Include="Controls\infobox.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="infobox.Designer.cs">
+ <Compile Include="Controls\infobox.Designer.cs">
<DependentUpon>infobox.cs</DependentUpon>
</Compile>
- <Compile Include="Jumper.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="Jumper.Designer.cs">
- <DependentUpon>Jumper.cs</DependentUpon>
- </Compile>
- <Compile Include="KnowledgeInput.cs">
+ <Compile Include="Apps\KnowledgeInput.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="KnowledgeInput.Designer.cs">
+ <Compile Include="Apps\KnowledgeInput.Designer.cs">
<DependentUpon>KnowledgeInput.cs</DependentUpon>
</Compile>
- <Compile Include="Labyrinth.cs">
+ <Compile Include="Apps\Labyrinth.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Labyrinth.Designer.cs">
+ <Compile Include="Apps\Labyrinth.Designer.cs">
<DependentUpon>Labyrinth.cs</DependentUpon>
</Compile>
- <Compile Include="ListViewEx.cs">
- <SubType>UserControl</SubType>
- </Compile>
- <Compile Include="ListViewEx.Designer.cs">
- <DependentUpon>ListViewEx.cs</DependentUpon>
- </Compile>
- <Compile Include="Lua_Interp.cs" />
- <Compile Include="MountMgr.cs" />
- <Compile Include="NameChanger.cs">
+ <Compile Include="Engine\Lua_Interp.cs" />
+ <Compile Include="HostLayer\MountMgr.cs" />
+ <Compile Include="Apps\NameChanger.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="NameChanger.Designer.cs">
+ <Compile Include="Apps\NameChanger.Designer.cs">
<DependentUpon>NameChanger.cs</DependentUpon>
</Compile>
- <Compile Include="NetGen.cs">
+ <Compile Include="Apps\NetGen.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="NetGen.Designer.cs">
+ <Compile Include="Apps\NetGen.Designer.cs">
<DependentUpon>NetGen.cs</DependentUpon>
</Compile>
- <Compile Include="NetModuleStatus.cs">
+ <Compile Include="Controls\NetModuleStatus.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="NetModuleStatus.Designer.cs">
+ <Compile Include="Controls\NetModuleStatus.Designer.cs">
<DependentUpon>NetModuleStatus.cs</DependentUpon>
</Compile>
- <Compile Include="NetworkBrowser.cs">
+ <Compile Include="Apps\NetworkBrowser.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="NetworkBrowser.Designer.cs">
+ <Compile Include="Apps\NetworkBrowser.Designer.cs">
<DependentUpon>NetworkBrowser.cs</DependentUpon>
</Compile>
- <Compile Include="Notification.cs">
+ <Compile Include="Controls\Notification.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="Notification.Designer.cs">
+ <Compile Include="Controls\Notification.Designer.cs">
<DependentUpon>Notification.cs</DependentUpon>
</Compile>
- <Compile Include="OSInfo.cs" />
- <Compile Include="Package_Grabber.cs" />
- <Compile Include="PanelManager.cs">
+ <Compile Include="HostLayer\OSInfo.cs" />
+ <Compile Include="Online\Hacking\Matchmaker.cs" />
+ <Compile Include="Online\Hacking\Objects.cs" />
+ <Compile Include="Online\Package_Grabber.cs" />
+ <Compile Include="Apps\PanelManager.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="PanelManager.Designer.cs">
+ <Compile Include="Apps\PanelManager.Designer.cs">
<DependentUpon>PanelManager.cs</DependentUpon>
</Compile>
- <Compile Include="Pong.cs">
+ <Compile Include="Apps\Pong.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Pong.Designer.cs">
+ <Compile Include="Apps\Pong.Designer.cs">
<DependentUpon>Pong.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
- <Compile Include="ProgressBarEX.cs">
+ <Compile Include="Controls\ProgressBarEX.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="ProgressBarEX.Designer.cs">
+ <Compile Include="Controls\ProgressBarEX.Designer.cs">
<DependentUpon>ProgressBarEX.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -333,96 +326,115 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
- <Compile Include="QuickChat.cs">
+ <Compile Include="Apps\Shifter.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="QuickChat.Designer.cs">
- <DependentUpon>QuickChat.cs</DependentUpon>
+ <Compile Include="Apps\Shifter.Designer.cs">
+ <DependentUpon>Shifter.cs</DependentUpon>
</Compile>
- <Compile Include="RemoteCoherence.cs" />
- <Compile Include="Shifter.cs">
- <SubType>Form</SubType>
+ <Compile Include="Controls\ShifterColorInput.cs">
+ <SubType>UserControl</SubType>
</Compile>
- <Compile Include="Shifter.Designer.cs">
- <DependentUpon>Shifter.cs</DependentUpon>
+ <Compile Include="Controls\ShifterColorInput.Designer.cs">
+ <DependentUpon>ShifterColorInput.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Controls\ShifterGraphicInput.cs">
+ <SubType>UserControl</SubType>
</Compile>
- <Compile Include="Shiftnet.cs">
+ <Compile Include="Controls\ShifterGraphicInput.Designer.cs">
+ <DependentUpon>ShifterGraphicInput.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Controls\ShifterIntInput.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Controls\ShifterIntInput.Designer.cs">
+ <DependentUpon>ShifterIntInput.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Controls\ShifterTextInput.cs">
+ <SubType>UserControl</SubType>
+ </Compile>
+ <Compile Include="Controls\ShifterTextInput.Designer.cs">
+ <DependentUpon>ShifterTextInput.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Apps\Shiftnet.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Shiftnet.Designer.cs">
+ <Compile Include="Apps\Shiftnet.Designer.cs">
<DependentUpon>Shiftnet.cs</DependentUpon>
</Compile>
- <Compile Include="ShiftnetDecryptor.cs">
+ <Compile Include="Apps\ShiftnetDecryptor.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="ShiftnetDecryptor.Designer.cs">
+ <Compile Include="Apps\ShiftnetDecryptor.Designer.cs">
<DependentUpon>ShiftnetDecryptor.cs</DependentUpon>
</Compile>
- <Compile Include="ShiftOSColorTable.cs" />
- <Compile Include="SkinLoader.cs">
+ <Compile Include="SkinEngine\ShiftOSColorTable.cs" />
+ <Compile Include="Apps\SkinLoader.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="SkinLoader.Designer.cs">
+ <Compile Include="Apps\SkinLoader.Designer.cs">
<DependentUpon>SkinLoader.cs</DependentUpon>
</Compile>
- <Compile Include="SpeechListener.cs" />
- <Compile Include="TextPad.cs">
+ <Compile Include="Apps\TextPad.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="TextPad.Designer.cs">
+ <Compile Include="Apps\TextPad.Designer.cs">
<DependentUpon>TextPad.cs</DependentUpon>
</Compile>
- <Compile Include="Viruses.cs" />
- <Compile Include="WidgetManager.cs">
+ <Compile Include="Engine\Viruses.cs" />
+ <Compile Include="Apps\WidgetManager.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="WidgetManager.Designer.cs">
+ <Compile Include="Apps\WidgetManager.Designer.cs">
<DependentUpon>WidgetManager.cs</DependentUpon>
</Compile>
- <Compile Include="WindowBorder.cs">
+ <Compile Include="Controls\WindowBorder.cs">
<SubType>UserControl</SubType>
</Compile>
- <Compile Include="WindowBorder.Designer.cs">
+ <Compile Include="Controls\WindowBorder.Designer.cs">
<DependentUpon>WindowBorder.cs</DependentUpon>
</Compile>
- <Compile Include="WindowComposition.cs" />
- <EmbeddedResource Include="AlternateDesktop.resx">
- <DependentUpon>AlternateDesktop.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Appscape.resx">
+ <Compile Include="SkinEngine\WindowComposition.cs" />
+ <EmbeddedResource Include="Apps\Appscape.resx">
<DependentUpon>Appscape.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="AppscapeUploader.resx">
+ <EmbeddedResource Include="Apps\AppscapeUploader.resx">
<DependentUpon>AppscapeUploader.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Artpad.resx">
+ <EmbeddedResource Include="Apps\Artpad.resx">
<DependentUpon>Artpad.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="BitnoteConverter.resx">
+ <EmbeddedResource Include="Apps\BitnoteConverter.resx">
<DependentUpon>BitnoteConverter.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="BitnoteDigger.resx">
+ <EmbeddedResource Include="Apps\BitnoteDigger.resx">
<DependentUpon>BitnoteDigger.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="BitnoteWallet.resx">
+ <EmbeddedResource Include="Apps\BitnoteWallet.resx">
<DependentUpon>BitnoteWallet.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Color_Picker.resx">
+ <EmbeddedResource Include="Dialogs\Color_Picker.resx">
<DependentUpon>Color_Picker.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Computer.resx">
+ <EmbeddedResource Include="Controls\Computer.resx">
<DependentUpon>Computer.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Connection.resx">
+ <EmbeddedResource Include="Controls\Connection.resx">
<DependentUpon>Connection.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="DesktopIcon.resx">
+ <EmbeddedResource Include="Online\ConnectionManager.resx">
+ <DependentUpon>ConnectionManager.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="CreditScroller.resx">
+ <DependentUpon>CreditScroller.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Controls\DesktopIcon.resx">
<DependentUpon>DesktopIcon.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Dodge.resx">
+ <EmbeddedResource Include="Apps\Dodge.resx">
<DependentUpon>Dodge.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="File Skimmer.resx">
+ <EmbeddedResource Include="Apps\File Skimmer.resx">
<DependentUpon>File Skimmer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FinalMission\ChoiceControl.resx">
@@ -437,67 +449,58 @@
<EmbeddedResource Include="FinalMission\QuestViewer.resx">
<DependentUpon>QuestViewer.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Graphic_Picker.resx">
- <DependentUpon>Graphic_Picker.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Hacking_Enemy.resx">
- <DependentUpon>Hacking_Enemy.cs</DependentUpon>
+ <EmbeddedResource Include="GameSettings.resx">
+ <DependentUpon>GameSettings.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Hacking_YourHealth.resx">
- <DependentUpon>Hacking_YourHealth.cs</DependentUpon>
+ <EmbeddedResource Include="Dialogs\Graphic_Picker.resx">
+ <DependentUpon>Graphic_Picker.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="HackUI.resx">
+ <EmbeddedResource Include="Gameplay\HackUI.resx">
<DependentUpon>HackUI.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="HijackScreen.resx">
+ <EmbeddedResource Include="Gameplay\HijackScreen.resx">
<DependentUpon>HijackScreen.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="HoloChat.resx">
+ <EmbeddedResource Include="Apps\HoloChat.resx">
<DependentUpon>HoloChat.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="IconControl.resx">
+ <EmbeddedResource Include="Controls\IconControl.resx">
<DependentUpon>IconControl.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="IconManager.resx">
+ <EmbeddedResource Include="Apps\IconManager.resx">
<DependentUpon>IconManager.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="ImageSelector.resx">
+ <EmbeddedResource Include="Controls\ImageSelector.resx">
<DependentUpon>ImageSelector.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="infobox.resx">
+ <EmbeddedResource Include="Controls\infobox.resx">
<DependentUpon>infobox.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Jumper.resx">
- <DependentUpon>Jumper.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="KnowledgeInput.resx">
+ <EmbeddedResource Include="Apps\KnowledgeInput.resx">
<DependentUpon>KnowledgeInput.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="ListViewEx.resx">
- <DependentUpon>ListViewEx.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="NameChanger.resx">
+ <EmbeddedResource Include="Apps\NameChanger.resx">
<DependentUpon>NameChanger.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="NetGen.resx">
+ <EmbeddedResource Include="Apps\NetGen.resx">
<DependentUpon>NetGen.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="NetModuleStatus.resx">
+ <EmbeddedResource Include="Controls\NetModuleStatus.resx">
<DependentUpon>NetModuleStatus.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="NetworkBrowser.resx">
+ <EmbeddedResource Include="Apps\NetworkBrowser.resx">
<DependentUpon>NetworkBrowser.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Notification.resx">
+ <EmbeddedResource Include="Controls\Notification.resx">
<DependentUpon>Notification.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="PanelManager.resx">
+ <EmbeddedResource Include="Apps\PanelManager.resx">
<DependentUpon>PanelManager.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Pong.resx">
+ <EmbeddedResource Include="Apps\Pong.resx">
<DependentUpon>Pong.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="ProgressBarEX.resx">
+ <EmbeddedResource Include="Controls\ProgressBarEX.resx">
<DependentUpon>ProgressBarEX.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
@@ -505,40 +508,46 @@
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
- <EmbeddedResource Include="QuickChat.resx">
- <DependentUpon>QuickChat.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Shifter.resx">
+ <EmbeddedResource Include="Apps\Shifter.resx">
<DependentUpon>Shifter.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Shiftnet.resx">
+ <EmbeddedResource Include="Controls\ShifterColorInput.resx">
+ <DependentUpon>ShifterColorInput.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Controls\ShifterGraphicInput.resx">
+ <DependentUpon>ShifterGraphicInput.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Controls\ShifterIntInput.resx">
+ <DependentUpon>ShifterIntInput.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Controls\ShifterTextInput.resx">
+ <DependentUpon>ShifterTextInput.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Apps\Shiftnet.resx">
<DependentUpon>Shiftnet.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="ShiftnetDecryptor.resx">
+ <EmbeddedResource Include="Apps\ShiftnetDecryptor.resx">
<DependentUpon>ShiftnetDecryptor.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Shiftorium.resx">
+ <EmbeddedResource Include="Apps\Shiftorium.resx">
<DependentUpon>Shiftorium.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="ShiftOSDesktop.resx">
+ <EmbeddedResource Include="Desktop\ShiftOSDesktop.resx">
<DependentUpon>ShiftOSDesktop.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="SkinLoader.resx">
+ <EmbeddedResource Include="Apps\SkinLoader.resx">
<DependentUpon>SkinLoader.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="Template.resx">
- <DependentUpon>Template.cs</DependentUpon>
- </EmbeddedResource>
- <EmbeddedResource Include="Terminal.resx">
+ <EmbeddedResource Include="Apps\Terminal.resx">
<DependentUpon>Terminal.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="TextPad.resx">
+ <EmbeddedResource Include="Apps\TextPad.resx">
<DependentUpon>TextPad.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="WidgetManager.resx">
+ <EmbeddedResource Include="Apps\WidgetManager.resx">
<DependentUpon>WidgetManager.cs</DependentUpon>
</EmbeddedResource>
- <EmbeddedResource Include="WindowBorder.resx">
+ <EmbeddedResource Include="Controls\WindowBorder.resx">
<DependentUpon>WindowBorder.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
@@ -559,11 +568,11 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
+ <None Include="Resources\Credits.txt" />
+ <None Include="Resources\MusicData.txt" />
<None Include="bin\Debug\Newtonsoft.Json.dll" />
<None Include="bin\Debug\NetSockets.dll" />
- <Content Include="Labyrinth.designer.vb" />
- <Content Include="Labyrinth.vb" />
- <Compile Include="Paths.cs" />
+ <Compile Include="HostLayer\Paths.cs" />
<None Include="Resources\3beepvirus.wav" />
<None Include="Resources\anycolourshade.png" />
<None Include="Resources\anycolourshade2.png" />
@@ -901,14 +910,14 @@
<None Include="Resources\christmas_skin.jpg" />
<None Include="Resources\jumperplayer.bmp" />
<None Include="Resources\upgradeadvancedshifter.png" />
- <Compile Include="SaveSystem.cs" />
- <Compile Include="Shiftorium.cs">
+ <Compile Include="Engine\SaveSystem.cs" />
+ <Compile Include="Apps\Shiftorium.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Shiftorium.Designer.cs">
+ <Compile Include="Apps\Shiftorium.Designer.cs">
<DependentUpon>Shiftorium.cs</DependentUpon>
</Compile>
- <Compile Include="skins.cs" />
+ <Compile Include="SkinEngine\skins.cs" />
<None Include="Resources\Icon.bmp" />
<None Include="Resources\QuitButton.Image.png" />
<None Include="Resources\BeginButton.Image.png" />
@@ -939,25 +948,38 @@
<None Include="Resources\Hacker_JonathanRivard.txt" />
<None Include="Resources\iconColourPicker.fw.png" />
<None Include="Resources\AustinWalkerCompletionStory.txt" />
- <Compile Include="ShiftOSDesktop.cs">
+ <Compile Include="Desktop\ShiftOSDesktop.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="ShiftOSDesktop.Designer.cs">
+ <Compile Include="Desktop\ShiftOSDesktop.Designer.cs">
<DependentUpon>ShiftOSDesktop.cs</DependentUpon>
</Compile>
- <Compile Include="Template.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="Template.Designer.cs">
- <DependentUpon>Template.cs</DependentUpon>
- </Compile>
- <Compile Include="Terminal.cs">
+ <Compile Include="Apps\Terminal.cs">
<SubType>Form</SubType>
</Compile>
- <Compile Include="Terminal.Designer.cs">
+ <Compile Include="Apps\Terminal.Designer.cs">
<DependentUpon>Terminal.cs</DependentUpon>
</Compile>
- <Compile Include="undo.cs" />
+ <Compile Include="Engine\undo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="AxWMPLib">
+ <Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>aximp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ <COMReference Include="WMPLib">
+ <Guid>{6BF52A50-394A-11D3-B153-00C04F79FAA6}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ </COMReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
diff --git a/source/WindowsFormsApplication1/ShiftOSColorTable.cs b/source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs
index f74b7c2..f74b7c2 100644
--- a/source/WindowsFormsApplication1/ShiftOSColorTable.cs
+++ b/source/WindowsFormsApplication1/SkinEngine/ShiftOSColorTable.cs
diff --git a/source/WindowsFormsApplication1/WindowComposition.cs b/source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs
index 70666ae..18fe2d1 100644
--- a/source/WindowsFormsApplication1/WindowComposition.cs
+++ b/source/WindowsFormsApplication1/SkinEngine/WindowComposition.cs
@@ -182,7 +182,7 @@ namespace ShiftOS
t.Stop();
}
}
- catch (Exception ex)
+ catch
{
formToClose = null;
}
@@ -238,7 +238,6 @@ namespace ShiftOS
};
t.Start();
break;
- break;
case WindowAnimationStyle.ToAppLauncher:
_CanClose = false;
t.Interval = 1;
diff --git a/source/WindowsFormsApplication1/skins.cs b/source/WindowsFormsApplication1/SkinEngine/skins.cs
index 2c93d20..206646f 100644
--- a/source/WindowsFormsApplication1/skins.cs
+++ b/source/WindowsFormsApplication1/SkinEngine/skins.cs
@@ -421,7 +421,7 @@ namespace Skinning
LoadedNames.NameChangerName = "Name Changer";
}
}
- catch(Exception ex)
+ catch
{
LoadedNames = new NamePack();
}
@@ -609,7 +609,7 @@ namespace Skinning
loadedSkin = JsonConvert.DeserializeObject<Skin>(rawData);
//Now, images.
loadimages();
- } catch(Exception ex)
+ } catch
{
API.CreateInfoboxSession("Error loading skin", "An error has occurred while loading the skin file. This could be because the skin file is no longer supported by this version of ShiftOS.", infobox.InfoboxMode.Info);
}
@@ -657,7 +657,7 @@ namespace Skinning
fStream.Close();
}
}
- catch(Exception ex)
+ catch
{
GenDefaultIconPack();
}
diff --git a/source/WindowsFormsApplication1/SpeechListener.cs b/source/WindowsFormsApplication1/SpeechListener.cs
deleted file mode 100644
index b871fd4..0000000
--- a/source/WindowsFormsApplication1/SpeechListener.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Speech.Recognition;
-
-namespace ShiftOS
-{
- public class SpeechListener
- {
- private SpeechRecognitionEngine _recognizer = null;
- public SpeechRecognitionEngine Engine
- {
- get
- {
- return _recognizer;
- }
- }
-
- public SpeechListener()
- {
- _recognizer = new SpeechRecognitionEngine();
- var g = new DictationGrammar();
- _recognizer.LoadGrammar(g);
- _recognizer.SetInputToDefaultAudioDevice();
- _recognizer.SpeechRecognized += (object s, SpeechRecognizedEventArgs a) =>
- {
- try {
- var h = OnRecognize;
- if (h != null)
- {
- h(a.Result.Text, new EventArgs());
- }
- }
- catch
- {
-
- }
- };
- _recognizer.AudioStateChanged += (object s, AudioStateChangedEventArgs a) =>
- {
- if(a.AudioState == AudioState.Stopped)
- {
- _recognizer.RecognizeAsync();
- }
- };
-
- }
-
- public event EventHandler OnRecognize;
- }
-}
diff --git a/source/WindowsFormsApplication1/Template.Designer.cs b/source/WindowsFormsApplication1/Template.Designer.cs
deleted file mode 100644
index 1cb48cf..0000000
--- a/source/WindowsFormsApplication1/Template.Designer.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-using System;
-
-namespace ShiftOS
-{
- partial class Template
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- this.Load += new EventHandler(this.Template_Load);
- this.pgleft = new System.Windows.Forms.Panel();
- this.pgbottomlcorner = new System.Windows.Forms.Panel();
- this.pgright = new System.Windows.Forms.Panel();
- this.pgbottomrcorner = new System.Windows.Forms.Panel();
- this.titlebar = new System.Windows.Forms.Panel();
- this.minimizebutton = new System.Windows.Forms.Panel();
- this.pnlicon = new System.Windows.Forms.PictureBox();
- this.rollupbutton = new System.Windows.Forms.Panel();
- this.closebutton = new System.Windows.Forms.Panel();
- this.lbtitletext = new System.Windows.Forms.Label();
- this.pgtoplcorner = new System.Windows.Forms.Panel();
- this.pgtoprcorner = new System.Windows.Forms.Panel();
- this.pgbottom = new System.Windows.Forms.Panel();
- this.pgcontents = new System.Windows.Forms.Panel();
- this.pullbs = new System.Windows.Forms.Timer(this.components);
- this.pullbottom = new System.Windows.Forms.Timer(this.components);
- this.pullside = new System.Windows.Forms.Timer(this.components);
- this.pgleft.SuspendLayout();
- this.pgright.SuspendLayout();
- this.titlebar.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pnlicon)).BeginInit();
- this.SuspendLayout();
- //
- // pgleft
- //
- this.pgleft.BackColor = System.Drawing.Color.Gray;
- this.pgleft.Controls.Add(this.pgbottomlcorner);
- this.pgleft.Dock = System.Windows.Forms.DockStyle.Left;
- this.pgleft.Location = new System.Drawing.Point(0, 30);
- this.pgleft.Name = "pgleft";
- this.pgleft.Size = new System.Drawing.Size(2, 345);
- this.pgleft.TabIndex = 16;
- //
- // pgbottomlcorner
- //
- this.pgbottomlcorner.BackColor = System.Drawing.Color.Red;
- this.pgbottomlcorner.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pgbottomlcorner.Location = new System.Drawing.Point(0, 343);
- this.pgbottomlcorner.Name = "pgbottomlcorner";
- this.pgbottomlcorner.Size = new System.Drawing.Size(2, 2);
- this.pgbottomlcorner.TabIndex = 14;
- //
- // pgright
- //
- this.pgright.BackColor = System.Drawing.Color.Gray;
- this.pgright.Controls.Add(this.pgbottomrcorner);
- this.pgright.Dock = System.Windows.Forms.DockStyle.Right;
- this.pgright.Location = new System.Drawing.Point(545, 30);
- this.pgright.Name = "pgright";
- this.pgright.Size = new System.Drawing.Size(2, 345);
- this.pgright.TabIndex = 17;
- //
- // pgbottomrcorner
- //
- this.pgbottomrcorner.BackColor = System.Drawing.Color.Red;
- this.pgbottomrcorner.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pgbottomrcorner.Location = new System.Drawing.Point(0, 343);
- this.pgbottomrcorner.Name = "pgbottomrcorner";
- this.pgbottomrcorner.Size = new System.Drawing.Size(2, 2);
- this.pgbottomrcorner.TabIndex = 15;
- //
- // titlebar
- //
- this.titlebar.BackColor = System.Drawing.Color.Gray;
- this.titlebar.Controls.Add(this.minimizebutton);
- this.titlebar.Controls.Add(this.pnlicon);
- this.titlebar.Controls.Add(this.rollupbutton);
- this.titlebar.Controls.Add(this.closebutton);
- this.titlebar.Controls.Add(this.lbtitletext);
- this.titlebar.Controls.Add(this.pgtoplcorner);
- this.titlebar.Controls.Add(this.pgtoprcorner);
- this.titlebar.Dock = System.Windows.Forms.DockStyle.Top;
- this.titlebar.ForeColor = System.Drawing.Color.White;
- this.titlebar.Location = new System.Drawing.Point(0, 0);
- this.titlebar.Name = "titlebar";
- this.titlebar.Size = new System.Drawing.Size(547, 30);
- this.titlebar.TabIndex = 14;
- //
- // minimizebutton
- //
- this.minimizebutton.BackColor = System.Drawing.Color.Black;
- this.minimizebutton.Location = new System.Drawing.Point(246, 5);
- this.minimizebutton.Name = "minimizebutton";
- this.minimizebutton.Size = new System.Drawing.Size(22, 22);
- this.minimizebutton.Click += new EventHandler(this.minimizebutton_Click);
- this.minimizebutton.TabIndex = 24;
- //
- // pnlicon
- //
- this.pnlicon.BackColor = System.Drawing.Color.Transparent;
- this.pnlicon.Location = new System.Drawing.Point(8, 8);
- this.pnlicon.Name = "pnlicon";
- this.pnlicon.Size = new System.Drawing.Size(16, 16);
- this.pnlicon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
- this.pnlicon.TabIndex = 24;
- this.pnlicon.TabStop = false;
- this.pnlicon.Visible = false;
- //
- // rollupbutton
- //
- this.rollupbutton.BackColor = System.Drawing.Color.Black;
- this.rollupbutton.Location = new System.Drawing.Point(274, 3);
- this.rollupbutton.Name = "rollupbutton";
- this.rollupbutton.Click += new EventHandler(this.rollupbutton_Click);
- this.rollupbutton.Size = new System.Drawing.Size(22, 22);
- this.rollupbutton.TabIndex = 22;
- //
- // closebutton
- //
- this.closebutton.BackColor = System.Drawing.Color.Black;
- this.closebutton.Location = new System.Drawing.Point(302, 3);
- this.closebutton.Name = "closebutton";
- this.closebutton.Click += new EventHandler(this.closebutton_Click);
- this.closebutton.Size = new System.Drawing.Size(22, 22);
- this.closebutton.TabIndex = 20;
- //
- // lbtitletext
- //
- this.lbtitletext.AutoSize = true;
- this.lbtitletext.BackColor = System.Drawing.Color.Transparent;
- this.lbtitletext.Font = new System.Drawing.Font("Felix Titling", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbtitletext.Location = new System.Drawing.Point(26, 7);
- this.lbtitletext.Name = "lbtitletext";
- this.lbtitletext.Size = new System.Drawing.Size(89, 18);
- this.lbtitletext.TabIndex = 19;
- this.lbtitletext.Text = "Template";
- //
- // pgtoplcorner
- //
- this.pgtoplcorner.BackColor = System.Drawing.Color.Red;
- this.pgtoplcorner.Dock = System.Windows.Forms.DockStyle.Left;
- this.pgtoplcorner.Location = new System.Drawing.Point(0, 0);
- this.pgtoplcorner.Name = "pgtoplcorner";
- this.pgtoplcorner.Size = new System.Drawing.Size(2, 30);
- this.pgtoplcorner.TabIndex = 17;
- //
- // pgtoprcorner
- //
- this.pgtoprcorner.BackColor = System.Drawing.Color.Red;
- this.pgtoprcorner.Dock = System.Windows.Forms.DockStyle.Right;
- this.pgtoprcorner.Location = new System.Drawing.Point(545, 0);
- this.pgtoprcorner.Name = "pgtoprcorner";
- this.pgtoprcorner.Size = new System.Drawing.Size(2, 30);
- this.pgtoprcorner.TabIndex = 16;
- //
- // pgbottom
- //
- this.pgbottom.BackColor = System.Drawing.Color.Gray;
- this.pgbottom.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pgbottom.Location = new System.Drawing.Point(2, 373);
- this.pgbottom.Name = "pgbottom";
- this.pgbottom.Size = new System.Drawing.Size(543, 2);
- this.pgbottom.TabIndex = 18;
- //
- // pgcontents
- //
- this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
- this.pgcontents.Location = new System.Drawing.Point(2, 30);
- this.pgcontents.Name = "pgcontents";
- this.pgcontents.Size = new System.Drawing.Size(543, 343);
- this.pgcontents.TabIndex = 15;
- //
- // pullbs
- //
- this.pullbs.Interval = 1;
- //
- // pullbottom
- //
- this.pullbottom.Interval = 1;
- //
- // pullside
- //
- this.pullside.Interval = 1;
- //
- // Template
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(547, 375);
- this.Controls.Add(this.pgcontents);
- this.Controls.Add(this.pgbottom);
- this.Controls.Add(this.pgright);
- this.Controls.Add(this.pgleft);
- this.Controls.Add(this.titlebar);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Name = "Template";
- this.Text = "template";
- this.TopMost = true;
- this.pgleft.ResumeLayout(false);
- this.pgright.ResumeLayout(false);
- this.titlebar.ResumeLayout(false);
- this.titlebar.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.pnlicon)).EndInit();
- this.ResumeLayout(false);
-
- }
- internal System.Windows.Forms.Panel pgleft;
- internal System.Windows.Forms.Panel pgbottomlcorner;
- internal System.Windows.Forms.Panel pgright;
- internal System.Windows.Forms.Panel pgbottomrcorner;
- internal System.Windows.Forms.Panel titlebar;
- internal System.Windows.Forms.Panel pgtoplcorner;
- internal System.Windows.Forms.Panel pgtoprcorner;
- internal System.Windows.Forms.Panel pgbottom;
- internal System.Windows.Forms.Panel pgcontents;
- internal System.Windows.Forms.Label lbtitletext;
- internal System.Windows.Forms.Panel closebutton;
- internal System.Windows.Forms.Panel rollupbutton;
- internal System.Windows.Forms.PictureBox pnlicon;
- internal System.Windows.Forms.Panel minimizebutton;
- internal System.Windows.Forms.Timer pullbs;
- internal System.Windows.Forms.Timer pullbottom;
- internal System.Windows.Forms.Timer pullside;
- }
-} \ No newline at end of file
diff --git a/source/WindowsFormsApplication1/Template.cs b/source/WindowsFormsApplication1/Template.cs
deleted file mode 100644
index 5d0ddd1..0000000
--- a/source/WindowsFormsApplication1/Template.cs
+++ /dev/null
@@ -1,589 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-
-namespace ShiftOS
-{
- public partial class Template : Form
- {
- public List<Control> NewControls = new List<Control>();
- public Form ManagedForm = null;
- public Template(string aname, Image aicon, Form frmToTake)
- {
- AppName = aname;
- AppIcon = aicon;
- foreach(Control ctrl in frmToTake.Controls)
- {
- NewControls.Add(ctrl);
- ctrl.Show();
- }
- ManagedForm = frmToTake;
- InitializeComponent();
- }
-
- public Image AppIcon { get; set; }
- public string AppName { get; set; }
-
- #region "Template Code"
- public int rolldownsize;
- public int oldbordersize;
- public int oldtitlebarheight;
- public bool justopened = false;
- public bool needtorollback = false;
- //replace with minimum size
- public int minimumsizewidth = 0;
- //replace with minimum size
- public int minimumsizeheight = 0;
-
- // ERROR: Handles clauses are not supported in C#
- private void Template_Load(object sender, EventArgs e)
- {
- justopened = true;
- this.Left = (Screen.PrimaryScreen.Bounds.Width - this.Width) / 2;
- this.Top = (Screen.PrimaryScreen.Bounds.Height - this.Height) / 2;
- setupall();
- foreach(Control ctrl in NewControls)
- {
- this.pgcontents.Controls.Add(ctrl);
- }
-
- //CHANGE NAME
- //modify to proper name
- }
-
- public void setupall()
- {
- setuptitlebar();
- setupborders();
- setskin();
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void ShiftOSDesktop_keydown(object sender, System.Windows.Forms.KeyEventArgs e)
- {
- //Make terminal appear
- if (e.KeyCode == Keys.T && e.Control)
- {
- API.CreateForm(new Terminal(), API.CurrentSave.TerminalName, Properties.Resources.iconTerminal);
- }
-
- //Movable Windows
- if (API.Upgrades["movablewindows"] == true)
- {
- if (e.KeyCode == Keys.A && e.Control)
- {
- e.Handled = true;
- this.Location = new Point(this.Location.X - 30, this.Location.Y);
- }
- if (e.KeyCode == Keys.D && e.Control)
- {
- e.Handled = true;
- this.Location = new Point(this.Location.X + 30, this.Location.Y);
- }
- if (e.KeyCode == Keys.W && e.Control)
- {
- e.Handled = true;
- this.Location = new Point(this.Location.X, this.Location.Y - 30);
- }
- if (e.KeyCode == Keys.S && e.Control)
- {
- e.Handled = true;
- this.Location = new Point(this.Location.X, this.Location.Y + 30);
- }
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void titlebar_MouseDown(object sender, MouseEventArgs e)
- {
- // Handle Draggable Windows
- if (API.Upgrades["draggablewindows"] == true)
- {
- if (e.Button == MouseButtons.Left)
- {
- titlebar.Capture = false;
- lbtitletext.Capture = false;
- pnlicon.Capture = false;
- pgtoplcorner.Capture = false;
- pgtoprcorner.Capture = false;
- const int WM_NCLBUTTONDOWN = 0xa1;
- const int HTCAPTION = 2;
- Message msg = Message.Create(this.Handle, WM_NCLBUTTONDOWN, new IntPtr(HTCAPTION), IntPtr.Zero);
- this.DefWndProc(ref msg);
- }
- //ShiftOSDesktop.log = //ShiftOSDesktop.log + My.Computer.Clock.LocalTime + " User dragged " + this.Name + " to " + this.Location.ToString + Environment.NewLine;
- }
- }
-
- public void setupborders()
- {
- if (API.Upgrades["windowborders"] == false)
- {
- pgleft.Hide();
- pgbottom.Hide();
- pgright.Hide();
- this.Size = new Size(this.Width - pgleft.Width - pgright.Width, this.Height - pgbottom.Height);
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void closebutton_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void closebutton_MouseEnter(object sender, EventArgs e)
- {
- closebutton.BackgroundImage = API.CurrentSkinImages.closebtnhover;
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void closebutton_MouseLeave(object sender, EventArgs e)
- {
- closebutton.BackgroundImage = API.CurrentSkinImages.closebtn;
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void closebutton_MouseDown(object sender, EventArgs e)
- {
- closebutton.BackgroundImage = API.CurrentSkinImages.closebtnclick;
- }
-
- public Point OldLoc = new Point(0, 0);
- public bool Minimized = false;
-
- // ERROR: Handles clauses are not supported in C#
- private void minimizebutton_Click(object sender, EventArgs e)
- {
- OldLoc = this.Location;
- Minimized = true;
- this.Location = new Point(99999, 99999);
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void rollupbutton_Click(object sender, EventArgs e)
- {
- rollupanddown();
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void rollupbutton_MouseEnter(object sender, EventArgs e)
- {
- rollupbutton.BackgroundImage = API.CurrentSkinImages.rollbtnhover;
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void rollupbutton_MouseLeave(object sender, EventArgs e)
- {
- rollupbutton.BackgroundImage = API.CurrentSkinImages.rollbtn;
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void rollupbutton_MouseDown(object sender, EventArgs e)
- {
- rollupbutton.BackgroundImage = API.CurrentSkinImages.rollbtnclick;
- }
-
-
- public void setuptitlebar()
- {
- setupborders();
-
- if (this.Height == this.titlebar.Height) { pgleft.Show(); pgbottom.Show(); pgright.Show(); this.Height = rolldownsize; needtorollback = true; }
- pgleft.Width = API.CurrentSkin.borderwidth;
- pgright.Width = API.CurrentSkin.borderwidth;
- pgbottom.Height = API.CurrentSkin.borderwidth;
- titlebar.Height = API.CurrentSkin.titlebarheight;
-
- if (justopened == true)
- {
- this.Size = new Size(420, 510);
- //put the default size of your window here
- this.Size = new Size(this.Width, this.Height + API.CurrentSkin.titlebarheight - 30);
- this.Size = new Size(this.Width + API.CurrentSkin.borderwidth + API.CurrentSkin.borderwidth, this.Height + API.CurrentSkin.borderwidth);
- oldbordersize = API.CurrentSkin.borderwidth;
- oldtitlebarheight = API.CurrentSkin.titlebarheight;
- justopened = false;
- }
- else {
- if (this.Visible == true)
- {
- this.Size = new Size(this.Width - (2 * oldbordersize) + (2 * API.CurrentSkin.borderwidth), (this.Height - oldtitlebarheight - oldbordersize) + API.CurrentSkin.titlebarheight + API.CurrentSkin.borderwidth);
- oldbordersize = API.CurrentSkin.borderwidth;
- oldtitlebarheight = API.CurrentSkin.titlebarheight;
- rolldownsize = this.Height;
- if (needtorollback == true) { this.Height = titlebar.Height; pgleft.Hide(); pgbottom.Hide(); pgright.Hide(); }
- }
- }
-
- if (API.CurrentSkin.enablecorners == true)
- {
- pgtoplcorner.Show();
- pgtoprcorner.Show();
- pgtoprcorner.Width = API.CurrentSkin.titlebarcornerwidth;
- pgtoplcorner.Width = API.CurrentSkin.titlebarcornerwidth;
- }
- else {
- pgtoplcorner.Hide();
- pgtoprcorner.Hide();
- }
-
- if (API.Upgrades["titlebar"] == false)
- {
- titlebar.Hide();
- this.Size = new Size(this.Width, this.Size.Height - titlebar.Height);
- }
-
- if (API.Upgrades["titletext"] == false)
- {
- lbtitletext.Hide();
- }
- else {
- lbtitletext.Font = new Font(API.CurrentSkin.titletextfontfamily, API.CurrentSkin.titletextfontsize, API.CurrentSkin.titletextfontstyle, GraphicsUnit.Point);
- lbtitletext.Text = this.AppName;
- //Remember to change to name of program!!!!
- lbtitletext.Show();
- }
-
- if (API.Upgrades["closebutton"] == false)
- {
- closebutton.Hide();
- }
- else {
- closebutton.BackColor = API.CurrentSkin.closebtncolour;
- closebutton.Size = API.CurrentSkin.closebtnsize;
- closebutton.Show();
- }
-
- if (API.Upgrades["rollupbutton"] == false)
- {
- rollupbutton.Hide();
- }
- else {
- rollupbutton.BackColor = API.CurrentSkin.rollbtncolour;
- rollupbutton.Size = API.CurrentSkin.rollbtnsize;
- rollupbutton.Show();
- }
-
- if (API.Upgrades["minimizebutton"] == false)
- {
- minimizebutton.Hide();
- }
- else {
- minimizebutton.BackColor = API.CurrentSkin.minbtncolour;
- minimizebutton.Size = API.CurrentSkin.minbtnsize;
- minimizebutton.Show();
- }
-
- if (API.Upgrades["windowborders"] == true)
- {
- closebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.closebtnfromside - closebutton.Size.Width, API.CurrentSkin.closebtnfromtop);
- rollupbutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.rollbtnfromside - rollupbutton.Size.Width, API.CurrentSkin.rollbtnfromtop);
- minimizebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.minbtnfromside - minimizebutton.Size.Width, API.CurrentSkin.minbtnfromtop);
- switch (API.CurrentSkin.titletextpos)
- {
- case "Left":
- lbtitletext.Location = new Point(API.CurrentSkin.titletextfromside, API.CurrentSkin.titletextfromtop);
- break;
- case "Centre":
- lbtitletext.Location = new Point((titlebar.Width / 2) - lbtitletext.Width / 2, API.CurrentSkin.titletextfromtop);
- break;
- }
- lbtitletext.ForeColor = API.CurrentSkin.titletextcolour;
- }
- else {
- closebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, API.CurrentSkin.closebtnfromtop);
- rollupbutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, API.CurrentSkin.rollbtnfromtop);
- minimizebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, API.CurrentSkin.minbtnfromtop);
- switch (API.CurrentSkin.titletextpos)
- {
- case "Left":
- lbtitletext.Location = new Point(API.CurrentSkin.titletextfromside + pgtoplcorner.Width, API.CurrentSkin.titletextfromtop);
- break;
- case "Centre":
- lbtitletext.Location = new Point((titlebar.Width / 2) - lbtitletext.Width / 2, API.CurrentSkin.titletextfromtop);
- break;
- }
- lbtitletext.ForeColor = API.CurrentSkin.titletextcolour;
- }
-
- //Change when Icon skinning complete
- // Change to program's icon
- if (API.Upgrades["appicons"] == true)
- {
- pnlicon.Visible = true;
- pnlicon.Location = new Point(API.CurrentSkin.titleiconfromside, API.CurrentSkin.titleiconfromtop);
- pnlicon.Size = new Size(API.CurrentSkin.titlebariconsize, API.CurrentSkin.titlebariconsize);
- pnlicon.Image = this.AppIcon;
- //Replace with the correct icon for the program.
- }
-
- }
-
- public void rollupanddown()
- {
- if (this.Height == this.titlebar.Height)
- {
- pgleft.Show();
- pgbottom.Show();
- pgright.Show();
- this.Height = rolldownsize;
- this.MinimumSize = new Size(minimumsizewidth, minimumsizeheight);
- }
- else {
- this.MinimumSize = new Size(0, 0);
- pgleft.Hide();
- pgbottom.Hide();
- pgright.Hide();
- rolldownsize = this.Height;
- this.Height = this.titlebar.Height;
- }
- }
-
- public void resettitlebar()
- {
- if (API.Upgrades["windowborders"] == true)
- {
- closebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.closebtnfromside - closebutton.Size.Width, API.CurrentSkin.closebtnfromtop);
- rollupbutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.rollbtnfromside - rollupbutton.Size.Width, API.CurrentSkin.rollbtnfromtop);
- minimizebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.minbtnfromside - minimizebutton.Size.Width, API.CurrentSkin.minbtnfromtop);
- switch (API.CurrentSkin.titletextpos)
- {
- case "Left":
- lbtitletext.Location = new Point(API.CurrentSkin.titletextfromside, API.CurrentSkin.titletextfromtop);
- break;
- case "Centre":
- lbtitletext.Location = new Point((titlebar.Width / 2) - lbtitletext.Width / 2, API.CurrentSkin.titletextfromtop);
- break;
- }
- lbtitletext.ForeColor = API.CurrentSkin.titletextcolour;
- }
- else {
- closebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.closebtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - closebutton.Size.Width, API.CurrentSkin.closebtnfromtop);
- rollupbutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.rollbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - rollupbutton.Size.Width, API.CurrentSkin.rollbtnfromtop);
- minimizebutton.Location = new Point(titlebar.Size.Width - API.CurrentSkin.minbtnfromside - pgtoplcorner.Width - pgtoprcorner.Width - minimizebutton.Size.Width, API.CurrentSkin.minbtnfromtop);
- switch (API.CurrentSkin.titletextpos)
- {
- case "Left":
- lbtitletext.Location = new Point(API.CurrentSkin.titletextfromside + pgtoplcorner.Width, API.CurrentSkin.titletextfromtop);
- break;
- case "Centre":
- lbtitletext.Location = new Point((titlebar.Width / 2) - lbtitletext.Width / 2, API.CurrentSkin.titletextfromtop);
- break;
- }
- lbtitletext.ForeColor = API.CurrentSkin.titletextcolour;
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void pullside_Tick(System.Object sender, System.EventArgs e)
- {
- this.Width = Cursor.Position.X - this.Location.X;
- resettitlebar();
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void pullbottom_Tick(System.Object sender, System.EventArgs e)
- {
- this.Height = Cursor.Position.Y - this.Location.Y;
- resettitlebar();
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void pullbs_Tick(object sender, System.EventArgs e)
- {
- this.Width = Cursor.Position.X - this.Location.X;
- this.Height = Cursor.Position.Y - this.Location.Y;
- resettitlebar();
- }
-
- //delete this for non-resizable windows
- // ERROR: Handles clauses are not supported in C#
- private void Rightpull_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- pullside.Start();
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void RightCursorOn_MouseDown(object sender, System.EventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- Cursor = Cursors.SizeWE;
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void bottomCursorOn_MouseDown(object sender, System.EventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- Cursor = Cursors.SizeNS;
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void CornerCursorOn_MouseDown(object sender, System.EventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- Cursor = Cursors.SizeNWSE;
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void SizeCursoroff_MouseDown(object sender, System.EventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- Cursor = Cursors.Default;
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void rightpull_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- pullside.Stop();
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void bottompull_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- pullbottom.Start();
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void buttompull_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- pullbottom.Stop();
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void bspull_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- pullbs.Start();
- }
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void bspull_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
- {
- if (API.Upgrades["resizablewindows"] == true)
- {
- pullbs.Stop();
- }
- }
-
- public void setskin()
- {
- //disposals
- closebutton.BackgroundImage = null;
- titlebar.BackgroundImage = null;
- rollupbutton.BackgroundImage = null;
- pgtoplcorner.BackgroundImage = null;
- pgtoprcorner.BackgroundImage = null;
- minimizebutton.BackgroundImage = null;
- //apply new skin
- if (API.CurrentSkinImages.closebtn == null)
- closebutton.BackColor = API.CurrentSkin.closebtncolour;
- else
- closebutton.BackgroundImage = API.CurrentSkinImages.closebtn;
- closebutton.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.closebtnlayout;
- if (API.CurrentSkinImages.titlebar == null)
- titlebar.BackColor = API.CurrentSkin.titlebarcolour;
- else
- titlebar.BackgroundImage = API.CurrentSkinImages.titlebar;
- titlebar.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.titlebarlayout;
- if (API.CurrentSkinImages.rollbtn == null)
- rollupbutton.BackColor = API.CurrentSkin.rollbtncolour;
- else
- rollupbutton.BackgroundImage = API.CurrentSkinImages.rollbtn;
- rollupbutton.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.rollbtnlayout;
- if (API.CurrentSkinImages.leftcorner == null)
- pgtoplcorner.BackColor = API.CurrentSkin.leftcornercolour;
- else
- pgtoplcorner.BackgroundImage = API.CurrentSkinImages.leftcorner;
- pgtoplcorner.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.leftcornerlayout;
- if (API.CurrentSkinImages.rightcorner == null)
- pgtoprcorner.BackColor = API.CurrentSkin.rightcornercolour;
- else
- pgtoprcorner.BackgroundImage = API.CurrentSkinImages.rightcorner;
- pgtoprcorner.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.rightcornerlayout;
- if (API.CurrentSkinImages.minbtn == null)
- minimizebutton.BackColor = API.CurrentSkin.minbtncolour;
- else
- minimizebutton.BackgroundImage = API.CurrentSkinImages.minbtn;
- minimizebutton.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.minbtnlayout;
- if (API.CurrentSkinImages.borderleft == null)
- pgleft.BackColor = API.CurrentSkin.borderleftcolour;
- else
- pgleft.BackgroundImage = API.CurrentSkinImages.borderleft;
- pgleft.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.borderleftlayout;
- if (API.CurrentSkinImages.borderright == null)
- pgright.BackColor = API.CurrentSkin.borderrightcolour;
- else
- pgright.BackgroundImage = API.CurrentSkinImages.borderright;
- pgleft.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.borderrightlayout;
- if (API.CurrentSkinImages.borderbottom == null)
- pgbottom.BackColor = API.CurrentSkin.borderbottomcolour;
- else
- pgbottom.BackgroundImage = API.CurrentSkinImages.borderbottom;
- pgbottom.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.borderbottomlayout;
- if (API.CurrentSkin.enablebordercorners == true)
- {
- if (API.CurrentSkinImages.bottomleftcorner == null)
- pgbottomlcorner.BackColor = API.CurrentSkin.bottomleftcornercolour;
- else
- pgbottomlcorner.BackgroundImage = API.CurrentSkinImages.bottomleftcorner;
- pgbottomlcorner.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.bottomleftcornerlayout;
- if (API.CurrentSkinImages.bottomrightcorner == null)
- pgbottomrcorner.BackColor = API.CurrentSkin.bottomrightcornercolour;
- else
- pgbottomrcorner.BackgroundImage = API.CurrentSkinImages.bottomrightcorner;
- pgbottomrcorner.BackgroundImageLayout = (ImageLayout)API.CurrentSkin.bottomrightcornerlayout;
- }
- else {
- pgbottomlcorner.BackColor = API.CurrentSkin.borderrightcolour;
- pgbottomrcorner.BackColor = API.CurrentSkin.borderrightcolour;
- pgbottomlcorner.BackgroundImage = null;
- pgbottomrcorner.BackgroundImage = null;
- }
-
- //set bottom border corner size
- pgbottomlcorner.Size = new Size(API.CurrentSkin.borderwidth, API.CurrentSkin.borderwidth);
- pgbottomrcorner.Size = new Size(API.CurrentSkin.borderwidth, API.CurrentSkin.borderwidth);
- pgbottomlcorner.Location = new Point(0, this.Height - API.CurrentSkin.borderwidth);
- pgbottomrcorner.Location = new Point(this.Width, this.Height - API.CurrentSkin.borderwidth);
-
- this.TransparencyKey = Skinning.Utilities.globaltransparencycolour;
- }
-
- // ERROR: Handles clauses are not supported in C#
- private void Clock_FormClosing(object sender, FormClosingEventArgs e)
- {
- this.Close();
- }
- }
- #endregion
-}