aboutsummaryrefslogtreecommitdiff
path: root/source/WindowsFormsApplication1/ShiftOSDesktop.cs
diff options
context:
space:
mode:
authorMichaelTheShifter <[email protected]>2016-05-26 19:11:01 -0400
committerMichaelTheShifter <[email protected]>2016-05-26 19:11:01 -0400
commitef09525b70c0e5000deee3ae8a101d387bf989a3 (patch)
tree254cb38ab6fcb914b6a10e6d268535d104e1530e /source/WindowsFormsApplication1/ShiftOSDesktop.cs
parentc43d82eebd5e71ff5860fb2797bc4ebaa90e541e (diff)
downloadshiftos-c-_theultimatehacker-ef09525b70c0e5000deee3ae8a101d387bf989a3.tar.gz
shiftos-c-_theultimatehacker-ef09525b70c0e5000deee3ae8a101d387bf989a3.tar.bz2
shiftos-c-_theultimatehacker-ef09525b70c0e5000deee3ae8a101d387bf989a3.zip
0.1.1 was released - time to update the repo.
Diffstat (limited to 'source/WindowsFormsApplication1/ShiftOSDesktop.cs')
-rw-r--r--source/WindowsFormsApplication1/ShiftOSDesktop.cs76
1 files changed, 54 insertions, 22 deletions
diff --git a/source/WindowsFormsApplication1/ShiftOSDesktop.cs b/source/WindowsFormsApplication1/ShiftOSDesktop.cs
index 365494d..bc0b9ed 100644
--- a/source/WindowsFormsApplication1/ShiftOSDesktop.cs
+++ b/source/WindowsFormsApplication1/ShiftOSDesktop.cs
@@ -58,7 +58,7 @@ namespace ShiftOS
API.LimitedMode = false;
SetupDesktop();
API.CloseEverything();
- switch(FinalMission.EndGameHandler.CurrentChoice)
+ switch (FinalMission.EndGameHandler.CurrentChoice)
{
case Choice.SideWithDevX:
var t = new System.Windows.Forms.Timer();
@@ -96,9 +96,9 @@ namespace ShiftOS
}
else if (ea.KeyCode == Keys.D && ea.Control)
{
- if(API.DeveloperMode == true)
+ if (API.DeveloperMode == true)
{
- if(ShowDebug == true)
+ if (ShowDebug == true)
{
ShowDebug = false;
}
@@ -118,13 +118,13 @@ namespace ShiftOS
clocktick.Interval = 2;
clocktick.Tick += (object s, EventArgs a) =>
{
- if(API.Upgrades["hacking"])
+ if (API.Upgrades["hacking"])
{
if (API.Upgrades["hackerbattles"] == false)
{
var rnd = new Random();
int c = rnd.Next(1, 1000);
- if(c == 500)
+ if (c == 500)
{
var t = new Terminal();
API.CreateForm(t, API.LoadedNames.TerminalName, Properties.Resources.iconTerminal);
@@ -148,7 +148,7 @@ namespace ShiftOS
lblog.Location = new Point(this.Width - lblog.Width - 5, 4);
break;
}
- if(File.Exists(Paths.SystemDir + "_Log.txt"))
+ if (File.Exists(Paths.SystemDir + "_Log.txt"))
{
lblog.Text = File.ReadAllText(Paths.SystemDir + "_Log.txt");
}
@@ -169,7 +169,7 @@ namespace ShiftOS
lbldebug.Hide();
lblog.Hide();
}
- if(Viruses.InfectedWith("seized"))
+ if (Viruses.InfectedWith("seized"))
{
Random rnd = new Random();
int r = rnd.Next(0, 255);
@@ -196,7 +196,7 @@ namespace ShiftOS
};
clocktick.Start();
- if(API.Upgrades["trmfiles"] == true)
+ if (API.Upgrades["trmfiles"] == true)
{
if (File.Exists(Paths.SystemDir + "AutoStart.trm"))
{
@@ -256,34 +256,36 @@ namespace ShiftOS
Clock.ContextMenuStrip = null;
PanelButtonHolder.ContextMenuStrip = null;
}
- foreach(var dp in DesktopPanels)
- {
- if(API.Upgrades["advanceddesktop"])
- {
- dp.ContextMenuStrip = cbdpanel;
- }
- else
+ if (DesktopPanels != null) {
+ foreach (var dp in DesktopPanels)
{
- dp.ContextMenuStrip = cbdpanel;
+ if (API.Upgrades["advanceddesktop"])
+ {
+ dp.ContextMenuStrip = cbdpanel;
+ }
+ else
+ {
+ dp.ContextMenuStrip = cbdpanel;
+ }
}
}
}
public void SetupWidgets()
{
- foreach(var w in API.CurrentSkin.Widgets)
+ foreach (var w in API.CurrentSkin.Widgets)
{
- foreach(var dp in DesktopPanels)
+ foreach (var dp in DesktopPanels)
{
var t = (Skinning.DesktopPanel)dp.Tag;
- if(t.Position == w.Panel)
+ if (t.Position == w.Panel)
{
SetupWidget(dp, w);
}
}
}
}
-
+
public void SetupWidget(Panel p, Skinning.DesktopWidget w)
{
if(WidgetsToMaintain != null)
@@ -623,6 +625,11 @@ namespace ShiftOS
public void SetupAppLauncher()
{
+ NewToolStripMenuItem.Visible = API.Upgrades["fsnewfolder"];
+ ArtpadPictureToolStripMenuItem.Visible = /*API.Upgrades["artpadsave"]*/false; // not yet implemented
+ TextDocumentToolStripMenuItem.Visible = API.Upgrades["textpadsave"];
+ NewSkin.Visible = API.Upgrades["skinning"];
+ scriptToolStripMenuItem.Visible = /*API.Upgrades["shiftnet"]*/false; //not yet implemented
API.GetAppLauncherItems();
if (API.Upgrades["applaunchermenu"] == true)
{
@@ -1105,9 +1112,13 @@ namespace ShiftOS
API.InfoboxSession.FormClosing += (object s, FormClosingEventArgs a) =>
{
var res = API.GetInfoboxResult();
- if(!File.Exists(Paths.Desktop + res))
+ if (res != "Cancelled")
{
- Skinning.Utilities.saveskintofile(Paths.Desktop + res);
+ if (!File.Exists(Paths.Desktop + res + ".skn"))
+ {
+ Skinning.Utilities.saveskintofile(Paths.Desktop + res + ".skn");
+ SetupDesktopIcons();
+ }
}
};
}
@@ -1187,6 +1198,27 @@ namespace ShiftOS
var dp = (Skinning.DesktopPanel)SelectedObject.Tag;
API.CreateForm(new PanelManager(dp), "Panel Options", API.GetIcon("PanelOptions"));
}
+
+ private void TextDocumentToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ API.CreateInfoboxSession("New Text Document", "Please type a name for your document.", infobox.InfoboxMode.TextEntry);
+ API.InfoboxSession.FormClosing += (o, a) =>
+ {
+ var res = API.GetInfoboxResult();
+ if(res != "Cancelled")
+ {
+ if(!File.Exists(Paths.Desktop + res + ".txt"))
+ {
+ File.WriteAllText(Paths.Desktop + res + ".txt", "");
+ SetupDesktopIcons();
+ }
+ else
+ {
+ API.CreateInfoboxSession("File exists!", "The file name you entered already exists.", infobox.InfoboxMode.Info);
+ }
+ }
+ };
+ }
}
public class DesktopIconManager