Loads of changes...

Custom shifter options using Lua, and other stuff.
This commit is contained in:
MichaelTheShifter 2016-06-24 16:44:42 -04:00
parent 8ea0903788
commit ecee91bc55
65 changed files with 4381 additions and 669 deletions

View file

@ -16,6 +16,16 @@
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 +81,12 @@ public class ModApplauncherItem
public class API
{
/// <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 +99,7 @@ public class API
/// 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 +115,22 @@ public class API
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;
@ -830,16 +862,17 @@ public static void RemoveCodepoints(int cp)
/// </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 +1045,14 @@ public static void CreateForm(Form formToCreate, string AppName, Image AppIcon)
{
formToCreate.Controls.Remove(ctrl);
ctrl.Show();
SkinControl(ctrl);
}
catch (Exception ex)
catch
{
API.CurrentSession.Invoke(new Action(() =>
{
ctrl.Show();
SkinControl(ctrl);
}));
}
}
@ -1197,7 +1232,8 @@ public static string GetTime()
/// <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 +1272,8 @@ public static bool CloseProgram(string command)
PanelButtons.Remove(pbtn);
}
return closed;
} catch(Exception ex)
}
catch
{
return false;
}
@ -1608,7 +1645,7 @@ public static string Guess(string guess)
return "success";
}
}
catch (Exception ex)
catch
{
API.LogException("User didn't guess a valid knowledge input guess.", false);
return "not_valid";
@ -1672,6 +1709,17 @@ public static bool OpenProgram(string cmd)
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 +1957,7 @@ public static Color GetLastColorFromSession()
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
}

View file

@ -116,7 +116,7 @@ public void SidebarButton_Click(object sender, EventArgs e)
PanelButton pbtn = (PanelButton)s.Tag;
API.ToggleMinimized(pbtn.FormToManage);
}
catch (Exception ex)
catch
{
}

View file

@ -236,7 +236,7 @@ private void lvpackages_SelectedIndexChanged(object sender, EventArgs e)
pbappscreenshot.Show();
pbappscreenshot.Load(pkg.ScreenshotPath);
}
catch(Exception ex)
catch
{
pbappscreenshot.Hide();
}
@ -266,7 +266,7 @@ private void lvpackages_SelectedIndexChanged(object sender, EventArgs e)
pbappicon.Show();
pbappicon.Load("http://playshiftos.ml/appscape/packages/" + pkg.PkgIconPath);
}
catch(Exception ex)
catch
{
pbappicon.Hide();
}
@ -490,8 +490,6 @@ public KeyValuePair<AppscapeModder, AppscapeClient> GetModderByDevID(string DevI
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 @@ private void btndonecustomizing_Click(object sender, EventArgs e)
{
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 @@ public AppscapeClient(string ip_address)
};
_IP = ip_address;
}
catch(Exception ex)
catch
{
throw new ArgumentException("IP address not found in client list.");
}

View file

@ -31,8 +31,6 @@ public AppscapeUploader(AppscapeModder modder, AppscapeClient repo)
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 @@ private void btndone_Click(object sender, EventArgs e)
{
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 @@ private void btndone_Click(object sender, EventArgs e)
result = "finished";
this.Close();
}
}
@ -136,7 +133,7 @@ private void RecursiveControlSetup(Control ctrl)
RecursiveControlSetup(c);
}
}
catch(Exception ex) {
catch {
}
}
@ -325,7 +322,7 @@ private void btncompilesaa_Click(object sender, EventArgs e)
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);
}

View file

@ -229,7 +229,7 @@ private void btnpixelsettersetpixel_Click(object sender, EventArgs e)
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 @@ private void picdrawingdisplay_Paint(object sender, System.Windows.Forms.PaintEv
e.Graphics.DrawImage(canvasbitmap, 0, 0);
e.Graphics.DrawImage(previewcanvasbitmap, 0, 0);
}
catch (System.OutOfMemoryException ex)
catch
{
}
@ -1075,7 +1075,7 @@ private void txtnewcanvaswidth_TextChanged(object sender, EventArgs e)
}
}
}
catch(Exception ex)
catch
{
}
@ -1295,7 +1295,7 @@ private void btnundo_Click(object sender, EventArgs e)
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 @@ private void btnredo_Click(object sender, EventArgs e)
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);

View file

@ -1,7 +1,4 @@
// WARNING: This thing likes leaking memory.
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -10,241 +7,202 @@
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 List<AudioResourceClient> Clients = null;
internal static bool Enabled = false;
public static void DisposeAll()
public static string Name
{
if(Clients != null)
get
{
foreach(var client in Clients)
string res = null;
try
{
client.Dispose();
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 AudioResourceClient
public class Visualizer
{
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;
}
}
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
}
}

View file

@ -37,7 +37,7 @@ private void txtcodepoints_TextChanged(object sender, EventArgs e)
lbstatus.Text = "> " + decstr + " BTN";
BitnotesToAdd = Convert.ToDecimal(decstr);
}
catch(Exception ex)
catch
{
BitnotesToAdd = 0;
}

View file

@ -76,7 +76,7 @@ private void btnsync_Click(object sender, EventArgs e)
};
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 @@ public BitnoteClient(string IP)
};
_IP = IP;
}
catch (Exception ex)
catch
{
throw new ArgumentException("IP address not found in client list.");
}

View file

@ -13,6 +13,10 @@ partial class Computer
/// <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();

View file

@ -45,8 +45,7 @@ public int HP
}
}
private SystemType _Type = SystemType.Core;
public SystemType Type
{
get; set;
@ -112,8 +111,6 @@ public AttackType GetProperType()
return AttackType.Core;
case SystemType.Turret:
return AttackType.Virus;
case SystemType.FTPServer:
return AttackType.Backdoor;
default:
return AttackType.None;
}
@ -284,30 +281,31 @@ public int GetTotal()
{
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 +339,7 @@ private void Computer_Load(object sender, EventArgs e)
(this.Parent.Height - this.Height) / 2
);
}
catch (Exception ex)
catch
{
}
@ -360,6 +358,26 @@ private void Computer_Load(object sender, EventArgs e)
}
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 +437,11 @@ private void Computer_Load(object sender, EventArgs e)
}
};
t.Start();
HealthTimer = t;
}
public event EventHandler StolenModule;
public event EventHandler OnDestruction;
public void ThrowDestroyed()
@ -446,16 +467,16 @@ private void lbstats_Click(object sender, EventArgs e)
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 {

View file

@ -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;
}
}

View file

@ -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);
}
};
}
}
}

View file

@ -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>

View file

@ -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;
}
}

View file

@ -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";
}
}
}

View file

@ -0,0 +1,132 @@
<?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>
<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="pongGameTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<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>

View file

@ -177,10 +177,11 @@ private void File_Skimmer_Load(object sender, EventArgs e)
{
if (lbcurrentfolder.Text != "/")
{
if (lbcurrentfolder.Text == MountPoint.Replace("\\", "/"))
if (MountPoint != null && lbcurrentfolder.Text == MountPoint.Replace("\\", "/"))
{
CurrentFolder = Paths.SaveRoot;
ListFiles();
}
else
{
@ -402,24 +403,18 @@ public string GetFileType(string extension)
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 @@ private void newFolderToolStripMenuItem_Click(object sender, EventArgs e)
Directory.CreateDirectory(fullname);
}
}
catch (Exception ex)
catch
{
API.CreateInfoboxSession("Error", "File Skimmer could not create the directory.", infobox.InfoboxMode.Info);
}
@ -598,7 +593,7 @@ private void lvfiles_SelectedIndexChanged(object sender, EventArgs e)
txtfilename.Text = itm.Text;
}
}
catch(Exception ex)
catch
{
}

View file

@ -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 @@ private void btnbegin_Click(object sender, EventArgs e)
private void onClose(object sender, FormClosingEventArgs e)
{
audioClient.Stop();
audioClient.Dispose();
audioClient = null;
Audio.ForceStop();
}
bool musicEnabled = true;
@ -139,11 +134,11 @@ private void button1_Click(object sender, EventArgs e)
{
if (musicEnabled)
{
audioClient.Stop();
Audio.ForceStop();
}
else
{
audioClient.Play("Rapture");
Audio.Play("hackerbattle_ambient");
}
musicEnabled = !musicEnabled;
}

View file

@ -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;
}
}

View file

@ -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();
}
}
}
}

View file

@ -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>

View file

@ -68,11 +68,23 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
//
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
//
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 @@ private void InitializeComponent()
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 void InitializeComponent()
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;
}
}

View file

@ -5,6 +5,7 @@
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
@ -15,6 +16,7 @@ public partial class HackUI : Form
public HackUI()
{
InitializeComponent();
this.TopMost = false;
ThisEnemyHacker = new EnemyHacker("Test Dummy", "A test hacker", "A test hacker", 1, 1, "easy");
}
@ -104,11 +106,16 @@ private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
{
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 +157,7 @@ private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
}
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 +169,35 @@ private void tmrplayerhealthdetect_Tick(object sender, EventArgs e)
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();
pc?.Dispose();
}
Computer[] epcs = new Computer[AllEnemyComputers.Count];
AllEnemyComputers.CopyTo(epcs);
foreach (var epc in epcs)
{
epc?.Dispose();
}
tmrplayerhealthdetect.Stop();
tmrenemyhealthdetect.Stop();
Hacking.RepairTimer.Start(); //Now the player can repair.
}
else
@ -182,6 +208,8 @@ private void this_Closing(object sender, FormClosingEventArgs e)
public Computer SelectedPlayerComputer = null;
public Computer module_to_steal = null;
public void AddModule(Computer newModule)
{
pnlyou.Controls.Add(newModule);
@ -190,6 +218,49 @@ public void AddModule(Computer newModule)
TotalPlayerHP += newModule.HP;
AllPlayerComputers.Add(newModule);
newModule.Show();
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)
@ -268,7 +339,10 @@ public void AddModule(Computer newModule)
{
newModule.MassDDoS += (object s, EventArgs a) =>
{
WormToEnemy();
if (newModule.Enslaved)
WormToPlayer();
else
WormToEnemy();
};
}
}
@ -289,6 +363,15 @@ public void WormToEnemy()
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 +385,7 @@ public void ShowPCInfo(string hostname)
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 +405,37 @@ public void ShowPCInfo(string hostname)
}
btnpoweroff.Show();
}
}
Computer c = null;
foreach (var pc in AllPlayerComputers)
{
if (pc.Hostname == hostname)
{
c = pc;
}
}
if (c != null)
{
lbtargets.Text = "Targets: ";
if (c.Enemies != null)
if (c.Enslaved)
{
if (c.Enemies.Count > 0)
lbtargets.Text = "*** WARNING ***: This module has been ENSLAVED! Consider a redeploy.";
}
else
{
lbtargets.Text = "Targets: ";
if (c.Enemies != null)
{
foreach (var pc in c.Enemies)
if (c.Enemies.Count > 0)
{
lbtargets.Text += " " + pc.Hostname + ",";
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.";
}
else
{
lbtargets.Text += " - Click on an enemy module to target it.";
}
lbtargets.Text += Environment.NewLine + "Some modules will not fire at their targets.";
}
}
@ -514,7 +597,7 @@ private void playfield_MouseDown(object sender, MouseEventArgs e)
{
SystemType type = FutureModules[cmbmodules.Text];
}
catch (Exception ex)
catch
{
cont = false;
API.CreateInfoboxSession("Error", "Please select a module type.", infobox.InfoboxMode.Info);
@ -680,7 +763,7 @@ private void txtgrade_TextChanged(object sender, EventArgs e)
}
SetupModuleInfo();
}
catch (Exception ex)
catch
{
txtgrade.Text = "1";
SetupModuleInfo();
@ -982,18 +1065,24 @@ private void btnnext_Click(object sender, EventArgs e)
private void HackUI_Load(object sender, EventArgs e)
{
this.TopMost = false;
Audio.Stopped += (o, a) =>
{
if (this != null)
{
Audio.Play("hackerbattle_ambient");
}
};
Audio.Play("hackerbattle_ambient");
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) =>
{
arc.PlayRandom();
};
arc.PlayRandom();
this.WindowState = FormWindowState.Maximized;
//this.TopMost = true;
LoadPlayerScreen();
LoadEnemyScreen();
tmrvisualizer.Interval = 10;
tmrvisualizer.Start();
}
#region ENEMY
@ -1056,6 +1145,49 @@ public void AddEnemyModule(Computer newModule)
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,7 +1266,10 @@ public void AddEnemyModule(Computer newModule)
{
newModule.MassDDoS += (object s, EventArgs a) =>
{
WormToPlayer();
if (newModule.Enslaved)
WormToEnemy();
else
WormToPlayer();
};
}
}
@ -1142,7 +1277,7 @@ public void AddEnemyModule(Computer newModule)
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)
@ -1218,13 +1353,10 @@ private void Enemy_System_Damaged(object s, EventArgs e)
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}";
@ -1234,7 +1366,12 @@ private void tmrenemyhealthdetect_Tick(object sender, EventArgs e)
{
if (pc.Disabled == false)
{
foreach (var enemy in AllPlayerComputers)
var elist = new List<Computer>();
if (pc.Enslaved)
elist = AllEnemyComputers;
else
elist = AllPlayerComputers;
foreach (var enemy in elist)
{
chance = rnd.Next(1, 20);
if (chance == 10)
@ -1282,7 +1419,7 @@ private void tmrenemyhealthdetect_Tick(object sender, EventArgs e)
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 +1442,15 @@ private void tmrenemyhealthdetect_Tick(object sender, EventArgs e)
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 +1490,432 @@ public void WormToPlayer()
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
{
txtyourconsole.Text = text + Environment.NewLine;
if (txtyourconsole.Text.Length == 0)
{
txtyourconsole.Text = text + Environment.NewLine;
}
else
{
txtyourconsole.Text += text + Environment.NewLine;
}
txtyourconsole.Select(txtyourconsole.TextLength, 0);
txtyourconsole.ScrollToCaret();
}
else
catch
{
txtyourconsole.Text += text + Environment.NewLine;
this.Invoke(new Action(() => { WriteLine(text); }));
}
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;
}
}
}

View file

@ -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>

View file

@ -139,7 +139,7 @@ public static void StartHackWithCharacter(int cid, Hack hack)
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 @@ public static void StartHackWithCharacter(int cid, Hack hack)
{
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 @@ public static List<FutureModule> GetFutureModules()
{
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 @@ public static void StartHackWithCharacter(int cid, string upgrade)
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 @@ public static void StartHackWithCharacter(int cid, string upgrade)
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 @@ public static void StartHack(int cid, Hack hack)
break;
}
}
catch(Exception ex)
catch
{
t.Stop();
var tr = new Terminal();
@ -553,6 +555,15 @@ public static void GetCharacters()
/// </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)));

View file

@ -285,7 +285,7 @@ private void tmrhealthdetect_Tick(object sender, EventArgs e)
}
}
}
catch(Exception ex)
catch
{
}

View file

@ -488,7 +488,7 @@ private void playfield_MouseDown(object sender, MouseEventArgs e)
{
SystemType type = FutureModules[cmbmodules.Text];
}
catch (Exception ex)
catch
{
cont = false;
API.CreateInfoboxSession("Error", "Please select a module type.", infobox.InfoboxMode.Info);
@ -654,7 +654,7 @@ private void txtgrade_TextChanged(object sender, EventArgs e)
}
SetupModuleInfo();
}
catch(Exception ex)
catch
{
txtgrade.Text = "1";
SetupModuleInfo();

View file

@ -48,7 +48,7 @@ private void btnsave_Click(object sender, EventArgs e)
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 @@ private void button1_Click(object sender, EventArgs e)
API.IconRegistry[finf.Name] = Image.FromStream(stream);
}
}
catch (Exception ex)
catch
{
API.IconRegistry.Add(finf.Name, Image.FromFile(finf.FullName));
}

View file

@ -31,7 +31,6 @@ public KnowledgeInput()
bool levelup;
int rewardbase;
string[] savecontent;
int totalguessed;
int level;
@ -314,8 +313,6 @@ private void handlewordtype(string[] listtype, string savepath)
}
}
int chance = 101;
// ERROR: Handles clauses are not supported in C#
// ERROR: Handles clauses are not supported in C#
private void me_closing()

View file

@ -111,6 +111,90 @@ public LuaInterpreter()
/// </summary>
public void RegisterCore()
{
//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>>(() =>
{
@ -159,7 +243,7 @@ public void RegisterCore()
{
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();
@ -497,7 +581,7 @@ public void RegisterCore()
i = it;
}
}
catch(Exception ex)
catch
{
}
@ -959,7 +1043,6 @@ public Control ConstructControl(string type, string text, int x, int y, int widt
return ctrl;
}
private bool Beeping = false;
/// <summary>
/// Broken, piece of dump beep function.

View file

@ -98,7 +98,7 @@ public static void ConnectToServer(string address, int port)
client.Connect(address, port);
clients.Add(client.RemoteHost, client);
}
catch (Exception ex)
catch
{
}
}
@ -191,7 +191,7 @@ public static bool GetPackage(string pkgname)
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 @@ public static string ExtractPackage(string localpath)
ZipFile.ExtractToDirectory(localpath, packagedir);
return packagedir;
}
catch (Exception ex)
catch
{
return "fail";
}

View file

@ -23,6 +23,7 @@ public class Paths
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 @@ public static void RegisterPaths()
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 @@ public static void RegisterPaths()
Bitnote = Drivers + "BNWallet.dri";
Icons = LoadedSkin + "Icons/";
WidgetFiles = SystemDir + "Widgets/";
APIs = SystemDir + "APIs/";
break;
}

View file

@ -8,6 +8,7 @@
using System.IO.Compression;
using System.ComponentModel;
using System.Threading;
using Newtonsoft.Json;
namespace ShiftOS
{
@ -19,6 +20,7 @@ static class Program
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Extract all dependencies before starting the engine.
@ -44,7 +46,7 @@ static void Main(string[] args)
}
}
}
catch(Exception ex)
catch
{
Console.WriteLine("[ServerThread/WARNING] Couldn't retrieve startup pool. Not connecting to any servers.");
}
@ -52,6 +54,17 @@ static void Main(string[] args)
poolThread.Start();
//Start the Windows Forms backend
Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS.
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();
SaveSystem.Utilities.CheckForOlderSaves(); //Backs up C:\ShiftOS on Windows systems if it exists and doesn't contain a _engineInfo.txt file telling ShiftOS what engine created it.
//If there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save.
//If not, load that save.
@ -111,7 +124,7 @@ static void Main(string[] args)
}
}
}
catch(Exception ex)
catch
{
}
@ -140,7 +153,6 @@ static void ExtractDependencies()
{
Directory.Delete(temppath, true);
}
bool firstfile = false;
ZipFile.ExtractToDirectory(zippath, temppath);
foreach (string f in Directory.GetFiles(temppath))
{
@ -164,7 +176,7 @@ static void ExtractDependencies()
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);

View file

@ -17,7 +17,37 @@ public ProgressBarEX()
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
@ -295,6 +325,9 @@ private void DoPaintProcess(Graphics g)
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);

View file

@ -318,7 +318,7 @@ internal static string AustinWalkerCompletionStory {
/// </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));
}
}
@ -462,6 +462,52 @@ internal static System.Drawing.Bitmap crash_ofm {
}
}
/// <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)
/// {
@ -1103,7 +1149,21 @@ internal static string MidGame_Holochat {
/// <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 @@ internal static System.Drawing.Bitmap notify_generic {
/// </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 @@ internal static System.Drawing.Bitmap object_large_Image {
/// </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 @@ internal static System.Drawing.Bitmap object_mid_Image {
/// </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 @@ internal static System.Drawing.Bitmap object_mid2_Image {
/// </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 @@ internal static System.Drawing.Bitmap object_small_Image {
/// </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 @@ internal static System.Drawing.Bitmap pausebutton {
/// </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 @@ internal static System.Drawing.Bitmap playbutton {
/// </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 @@ internal static System.Drawing.Bitmap previousbutton {
/// </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));
}
}

View file

@ -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>

View file

@ -52,7 +52,7 @@ private void tmrimfuckinglucky_Tick(object sender, EventArgs e)
this.Close();
}
}
catch(Exception ex)
catch
{
}
@ -72,7 +72,7 @@ private void btnsend_Click(object sender, EventArgs e)
}
}
}
catch(Exception ex)
catch
{
}

View file

@ -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!

View file

@ -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}
]
}
}

View file

@ -1,6 +1,8 @@
{
"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}]}
}

View file

@ -186,6 +186,32 @@ public class ShiftoriumRegistry
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 +486,14 @@ public static void UpdateShiftorium()
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 +532,10 @@ public class Utilities
/// <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 +588,7 @@ public static List<Upgrade> GetAvailable()
}
catch (Exception ex)
catch
{
if (upgrade.id.Contains("dummy"))
{

View file

@ -146,6 +146,18 @@
<Compile Include="Connection.Designer.cs">
<DependentUpon>Connection.cs</DependentUpon>
</Compile>
<Compile Include="ConnectionManager.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="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="DesktopIcon.cs">
<SubType>UserControl</SubType>
</Compile>
@ -189,6 +201,12 @@
<Compile Include="FinalMission\QuestViewer.Designer.cs">
<DependentUpon>QuestViewer.cs</DependentUpon>
</Compile>
<Compile Include="GameSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="GameSettings.Designer.cs">
<DependentUpon>GameSettings.cs</DependentUpon>
</Compile>
<Compile Include="Graphic_Picker.cs">
<SubType>Form</SubType>
</Compile>
@ -346,6 +364,30 @@
<Compile Include="Shifter.Designer.cs">
<DependentUpon>Shifter.cs</DependentUpon>
</Compile>
<Compile Include="ShifterColorInput.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ShifterColorInput.Designer.cs">
<DependentUpon>ShifterColorInput.cs</DependentUpon>
</Compile>
<Compile Include="ShifterGraphicInput.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ShifterGraphicInput.Designer.cs">
<DependentUpon>ShifterGraphicInput.cs</DependentUpon>
</Compile>
<Compile Include="ShifterIntInput.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ShifterIntInput.Designer.cs">
<DependentUpon>ShifterIntInput.cs</DependentUpon>
</Compile>
<Compile Include="ShifterTextInput.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="ShifterTextInput.Designer.cs">
<DependentUpon>ShifterTextInput.cs</DependentUpon>
</Compile>
<Compile Include="Shiftnet.cs">
<SubType>Form</SubType>
</Compile>
@ -416,6 +458,12 @@
<EmbeddedResource Include="Connection.resx">
<DependentUpon>Connection.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ConnectionManager.resx">
<DependentUpon>ConnectionManager.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CreditScroller.resx">
<DependentUpon>CreditScroller.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DesktopIcon.resx">
<DependentUpon>DesktopIcon.cs</DependentUpon>
</EmbeddedResource>
@ -437,6 +485,9 @@
<EmbeddedResource Include="FinalMission\QuestViewer.resx">
<DependentUpon>QuestViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GameSettings.resx">
<DependentUpon>GameSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Graphic_Picker.resx">
<DependentUpon>Graphic_Picker.cs</DependentUpon>
</EmbeddedResource>
@ -511,6 +562,18 @@
<EmbeddedResource Include="Shifter.resx">
<DependentUpon>Shifter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ShifterColorInput.resx">
<DependentUpon>ShifterColorInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ShifterGraphicInput.resx">
<DependentUpon>ShifterGraphicInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ShifterIntInput.resx">
<DependentUpon>ShifterIntInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ShifterTextInput.resx">
<DependentUpon>ShifterTextInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Shiftnet.resx">
<DependentUpon>Shiftnet.cs</DependentUpon>
</EmbeddedResource>
@ -559,6 +622,8 @@
<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" />
@ -959,7 +1024,25 @@
</Compile>
<Compile Include="undo.cs" />
</ItemGroup>
<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>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Baseclass.Contrib.Nuget.Output.2.0.0\build\net40\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('..\packages\Baseclass.Contrib.Nuget.Output.2.0.0\build\net40\Baseclass.Contrib.Nuget.Output.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View file

@ -385,7 +385,7 @@ public void SetupWidget(Panel p, Skinning.DesktopWidget w)
ctrl.Width = w.Width;
Skinning.Utilities.saveskin();
}
catch(Exception ex)
catch
{
AddNotification("Invalid width", "You have entered an invalid width.");
}
@ -397,7 +397,7 @@ public void SetupWidget(Panel p, Skinning.DesktopWidget w)
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);
}
@ -666,7 +666,7 @@ public void SetupAppLauncher()
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);
}
@ -894,7 +894,7 @@ public void ChangePosition(Control ctrl, Panel newPanel)
ctrl.Parent.Controls.Remove(ctrl);
newPanel.Controls.Add(ctrl);
}
catch(Exception ex)
catch
{
newPanel.Controls.Add(ctrl);
}
@ -996,7 +996,7 @@ public void PanelButton_Click(object sender, EventArgs e)
API.ToggleMinimized(frm);
}
}
catch (Exception ex)
catch
{
}

View file

@ -34,6 +34,7 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
this.pnlbasic.SuspendLayout();
this.pnlmenusintro.SuspendLayout();
this.pnlmenucategories.SuspendLayout();
this.pnlluaoptions.SuspendLayout();
this.SuspendLayout();
//
// clocktick
@ -532,6 +537,7 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
| 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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
//
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 @@ private void InitializeComponent()
//
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
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 @@ private void InitializeComponent()
private Label label150;
private TextBox txtwinfadespeed;
private Label label151;
private Button btnmore;
private Panel pnlluaoptions;
private FlowLayoutPanel flmorebuttons;
private Panel pnlluafield;
}
}

View file

@ -581,7 +581,7 @@ private void txtdesktoppanelheight_ValueChanged(object sender, EventArgs e)
SetPreviewSkin(false);
AddCP(1);
}
catch (Exception ex)
catch
{
txtdesktoppanelheight.Text = CustomizingSkin.desktoppanelheight.ToString();
}
@ -800,7 +800,7 @@ private void txtappbuttontextsize_TextChanged(object sender, EventArgs e)
SetPreviewSkin(false);
AddCP(1);
}
catch(Exception ex)
catch
{
txtappbuttontextsize.Text = CustomizingSkin.applicationbuttontextsize.ToString();
}
@ -828,7 +828,7 @@ private void txtapplicationsbuttonheight_TextChanged(object sender, EventArgs e)
SetPreviewSkin(false);
AddCP(1);
}
catch (Exception ex)
catch
{
txtapplicationsbuttonheight.Text = CustomizingSkin.applicationbuttonheight.ToString();
}
@ -842,7 +842,7 @@ private void txtapplauncherwidth_TextChanged(object sender, EventArgs e)
SetPreviewSkin(false);
AddCP(1);
}
catch (Exception ex)
catch
{
txtapplauncherwidth.Text = CustomizingSkin.applaunchermenuholderwidth.ToString();
}
@ -1005,8 +1005,7 @@ private void txtpanelbuttonwidth_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttonwidth = Convert.ToInt16(txtpanelbuttonwidth.Text);
AddCP(1);
}
catch(Exception ex)
{
catch{
txtpanelbuttonwidth.Text = CustomizingSkin.panelbuttonwidth.ToString();
}
SetPreviewSkin(false);
@ -1019,7 +1018,7 @@ private void txtpanelbuttoninitalgap_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttoninitialgap = Convert.ToInt16(txtpanelbuttoninitalgap.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttoninitalgap.Text = CustomizingSkin.panelbuttoninitialgap.ToString();
}
@ -1033,7 +1032,7 @@ private void txtpanelbuttonheight_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttonheight = Convert.ToInt16(txtpanelbuttonheight.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttonheight.Text = CustomizingSkin.panelbuttonheight.ToString();
}
@ -1047,7 +1046,7 @@ private void txtpanelbuttongap_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttongap = Convert.ToInt16(txtpanelbuttongap.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttongap.Text = CustomizingSkin.panelbuttongap.ToString();
}
@ -1121,7 +1120,7 @@ private void txtpanelbuttoniconsize_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttoniconsize = Convert.ToInt16(txtpanelbuttoniconsize.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttoniconsize.Text = CustomizingSkin.panelbuttoniconsize.ToString();
}
@ -1135,7 +1134,7 @@ private void txtpanelbuttoniconside_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttoniconside = Convert.ToInt16(txtpanelbuttoniconside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttoniconside.Text = CustomizingSkin.panelbuttoniconside.ToString();
}
@ -1149,7 +1148,7 @@ private void txtpanelbuttonicontop_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttonicontop = Convert.ToInt16(txtpanelbuttonicontop.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttonicontop.Text = CustomizingSkin.panelbuttonicontop.ToString();
}
@ -1163,7 +1162,7 @@ private void txtpanelbuttontextside_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttontextside = Convert.ToInt16(txtpanelbuttontextside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttontextside.Text = CustomizingSkin.panelbuttontextside.ToString();
}
@ -1177,7 +1176,7 @@ private void txtpanelbuttontexttop_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttontexttop = Convert.ToInt16(txtpanelbuttontexttop.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttontexttop.Text = CustomizingSkin.panelbuttontexttop.ToString();
}
@ -1191,7 +1190,7 @@ private void txtpaneltextbuttonsize_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttontextsize = Convert.ToInt16(txtpaneltextbuttonsize.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpaneltextbuttonsize.Text = CustomizingSkin.panelbuttontextsize.ToString();
}
@ -1205,7 +1204,7 @@ private void txtpanelbuttontop_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelbuttonfromtop = Convert.ToInt16(txtpanelbuttontop.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtpanelbuttontop.Text = CustomizingSkin.panelbuttonfromtop.ToString();
}
@ -1297,7 +1296,7 @@ private void txtclocktextsize_TextChanged(object sender, EventArgs e)
CustomizingSkin.panelclocktextsize = Convert.ToInt16(txtclocktextsize.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtclocktextsize.Text = CustomizingSkin.panelclocktextsize.ToString();
}
@ -1311,7 +1310,7 @@ private void txtclocktextfromtop_TextChanged(object sender, EventArgs e)
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 @@ private void txttitletexttop_TextChanged(object sender, EventArgs e)
CustomizingSkin.titletextfromtop = Convert.ToInt16(txttitletexttop.Text);
AddCP(1);
}
catch(Exception ex)
catch
{
txttitletexttop.Text = CustomizingSkin.titletextfromtop.ToString();
}
@ -1372,7 +1371,7 @@ private void txttitletextside_TextChanged(object sender, EventArgs e)
CustomizingSkin.titletextfromside = Convert.ToInt16(txttitletextside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txttitletextside.Text = CustomizingSkin.titletextfromside.ToString();
}
@ -1407,7 +1406,7 @@ private void txttitletextsize_TextChanged(object sender, EventArgs e)
CustomizingSkin.titletextfontsize = Convert.ToInt16(txttitletextsize.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txttitletextsize.Text = CustomizingSkin.titletextfontsize.ToString();
}
@ -1746,7 +1745,7 @@ private void txtbordersize_TextChanged(object sender, EventArgs e)
CustomizingSkin.borderwidth = Convert.ToInt16(txtbordersize.Text);
AddCP(1);
}
catch(Exception ex)
catch
{
txtbordersize.Text = CustomizingSkin.borderwidth.ToString();
}
@ -1836,7 +1835,7 @@ private void txttitlebarheight_TextChanged(object sender, EventArgs e)
CustomizingSkin.titlebarheight = Convert.ToInt16(txttitlebarheight.Text);
AddCP(1);
}
catch(Exception ex)
catch
{
txttitlebarheight.Text = CustomizingSkin.titlebarheight.ToString();
}
@ -1850,7 +1849,7 @@ private void txttitlebarcornerwidth_TextChanged(object sender, EventArgs e)
CustomizingSkin.titlebarcornerwidth = Convert.ToInt16(txttitlebarcornerwidth.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txttitlebarcornerwidth.Text = CustomizingSkin.titlebarcornerwidth.ToString();
}
@ -1926,7 +1925,7 @@ private void txticonfromside_TextChanged(object sender, EventArgs e)
CustomizingSkin.titleiconfromside = Convert.ToInt16(txticonfromside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txticonfromside.Text = CustomizingSkin.titleiconfromside.ToString();
}
@ -1940,7 +1939,7 @@ private void txticonfromtop_TextChanged(object sender, EventArgs e)
CustomizingSkin.titleiconfromtop = Convert.ToInt16(txticonfromtop.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txticonfromtop.Text = CustomizingSkin.titleiconfromtop.ToString();
}
@ -2064,7 +2063,7 @@ private void txtminimizebuttonheight_TextChanged(object sender, EventArgs e)
CustomizingSkin.minbtnsize.Height = Convert.ToInt16(txtminimizebuttonheight.Text);
AddCP(1);
}
catch(Exception ex)
catch
{
txtminimizebuttonheight.Text = CustomizingSkin.minbtnsize.Height.ToString();
}
@ -2078,7 +2077,7 @@ private void txtminimizebuttonwidth_TextChanged(object sender, EventArgs e)
CustomizingSkin.minbtnsize.Width = Convert.ToInt16(txtminimizebuttonwidth.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtminimizebuttonwidth.Text = CustomizingSkin.minbtnsize.Width.ToString();
}
@ -2092,7 +2091,7 @@ private void txtminimizebuttontop_TextChanged(object sender, EventArgs e)
CustomizingSkin.minbtnfromtop = Convert.ToInt16(txtminimizebuttontop.Text);
AddCP(1);
}
catch(Exception ex)
catch
{
txtminimizebuttontop.Text = CustomizingSkin.minbtnfromtop.ToString();
}
@ -2106,7 +2105,7 @@ private void txtminimizebuttonside_TextChanged(object sender, EventArgs e)
CustomizingSkin.minbtnfromside = Convert.ToInt16(txtminimizebuttonside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtminimizebuttonside.Text = CustomizingSkin.minbtnfromside.ToString();
}
@ -2155,7 +2154,7 @@ private void txtrollupbuttonheight_TextChanged(object sender, EventArgs e)
CustomizingSkin.rollbtnsize.Height = Convert.ToInt16(txtrollupbuttonheight.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtrollupbuttonheight.Text = CustomizingSkin.rollbtnsize.Height.ToString();
}
@ -2169,7 +2168,7 @@ private void txtrollupbuttonwidth_TextChanged(object sender, EventArgs e)
CustomizingSkin.rollbtnsize.Width = Convert.ToInt16(txtrollupbuttonwidth.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtrollupbuttonwidth.Text = CustomizingSkin.rollbtnsize.Width.ToString();
}
@ -2183,7 +2182,7 @@ private void txtrollupbuttontop_TextChanged(object sender, EventArgs e)
CustomizingSkin.rollbtnfromtop = Convert.ToInt16(txtrollupbuttontop.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtrollupbuttontop.Text = CustomizingSkin.rollbtnfromtop.ToString();
}
@ -2197,7 +2196,7 @@ private void txtrollupbuttonside_TextChanged(object sender, EventArgs e)
CustomizingSkin.rollbtnfromside = Convert.ToInt16(txtrollupbuttonside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtrollupbuttonside.Text = CustomizingSkin.rollbtnfromside.ToString();
}
@ -2246,7 +2245,7 @@ private void txtclosebuttonheight_TextChanged(object sender, EventArgs e)
CustomizingSkin.closebtnsize.Height = Convert.ToInt16(txtclosebuttonheight.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtclosebuttonheight.Text = CustomizingSkin.closebtnsize.Height.ToString();
}
@ -2260,7 +2259,7 @@ private void txtclosebuttonwidth_TextChanged(object sender, EventArgs e)
CustomizingSkin.closebtnsize.Width = Convert.ToInt16(txtclosebuttonwidth.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtclosebuttonwidth.Text = CustomizingSkin.closebtnsize.Width.ToString();
}
@ -2274,7 +2273,7 @@ private void txtclosebuttonfromtop_TextChanged(object sender, EventArgs e)
CustomizingSkin.closebtnfromtop = Convert.ToInt16(txtclosebuttonfromtop.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtclosebuttonfromtop.Text = CustomizingSkin.closebtnfromtop.ToString();
}
@ -2288,7 +2287,7 @@ private void txtclosebuttonfromside_TextChanged(object sender, EventArgs e)
CustomizingSkin.closebtnfromside = Convert.ToInt16(txtclosebuttonfromside.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtclosebuttonfromside.Text = CustomizingSkin.closebtnfromside.ToString();
}
@ -2899,7 +2898,7 @@ private void txtfadespeed_TextChanged(object sender, EventArgs e)
CustomizingSkin.DragFadeInterval = Convert.ToInt32(txtfadespeed.Text);
AddCP(1);
}
catch(Exception ex)
catch
{
txtfadespeed.Text = CustomizingSkin.DragFadeInterval.ToString();
}
@ -2912,7 +2911,7 @@ private void txtdragfadedec_TextChanged(object sender, EventArgs e)
CustomizingSkin.DragFadeSpeed = Convert.ToDouble(txtdragfadedec.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtdragfadedec.Text = CustomizingSkin.DragFadeSpeed.ToString();
}
@ -2932,7 +2931,7 @@ private void txtdragopacitydec_TextChanged(object sender, EventArgs e)
CustomizingSkin.DragFadeLevel = Convert.ToDouble(txtdragopacitydec.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtdragopacitydec.Text = CustomizingSkin.DragFadeLevel.ToString();
}
@ -2945,7 +2944,7 @@ private void txtshakemax_TextChanged(object sender, EventArgs e)
CustomizingSkin.ShakeMaxOffset = Convert.ToInt32(txtshakemax.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtshakemax.Text = CustomizingSkin.ShakeMaxOffset.ToString();
}
@ -2958,7 +2957,7 @@ private void txtshakeminoffset_TextChanged(object sender, EventArgs e)
CustomizingSkin.ShakeMinOffset = Convert.ToInt32(txtshakeminoffset.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtshakeminoffset.Text = CustomizingSkin.ShakeMinOffset.ToString();
}
@ -2971,7 +2970,7 @@ private void txtwinfadespeed_TextChanged(object sender, EventArgs e)
CustomizingSkin.WindowFadeTime = Convert.ToInt32(txtwinfadespeed.Text);
AddCP(1);
}
catch (Exception ex)
catch
{
txtwinfadespeed.Text = CustomizingSkin.WindowFadeTime.ToString();
}
@ -2984,10 +2983,111 @@ private void txtwinfadedec_TextChanged(object sender, EventArgs e)
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;
}
}
};
}
}
}
}

View file

@ -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>

View file

@ -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;
}
}

View file

@ -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;
}
}
}
}

View file

@ -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>

View file

@ -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;
}
}

View file

@ -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;
}
}
}
}

View file

@ -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>

View file

@ -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;
}
}

View file

@ -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();
}
}
}
}

View file

@ -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>

View file

@ -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;
}
}

View file

@ -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);
}
}
}

View file

@ -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>

View file

@ -87,7 +87,7 @@ public static string VisitSite(string url)
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.");

View file

@ -46,7 +46,7 @@ private void RecursiveControlSetup(Control ctrl)
RecursiveControlSetup(c);
}
}
catch (Exception ex)
catch
{
}
@ -87,7 +87,7 @@ private void tmrdecrypt_Tick(object sender, EventArgs e)
{
encrypted_contents = new WebClient().DownloadString(currentaddress);
}
catch(Exception ex)
catch
{
WriteLine(" *** ERROR: Remote file could not be accessed.");
tmrdecrypt.Stop();

View file

@ -77,7 +77,7 @@ public void GetUpgrades()
btnhack.Hide();
}
}
catch(Exception ex)
catch
{
lbcategory.Text = "No upgrades!";
}
@ -132,12 +132,12 @@ private void lbupgrades_SelectedIndexChanged(object sender, EventArgs e)
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.
}

View file

@ -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 @@ public Terminal(bool modlog)
ModLogger = modlog;
InitializeComponent();
API.LoggerTerminal = this;
current_dir = Paths.SaveRoot;
}
public void StartOtherPlayerStory()
@ -110,7 +114,7 @@ private void Terminal_Load(object sender, EventArgs e)
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 @@ private void StartLogCheck()
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 @@ private void txtterm_KeyPress(object sender, System.Windows.Forms.KeyEventArgs e
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 @@ internal void StartShellShock()
t.Start();
}
public void SetPrefix(string _prefix)
{
prefix = _prefix;
}
internal void StartBridgeToMidGame()
{
var t2 = new System.Windows.Forms.Timer();
@ -787,7 +790,7 @@ public void ShowTools()
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 @@ public void StartShiftnetStory()
{
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 @@ public Color SetColor(string name)
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 @@ public void DoCommand()
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 @@ public void DoCommand()
break;
}
}
catch(Exception ex)
catch
{
WriteLine("connections: Missing arguments.");
}
@ -1526,7 +1588,7 @@ public void DoCommand()
break;
}
}
catch(Exception ex)
catch
{
WriteLine("Missing arguments.");
}
@ -1548,29 +1610,11 @@ public void DoCommand()
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 @@ public void DoCommand()
WriteLine("Lua script file not found.");
}
}
catch (Exception ex)
catch
{
this.LuaMode = true;
this.Interpreter = new LuaInterpreter();
@ -1946,7 +1990,7 @@ public void DoCommand()
break;
}
}
catch(Exception ex)
catch
{
WriteLine("alias: Missing arguments. Try alias --help for help with the Alias command.");
}
@ -1958,7 +2002,7 @@ public void DoCommand()
{
API.CurrentSave.username = args[1];
}
catch(Exception ex)
catch
{
WriteLine("username: Missing arguments.");
}
@ -1975,7 +2019,7 @@ public void DoCommand()
{
API.CurrentSave.osname = args[1];
}
catch (Exception ex)
catch
{
WriteLine("osname: Missing arguments.");
}
@ -2145,7 +2189,8 @@ public void DoCommand()
wrongcommand();
break;
}
} catch(Exception ex) {
} catch
{
wrongcommand(); //Debug command pretends to be an invalid command if an exception is thrown.
}
}
@ -2163,6 +2208,7 @@ public void DoCommand()
case "syncsave":
WriteLine("Command removed.");
break;
default:
if (API.OpenProgram(args[0]) == false)
{
@ -2672,7 +2718,7 @@ private void ResetTerminalFont()
try {
txtterm.Font = new Font(fname, fsize);
}
catch(Exception ex)
catch
{
txtterm.Font = new Font(fname, 9);
}

View file

@ -121,7 +121,7 @@ public static void CheckInfected(string filepath) {
}
Directory.Delete(pth, true);
}
catch(Exception ex)
catch
{
API.LogException("Corrupted package file detected while checking for infections... skipping.", false);
}
@ -146,7 +146,7 @@ public static void CheckInfected(string filepath) {
}
}
}
catch (CryptographicException cex)
catch
{
if (encrypted != "")
{
@ -326,7 +326,7 @@ public static void InfectFile(string FileName, VirusID id)
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 @@ public static void InfectFile(string FileName, VirusID id)
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 @@ public static void InfectFile(string FileName, VirusID id)
public static void DisInfect(string FileName)
{
bool cont = false;
FileInfo finf = new FileInfo(FileName);
switch (finf.Extension)
{
@ -379,7 +378,7 @@ public static void DisInfect(string FileName)
dirsep = "/";
break;
}
if(File.Exists(pth + dirsep + virusfilename))
if (File.Exists(pth + dirsep + virusfilename))
{
File.Delete(pth + dirsep + virusfilename);
}
@ -401,15 +400,13 @@ public static void DisInfect(string FileName)
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 @@ public static void InfectFile(string FileName, string id)
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 @@ public static void InfectFile(string FileName, string id)
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 @@ public static void DropDevXPayload()
InfectFile(file, VirusID.ImTheShifterNow);
InfectFile(file, VirusID.MouseTrap);
}
catch(NotHappeningException nhex)
catch
{
DropDevXPayload();
}
@ -600,10 +597,8 @@ public static string Intercept()
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;
}
}
}

View file

@ -182,7 +182,7 @@ public static void CloseForm(Form formToClose, PanelButton pbtn, WindowAnimation
t.Stop();
}
}
catch (Exception ex)
catch
{
formToClose = null;
}
@ -238,7 +238,6 @@ public static void CloseForm(Form formToClose, PanelButton pbtn, WindowAnimation
};
t.Start();
break;
break;
case WindowAnimationStyle.ToAppLauncher:
_CanClose = false;
t.Interval = 1;

View file

@ -421,7 +421,7 @@ public static void LoadEmbeddedNamePack()
LoadedNames.NameChangerName = "Name Changer";
}
}
catch(Exception ex)
catch
{
LoadedNames = new NamePack();
}
@ -609,7 +609,7 @@ public static void loadsknfile(string filepath)
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 @@ public static void loadimages()
fStream.Close();
}
}
catch(Exception ex)
catch
{
GenDefaultIconPack();
}