mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-04-19 18:20:24 +00:00
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
This commit is contained in:
commit
61c906e596
142 changed files with 10782 additions and 3099 deletions
1030
.vs/config/applicationhost.config
Normal file
1030
.vs/config/applicationhost.config
Normal file
File diff suppressed because it is too large
Load diff
16
ShiftOS.Objects/ChatRoom.cs
Normal file
16
ShiftOS.Objects/ChatRoom.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ShiftOS.Objects
|
||||
{
|
||||
public class ChatRoom
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
public List<ChatMessage> Messages { get; set; }
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@ namespace ShiftOS.Objects
|
|||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int CostPerMonth { get; set; }
|
||||
public uint CostPerMonth { get; set; }
|
||||
public int DownloadSpeed { get; set; }
|
||||
public string Company { get; set; }
|
||||
}
|
||||
|
|
|
@ -26,20 +26,94 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
namespace ShiftOS.Objects
|
||||
{
|
||||
//Better to store this stuff server-side so we can do some neat stuff with hacking...
|
||||
public class Save
|
||||
{
|
||||
public bool MusicEnabled = true;
|
||||
public bool SoundEnabled = true;
|
||||
public int MusicVolume = 100;
|
||||
|
||||
[Obsolete("This save variable is no longer used in Beta 2.4 and above of ShiftOS. Please use ShiftOS.Engine.SaveSystem.CurrentUser.Username to access the current user's username.")]
|
||||
public string Username { get; set; }
|
||||
|
||||
private List<Action> _setCpCallbacks = new List<Action>(); // everything in this list is called by Codepoints.set() and syncCp().
|
||||
private ulong _cp = 0; // locally cached codepoints counter
|
||||
private Object _cpLock = new Object(); // locked when modifying or reading the codepoints counter
|
||||
private Object _webLock = new Object(); // locked when communicating with the server
|
||||
private Timer _updTimer; // timer to start a new sync thread every 5 minutes
|
||||
|
||||
// Sync local Codepoints count with the server.
|
||||
public void syncCp()
|
||||
{
|
||||
new Thread(() =>
|
||||
{
|
||||
lock (_cpLock)
|
||||
{
|
||||
lock (_webLock)
|
||||
{
|
||||
var uc = new ShiftOS.Unite.UniteClient("", UniteAuthToken);
|
||||
_cp = uc.GetCodepoints();
|
||||
}
|
||||
}
|
||||
foreach (Action a in _setCpCallbacks)
|
||||
a();
|
||||
}).Start();
|
||||
}
|
||||
|
||||
// we have to write these wrapper functions so we can keep _setCpCallbacks private,
|
||||
// so that it doesn't get serialised
|
||||
public void addSetCpCallback(Action callback)
|
||||
{
|
||||
_setCpCallbacks.Add(callback);
|
||||
}
|
||||
|
||||
public void removeSetCpCallback(Action callback)
|
||||
{
|
||||
_setCpCallbacks.Remove(callback);
|
||||
}
|
||||
|
||||
public ulong Codepoints
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_updTimer == null)
|
||||
_updTimer = new Timer((o) => syncCp(), null, 0, 300000);
|
||||
lock (_cpLock)
|
||||
{
|
||||
return _cp;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
lock (_cpLock)
|
||||
{
|
||||
_cp = value;
|
||||
new Thread(() =>
|
||||
{
|
||||
lock (_webLock)
|
||||
{
|
||||
try
|
||||
{
|
||||
var uc = new ShiftOS.Unite.UniteClient("", UniteAuthToken);
|
||||
uc.SetCodepoints(value);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
})
|
||||
{
|
||||
IsBackground = false
|
||||
}.Start();
|
||||
}
|
||||
foreach (Action a in _setCpCallbacks)
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
public long Codepoints { get; set; }
|
||||
public Dictionary<string, bool> Upgrades { get; set; }
|
||||
public int StoryPosition { get; set; }
|
||||
public string Language { get; set; }
|
||||
|
@ -99,6 +173,11 @@ namespace ShiftOS.Objects
|
|||
}
|
||||
|
||||
public List<ClientSave> Users { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DO NOT MODIFY THIS. EVER. YOU WILL BREAK THE STORYLINE. Let the engine do it's job.
|
||||
/// </summary>
|
||||
public string PickupPoint { get; set; }
|
||||
}
|
||||
|
||||
public class SettingsObject : DynamicObject
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ChatRoom.cs" />
|
||||
<Compile Include="ClientSave.cs" />
|
||||
<Compile Include="EngineShiftnetSubscription.cs" />
|
||||
<Compile Include="Job.cs" />
|
||||
|
@ -56,8 +57,10 @@
|
|||
<Compile Include="Save.cs" />
|
||||
<Compile Include="ShiftFS.cs" />
|
||||
<Compile Include="Shop.cs" />
|
||||
<Compile Include="UniteClient.cs" />
|
||||
<Compile Include="Unite\Download.cs" />
|
||||
<Compile Include="Unite\ReleaseQuery.cs" />
|
||||
<Compile Include="UserConfig.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace ShiftOS.Objects
|
|||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int Cost { get; set; }
|
||||
public ulong Cost { get; set; }
|
||||
public int FileType { get; set; }
|
||||
public byte[] MUDFile { get; set; }
|
||||
}
|
||||
|
|
236
ShiftOS.Objects/UniteClient.cs
Normal file
236
ShiftOS.Objects/UniteClient.cs
Normal file
|
@ -0,0 +1,236 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using ShiftOS.Objects;
|
||||
|
||||
namespace ShiftOS.Unite
|
||||
{
|
||||
public class UniteClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a string represents the user token for this Unite Client.
|
||||
/// </summary>
|
||||
public string Token { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base URL used in all API calls. Retrieved from the user's servers.json file.
|
||||
/// </summary>
|
||||
public string BaseURL
|
||||
{
|
||||
get
|
||||
{
|
||||
return UserConfig.Get().UniteUrl;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the display name of a user.
|
||||
/// </summary>
|
||||
/// <param name="id">The user ID to look at.</param>
|
||||
/// <returns></returns>
|
||||
public string GetDisplayNameId(string id)
|
||||
{
|
||||
return MakeCall("/API/GetDisplayName/" + id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the Pong highscore stats for all users.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PongHighscoreModel GetPongHighscores()
|
||||
{
|
||||
return JsonConvert.DeserializeObject<PongHighscoreModel>(MakeCall("/API/GetPongHighscores"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new instance of the <see cref="UniteClient"/> object.
|
||||
/// </summary>
|
||||
/// <param name="baseurl">Unused.</param>
|
||||
/// <param name="usertoken">The user API token to use for this client (see http://getshiftos.ml/Manage and click "API" to see your tokens)</param>
|
||||
public UniteClient(string baseurl, string usertoken)
|
||||
{
|
||||
//Handled by the servers.json file
|
||||
//BaseURL = baseurl;
|
||||
Token = usertoken;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a call to the Unite API using the current user token and base URL.
|
||||
/// </summary>
|
||||
/// <param name="url">The path, relative to the base URL, to call.</param>
|
||||
/// <returns>The server's response.</returns>
|
||||
internal string MakeCall(string url)
|
||||
{
|
||||
var webrequest = WebRequest.Create(BaseURL + url);
|
||||
webrequest.Headers.Add("Authentication: Token " + Token);
|
||||
using (var response = webrequest.GetResponse())
|
||||
{
|
||||
using (var stream = response.GetResponseStream())
|
||||
{
|
||||
using (var reader = new System.IO.StreamReader(stream))
|
||||
{
|
||||
return reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the Pong codepoint highscore for the current user.
|
||||
/// </summary>
|
||||
/// <returns>The amount of Codepoints returned by the server</returns>
|
||||
public ulong GetPongCP()
|
||||
{
|
||||
return Convert.ToUInt64(MakeCall("/API/GetPongCP"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the pong highest level score for this user
|
||||
/// </summary>
|
||||
/// <returns>The highest level the user has reached.</returns>
|
||||
public int GetPongLevel()
|
||||
{
|
||||
return Convert.ToInt32(MakeCall("/API/GetPongLevel"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the user's highest level record for Pong.
|
||||
/// </summary>
|
||||
/// <param name="value">The level to set the record to.</param>
|
||||
public void SetPongLevel(int value)
|
||||
{
|
||||
MakeCall("/API/SetPongLevel/" + value.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the pong Codepoints record for the user
|
||||
/// </summary>
|
||||
/// <param name="value">The amount of Codepoints to set the record to</param>
|
||||
public void SetPongCP(ulong value)
|
||||
{
|
||||
MakeCall("/API/SetPongCP/" + value.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user's email address.
|
||||
/// </summary>
|
||||
/// <returns>The user's email address.</returns>
|
||||
public string GetEmail()
|
||||
{
|
||||
return MakeCall("/API/GetEmail");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user's system name.
|
||||
/// </summary>
|
||||
/// <returns>The user's system name.</returns>
|
||||
public string GetSysName()
|
||||
{
|
||||
return MakeCall("/API/GetSysName");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the user's system name.
|
||||
/// </summary>
|
||||
/// <param name="value">The system name to set the record to.</param>
|
||||
public void SetSysName(string value)
|
||||
{
|
||||
MakeCall("/API/SetSysName/" + value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user's display name.
|
||||
/// </summary>
|
||||
/// <returns>The user's display name.</returns>
|
||||
public string GetDisplayName()
|
||||
{
|
||||
return MakeCall("/API/GetDisplayName");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the user's display name.
|
||||
/// </summary>
|
||||
/// <param name="value">The display name to set the user's account to.</param>
|
||||
public void SetDisplayName(string value)
|
||||
{
|
||||
MakeCall("/API/SetDisplayName/" + value.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user's full name if they have set it in their profile.
|
||||
/// </summary>
|
||||
/// <returns>Empty string if the user hasn't set their fullname, else, a string representing their fullname.</returns>
|
||||
public string GetFullName()
|
||||
{
|
||||
return MakeCall("/API/GetFullName");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the user's fullname.
|
||||
/// </summary>
|
||||
/// <param name="value">The new fullname.</param>
|
||||
public void SetFullName(string value)
|
||||
{
|
||||
MakeCall("/API/SetFullName/" + value.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the user's codepoints.
|
||||
/// </summary>
|
||||
/// <returns>The amount of codepoints stored on the server for this user.</returns>
|
||||
public ulong GetCodepoints()
|
||||
{
|
||||
return Convert.ToUInt64(MakeCall("/API/GetCodepoints"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the user's codepoints.
|
||||
/// </summary>
|
||||
/// <param name="value">The amount of codepoints to set the user's codepoints value to.</param>
|
||||
public void SetCodepoints(ulong value)
|
||||
{
|
||||
MakeCall("/API/SetCodepoints/" + value.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API data model for Unite pong highscores.
|
||||
/// </summary>
|
||||
public class PongHighscoreModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Amount of pages in this list.
|
||||
/// </summary>
|
||||
public int Pages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// An array representing the highscores found on the server.
|
||||
/// </summary>
|
||||
public PongHighscore[] Highscores { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API data model for a single Pong highscore.
|
||||
/// </summary>
|
||||
public class PongHighscore
|
||||
{
|
||||
/// <summary>
|
||||
/// The user ID linked to this highscore.
|
||||
/// </summary>
|
||||
public string UserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The highscore's level record.
|
||||
/// </summary>
|
||||
public int Level { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The highscore's codepoint cashout record.
|
||||
/// </summary>
|
||||
public long CodepointsCashout { get; set; }
|
||||
}
|
||||
}
|
37
ShiftOS.Objects/UserConfig.cs
Normal file
37
ShiftOS.Objects/UserConfig.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ShiftOS.Objects
|
||||
{
|
||||
public class UserConfig
|
||||
{
|
||||
public string UniteUrl { get; set; }
|
||||
public string DigitalSocietyAddress { get; set; }
|
||||
public int DigitalSocietyPort { get; set; }
|
||||
|
||||
public static UserConfig Get()
|
||||
{
|
||||
var conf = new UserConfig
|
||||
{
|
||||
UniteUrl = "http://getshiftos.ml",
|
||||
DigitalSocietyAddress = "michaeltheshifter.me",
|
||||
DigitalSocietyPort = 13370
|
||||
};
|
||||
|
||||
if (!File.Exists("servers.json"))
|
||||
{
|
||||
File.WriteAllText("servers.json", JsonConvert.SerializeObject(conf, Formatting.Indented));
|
||||
}
|
||||
else
|
||||
{
|
||||
conf = JsonConvert.DeserializeObject<UserConfig>(File.ReadAllText("servers.json"));
|
||||
}
|
||||
return conf;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -54,17 +54,6 @@ namespace ShiftOS.Server
|
|||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The admin username.
|
||||
/// </summary>
|
||||
public static string AdminUsername = "admin";
|
||||
|
||||
/// <summary>
|
||||
/// The admin password.
|
||||
/// </summary>
|
||||
public static string AdminPassword = "admin";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The server.
|
||||
/// </summary>
|
||||
|
@ -86,16 +75,28 @@ namespace ShiftOS.Server
|
|||
/// <param name="args">The command-line arguments.</param>
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
AppDomain.CurrentDomain.UnhandledException += (o, a) =>
|
||||
{
|
||||
System.Diagnostics.Process.Start("ShiftOS.Server.exe");
|
||||
Environment.Exit(0);
|
||||
};
|
||||
UserConfig.Get();
|
||||
System.Timers.Timer tmr = new System.Timers.Timer(5000);
|
||||
tmr.Elapsed += (o, a) =>
|
||||
{
|
||||
if (server.IsOnline)
|
||||
{
|
||||
server.DispatchAll(new NetObject("heartbeat", new ServerMessage
|
||||
|
||||
try
|
||||
{
|
||||
Name = "heartbeat",
|
||||
GUID = "server"
|
||||
}));
|
||||
server.DispatchAll(new NetObject("heartbeat", new ServerMessage
|
||||
{
|
||||
Name = "heartbeat",
|
||||
GUID = "server"
|
||||
}));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
};
|
||||
if (!Directory.Exists("saves"))
|
||||
|
@ -154,13 +155,7 @@ namespace ShiftOS.Server
|
|||
Console.WriteLine("FUCK. Something HORRIBLE JUST HAPPENED.");
|
||||
};
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += (o, a) =>
|
||||
{
|
||||
if(server.IsOnline == true)
|
||||
server.Stop();
|
||||
System.Diagnostics.Process.Start("ShiftOS.Server.exe");
|
||||
};
|
||||
|
||||
|
||||
server.OnReceived += (o, a) =>
|
||||
{
|
||||
var obj = a.Data.Object;
|
||||
|
@ -207,7 +202,6 @@ namespace ShiftOS.Server
|
|||
task.Wait();
|
||||
*/
|
||||
|
||||
RandomUserGenerator.StartThread();
|
||||
|
||||
while (server.IsOnline)
|
||||
{
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace ShiftOS.Server
|
|||
break;
|
||||
}
|
||||
|
||||
sve.Codepoints = rnd.Next(startCP, maxAmt);
|
||||
sve.Codepoints = (ulong)rnd.Next(startCP, maxAmt);
|
||||
|
||||
//FS treasure generation.
|
||||
/*
|
||||
|
|
|
@ -189,7 +189,7 @@ namespace ShiftOS.Server
|
|||
//Update the shiftos website with the user's codepoints.
|
||||
if (!string.IsNullOrWhiteSpace(sav.UniteAuthToken))
|
||||
{
|
||||
var wreq = WebRequest.Create("http://getshiftos.ml/API/SetCodepoints/" + sav.Codepoints.ToString());
|
||||
var wreq = WebRequest.Create(UserConfig.Get().UniteUrl + "/API/SetCodepoints/" + sav.Codepoints.ToString());
|
||||
wreq.Headers.Add("Authentication: Token " + sav.UniteAuthToken);
|
||||
wreq.GetResponse();
|
||||
}
|
||||
|
@ -207,8 +207,7 @@ namespace ShiftOS.Server
|
|||
{
|
||||
var save = JsonConvert.DeserializeObject<Save>(ReadEncFile(savefile));
|
||||
|
||||
|
||||
if (save.UniteAuthToken==token)
|
||||
if (save.UniteAuthToken == token)
|
||||
{
|
||||
if (save.ID == new Guid())
|
||||
{
|
||||
|
@ -216,6 +215,31 @@ namespace ShiftOS.Server
|
|||
WriteEncFile(savefile, JsonConvert.SerializeObject(save));
|
||||
}
|
||||
|
||||
var wr = HttpWebRequest.Create(UserConfig.Get().UniteUrl + "/API/GetCodepoints");
|
||||
wr.Headers.Add("Authentication: Token " + save.UniteAuthToken);
|
||||
try
|
||||
{
|
||||
using (var resp = wr.GetResponse())
|
||||
{
|
||||
using (var str = resp.GetResponseStream())
|
||||
{
|
||||
using (var reader = new StreamReader(str))
|
||||
{
|
||||
Console.WriteLine("This user has " + reader.ReadToEnd() + " Codepoint(s).");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
|
||||
{
|
||||
Name = "mud_login_denied",
|
||||
GUID = "server"
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
Program.server.DispatchTo(new Guid(guid), new NetObject("mud_savefile", new ServerMessage
|
||||
{
|
||||
|
@ -228,15 +252,11 @@ namespace ShiftOS.Server
|
|||
}
|
||||
catch { }
|
||||
}
|
||||
try
|
||||
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
|
||||
{
|
||||
Program.server.DispatchTo(new Guid(guid), new NetObject("auth_failed", new ServerMessage
|
||||
{
|
||||
Name = "mud_login_denied",
|
||||
GUID = "server"
|
||||
}));
|
||||
}
|
||||
catch { }
|
||||
Name = "mud_login_denied",
|
||||
GUID = "server"
|
||||
}));
|
||||
}
|
||||
|
||||
[MudRequest("delete_save", typeof(ClientSave))]
|
||||
|
@ -268,7 +288,7 @@ namespace ShiftOS.Server
|
|||
{
|
||||
args["username"] = args["username"].ToString().ToLower();
|
||||
string userName = args["username"] as string;
|
||||
long cpAmount = (long)args["amount"];
|
||||
ulong cpAmount = (ulong)args["amount"];
|
||||
|
||||
if (Directory.Exists("saves"))
|
||||
{
|
||||
|
@ -302,7 +322,7 @@ namespace ShiftOS.Server
|
|||
args["username"] = args["username"].ToString().ToLower();
|
||||
string userName = args["username"] as string;
|
||||
string passw = args["password"] as string;
|
||||
int cpAmount = (int)args["amount"];
|
||||
ulong cpAmount = (ulong)args["amount"];
|
||||
|
||||
if (Directory.Exists("saves"))
|
||||
{
|
||||
|
@ -315,7 +335,7 @@ namespace ShiftOS.Server
|
|||
WriteEncFile(saveFile, JsonConvert.SerializeObject(saveFileContents, Formatting.Indented));
|
||||
Program.ClientDispatcher.Broadcast("update_your_cp", new {
|
||||
username = userName,
|
||||
amount = -cpAmount
|
||||
amount = -(long)cpAmount
|
||||
});
|
||||
Program.ClientDispatcher.DispatchTo("update_your_cp", guid, new
|
||||
{
|
||||
|
|
10
ShiftOS.WinForms/Applications/About.Designer.cs
generated
10
ShiftOS.WinForms/Applications/About.Designer.cs
generated
|
@ -55,7 +55,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.lbshiftit = new System.Windows.Forms.Label();
|
||||
this.lbaboutdesc = new System.Windows.Forms.Label();
|
||||
this.lbaboutdesc = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -94,11 +94,11 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.lbaboutdesc.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.lbaboutdesc.Location = new System.Drawing.Point(14, 126);
|
||||
this.lbaboutdesc.Location = new System.Drawing.Point(23, 158);
|
||||
this.lbaboutdesc.Multiline = true;
|
||||
this.lbaboutdesc.Name = "lbaboutdesc";
|
||||
this.lbaboutdesc.Size = new System.Drawing.Size(498, 328);
|
||||
this.lbaboutdesc.Size = new System.Drawing.Size(492, 302);
|
||||
this.lbaboutdesc.TabIndex = 3;
|
||||
this.lbaboutdesc.Text = "label2";
|
||||
//
|
||||
// About
|
||||
//
|
||||
|
@ -121,6 +121,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label lbshiftit;
|
||||
private System.Windows.Forms.Label lbaboutdesc;
|
||||
private System.Windows.Forms.TextBox lbaboutdesc;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,18 +53,73 @@ namespace ShiftOS.WinForms.Applications
|
|||
lbaboutdesc.Text = $@"ShiftOS
|
||||
Copyright (c) 2015-{DateTime.Now.Year} Michael VanOverbeek and ShiftOS devs
|
||||
|
||||
Engine version: Milestone 3, 1.0 Beta Series (Developer mode ON)
|
||||
Frontend version: 1.0 Beta 1.2
|
||||
Multi-user domain version: 1.0 Rolling-Release
|
||||
|
||||
Music courtesy of Selulance. Listen to the Fractal Forest album here:
|
||||
https://www.youtube.com/watch?v=LB5jAYDL3VU&t=913s
|
||||
Engine version: Milestone 4, 1.0 Beta Series (Developer mode ON)
|
||||
Frontend version: 1.0 Beta 2.5
|
||||
Digital Society version: 1.0 Rolling-Release
|
||||
Project: Unite version: 1.0 Beta 1.7
|
||||
|
||||
Special thanks to Philip Adams, the original creator of ShiftOS for helping us grow our community of amazing Shifters by featuring us on the YouTube Millionaire series and advertising us throughout various other series ran by him.
|
||||
|
||||
Also, thanks to Rylan Arbour, Victor Tran and the other community moderators and administrators for helping us keep the community peaceful.
|
||||
|
||||
Lastly, a huge special thanks to the community themselves - for testing, debugging, fixing, reporting bugs for, and enjoying our game even through its many failures, successes, revamps, etc. You guys are the reason we develop the game!";
|
||||
Lastly, a huge special thanks to the community themselves - for testing, debugging, fixing, reporting bugs for, and enjoying our game even through its many failures, successes, revamps, etc. You guys are the reason we develop the game!
|
||||
|
||||
=== Licensing information
|
||||
|
||||
ShiftOS is licensed under the MIT license.
|
||||
|
||||
Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the ""Software""), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
== Credit where credit is due
|
||||
|
||||
-- Development and staff team:
|
||||
- Rylan Arbour (Lead community administrator)
|
||||
- Victor Tran (Discord administrator)
|
||||
- cjhannah (ShiftFS backend developer)
|
||||
- AShifter (Project: Unite penetration tester)
|
||||
- arencllc (ShiftLetters developer)
|
||||
- Michael VanOverbeek (Lead developer, system administrator, the guy who wrote this text)
|
||||
- fixylol, Nebble, TravisNC, Neptune (Community moderators)
|
||||
- bandic00t_ (Skin Engine stresstesting)
|
||||
|
||||
-- System audio
|
||||
|
||||
- Default system event sounds (Infobox, Network Connecting, System Beeps) are from the original ShiftOS 0.0.x source code.
|
||||
- Ambient music list courtesy of https://www.youtube.com/channel/UC56Qctnsu8wAyvzf4Yx6LIw (ArgoFox | Royalty Free Music)
|
||||
|
||||
Tracklist:
|
||||
|
||||
Dylan Hardy - Strangely Unaffected
|
||||
Noxive - Home
|
||||
Dylan Hardy and Abraham Alberto - Slow Drift
|
||||
A Himitsu - Easier To Fade
|
||||
Noxive - Resilience
|
||||
Wanderflux - Visions
|
||||
Aerocity - Cold Weather Kids
|
||||
Aether - Wanderlust
|
||||
Aerocity - Love Lost
|
||||
|
||||
|
||||
Finally, special thanks to our Patreon supporters. Without you guys, our servers wouldn't be running, and you wouldn't be reading this.";
|
||||
}
|
||||
|
||||
public string GetEngineVersion()
|
||||
|
@ -107,7 +162,7 @@ Lastly, a huge special thanks to the community themselves - for testing, debuggi
|
|||
|
||||
public bool OnUnload()
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
|
|
|
@ -141,12 +141,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// pgplaytime
|
||||
//
|
||||
this.pgplaytime.BlockSize = 5;
|
||||
this.pgplaytime.Location = new System.Drawing.Point(46, 3);
|
||||
this.pgplaytime.Maximum = 100;
|
||||
this.pgplaytime.Name = "pgplaytime";
|
||||
this.pgplaytime.Size = new System.Drawing.Size(749, 23);
|
||||
this.pgplaytime.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pgplaytime.TabIndex = 1;
|
||||
this.pgplaytime.Tag = "keepbg";
|
||||
this.pgplaytime.Text = "shiftedProgressBar1";
|
||||
|
|
97
ShiftOS.WinForms/Applications/Chat.Designer.cs
generated
97
ShiftOS.WinForms/Applications/Chat.Designer.cs
generated
|
@ -54,6 +54,13 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Chat));
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.pnlstart = new System.Windows.Forms.Panel();
|
||||
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.txtchatid = new System.Windows.Forms.TextBox();
|
||||
this.btnjoin = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.rtbchat = new System.Windows.Forms.RichTextBox();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.tschatid = new System.Windows.Forms.ToolStripLabel();
|
||||
|
@ -62,12 +69,15 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.txtuserinput = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.btnsend = new System.Windows.Forms.ToolStripButton();
|
||||
this.panel1.SuspendLayout();
|
||||
this.pnlstart.SuspendLayout();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.tsbottombar.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.pnlstart);
|
||||
this.panel1.Controls.Add(this.rtbchat);
|
||||
this.panel1.Controls.Add(this.toolStrip1);
|
||||
this.panel1.Controls.Add(this.tsbottombar);
|
||||
|
@ -77,6 +87,82 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.panel1.Size = new System.Drawing.Size(633, 318);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// pnlstart
|
||||
//
|
||||
this.pnlstart.Controls.Add(this.flowLayoutPanel1);
|
||||
this.pnlstart.Controls.Add(this.label3);
|
||||
this.pnlstart.Controls.Add(this.label2);
|
||||
this.pnlstart.Controls.Add(this.label1);
|
||||
this.pnlstart.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlstart.Location = new System.Drawing.Point(0, 25);
|
||||
this.pnlstart.Name = "pnlstart";
|
||||
this.pnlstart.Size = new System.Drawing.Size(633, 268);
|
||||
this.pnlstart.TabIndex = 4;
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flowLayoutPanel1.Controls.Add(this.txtchatid);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnjoin);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 118);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(633, 29);
|
||||
this.flowLayoutPanel1.TabIndex = 3;
|
||||
//
|
||||
// txtchatid
|
||||
//
|
||||
this.txtchatid.Location = new System.Drawing.Point(3, 3);
|
||||
this.txtchatid.Name = "txtchatid";
|
||||
this.txtchatid.Size = new System.Drawing.Size(192, 20);
|
||||
this.txtchatid.TabIndex = 0;
|
||||
//
|
||||
// btnjoin
|
||||
//
|
||||
this.btnjoin.Location = new System.Drawing.Point(201, 3);
|
||||
this.btnjoin.Name = "btnjoin";
|
||||
this.btnjoin.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnjoin.TabIndex = 1;
|
||||
this.btnjoin.Text = "Join";
|
||||
this.btnjoin.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label3.Location = new System.Drawing.Point(0, 85);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.label3.Size = new System.Drawing.Size(79, 33);
|
||||
this.label3.TabIndex = 2;
|
||||
this.label3.Tag = "header3";
|
||||
this.label3.Text = "Join a chat";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label2.Location = new System.Drawing.Point(0, 33);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.label2.Size = new System.Drawing.Size(633, 52);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "SimpleSRC is a simple chat program that utilises the ShiftOS Relay Chat protocol." +
|
||||
" All you have to do is enter a chat code or system name, and SimpleSRC will try " +
|
||||
"to initiate a chat for you.";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.label1.Size = new System.Drawing.Size(143, 33);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Tag = "header1";
|
||||
this.label1.Text = "Welcome to SimpleSRC!";
|
||||
//
|
||||
// rtbchat
|
||||
//
|
||||
this.rtbchat.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
|
@ -150,6 +236,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.Size = new System.Drawing.Size(633, 318);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.pnlstart.ResumeLayout(false);
|
||||
this.pnlstart.PerformLayout();
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.tsbottombar.ResumeLayout(false);
|
||||
|
@ -168,5 +258,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
private System.Windows.Forms.ToolStrip tsbottombar;
|
||||
private System.Windows.Forms.ToolStripTextBox txtuserinput;
|
||||
private System.Windows.Forms.ToolStripButton btnsend;
|
||||
private System.Windows.Forms.Panel pnlstart;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.TextBox txtchatid;
|
||||
private System.Windows.Forms.Button btnjoin;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,75 +33,27 @@ using System.Threading.Tasks;
|
|||
using System.Windows.Forms;
|
||||
using Newtonsoft.Json;
|
||||
using ShiftOS.Engine;
|
||||
using System.Threading;
|
||||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
[MultiplayerOnly]
|
||||
[WinOpen("simplesrc")]
|
||||
[Launcher("SimpleSRC Client", false, null, "Networking")]
|
||||
[DefaultTitle("SimpleSRC Client")]
|
||||
[AppscapeEntry("SimpleSRC", "A simple ShiftOS Relay Chat client that allows you to talk with other ShiftOS users from all over the world.", 300, 145, "file_skimmer", "Networking")]
|
||||
public partial class Chat : UserControl, IShiftOSWindow
|
||||
{
|
||||
public Chat(string chatId)
|
||||
public Chat()
|
||||
{
|
||||
InitializeComponent();
|
||||
id = chatId;
|
||||
ServerManager.MessageReceived += (msg) =>
|
||||
{
|
||||
if (msg.Name == "chat_msgreceived")
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var args = JsonConvert.DeserializeObject<Dictionary<string, string>>(msg.Contents);
|
||||
var cmsg = new ShiftOS.Objects.ChatMessage(args["Username"] as string, args["SystemName"] as string, args["Message"] as string, args["Channel"] as string);
|
||||
if (id == cmsg.Channel)
|
||||
rtbchat.AppendText($"[{cmsg.Username}@{cmsg.SystemName}]: {cmsg.Message}{Environment.NewLine}");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
rtbchat.AppendText($"[system@multiuserdomain] Exception thrown by client: {ex}");
|
||||
}
|
||||
}));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
else if(msg.Name == "chatlog")
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
rtbchat.AppendText(msg.Contents);
|
||||
}));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void SendMessage(string msg)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(msg))
|
||||
{
|
||||
rtbchat.AppendText($"[{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}] {msg}{Environment.NewLine}");
|
||||
|
||||
ServerManager.SendMessage("chat_send", JsonConvert.SerializeObject(new ShiftOS.Objects.ChatMessage(SaveSystem.CurrentSave.Username, SaveSystem.CurrentSave.SystemName, msg, id)));
|
||||
}
|
||||
else
|
||||
{
|
||||
rtbchat.AppendText($"[sys@multiuserdomain] You can't send blank messages. (only you can see this)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string id = "";
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
ServerManager.SendMessage("chat_getlog", JsonConvert.SerializeObject(new ShiftOS.Objects.ChatLogRequest(id, 50)));
|
||||
|
||||
SendMessage("User has joined the chat.");
|
||||
AllInstances.Add(this);
|
||||
if (!string.IsNullOrWhiteSpace(ChatID))
|
||||
pnlstart.SendToBack();
|
||||
RefreshUserInput();
|
||||
}
|
||||
|
||||
|
@ -112,8 +64,8 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public bool OnUnload()
|
||||
{
|
||||
SendMessage("User has left the chat.");
|
||||
id = null;
|
||||
AllInstances.Remove(this);
|
||||
ChatID = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -146,15 +98,102 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
rtbchat.SelectionStart = rtbchat.Text.Length;
|
||||
rtbchat.ScrollToCaret();
|
||||
tschatid.Text = id;
|
||||
tsuserdata.Text = $"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}";
|
||||
tschatid.Text = ChatID;
|
||||
AppearanceManager.SetWindowTitle(this, tschatid.Text + " - SimpleSRC Client");
|
||||
tsuserdata.Text = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}";
|
||||
RefreshUserInput();
|
||||
}
|
||||
|
||||
public static readonly List<Chat> AllInstances = new List<Chat>();
|
||||
|
||||
public static void SendMessage(string user, string destination, string msg)
|
||||
{
|
||||
foreach(var chat in AllInstances)
|
||||
{
|
||||
chat.PostMessage(user, destination, msg);
|
||||
}
|
||||
}
|
||||
|
||||
public string ChatID = "";
|
||||
|
||||
public void PostMessage(string user, string destination, string message)
|
||||
{
|
||||
if (ChatID == destination)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
rtbchat.SelectionFont = new Font(rtbchat.Font, FontStyle.Bold);
|
||||
rtbchat.AppendText($"[{user}] ");
|
||||
rtbchat.SelectionFont = rtbchat.Font;
|
||||
rtbchat.AppendText(message);
|
||||
rtbchat.AppendText(Environment.NewLine + Environment.NewLine);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private void btnsend_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendMessage(txtuserinput.Text);
|
||||
//Update ALL chat windows with this message if they're connected to this chat.
|
||||
SendMessage($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}", ChatID, txtuserinput.Text);
|
||||
txtuserinput.Text = "";
|
||||
}
|
||||
|
||||
[Story("story_thefennfamily")]
|
||||
public static void Story_TheFennFamily()
|
||||
{
|
||||
bool complete = false;
|
||||
Infobox.Show("SimpleSRC", "A direct message has been sent to you on SimpleSRC from user \"maureenfenn@trisys\".", () =>
|
||||
{
|
||||
string ch = "maureenfenn@trisys";
|
||||
var c = new Chat();
|
||||
c.ChatID = ch;
|
||||
AppearanceManager.SetupWindow(c);
|
||||
string you = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}";
|
||||
|
||||
var t = new Thread(() =>
|
||||
{
|
||||
SendMessage(you, ch, "User has joined the chat.");
|
||||
Thread.Sleep(2000);
|
||||
SendMessage(ch, ch, "Hello, " + you + ". My name is Maureen. Maureen Fenn.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "I am the author of the various Tri applications you may see on Appscape.");
|
||||
Thread.Sleep(2000);
|
||||
SendMessage(ch, ch, "I need your help with something...");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "Firstly, a little backstory. There was a time in ShiftOS when none of us were connected.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "There wasn't a Digital Society, we didn't have chat applications or anything...");
|
||||
Thread.Sleep(2000);
|
||||
SendMessage(ch, ch, "All we had was the Shiftnet.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "However, in 2016, something happened called the \"connected revolution\". It was like, the invention of the Internet - it was huge for the world of ShiftOS.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "Before this, the only way you could earn Codepoints was through playing games in ShiftOS.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "I was the one who coded those games, and I would put them on a Shiftnet website that you can still access today, shiftnet/main/shiftgames.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "But when the Connected Revolution took place, things got difficult. My son, Nalyr Fenn, was born, and people stopped using my software and instead moved on to hacking eachother and stealing peoples' Codepoints.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "When Nalyr's sentience levels reached near human - i.e, he grew up, we decided to start TriOffice. It was a huge success, thanks to Aiden Nirh, the guy who runs Appscape.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "However... a few months ago he cut contact with us and we stopped receiving Codepoints from TriOffice.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "I'm running low - I can't afford to keep my system running much longer. You have to help!");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "Perhaps, you could breach Aiden's server and look for clues as to why he's against us? I'll reward you with the last Codepoints I have.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(you, ch, "Alright, I'm in - but I don't know where to begin...");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "A little birdie tells me you know about the RTS exploits going around... Try using that on Aiden's server. You can find his systemname on Appscape under \"Contact Us.\" He has a mailserver on Appscape - and also has RTS on the same server.");
|
||||
Thread.Sleep(2500);
|
||||
SendMessage(ch, ch, "Good luck... My life depends on you!");
|
||||
complete = true;
|
||||
});
|
||||
t.IsBackground = true;
|
||||
t.Start();
|
||||
});
|
||||
while (!complete)
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,6 +123,12 @@
|
|||
<metadata name="tsbottombar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>122, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="tsbottombar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>122, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="btnsend.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
|
|
@ -70,9 +70,9 @@ namespace ShiftOS.WinForms.Applications
|
|||
// lvitems
|
||||
//
|
||||
this.lvitems.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lvitems.Location = new System.Drawing.Point(0, 0);
|
||||
this.lvitems.Location = new System.Drawing.Point(149, 0);
|
||||
this.lvitems.Name = "lvitems";
|
||||
this.lvitems.Size = new System.Drawing.Size(634, 332);
|
||||
this.lvitems.Size = new System.Drawing.Size(485, 332);
|
||||
this.lvitems.TabIndex = 0;
|
||||
this.lvitems.UseCompatibleStateImageBehavior = false;
|
||||
this.lvitems.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lvitems_ItemSelectionChanged);
|
||||
|
@ -81,8 +81,8 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.pinnedItems);
|
||||
this.panel1.Controls.Add(this.lvitems);
|
||||
this.panel1.Controls.Add(this.pinnedItems);
|
||||
this.panel1.Controls.Add(this.lbcurrentfolder);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 24);
|
||||
|
@ -92,10 +92,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// pinnedItems
|
||||
//
|
||||
this.pinnedItems.Location = new System.Drawing.Point(437, 208);
|
||||
this.pinnedItems.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.pinnedItems.Location = new System.Drawing.Point(0, 0);
|
||||
this.pinnedItems.Name = "pinnedItems";
|
||||
this.pinnedItems.Size = new System.Drawing.Size(197, 124);
|
||||
this.pinnedItems.Size = new System.Drawing.Size(149, 332);
|
||||
this.pinnedItems.TabIndex = 3;
|
||||
this.pinnedItems.Click += new System.EventHandler(this.pinnedItems_Click);
|
||||
//
|
||||
// lbcurrentfolder
|
||||
//
|
||||
|
|
|
@ -35,6 +35,7 @@ using System.Windows.Forms;
|
|||
|
||||
using static ShiftOS.Objects.ShiftFS.Utils;
|
||||
using ShiftOS.Engine;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
|
@ -128,8 +129,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
int amountsCalled = -1;
|
||||
amountsCalled = amountsCalled + 1;
|
||||
pinnedItems.Nodes.Add(path);
|
||||
pinnedItems.Nodes[amountsCalled].Nodes.Add("test");
|
||||
List<string> Pinned = new List<string>();
|
||||
if(FileExists(Paths.GetPath("data") + "/pinned_items.dat"))
|
||||
{
|
||||
Pinned = JsonConvert.DeserializeObject<List<string>>(ReadAllText(Paths.GetPath("data") + "/pinned_items.dat"));
|
||||
}
|
||||
Pinned.Add(path);
|
||||
WriteAllText(Paths.GetPath("data") + "/pinned_items.dat", JsonConvert.SerializeObject(Pinned));
|
||||
ResetList();
|
||||
}
|
||||
|
||||
public void ChangeDirectory(string path)
|
||||
|
@ -152,8 +159,40 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
}
|
||||
|
||||
public void PopulatePinned(TreeNode node, string[] items)
|
||||
{
|
||||
foreach(var dir in items)
|
||||
{
|
||||
var treenode = new TreeNode();
|
||||
if (DirectoryExists(dir))
|
||||
{
|
||||
var dinf = GetDirectoryInfo(dir);
|
||||
treenode.Text = dinf.Name;
|
||||
}
|
||||
else if (FileExists(dir))
|
||||
{
|
||||
var finf = GetFileInfo(dir);
|
||||
treenode.Text = finf.Name;
|
||||
}
|
||||
treenode.Tag = dir;
|
||||
node.Nodes.Add(treenode);
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetList()
|
||||
{
|
||||
pinnedItems.Nodes.Clear();
|
||||
List<string> Pinned = new List<string>();
|
||||
if(FileExists(Paths.GetPath("data") + "/pinned_items.dat"))
|
||||
{
|
||||
Pinned = JsonConvert.DeserializeObject<List<string>>(ReadAllText(Paths.GetPath("data") + "/pinned_items.dat"));
|
||||
}
|
||||
var node = new TreeNode();
|
||||
node.Text = "Pinned";
|
||||
PopulatePinned(node, Pinned.ToArray());
|
||||
pinnedItems.Nodes.Add(node);
|
||||
node.ExpandAll();
|
||||
|
||||
if(lvitems.LargeImageList == null)
|
||||
{
|
||||
lvitems.LargeImageList = new ImageList();
|
||||
|
@ -437,5 +476,26 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void pinnedItems_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (pinnedItems.SelectedNode != null)
|
||||
{
|
||||
string path = pinnedItems.SelectedNode.Tag.ToString();
|
||||
if (DirectoryExists(path))
|
||||
{
|
||||
currentdir = path;
|
||||
ResetList();
|
||||
}
|
||||
else if (FileExists(path))
|
||||
{
|
||||
FileSkimmerBackend.OpenFile(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,12 +86,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.pgcontents.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pgcontents.Location = new System.Drawing.Point(0, 0);
|
||||
this.pgcontents.Name = "pgcontents";
|
||||
this.pgcontents.Size = new System.Drawing.Size(390, 383);
|
||||
this.pgcontents.Size = new System.Drawing.Size(487, 383);
|
||||
this.pgcontents.TabIndex = 20;
|
||||
//
|
||||
// btncancel
|
||||
//
|
||||
this.btncancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btncancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btncancel.Location = new System.Drawing.Point(21, 335);
|
||||
this.btncancel.Name = "btncancel";
|
||||
this.btncancel.Size = new System.Drawing.Size(109, 32);
|
||||
|
@ -102,10 +102,11 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// btnreset
|
||||
//
|
||||
this.btnreset.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnreset.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnreset.Location = new System.Drawing.Point(136, 335);
|
||||
this.btnreset.Name = "btnreset";
|
||||
this.btnreset.Size = new System.Drawing.Size(109, 32);
|
||||
this.btnreset.Size = new System.Drawing.Size(206, 32);
|
||||
this.btnreset.TabIndex = 22;
|
||||
this.btnreset.Text = "Reset";
|
||||
this.btnreset.UseVisualStyleBackColor = true;
|
||||
|
@ -113,8 +114,8 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// btnapply
|
||||
//
|
||||
this.btnapply.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
this.btnapply.Location = new System.Drawing.Point(251, 335);
|
||||
this.btnapply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnapply.Location = new System.Drawing.Point(348, 335);
|
||||
this.btnapply.Name = "btnapply";
|
||||
this.btnapply.Size = new System.Drawing.Size(118, 32);
|
||||
this.btnapply.TabIndex = 21;
|
||||
|
@ -124,19 +125,21 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// Label2
|
||||
//
|
||||
this.Label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.Label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.Label2.Font = new System.Drawing.Font("Arial", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.Label2.Location = new System.Drawing.Point(125, 260);
|
||||
this.Label2.Name = "Label2";
|
||||
this.Label2.Size = new System.Drawing.Size(163, 28);
|
||||
this.Label2.Size = new System.Drawing.Size(260, 28);
|
||||
this.Label2.TabIndex = 12;
|
||||
this.Label2.Tag = "header3";
|
||||
this.Label2.Text = "Idle";
|
||||
this.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// btnidlebrowse
|
||||
//
|
||||
this.btnidlebrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnidlebrowse.Location = new System.Drawing.Point(295, 260);
|
||||
this.btnidlebrowse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnidlebrowse.Location = new System.Drawing.Point(392, 260);
|
||||
this.btnidlebrowse.Name = "btnidlebrowse";
|
||||
this.btnidlebrowse.Size = new System.Drawing.Size(73, 60);
|
||||
this.btnidlebrowse.TabIndex = 10;
|
||||
|
@ -146,14 +149,15 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// txtidlefile
|
||||
//
|
||||
this.txtidlefile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.txtidlefile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtidlefile.BackColor = System.Drawing.Color.White;
|
||||
this.txtidlefile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtidlefile.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.txtidlefile.Location = new System.Drawing.Point(125, 291);
|
||||
this.txtidlefile.Multiline = true;
|
||||
this.txtidlefile.Name = "txtidlefile";
|
||||
this.txtidlefile.Size = new System.Drawing.Size(163, 29);
|
||||
this.txtidlefile.Size = new System.Drawing.Size(260, 29);
|
||||
this.txtidlefile.TabIndex = 9;
|
||||
this.txtidlefile.Text = "None";
|
||||
this.txtidlefile.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
|
@ -172,9 +176,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// btnzoom
|
||||
//
|
||||
this.btnzoom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnzoom.FlatAppearance.BorderColor = System.Drawing.Color.Black;
|
||||
this.btnzoom.FlatAppearance.BorderSize = 0;
|
||||
this.btnzoom.Location = new System.Drawing.Point(286, 144);
|
||||
this.btnzoom.Location = new System.Drawing.Point(383, 144);
|
||||
this.btnzoom.Name = "btnzoom";
|
||||
this.btnzoom.Size = new System.Drawing.Size(82, 65);
|
||||
this.btnzoom.TabIndex = 7;
|
||||
|
@ -184,9 +189,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// btnstretch
|
||||
//
|
||||
this.btnstretch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnstretch.FlatAppearance.BorderColor = System.Drawing.Color.Black;
|
||||
this.btnstretch.FlatAppearance.BorderSize = 0;
|
||||
this.btnstretch.Location = new System.Drawing.Point(197, 144);
|
||||
this.btnstretch.Location = new System.Drawing.Point(294, 144);
|
||||
this.btnstretch.Name = "btnstretch";
|
||||
this.btnstretch.Size = new System.Drawing.Size(82, 65);
|
||||
this.btnstretch.TabIndex = 6;
|
||||
|
@ -228,6 +234,9 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// picgraphic
|
||||
//
|
||||
this.picgraphic.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.picgraphic.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
|
||||
this.picgraphic.Location = new System.Drawing.Point(0, 0);
|
||||
this.picgraphic.Name = "picgraphic";
|
||||
|
@ -237,11 +246,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
// lblobjecttoskin
|
||||
//
|
||||
this.lblobjecttoskin.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.lblobjecttoskin.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblobjecttoskin.Location = new System.Drawing.Point(19, 9);
|
||||
this.lblobjecttoskin.Name = "lblobjecttoskin";
|
||||
this.lblobjecttoskin.Size = new System.Drawing.Size(350, 23);
|
||||
this.lblobjecttoskin.Size = new System.Drawing.Size(447, 23);
|
||||
this.lblobjecttoskin.TabIndex = 2;
|
||||
this.lblobjecttoskin.Tag = "header1";
|
||||
this.lblobjecttoskin.Text = "Close Button";
|
||||
this.lblobjecttoskin.TextAlign = System.Drawing.ContentAlignment.TopCenter;
|
||||
//
|
||||
|
@ -249,10 +261,9 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(390, 383);
|
||||
this.Controls.Add(this.pgcontents);
|
||||
this.Name = "GraphicPicker";
|
||||
this.Text = "{GRAPHIC_PICKER_NAME}";
|
||||
this.Size = new System.Drawing.Size(487, 383);
|
||||
this.Load += new System.EventHandler(this.Graphic_Picker_Load);
|
||||
this.pgcontents.ResumeLayout(false);
|
||||
this.pgcontents.PerformLayout();
|
||||
|
|
|
@ -45,6 +45,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
InitializeComponent();
|
||||
SelectedLayout = layout;
|
||||
Image = old;
|
||||
using(var ms = new System.IO.MemoryStream())
|
||||
{
|
||||
Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
|
||||
ImageAsBinary = ms.ToArray();
|
||||
}
|
||||
Callback = cb;
|
||||
lblobjecttoskin.Text = name;
|
||||
|
||||
|
@ -123,10 +129,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public void OnLoad()
|
||||
{
|
||||
Setup();
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
Setup();
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
|
@ -136,6 +144,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
Setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
163
ShiftOS.WinForms/Applications/IconManager.Designer.cs
generated
Normal file
163
ShiftOS.WinForms/Applications/IconManager.Designer.cs
generated
Normal file
|
@ -0,0 +1,163 @@
|
|||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
partial class IconManager
|
||||
{
|
||||
/// <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.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnclose = new System.Windows.Forms.Button();
|
||||
this.btnreset = new System.Windows.Forms.Button();
|
||||
this.btnapply = new System.Windows.Forms.Button();
|
||||
this.flbody = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.lbcurrentpage = new System.Windows.Forms.Label();
|
||||
this.btnprev = new System.Windows.Forms.Button();
|
||||
this.btnnext = new System.Windows.Forms.Button();
|
||||
this.flowLayoutPanel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
this.flowLayoutPanel1.AutoSize = true;
|
||||
this.flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnclose);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnreset);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnapply);
|
||||
this.flowLayoutPanel1.Controls.Add(this.lbcurrentpage);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnprev);
|
||||
this.flowLayoutPanel1.Controls.Add(this.btnnext);
|
||||
this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 416);
|
||||
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
this.flowLayoutPanel1.Size = new System.Drawing.Size(393, 29);
|
||||
this.flowLayoutPanel1.TabIndex = 0;
|
||||
//
|
||||
// btnclose
|
||||
//
|
||||
this.btnclose.AutoSize = true;
|
||||
this.btnclose.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnclose.Location = new System.Drawing.Point(3, 3);
|
||||
this.btnclose.Name = "btnclose";
|
||||
this.btnclose.Size = new System.Drawing.Size(43, 23);
|
||||
this.btnclose.TabIndex = 0;
|
||||
this.btnclose.Text = "Close";
|
||||
this.btnclose.UseVisualStyleBackColor = true;
|
||||
this.btnclose.Click += new System.EventHandler(this.btnclose_Click);
|
||||
//
|
||||
// btnreset
|
||||
//
|
||||
this.btnreset.AutoSize = true;
|
||||
this.btnreset.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnreset.Location = new System.Drawing.Point(52, 3);
|
||||
this.btnreset.Name = "btnreset";
|
||||
this.btnreset.Size = new System.Drawing.Size(45, 23);
|
||||
this.btnreset.TabIndex = 1;
|
||||
this.btnreset.Text = "Reset";
|
||||
this.btnreset.UseVisualStyleBackColor = true;
|
||||
this.btnreset.Click += new System.EventHandler(this.btnreset_Click);
|
||||
//
|
||||
// btnapply
|
||||
//
|
||||
this.btnapply.AutoSize = true;
|
||||
this.btnapply.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnapply.Location = new System.Drawing.Point(103, 3);
|
||||
this.btnapply.Name = "btnapply";
|
||||
this.btnapply.Size = new System.Drawing.Size(43, 23);
|
||||
this.btnapply.TabIndex = 2;
|
||||
this.btnapply.Text = "Apply";
|
||||
this.btnapply.UseVisualStyleBackColor = true;
|
||||
this.btnapply.Click += new System.EventHandler(this.btnapply_Click);
|
||||
//
|
||||
// flbody
|
||||
//
|
||||
this.flbody.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.flbody.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.flbody.Location = new System.Drawing.Point(0, 0);
|
||||
this.flbody.Name = "flbody";
|
||||
this.flbody.Size = new System.Drawing.Size(393, 416);
|
||||
this.flbody.TabIndex = 1;
|
||||
this.flbody.WrapContents = false;
|
||||
//
|
||||
// lbcurrentpage
|
||||
//
|
||||
this.lbcurrentpage.AutoSize = true;
|
||||
this.lbcurrentpage.Location = new System.Drawing.Point(152, 0);
|
||||
this.lbcurrentpage.Name = "lbcurrentpage";
|
||||
this.lbcurrentpage.Size = new System.Drawing.Size(71, 13);
|
||||
this.lbcurrentpage.TabIndex = 3;
|
||||
this.lbcurrentpage.Text = "Current page:";
|
||||
//
|
||||
// btnprev
|
||||
//
|
||||
this.btnprev.AutoSize = true;
|
||||
this.btnprev.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnprev.Location = new System.Drawing.Point(229, 3);
|
||||
this.btnprev.Name = "btnprev";
|
||||
this.btnprev.Size = new System.Drawing.Size(51, 23);
|
||||
this.btnprev.TabIndex = 4;
|
||||
this.btnprev.Text = " < Prev";
|
||||
this.btnprev.UseVisualStyleBackColor = true;
|
||||
this.btnprev.Click += new System.EventHandler(this.btnprev_Click);
|
||||
//
|
||||
// btnnext
|
||||
//
|
||||
this.btnnext.AutoSize = true;
|
||||
this.btnnext.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnnext.Location = new System.Drawing.Point(286, 3);
|
||||
this.btnnext.Name = "btnnext";
|
||||
this.btnnext.Size = new System.Drawing.Size(48, 23);
|
||||
this.btnnext.TabIndex = 5;
|
||||
this.btnnext.Text = "Next >";
|
||||
this.btnnext.UseVisualStyleBackColor = true;
|
||||
this.btnnext.Click += new System.EventHandler(this.btnnext_Click);
|
||||
//
|
||||
// IconManager
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.flbody);
|
||||
this.Controls.Add(this.flowLayoutPanel1);
|
||||
this.Name = "IconManager";
|
||||
this.Size = new System.Drawing.Size(393, 445);
|
||||
this.flowLayoutPanel1.ResumeLayout(false);
|
||||
this.flowLayoutPanel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
|
||||
private System.Windows.Forms.Button btnclose;
|
||||
private System.Windows.Forms.Button btnreset;
|
||||
private System.Windows.Forms.Button btnapply;
|
||||
private System.Windows.Forms.FlowLayoutPanel flbody;
|
||||
private System.Windows.Forms.Label lbcurrentpage;
|
||||
private System.Windows.Forms.Button btnprev;
|
||||
private System.Windows.Forms.Button btnnext;
|
||||
}
|
||||
}
|
244
ShiftOS.WinForms/Applications/IconManager.cs
Normal file
244
ShiftOS.WinForms/Applications/IconManager.cs
Normal file
|
@ -0,0 +1,244 @@
|
|||
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;
|
||||
using ShiftOS.Engine;
|
||||
using System.Reflection;
|
||||
using ShiftOS.WinForms.Tools;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
[RequiresUpgrade("icon_manager")]
|
||||
[Launcher("Icon Manager", true, "al_icon_manager", "Customization")]
|
||||
[DefaultTitle("Icon Manager")]
|
||||
[DefaultIcon("iconIconManager")]
|
||||
public partial class IconManager : UserControl, IShiftOSWindow
|
||||
{
|
||||
public IconManager()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
LoadIconsFromEngine();
|
||||
SetupUI();
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
LoadIconsFromEngine();
|
||||
SetupUI();
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
{
|
||||
Icons = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
private Dictionary<string, byte[]> Icons = null;
|
||||
|
||||
private const int pageSize = 10;
|
||||
private int currentPage = 0;
|
||||
private int pageCount = 0;
|
||||
|
||||
public Image GetIcon(string id)
|
||||
{
|
||||
if (!Icons.ContainsKey(id))
|
||||
Icons.Add(id, null);
|
||||
|
||||
if (Icons[id] == null)
|
||||
{
|
||||
var img = SkinEngine.GetDefaultIcon(id);
|
||||
using (var mstr = new System.IO.MemoryStream())
|
||||
{
|
||||
img.Save(mstr, System.Drawing.Imaging.ImageFormat.Png);
|
||||
Icons[id] = mstr.ToArray();
|
||||
}
|
||||
return img;
|
||||
}
|
||||
else
|
||||
{
|
||||
using (var sr = new System.IO.MemoryStream(Icons[id]))
|
||||
{
|
||||
return Image.FromStream(sr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIcon(string key, byte[] raw)
|
||||
{
|
||||
if (!Icons.ContainsKey(key))
|
||||
Icons.Add(key, raw);
|
||||
Icons[key] = raw;
|
||||
}
|
||||
|
||||
public void LoadIconsFromEngine()
|
||||
{
|
||||
//We have to serialize the engine icon list to JSON to break references with the data.
|
||||
string json = JsonConvert.SerializeObject(SkinEngine.LoadedSkin.AppIcons);
|
||||
//And deserialize to the local instance...essentially making a clone.
|
||||
Icons = JsonConvert.DeserializeObject<Dictionary<string, byte[]>>(json);
|
||||
}
|
||||
|
||||
public void SetupUI()
|
||||
{
|
||||
flbody.Controls.Clear(); //Clear the icon list.
|
||||
|
||||
List<Type> types = new List<Type>();
|
||||
|
||||
foreach(var exe in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
|
||||
{
|
||||
if(exe.ToLower().EndsWith(".exe") || exe.ToLower().EndsWith(".dll"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var asm = Assembly.LoadFile(exe);
|
||||
|
||||
var typeList = asm.GetTypes().Where(x => x.GetCustomAttributes(false).FirstOrDefault(y => y is DefaultIconAttribute) != null);
|
||||
types.AddRange(typeList);
|
||||
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
pageCount = types.ToArray().GetPageCount(pageSize);
|
||||
|
||||
foreach (var type in types.ToArray().GetItemsOnPage(currentPage, pageSize))
|
||||
{
|
||||
if (Shiftorium.UpgradeAttributesUnlocked(type))
|
||||
{
|
||||
var pnl = new Panel();
|
||||
pnl.Height = 30;
|
||||
pnl.Width = flbody.Width - 15;
|
||||
flbody.Controls.Add(pnl);
|
||||
pnl.Show();
|
||||
var pic = new PictureBox();
|
||||
pic.SizeMode = PictureBoxSizeMode.StretchImage;
|
||||
pic.Size = new Size(24, 24);
|
||||
pic.Image = GetIcon(type.Name);
|
||||
pnl.Controls.Add(pic);
|
||||
pic.Left = 5;
|
||||
pic.Top = (pnl.Height - pic.Height) / 2;
|
||||
pic.Show();
|
||||
var lbl = new Label();
|
||||
lbl.Tag = "header3";
|
||||
lbl.AutoSize = true;
|
||||
lbl.Text = NameChangerBackend.GetNameRaw(type);
|
||||
ControlManager.SetupControl(lbl);
|
||||
pnl.Controls.Add(lbl);
|
||||
lbl.CenterParent();
|
||||
lbl.Show();
|
||||
var btn = new Button();
|
||||
btn.Text = "Change...";
|
||||
btn.AutoSize = true;
|
||||
btn.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||
pnl.Controls.Add(btn);
|
||||
btn.Left = (pnl.Width - btn.Width) - 5;
|
||||
btn.Top = (pnl.Height - btn.Height) / 2;
|
||||
btn.Click += (o, a) =>
|
||||
{
|
||||
var gfp = new GraphicPicker(pic.Image, lbl.Text + " icon", ImageLayout.Stretch, (raw, img, layout) =>
|
||||
{
|
||||
pic.Image = img;
|
||||
SetIcon(type.Name, raw);
|
||||
});
|
||||
AppearanceManager.SetupDialog(gfp);
|
||||
};
|
||||
btn.Show();
|
||||
ControlManager.SetupControls(pnl);
|
||||
}
|
||||
}
|
||||
|
||||
btnnext.Visible = (currentPage < pageCount - 1);
|
||||
btnprev.Visible = (currentPage > 0);
|
||||
|
||||
lbcurrentpage.Text = "Page " + (currentPage + 1).ToString() + " of " + pageCount.ToString();
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
LoadIconsFromEngine();
|
||||
SetupUI();
|
||||
}
|
||||
|
||||
private void btnprev_Click(object sender, EventArgs e)
|
||||
{
|
||||
currentPage--;
|
||||
SetupUI();
|
||||
}
|
||||
|
||||
public void ResetToDefaults()
|
||||
{
|
||||
currentPage = 0;
|
||||
foreach (var key in Icons.Keys)
|
||||
{
|
||||
var img = SkinEngine.GetDefaultIcon(key);
|
||||
using(var ms = new System.IO.MemoryStream())
|
||||
{
|
||||
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
|
||||
Icons[key] = ms.ToArray();
|
||||
}
|
||||
}
|
||||
SetupUI();
|
||||
}
|
||||
|
||||
private void btnnext_Click(object sender, EventArgs e)
|
||||
{
|
||||
currentPage++;
|
||||
SetupUI();
|
||||
}
|
||||
|
||||
private void btnclose_Click(object sender, EventArgs e)
|
||||
{
|
||||
AppearanceManager.Close(this);
|
||||
}
|
||||
|
||||
private void btnreset_Click(object sender, EventArgs e)
|
||||
{
|
||||
ResetToDefaults();
|
||||
}
|
||||
|
||||
private void btnapply_Click(object sender, EventArgs e)
|
||||
{
|
||||
SkinEngine.LoadedSkin.AppIcons = Icons;
|
||||
SkinEngine.SaveSkin();
|
||||
SkinEngine.LoadSkin();
|
||||
Infobox.Show("Icons applied!", "The new icons have been applied to ShiftOS successfully!");
|
||||
}
|
||||
}
|
||||
|
||||
public static class PaginationExtensions
|
||||
{
|
||||
public static int GetPageCount<T>(this IEnumerable<T> collection, int pageSize)
|
||||
{
|
||||
return (collection.Count() + pageSize - 1) / pageSize;
|
||||
}
|
||||
|
||||
public static T[] GetItemsOnPage<T>(this T[] collection, int page, int pageSize)
|
||||
{
|
||||
List<T> obj = new List<T>();
|
||||
|
||||
for (int i = pageSize * page; i <= pageSize + (pageSize * page) && i < collection.Count(); i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
obj.Add(collection[i]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
return obj.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
120
ShiftOS.WinForms/Applications/IconManager.resx
Normal file
120
ShiftOS.WinForms/Applications/IconManager.resx
Normal 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>
|
|
@ -118,12 +118,10 @@
|
|||
//
|
||||
this.pginstall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pginstall.BlockSize = 5;
|
||||
this.pginstall.Location = new System.Drawing.Point(17, 161);
|
||||
this.pginstall.Maximum = 100;
|
||||
this.pginstall.Name = "pginstall";
|
||||
this.pginstall.Size = new System.Drawing.Size(414, 23);
|
||||
this.pginstall.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pginstall.TabIndex = 2;
|
||||
this.pginstall.Text = "shiftedProgressBar1";
|
||||
this.pginstall.Value = 0;
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
ServerManager.SendMessage("shop_removeowned", JsonConvert.SerializeObject(new
|
||||
{
|
||||
username = SaveSystem.CurrentSave.Username
|
||||
username = SaveSystem.CurrentUser.Username
|
||||
}));
|
||||
ShowCreateShop();
|
||||
}
|
||||
|
@ -274,9 +274,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
}
|
||||
|
||||
[Obsolete("MUD control center is dying! KILL IT!")]
|
||||
public void OpenChat(string id)
|
||||
{
|
||||
AppearanceManager.SetupWindow(new Chat(id));
|
||||
// AppearanceManager.SetupWindow(new Chat(id));
|
||||
}
|
||||
|
||||
private Shop editingShop = null;
|
||||
|
@ -289,7 +290,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
creatingShop = true;
|
||||
editingShop.Name = "My shop";
|
||||
editingShop.Description = "My shop has lots of awesome items. You should buy from my shop.";
|
||||
editingShop.Owner = SaveSystem.CurrentSave.Username;
|
||||
editingShop.Owner = SaveSystem.CurrentUser.Username;
|
||||
editingShop.Items = new List<ShopItem>();
|
||||
shop_editor.BringToFront();
|
||||
PopulateShopEditor();
|
||||
|
@ -401,7 +402,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
lbprice.Text = $"Cost: {item.Cost} CP";
|
||||
btnbuy.Show();
|
||||
};
|
||||
if(shop.Owner == SaveSystem.CurrentSave.Username)
|
||||
if(shop.Owner == SaveSystem.CurrentUser.Username)
|
||||
{
|
||||
btneditshop.Show();
|
||||
}
|
||||
|
@ -559,7 +560,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
you_systemstatus.BringToFront();
|
||||
|
||||
lblsysstatus.Text = $@"Username: {SaveSystem.CurrentSave.Username}
|
||||
lblsysstatus.Text = $@"Username: {SaveSystem.CurrentUser.Username}
|
||||
System name: {SaveSystem.CurrentSave.SystemName}
|
||||
|
||||
Codepoints: {SaveSystem.CurrentSave.Codepoints}
|
||||
|
@ -590,7 +591,7 @@ Current legions: {legionname}";
|
|||
private void tsMemos_Click(object sender, EventArgs e)
|
||||
{
|
||||
ServerManager.SendMessage("get_memos_for_user", $@"{{
|
||||
username: ""{SaveSystem.CurrentSave.Username}""
|
||||
username: ""{SaveSystem.CurrentUser.Username}""
|
||||
}}");
|
||||
you_memos.BringToFront();
|
||||
}
|
||||
|
@ -811,7 +812,7 @@ Current legions: {legionname}";
|
|||
{
|
||||
ServerManager.SendMessage("user_shop_check", JsonConvert.SerializeObject(new
|
||||
{
|
||||
username = SaveSystem.CurrentSave.Username
|
||||
username = SaveSystem.CurrentUser.Username
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -894,7 +895,7 @@ Current legions: {legionname}";
|
|||
|
||||
private void myShopToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentSave.Username);
|
||||
ServerManager.SendMessage("user_get_shop", SaveSystem.CurrentUser.Username);
|
||||
}
|
||||
|
||||
private void btneditshop_Click(object sender, EventArgs e)
|
||||
|
@ -922,7 +923,7 @@ Current legions: {legionname}";
|
|||
{
|
||||
ServerManager.SendMessage("delete_save", JsonConvert.SerializeObject(new ClientSave
|
||||
{
|
||||
Username = SaveSystem.CurrentSave.Username,
|
||||
Username = SaveSystem.CurrentUser.Username,
|
||||
Password = SaveSystem.CurrentSave.Password
|
||||
}));
|
||||
|
||||
|
|
3
ShiftOS.WinForms/Applications/Pong.Designer.cs
generated
3
ShiftOS.WinForms/Applications/Pong.Designer.cs
generated
|
@ -182,7 +182,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.pgcontents.Name = "pgcontents";
|
||||
this.pgcontents.Size = new System.Drawing.Size(912, 504);
|
||||
this.pgcontents.TabIndex = 20;
|
||||
this.pgcontents.Paint += new System.Windows.Forms.PaintEventHandler(this.pgcontents_Paint);
|
||||
this.pgcontents.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pongMain_MouseMove);
|
||||
//
|
||||
// pnlmultiplayerhandshake
|
||||
|
@ -250,7 +249,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.Label6.TabIndex = 15;
|
||||
this.Label6.Text = "{PONG_DESC}";
|
||||
this.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.Label6.Click += new System.EventHandler(this.Label6_Click);
|
||||
//
|
||||
// btnstartgame
|
||||
//
|
||||
|
@ -273,7 +271,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.Label8.Size = new System.Drawing.Size(280, 31);
|
||||
this.Label8.TabIndex = 14;
|
||||
this.Label8.Text = "{PONG_WELCOME}";
|
||||
this.Label8.Click += new System.EventHandler(this.Label8_Click);
|
||||
//
|
||||
// pnlhighscore
|
||||
//
|
||||
|
|
|
@ -58,13 +58,62 @@ namespace ShiftOS.WinForms.Applications
|
|||
double incrementy = 0.2;
|
||||
int levelxspeed = 3;
|
||||
int levelyspeed = 3;
|
||||
int beatairewardtotal;
|
||||
int beataireward = 1;
|
||||
int[] levelrewards = new int[50];
|
||||
int totalreward;
|
||||
ulong beatairewardtotal;
|
||||
ulong beataireward = 1;
|
||||
readonly uint[] levelrewards = {
|
||||
0,
|
||||
20,
|
||||
60,
|
||||
140,
|
||||
290,
|
||||
400,
|
||||
600,
|
||||
900,
|
||||
1200,
|
||||
1600,
|
||||
2000,
|
||||
2500,
|
||||
3000,
|
||||
4000,
|
||||
5000,
|
||||
6000,
|
||||
8000,
|
||||
10000,
|
||||
13000,
|
||||
16000,
|
||||
20000,
|
||||
25000,
|
||||
32000,
|
||||
40000,
|
||||
50000,
|
||||
60000,
|
||||
75000,
|
||||
90000,
|
||||
110000,
|
||||
140000,
|
||||
180000,
|
||||
220000,
|
||||
270000,
|
||||
320000,
|
||||
400000,
|
||||
500000,
|
||||
640000,
|
||||
800000,
|
||||
1000000,
|
||||
1500000,
|
||||
2000000};
|
||||
ulong totalreward;
|
||||
int countdown = 3;
|
||||
int rwdmultiplier;
|
||||
Thread soundThread;
|
||||
|
||||
bool aiShouldIsbeEnabled = true;
|
||||
bool aiShouldIsbeEnabled = true; // who named this variable? and were they having a stroke?
|
||||
|
||||
private void playsound(System.IO.Stream stream)
|
||||
{
|
||||
soundThread = new Thread((a) => ShiftOS.Engine.AudioManager.PlayStream((System.IO.Stream)a));
|
||||
soundThread.Start(stream);
|
||||
}
|
||||
|
||||
public Pong()
|
||||
{
|
||||
|
@ -73,11 +122,9 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
private void Pong_Load(object sender, EventArgs e)
|
||||
{
|
||||
setuplevelrewards();
|
||||
rwdmultiplier = ShiftoriumFrontend.UpgradeInstalled("pong_upgrade") ? 2 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Move the paddle according to the mouse position.
|
||||
private void pongMain_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
|
@ -133,9 +180,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
if (this.Left < Screen.PrimaryScreen.Bounds.Width)
|
||||
{
|
||||
ball.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
|
||||
paddleComputer.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
|
||||
paddleHuman.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
|
||||
ball.BackColor = paddleComputer.BackColor = paddleHuman.BackColor = SkinEngine.LoadedSkin.ControlTextColor;
|
||||
|
||||
//Check if paddle upgrade has been bought and change paddles accordingly
|
||||
//if (ShiftoriumFrontend.UpgradeInstalled("pong_increased_paddle_size"))
|
||||
|
@ -146,7 +191,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
//I don't know the point of this but I'm fucking 86ing it. - Michael
|
||||
|
||||
//Set the computer player to move according to the ball's position.
|
||||
if (IsMultiplayerSession == true)
|
||||
if (IsMultiplayerSession)
|
||||
{
|
||||
//If we're multiplayer, then we want to set the computer Y to the opponent's Y.
|
||||
//If we're the leader, we set the AI paddle, else we set the player paddle.
|
||||
|
@ -160,83 +205,63 @@ namespace ShiftOS.WinForms.Applications
|
|||
if (aiShouldIsbeEnabled)
|
||||
if (ball.Location.X > (this.Width - (this.Width / 3)) - xVel * 10 && xVel > 0)
|
||||
{
|
||||
if (ball.Location.Y > paddleComputer.Location.Y + 50)
|
||||
{
|
||||
paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed);
|
||||
}
|
||||
if (ball.Location.Y < paddleComputer.Location.Y + 50)
|
||||
{
|
||||
paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed);
|
||||
}
|
||||
if (ball.Top > paddleComputer.Top + 50)
|
||||
paddleComputer.Top += computerspeed;
|
||||
else
|
||||
paddleComputer.Top -= computerspeed;
|
||||
casualposition = rand.Next(-150, 201);
|
||||
}
|
||||
else
|
||||
{
|
||||
//used to be me.location.y - except it's fucking C# and this comment is misleading as fuck. OH WAIT! I didn't write it! And none of the current devs did either! - Michael
|
||||
if (paddleComputer.Location.Y > this.Size.Height / 2 - paddleComputer.Height + casualposition)
|
||||
{
|
||||
paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y - computerspeed);
|
||||
}
|
||||
//Rylan is hot. Used to be //used to be me.location.y
|
||||
if (paddleComputer.Location.Y < this.Size.Height / 2 - paddleComputer.Height + casualposition)
|
||||
{
|
||||
paddleComputer.Location = new Point(paddleComputer.Location.X, paddleComputer.Location.Y + computerspeed);
|
||||
}
|
||||
if (paddleComputer.Top > this.Height / 2 - paddleComputer.Height + casualposition)
|
||||
paddleComputer.Top -= computerspeed;
|
||||
else
|
||||
paddleComputer.Top += computerspeed;
|
||||
}
|
||||
}
|
||||
//Set Xvel and Yvel speeds from decimal
|
||||
if (xVel > 0)
|
||||
xVel = (int)Math.Round(xveldec);
|
||||
if (xVel < 0)
|
||||
else
|
||||
xVel = (int)-Math.Round(xveldec);
|
||||
if (yVel > 0)
|
||||
yVel = (int)Math.Round(yveldec);
|
||||
if (yVel < 0)
|
||||
else
|
||||
yVel = (int)-Math.Round(yveldec);
|
||||
|
||||
bool BallPhysics = true;
|
||||
|
||||
if (IsMultiplayerSession)
|
||||
if (IsMultiplayerSession && !IsLeader)
|
||||
{
|
||||
//Logic for moving the ball in Multiplayer.
|
||||
if (IsLeader)
|
||||
{
|
||||
ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Move it to the leader's ball position.
|
||||
ball.Location = new Point(LeaderX, LeaderY);
|
||||
BallPhysics = false;
|
||||
}
|
||||
// Move it to the leader's ball position.
|
||||
ball.Location = new Point(LeaderX, LeaderY);
|
||||
}
|
||||
else
|
||||
{// Move the game ball.
|
||||
ball.Location = new Point(ball.Location.X + xVel, ball.Location.Y + yVel);
|
||||
}
|
||||
if (BallPhysics)
|
||||
{
|
||||
var newRect = new Rectangle(ball.Location, ball.Size); // copy ball's Bounds
|
||||
newRect.X += xVel;
|
||||
newRect.Y += yVel;
|
||||
|
||||
// Check for top wall.
|
||||
if (ball.Location.Y < 0)
|
||||
if (newRect.Y < 0)
|
||||
{
|
||||
ball.Location = new Point(ball.Location.X, 0);
|
||||
newRect.Y = 0;
|
||||
yVel = -yVel;
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
|
||||
playsound(Properties.Resources.typesound);
|
||||
}
|
||||
|
||||
// Check for bottom wall.
|
||||
if (ball.Location.Y > pgcontents.Height - ball.Height)
|
||||
if (newRect.Y > pgcontents.Height - ball.Height)
|
||||
{
|
||||
ball.Location = new Point(ball.Location.X, pgcontents.Height - ball.Size.Height);
|
||||
newRect.Y = pgcontents.Height - ball.Height;
|
||||
yVel = -yVel;
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
|
||||
playsound(Properties.Resources.typesound);
|
||||
}
|
||||
|
||||
|
||||
// Check for player paddle.
|
||||
if (ball.Bounds.IntersectsWith(paddleHuman.Bounds))
|
||||
if (newRect.IntersectsWith(paddleHuman.Bounds))
|
||||
{
|
||||
ball.Location = new Point(paddleHuman.Location.X + ball.Size.Width + 1, ball.Location.Y);
|
||||
newRect.X = paddleHuman.Left + ball.Width + 1;
|
||||
//randomly increase x or y speed of ball
|
||||
switch (rand.Next(1, 3))
|
||||
{
|
||||
|
@ -246,23 +271,24 @@ namespace ShiftOS.WinForms.Applications
|
|||
case 2:
|
||||
if (yveldec > 0)
|
||||
yveldec = yveldec + incrementy;
|
||||
if (yveldec < 0)
|
||||
else
|
||||
yveldec = yveldec - incrementy;
|
||||
break;
|
||||
}
|
||||
xVel = -xVel;
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.writesound);
|
||||
playsound(Properties.Resources.writesound);
|
||||
|
||||
}
|
||||
|
||||
// Check for computer paddle.
|
||||
if (ball.Bounds.IntersectsWith(paddleComputer.Bounds))
|
||||
if (newRect.IntersectsWith(paddleComputer.Bounds))
|
||||
{
|
||||
ball.Location = new Point(paddleComputer.Location.X - paddleComputer.Size.Width - 1, ball.Location.Y);
|
||||
newRect.X = paddleComputer.Left - paddleComputer.Width - 1;
|
||||
xveldec = xveldec + incrementx;
|
||||
xVel = -xVel;
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.writesound);
|
||||
playsound(Properties.Resources.writesound);
|
||||
}
|
||||
ball.Location = newRect.Location;
|
||||
}
|
||||
|
||||
|
||||
|
@ -297,11 +323,11 @@ namespace ShiftOS.WinForms.Applications
|
|||
lblmissedout.Text = Localization.Parse("{YOU_MISSED_OUT_ON}:") + Environment.NewLine + lblstatscodepoints.Text.Replace(Localization.Parse("{CODEPOINTS}: "), "") + Localization.Parse(" {CODEPOINTS}");
|
||||
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade_2"))
|
||||
{
|
||||
totalreward = levelrewards[level - 1] + beatairewardtotal;
|
||||
totalreward = (levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal);
|
||||
double onePercent = (totalreward / 100);
|
||||
lblbutyougained.Show();
|
||||
lblbutyougained.Text = Localization.Parse("{BUT_YOU_GAINED}:") + Environment.NewLine + onePercent.ToString("") + (Localization.Parse(" {CODEPOINTS}"));
|
||||
SaveSystem.TransferCodepointsFrom("pong", (totalreward / 100));
|
||||
SaveSystem.TransferCodepointsFrom("pong", (ulong)(onePercent));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -343,10 +369,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
if (IsLeader)
|
||||
{
|
||||
//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 = Localization.Parse("{H_VEL}: ") + xveldec;
|
||||
lblstatsY.Text = Localization.Parse("{V_VEL}: ") + yveldec;
|
||||
lblstatscodepoints.Text = Localization.Parse("{CODEPOINTS}: ") + (levelrewards[level - 1] + beatairewardtotal).ToString();
|
||||
lbllevelandtime.Text = Localization.Parse("{LEVEL}: " + level + " - " + secondsleft + " {SECONDS_LEFT}");
|
||||
lblstatsX.Text = "X vel: " + xveldec;
|
||||
lblstatsY.Text = "Y vel: " + yveldec;
|
||||
lblstatscodepoints.Text = "Codepoints: " + (levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal).ToString();
|
||||
lbllevelandtime.Text = "Level: " + level + " - " + secondsleft + " seconds left";
|
||||
|
||||
if (xVel > 20 || xVel < -20)
|
||||
{
|
||||
|
@ -355,8 +381,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
else
|
||||
{
|
||||
paddleHuman.Width = 20;
|
||||
paddleComputer.Width = 20;
|
||||
paddleHuman.Width = paddleComputer.Width = 20;
|
||||
}
|
||||
}
|
||||
if (!IsMultiplayerSession)
|
||||
|
@ -415,7 +440,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
StartLevel();
|
||||
}));
|
||||
}
|
||||
else if(msg.Name == "pong_mp_levelcompleted")
|
||||
else if (msg.Name == "pong_mp_levelcompleted")
|
||||
{
|
||||
level = Convert.ToInt32(msg.Contents) + 1;
|
||||
this.Invoke(new Action(CompleteLevel));
|
||||
|
@ -434,7 +459,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
pnlmultiplayerhandshake.Hide();
|
||||
}));
|
||||
}
|
||||
else if(msg.Name == "pong_mp_cashedout")
|
||||
else if (msg.Name == "pong_mp_cashedout")
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
|
@ -442,19 +467,19 @@ namespace ShiftOS.WinForms.Applications
|
|||
}));
|
||||
Infobox.Show("Cashed out.", "The other player has cashed out their Codepoints. Therefore, we have automatically cashed yours out.");
|
||||
}
|
||||
else if(msg.Name == "pong_mp_startlevel")
|
||||
else if (msg.Name == "pong_mp_startlevel")
|
||||
{
|
||||
OpponentAgrees = true;
|
||||
if(YouAgree == false)
|
||||
if (YouAgree == false)
|
||||
{
|
||||
Infobox.PromptYesNo("Play another level?", "The opponent wants to play another level. Would you like to as well?", (answer)=>
|
||||
Infobox.PromptYesNo("Play another level?", "The opponent wants to play another level. Would you like to as well?", (answer) =>
|
||||
{
|
||||
YouAgree = answer;
|
||||
ServerManager.Forward(OpponentGUID, "pong_mp_level_callback", YouAgree.ToString());
|
||||
});
|
||||
}
|
||||
}
|
||||
else if(msg.Name == "pong_mp_level_callback")
|
||||
else if (msg.Name == "pong_mp_level_callback")
|
||||
{
|
||||
bool agreed = bool.Parse(msg.Contents);
|
||||
OpponentAgrees = agreed;
|
||||
|
@ -472,7 +497,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.PossibleMatchmakes.Remove(msg.Contents);
|
||||
this.Invoke(new Action(ListMatchmakes));
|
||||
}
|
||||
else if(msg.Name == "pong_mp_clockupdate")
|
||||
else if (msg.Name == "pong_mp_clockupdate")
|
||||
{
|
||||
secondsleft = Convert.ToInt32(msg.Contents);
|
||||
}
|
||||
|
@ -566,7 +591,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
public void LoseMP()
|
||||
{
|
||||
ball.Location = new Point(this.Size.Width / 2 + 200, this.Size.Height / 2);
|
||||
if(IsLeader)
|
||||
if (IsLeader)
|
||||
if (xVel > 0)
|
||||
xVel = -xVel;
|
||||
lblbeatai.Show();
|
||||
|
@ -629,12 +654,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
if (this.Left < Screen.PrimaryScreen.Bounds.Width)
|
||||
{
|
||||
secondsleft = secondsleft - 1;
|
||||
if (secondsleft == 1)
|
||||
if (secondsleft == 0)
|
||||
{
|
||||
CompleteLevel();
|
||||
}
|
||||
|
||||
lblstatscodepoints.Text = Localization.Parse("{CODEPOINTS}: ") + (levelrewards[level - 1] + beatairewardtotal).ToString();
|
||||
lblstatscodepoints.Text = "Codepoints: " + (levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal).ToString();
|
||||
}
|
||||
}
|
||||
SetupStats();
|
||||
|
@ -670,200 +695,56 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
lblpreviousstats.Text = Localization.Parse("{INITIAL_H_VEL}: " + levelxspeed + Environment.NewLine + "{INITIAL_V_VEL}: " + levelyspeed + Environment.NewLine + "{INC_H_VEL}: " + incrementx + Environment.NewLine + "{INC_V_VEL}: " + incrementy);
|
||||
|
||||
switch (rand.Next(1, 3))
|
||||
{
|
||||
case 1:
|
||||
levelxspeed = levelxspeed + 1;
|
||||
break;
|
||||
case 2:
|
||||
levelxspeed = levelxspeed + 2;
|
||||
break;
|
||||
}
|
||||
levelxspeed += rand.Next(1, 3);
|
||||
|
||||
switch (rand.Next(1, 3))
|
||||
{
|
||||
case 1:
|
||||
levelyspeed = levelyspeed + 1;
|
||||
break;
|
||||
case 2:
|
||||
levelyspeed = levelyspeed + 2;
|
||||
break;
|
||||
}
|
||||
levelyspeed += rand.Next(1, 3);
|
||||
|
||||
switch (rand.Next(1, 6))
|
||||
{
|
||||
case 1:
|
||||
incrementx = incrementx + 0.1;
|
||||
break;
|
||||
case 2:
|
||||
incrementx = incrementx + 0.2;
|
||||
break;
|
||||
case 3:
|
||||
incrementy = incrementy + 0.1;
|
||||
break;
|
||||
case 4:
|
||||
incrementy = incrementy + 0.2;
|
||||
break;
|
||||
case 5:
|
||||
incrementy = incrementy + 0.3;
|
||||
break;
|
||||
}
|
||||
int rndinc = rand.Next(1, 6);
|
||||
if (rndinc == 5)
|
||||
incrementy += 0.3;
|
||||
else
|
||||
incrementy += (((rndinc - 1) % 2) + 1) / 10;
|
||||
|
||||
lblnextstats.Text = Localization.Parse("{INITIAL_H_VEL}: " + levelxspeed + Environment.NewLine + "{INITIAL_V_VEL}: " + levelyspeed + Environment.NewLine + "{INC_H_VEL}: " + incrementx + Environment.NewLine + "{INC_V_VEL}: " + incrementy);
|
||||
|
||||
if (level < 15)
|
||||
{
|
||||
beataireward = (ulong)(level * 5);
|
||||
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
|
||||
{
|
||||
beataireward = level * 10;
|
||||
} else
|
||||
{
|
||||
beataireward = level * 5;
|
||||
}
|
||||
beataireward *= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
|
||||
{
|
||||
double br = levelrewards[level - 1] / 10;
|
||||
beataireward = (int)Math.Round(br) * 10;
|
||||
} else
|
||||
{
|
||||
double br = levelrewards[level - 1] / 10;
|
||||
beataireward = (int)Math.Round(br) * 5;
|
||||
}
|
||||
}
|
||||
beataireward = levelrewards[level - 1];
|
||||
else
|
||||
beataireward = (ulong)Math.Round((double) levelrewards[level - 1] / 2);
|
||||
|
||||
totalreward = levelrewards[level - 1] + beatairewardtotal;
|
||||
totalreward = levelrewards[level - 1] * (ulong) rwdmultiplier + beatairewardtotal;
|
||||
|
||||
btncashout.Text = Localization.Parse("{CASH_OUT_WITH_CODEPOINTS}");
|
||||
btnplayon.Text = Localization.Parse("{PONG_PLAY_ON_FOR_MORE}");
|
||||
}
|
||||
|
||||
private void setuplevelrewards()
|
||||
{
|
||||
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
|
||||
{
|
||||
levelrewards[0] = 0;
|
||||
levelrewards[1] = 40;
|
||||
levelrewards[2] = 120;
|
||||
levelrewards[3] = 280;
|
||||
levelrewards[4] = 580;
|
||||
levelrewards[5] = 800;
|
||||
levelrewards[6] = 1200;
|
||||
levelrewards[7] = 1800;
|
||||
levelrewards[8] = 2400;
|
||||
levelrewards[9] = 3200;
|
||||
levelrewards[10] = 4000;
|
||||
levelrewards[11] = 5000;
|
||||
levelrewards[12] = 6000;
|
||||
levelrewards[13] = 8000;
|
||||
levelrewards[14] = 10000;
|
||||
levelrewards[15] = 12000;
|
||||
levelrewards[16] = 16000;
|
||||
levelrewards[17] = 20000;
|
||||
levelrewards[18] = 26000;
|
||||
levelrewards[19] = 32000;
|
||||
levelrewards[20] = 40000;
|
||||
levelrewards[21] = 50000;
|
||||
levelrewards[22] = 64000;
|
||||
levelrewards[23] = 80000;
|
||||
levelrewards[24] = 100000;
|
||||
levelrewards[25] = 120000;
|
||||
levelrewards[26] = 150000;
|
||||
levelrewards[27] = 180000;
|
||||
levelrewards[28] = 220000;
|
||||
levelrewards[29] = 280000;
|
||||
levelrewards[30] = 360000;
|
||||
levelrewards[31] = 440000;
|
||||
levelrewards[32] = 540000;
|
||||
levelrewards[33] = 640000;
|
||||
levelrewards[34] = 800000;
|
||||
levelrewards[35] = 1000000;
|
||||
levelrewards[36] = 1280000;
|
||||
levelrewards[37] = 1600000;
|
||||
levelrewards[38] = 2000000;
|
||||
levelrewards[39] = 3000000;
|
||||
levelrewards[40] = 4000000;
|
||||
} else
|
||||
{
|
||||
levelrewards[0] = 0;
|
||||
levelrewards[1] = 20;
|
||||
levelrewards[2] = 60;
|
||||
levelrewards[3] = 140;
|
||||
levelrewards[4] = 290;
|
||||
levelrewards[5] = 400;
|
||||
levelrewards[6] = 600;
|
||||
levelrewards[7] = 900;
|
||||
levelrewards[8] = 1200;
|
||||
levelrewards[9] = 1600;
|
||||
levelrewards[10] = 2000;
|
||||
levelrewards[11] = 2500;
|
||||
levelrewards[12] = 3000;
|
||||
levelrewards[13] = 4000;
|
||||
levelrewards[14] = 5000;
|
||||
levelrewards[15] = 6000;
|
||||
levelrewards[16] = 8000;
|
||||
levelrewards[17] = 10000;
|
||||
levelrewards[18] = 13000;
|
||||
levelrewards[19] = 16000;
|
||||
levelrewards[20] = 20000;
|
||||
levelrewards[21] = 25000;
|
||||
levelrewards[22] = 32000;
|
||||
levelrewards[23] = 40000;
|
||||
levelrewards[24] = 50000;
|
||||
levelrewards[25] = 60000;
|
||||
levelrewards[26] = 75000;
|
||||
levelrewards[27] = 90000;
|
||||
levelrewards[28] = 110000;
|
||||
levelrewards[29] = 140000;
|
||||
levelrewards[30] = 180000;
|
||||
levelrewards[31] = 220000;
|
||||
levelrewards[32] = 270000;
|
||||
levelrewards[33] = 320000;
|
||||
levelrewards[34] = 400000;
|
||||
levelrewards[35] = 500000;
|
||||
levelrewards[36] = 640000;
|
||||
levelrewards[37] = 800000;
|
||||
levelrewards[38] = 1000000;
|
||||
levelrewards[39] = 1500000;
|
||||
levelrewards[40] = 2000000;
|
||||
}
|
||||
}
|
||||
|
||||
// ERROR: Handles clauses are not supported in C#
|
||||
private void countdown_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Left < Screen.PrimaryScreen.Bounds.Width)
|
||||
{
|
||||
switch (countdown)
|
||||
if (countdown == 0)
|
||||
{
|
||||
case 0:
|
||||
countdown = 3;
|
||||
lblcountdown.Hide();
|
||||
lblbeatai.Hide();
|
||||
gameTimer.Start();
|
||||
counter.Start();
|
||||
tmrcountdown.Stop();
|
||||
break;
|
||||
case 1:
|
||||
lblcountdown.Text = "1";
|
||||
countdown = countdown - 1;
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
|
||||
break;
|
||||
case 2:
|
||||
lblcountdown.Text = "2";
|
||||
countdown = countdown - 1;
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
|
||||
break;
|
||||
case 3:
|
||||
lblcountdown.Text = "3";
|
||||
countdown = countdown - 1;
|
||||
lblcountdown.Show();
|
||||
ShiftOS.Engine.AudioManager.PlayStream(Properties.Resources.typesound);
|
||||
break;
|
||||
countdown = 3;
|
||||
lblcountdown.Hide();
|
||||
lblbeatai.Hide();
|
||||
gameTimer.Start();
|
||||
counter.Start();
|
||||
tmrcountdown.Stop();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!lblcountdown.Visible)
|
||||
lblcountdown.Show();
|
||||
lblcountdown.Text = countdown.ToString();
|
||||
countdown -= 1;
|
||||
playsound(Properties.Resources.typesound);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -874,7 +755,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
pnlfinalstats.Show();
|
||||
lblfinalcodepointswithtext.Text = Localization.Parse("{YOU_WON} " + totalreward + " {CODEPOINTS}!");
|
||||
lblfinallevelreached.Text = Localization.Parse("{CODEPOINTS_FOR_BEATING_LEVEL}: ") + (level - 1).ToString();
|
||||
lblfinallevelreward.Text = levelrewards[level - 1].ToString();
|
||||
lblfinallevelreward.Text = (levelrewards[level - 1] * rwdmultiplier).ToString();
|
||||
lblfinalcomputerreward.Text = beatairewardtotal.ToString();
|
||||
lblfinalcodepoints.Text = totalreward + Localization.Parse(" {CODEPOINTS_SHORT}");
|
||||
SaveSystem.TransferCodepointsFrom("pong", totalreward);
|
||||
|
@ -912,7 +793,8 @@ namespace ShiftOS.WinForms.Applications
|
|||
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
|
||||
{
|
||||
beataireward = 10;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
beataireward = 5;
|
||||
}
|
||||
|
@ -981,6 +863,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
var hs = unite.GetPongHighscores();
|
||||
foreach (var score in hs.Highscores)
|
||||
{
|
||||
if (this.ParentForm.Visible == false)
|
||||
{
|
||||
Thread.CurrentThread.Abort();
|
||||
}
|
||||
string username = unite.GetDisplayNameId(score.UserId);
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
|
@ -994,8 +880,15 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
catch
|
||||
{
|
||||
Infobox.Show("Service unavailable.", "The Pong Highscore service is unavailable at this time.");
|
||||
this.Invoke(new Action(pnlgamestats.BringToFront));
|
||||
try
|
||||
{
|
||||
if (this.ParentForm.Visible)
|
||||
{
|
||||
Infobox.Show("Service unavailable.", "The Pong Highscore service is unavailable at this time.");
|
||||
this.Invoke(new Action(pnlgamestats.BringToFront));
|
||||
}
|
||||
}
|
||||
catch { } //JUST. ABORT. THE. FUCKING. THREAD.
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
@ -1019,7 +912,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
newgame();
|
||||
}
|
||||
|
||||
|
||||
// ERROR: Handles clauses are not supported in C#
|
||||
private void btnstartgame_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -1034,9 +927,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
int i = rand.Next(0, 100);
|
||||
|
||||
if (i >= 25 && i <= 50)
|
||||
{
|
||||
tmrstoryline.Stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1046,25 +937,13 @@ namespace ShiftOS.WinForms.Applications
|
|||
tmrstoryline.Stop();
|
||||
}
|
||||
|
||||
private void Label6_Click(object sender, EventArgs e)
|
||||
private void ball_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Label8_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void pgcontents_Paint(object sender, PaintEventArgs e) {
|
||||
|
||||
}
|
||||
|
||||
private void ball_MouseEnter(object sender, EventArgs e) {
|
||||
aiShouldIsbeEnabled = false;
|
||||
}
|
||||
|
||||
private void ball_MouseLeave(object sender, EventArgs e) {
|
||||
private void ball_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
aiShouldIsbeEnabled = true;
|
||||
}
|
||||
|
||||
|
@ -1091,12 +970,12 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public bool OnUnload()
|
||||
{
|
||||
if(IsMultiplayerSession == true)
|
||||
if (IsMultiplayerSession)
|
||||
{
|
||||
if(!string.IsNullOrWhiteSpace(OpponentGUID))
|
||||
if (!string.IsNullOrWhiteSpace(OpponentGUID))
|
||||
ServerManager.Forward(OpponentGUID, "pong_mp_left", null);
|
||||
LeaveMatchmake();
|
||||
}
|
||||
LeaveMatchmake();
|
||||
ServerManager.MessageReceived -= this.ServerMessageReceivedHandler;
|
||||
|
||||
return true;
|
||||
|
@ -1123,10 +1002,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
private void lvotherplayers_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
if(lvotherplayers.SelectedItems.Count > 0)
|
||||
if (lvotherplayers.SelectedItems.Count > 0)
|
||||
{
|
||||
SendLeaderGUID(lvotherplayers.SelectedItems[0].Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -129,4 +129,7 @@
|
|||
<metadata name="tmrstoryline.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="soundtimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>472, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -38,7 +38,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
[MultiplayerOnly]
|
||||
[Launcher("ShiftLetters", false, null, "Games")]
|
||||
[RequiresUpgrade("shiftletters")]
|
||||
[AppscapeEntry("ShiftLetters", "Let's see how much you know about ShiftOS by playing this tiny little Hangman game! Shiftorium Upgrades exist to allow you to buy different word sets!", 300, 150, null, "Games")]
|
||||
[WinOpen("shiftletters")]
|
||||
[DefaultIcon("iconShiftLetters")]
|
||||
public partial class ShiftLetters : UserControl, IShiftOSWindow
|
||||
|
@ -217,7 +217,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
if (!lblword.Text.Contains("_"))
|
||||
{
|
||||
int oldlives = lives;
|
||||
int cp = (word.Length * oldlives) * 2; //drunky michael made this 5x...
|
||||
ulong cp = (ulong)(word.Length * oldlives) * 2; //drunky michael made this 5x...
|
||||
SaveSystem.TransferCodepointsFrom("shiftletters", cp);
|
||||
StartGame();
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
else
|
||||
{
|
||||
if (SaveSystem.CurrentSave.Codepoints - (codePoints * difficulty) <= 0)
|
||||
if (SaveSystem.CurrentSave.Codepoints - (ulong)(codePoints * difficulty) <= 0)
|
||||
{
|
||||
Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to gamble this amount!");
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
int winningNumber = rnd.Next(0, difficulty);
|
||||
|
||||
// Multiply CodePoints * Difficulty
|
||||
int jackpot = codePoints * difficulty;
|
||||
ulong jackpot = (ulong)(codePoints * difficulty);
|
||||
|
||||
// Test the random ints
|
||||
if (guessedNumber == winningNumber)
|
||||
|
|
|
@ -35,7 +35,7 @@ using ShiftOS.Engine;
|
|||
|
||||
namespace ShiftOS.WinForms.Applications {
|
||||
[Launcher("ShiftSweeper", true, "al_shiftsweeper", "Games")]
|
||||
[RequiresUpgrade("shiftsweeper")]
|
||||
[AppscapeEntry("ShiftSweeper", "A simple Minesweeper game built for ShiftOS! Careful, it's a hard one.", 1600, 800, "shiftletters", "Games")]
|
||||
[MultiplayerOnly]
|
||||
[WinOpen("shiftsweeper")]
|
||||
[DefaultIcon("iconShiftSweeper")]
|
||||
|
@ -300,12 +300,12 @@ namespace ShiftOS.WinForms.Applications {
|
|||
}
|
||||
|
||||
public void winGame() {
|
||||
int cp = 0;
|
||||
int origminecount = gameBombCount * 10;
|
||||
ulong cp = 0;
|
||||
ulong origminecount = (ulong)(gameBombCount * 10);
|
||||
if (minetimer < 31) cp = (origminecount * 3);
|
||||
else if (minetimer < 61) cp = (Int32)(origminecount * 2.5);
|
||||
else if (minetimer < 61) cp = (ulong)(origminecount * 2.5);
|
||||
else if (minetimer < 91) cp = (origminecount * 2);
|
||||
else if (minetimer < 121) cp = (Int32)(origminecount * 1.5);
|
||||
else if (minetimer < 121) cp = (ulong)(origminecount * 1.5);
|
||||
else if (minetimer > 120) cp = (origminecount * 1);
|
||||
SaveSystem.TransferCodepointsFrom("shiftsweeper", cp);
|
||||
panelGameStatus.Image = Properties.Resources.SweeperWinFace;
|
||||
|
|
|
@ -31,6 +31,8 @@ using System.Reflection;
|
|||
using System.Windows.Forms;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.WinForms.Tools;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
|
@ -139,10 +141,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
pnldesktoppreview.BackColor = Color.FromArgb(LoadedSkin.DesktopColor.R, LoadedSkin.DesktopColor.G, LoadedSkin.DesktopColor.B);
|
||||
//Not doing this will cause an ArgumentException.
|
||||
|
||||
DitheringEngine.DitherImage(SkinEngine.GetImage("desktopbackground"), new Action<Image>((img) =>
|
||||
{
|
||||
pnldesktoppreview.BackgroundImage = img;
|
||||
}));
|
||||
pnldesktoppreview.BackgroundImage = SkinEngine.GetImage("desktopbackground");
|
||||
pnldesktoppreview.BackgroundImageLayout = GetImageLayout("desktopbackground");
|
||||
desktoppanel.BackColor = LoadedSkin.DesktopPanelColor;
|
||||
|
||||
|
@ -392,7 +391,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
|
||||
|
||||
public int CodepointValue = 0;
|
||||
public uint CodepointValue = 0;
|
||||
public List<ShifterSetting> settings = new List<ShifterSetting>();
|
||||
public Skin LoadedSkin = null;
|
||||
|
||||
|
@ -543,403 +542,425 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
flbody.Controls.Clear();
|
||||
|
||||
List<ShifterSetting> cats = new List<ShifterSetting>();
|
||||
IEnumerable<ShifterSetting> cats = this.settings.Where(x => x.SubCategory == subcat && x.Category == cat && x.Field.FlagFullfilled(LoadedSkin)).OrderBy(x=>x.Name);
|
||||
|
||||
foreach (var c in this.settings)
|
||||
new Thread(() =>
|
||||
{
|
||||
if (c.SubCategory == subcat && c.Category == cat)
|
||||
foreach (var c in cats)
|
||||
{
|
||||
if (c.Field.FlagFullfilled(LoadedSkin))
|
||||
Label lbl = null;
|
||||
int labelHeight = 0;
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
if (!cats.Contains(c))
|
||||
{
|
||||
cats.Add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var c in cats)
|
||||
{
|
||||
var lbl = new Label();
|
||||
int labelHeight = 0;
|
||||
lbl.AutoSize = true;
|
||||
lbl.Text = c.Name + ":";
|
||||
flbody.Controls.Add(lbl);
|
||||
lbl.TextAlign = ContentAlignment.MiddleLeft;
|
||||
lbl.Show();
|
||||
//Cool - label's in.
|
||||
if(c.Field.FieldType == typeof(Point))
|
||||
{
|
||||
var width = new TextBox();
|
||||
var height = new TextBox();
|
||||
labelHeight = width.Height; //irony?
|
||||
width.Width = 30;
|
||||
height.Width = width.Width;
|
||||
width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
|
||||
height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
|
||||
flbody.SetFlowBreak(height, true);
|
||||
ControlManager.SetupControl(width);
|
||||
ControlManager.SetupControl(height);
|
||||
|
||||
flbody.Controls.Add(width);
|
||||
width.Show();
|
||||
flbody.Controls.Add(height);
|
||||
height.Show();
|
||||
|
||||
EventHandler tc = (o, a) =>
|
||||
lbl = new Label();
|
||||
lbl.AutoSize = true;
|
||||
lbl.Text = c.Name + ":";
|
||||
flbody.Controls.Add(lbl);
|
||||
lbl.TextAlign = ContentAlignment.MiddleLeft;
|
||||
lbl.Show();
|
||||
});
|
||||
//Cool - label's in.
|
||||
if (c.Field.FieldType == typeof(Point))
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Convert.ToInt32(width.Text);
|
||||
int y = Convert.ToInt32(height.Text);
|
||||
|
||||
int oldx = ((Point)c.Field.GetValue(this.LoadedSkin)).X;
|
||||
int oldy = ((Point)c.Field.GetValue(this.LoadedSkin)).Y;
|
||||
|
||||
if(x != oldx || y != oldy)
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, new Point(x, y));
|
||||
CodepointValue += 200;
|
||||
}
|
||||
}
|
||||
catch
|
||||
TextBox width = null;
|
||||
TextBox height = null;
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
width = new TextBox();
|
||||
height = new TextBox();
|
||||
labelHeight = width.Height; //irony?
|
||||
width.Width = 30;
|
||||
height.Width = width.Width;
|
||||
width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
|
||||
height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
|
||||
}
|
||||
InvokeSetup(cat);
|
||||
};
|
||||
flbody.SetFlowBreak(height, true);
|
||||
ControlManager.SetupControl(width);
|
||||
ControlManager.SetupControl(height);
|
||||
|
||||
width.TextChanged += tc;
|
||||
height.TextChanged += tc;
|
||||
flbody.Controls.Add(width);
|
||||
width.Show();
|
||||
flbody.Controls.Add(height);
|
||||
height.Show();
|
||||
|
||||
}
|
||||
else if(c.Field.FieldType == typeof(string))
|
||||
{
|
||||
var str = new TextBox();
|
||||
str.Width = 120;
|
||||
ControlManager.SetupControl(str);
|
||||
labelHeight = str.Height;
|
||||
str.Text = c.Field.GetValue(LoadedSkin).ToString();
|
||||
flbody.SetFlowBreak(str, true);
|
||||
str.TextChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, str.Text); CodepointValue += 100;
|
||||
|
||||
InvokeSetup(cat);
|
||||
};
|
||||
flbody.Controls.Add(str);
|
||||
str.Show();
|
||||
}
|
||||
else if(c.Field.FieldType == typeof(byte[]))
|
||||
{
|
||||
//We'll assume that this is an image file.
|
||||
var color = new Button();
|
||||
color.Width = 40;
|
||||
labelHeight = color.Height;
|
||||
//just so it's flat like the system.
|
||||
ControlManager.SetupControl(color);
|
||||
flbody.SetFlowBreak(color, true);
|
||||
|
||||
color.BackgroundImage = SkinEngine.ImageFromBinary((byte[])c.Field.GetValue(this.LoadedSkin));
|
||||
color.Click += (o, a) =>
|
||||
{
|
||||
AppearanceManager.SetupDialog(new GraphicPicker(color.BackgroundImage, c.Name, GetLayout(c.Field.GetImageName()), new Action<byte[], Image, ImageLayout>((col, gdiImg, layout) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, col);
|
||||
color.BackgroundImage = SkinEngine.ImageFromBinary(col);
|
||||
color.BackgroundImageLayout = layout;
|
||||
LoadedSkin.SkinImageLayouts[c.Field.GetImageName()] = layout;
|
||||
CodepointValue += 700;
|
||||
InvokeSetup(cat);
|
||||
|
||||
})));
|
||||
};
|
||||
flbody.Controls.Add(color);
|
||||
color.Show();
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(Size))
|
||||
{
|
||||
var width = new TextBox();
|
||||
var height = new TextBox();
|
||||
width.Width = 30;
|
||||
height.Width = width.Width;
|
||||
labelHeight = width.Height;
|
||||
flbody.SetFlowBreak(height, true);
|
||||
|
||||
width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
|
||||
height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
|
||||
ControlManager.SetupControl(width);
|
||||
ControlManager.SetupControl(height);
|
||||
|
||||
flbody.Controls.Add(width);
|
||||
width.Show();
|
||||
flbody.Controls.Add(height);
|
||||
height.Show();
|
||||
|
||||
EventHandler tc = (o, a) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Convert.ToInt32(width.Text);
|
||||
int y = Convert.ToInt32(height.Text);
|
||||
|
||||
int oldx = ((Size)c.Field.GetValue(this.LoadedSkin)).Width;
|
||||
int oldy = ((Size)c.Field.GetValue(this.LoadedSkin)).Height;
|
||||
|
||||
if (x != oldx || y != oldy)
|
||||
EventHandler tc = (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, new Size(x, y));
|
||||
CodepointValue += 200;
|
||||
}
|
||||
}
|
||||
catch
|
||||
try
|
||||
{
|
||||
int x = Convert.ToInt32(width.Text);
|
||||
int y = Convert.ToInt32(height.Text);
|
||||
|
||||
int oldx = ((Point)c.Field.GetValue(this.LoadedSkin)).X;
|
||||
int oldy = ((Point)c.Field.GetValue(this.LoadedSkin)).Y;
|
||||
|
||||
if (x != oldx || y != oldy)
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, new Point(x, y));
|
||||
CodepointValue += 200;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
width.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).X.ToString();
|
||||
height.Text = ((Point)c.Field.GetValue(this.LoadedSkin)).Y.ToString();
|
||||
}
|
||||
InvokeSetup(cat);
|
||||
};
|
||||
|
||||
width.TextChanged += tc;
|
||||
height.TextChanged += tc;
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(string))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var str = new TextBox();
|
||||
str.Width = 120;
|
||||
ControlManager.SetupControl(str);
|
||||
labelHeight = str.Height;
|
||||
str.Text = c.Field.GetValue(LoadedSkin).ToString();
|
||||
flbody.SetFlowBreak(str, true);
|
||||
str.TextChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, str.Text); CodepointValue += 100;
|
||||
|
||||
InvokeSetup(cat);
|
||||
};
|
||||
flbody.Controls.Add(str);
|
||||
str.Show();
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(byte[]))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
//We'll assume that this is an image file.
|
||||
var color = new Button();
|
||||
color.Width = 40;
|
||||
labelHeight = color.Height;
|
||||
//just so it's flat like the system.
|
||||
ControlManager.SetupControl(color);
|
||||
flbody.SetFlowBreak(color, true);
|
||||
|
||||
color.BackgroundImage = SkinEngine.ImageFromBinary((byte[])c.Field.GetValue(this.LoadedSkin));
|
||||
color.Click += (o, a) =>
|
||||
{
|
||||
AppearanceManager.SetupDialog(new GraphicPicker(color.BackgroundImage, c.Name, GetLayout(c.Field.GetImageName()), new Action<byte[], Image, ImageLayout>((col, gdiImg, layout) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, col);
|
||||
color.BackgroundImage = SkinEngine.ImageFromBinary(col);
|
||||
color.BackgroundImageLayout = layout;
|
||||
LoadedSkin.SkinImageLayouts[c.Field.GetImageName()] = layout;
|
||||
CodepointValue += 700;
|
||||
InvokeSetup(cat);
|
||||
|
||||
})));
|
||||
};
|
||||
flbody.Controls.Add(color);
|
||||
color.Show();
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(Size))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var width = new TextBox();
|
||||
var height = new TextBox();
|
||||
width.Width = 30;
|
||||
height.Width = width.Width;
|
||||
labelHeight = width.Height;
|
||||
flbody.SetFlowBreak(height, true);
|
||||
|
||||
width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
|
||||
height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
|
||||
}
|
||||
InvokeSetup(cat);
|
||||
ControlManager.SetupControl(width);
|
||||
ControlManager.SetupControl(height);
|
||||
|
||||
};
|
||||
flbody.Controls.Add(width);
|
||||
width.Show();
|
||||
flbody.Controls.Add(height);
|
||||
height.Show();
|
||||
|
||||
width.TextChanged += tc;
|
||||
height.TextChanged += tc;
|
||||
|
||||
}
|
||||
else if(c.Field.FieldType == typeof(bool))
|
||||
{
|
||||
var check = new CheckBox();
|
||||
check.Checked = ((bool)c.Field.GetValue(LoadedSkin));
|
||||
labelHeight = check.Height;
|
||||
check.CheckedChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, check.Checked);
|
||||
CodepointValue += 50;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
flbody.SetFlowBreak(check, true);
|
||||
|
||||
flbody.Controls.Add(check);
|
||||
check.Show();
|
||||
}
|
||||
else if(c.Field.FieldType == typeof(Font))
|
||||
{
|
||||
var name = new ComboBox();
|
||||
var size = new TextBox();
|
||||
var style = new ComboBox();
|
||||
|
||||
name.Width = 120;
|
||||
labelHeight = name.Height;
|
||||
size.Width = 40;
|
||||
style.Width = 80;
|
||||
flbody.SetFlowBreak(style, true);
|
||||
|
||||
ControlManager.SetupControl(name);
|
||||
ControlManager.SetupControl(size);
|
||||
ControlManager.SetupControl(style);
|
||||
|
||||
//populate the font name box
|
||||
foreach(var font in FontFamily.Families)
|
||||
{
|
||||
name.Items.Add(font.Name);
|
||||
}
|
||||
name.Text = ((Font)c.Field.GetValue(LoadedSkin)).Name;
|
||||
|
||||
size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
|
||||
|
||||
//populate the style box
|
||||
foreach(var s in (FontStyle[])Enum.GetValues(typeof(FontStyle)))
|
||||
{
|
||||
style.Items.Add(s.ToString());
|
||||
}
|
||||
style.Text = ((Font)c.Field.GetValue(LoadedSkin)).Style.ToString();
|
||||
|
||||
name.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
|
||||
|
||||
var f = en[style.SelectedIndex];
|
||||
|
||||
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
|
||||
CodepointValue += 100;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
style.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
|
||||
|
||||
var f = en[style.SelectedIndex];
|
||||
|
||||
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
|
||||
CodepointValue += 50;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
size.TextChanged += (o, a) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
|
||||
|
||||
var f = en[style.SelectedIndex];
|
||||
|
||||
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
|
||||
}
|
||||
catch
|
||||
{
|
||||
size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
|
||||
}
|
||||
CodepointValue += 50;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
flbody.Controls.Add(name);
|
||||
flbody.Controls.Add(size);
|
||||
flbody.Controls.Add(style);
|
||||
|
||||
name.Show();
|
||||
size.Show();
|
||||
style.Show();
|
||||
|
||||
}
|
||||
else if(c.Field.FieldType == typeof(Color))
|
||||
{
|
||||
var color = new Button();
|
||||
color.Width = 40;
|
||||
labelHeight = color.Height;
|
||||
//just so it's flat like the system.
|
||||
ControlManager.SetupControl(color);
|
||||
|
||||
color.BackColor = ((Color)c.Field.GetValue(LoadedSkin));
|
||||
color.BackColorChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, color.BackColor);
|
||||
};
|
||||
color.Click += (o, a) =>
|
||||
{
|
||||
AppearanceManager.SetupDialog(new ColorPicker(color.BackColor, c.Name, new Action<Color>((col) =>
|
||||
{
|
||||
color.BackColor = col;
|
||||
CodepointValue += 300;
|
||||
InvokeSetup(cat);
|
||||
|
||||
})));
|
||||
};
|
||||
flbody.SetFlowBreak(color, true);
|
||||
color.Tag = "keepbg";
|
||||
flbody.Controls.Add(color);
|
||||
color.Show();
|
||||
}
|
||||
else if(c.Field.FieldType.IsEnum == true)
|
||||
{
|
||||
var cBox = new ComboBox();
|
||||
cBox.Width = 150;
|
||||
ControlManager.SetupControl(cBox);
|
||||
|
||||
foreach(var itm in Enum.GetNames(c.Field.FieldType))
|
||||
{
|
||||
cBox.Items.Add(itm);
|
||||
}
|
||||
|
||||
cBox.Text = c.Field.GetValue(LoadedSkin).ToString();
|
||||
|
||||
cBox.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, Enum.Parse(c.Field.FieldType, cBox.Text));
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
labelHeight = cBox.Height;
|
||||
|
||||
flbody.Controls.Add(cBox);
|
||||
cBox.Show();
|
||||
flbody.SetFlowBreak(cBox, true);
|
||||
}
|
||||
else if(c.Field.FieldType == typeof(int))
|
||||
{
|
||||
if (c.Field.HasShifterEnumMask())
|
||||
{
|
||||
var name = new ComboBox();
|
||||
name.Width = 120;
|
||||
ControlManager.SetupControl(name);
|
||||
string[] items = c.Field.GetShifterEnumMask();
|
||||
foreach(var item in items)
|
||||
{
|
||||
name.Items.Add(item);
|
||||
}
|
||||
name.SelectedIndex = (int)c.Field.GetValue(LoadedSkin);
|
||||
name.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, name.SelectedIndex);
|
||||
CodepointValue += 75;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
labelHeight = name.Height;
|
||||
flbody.Controls.Add(name);
|
||||
name.Show();
|
||||
flbody.SetFlowBreak(name, true);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var width = new TextBox();
|
||||
width.Width = 30;
|
||||
width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
|
||||
ControlManager.SetupControl(width);
|
||||
labelHeight = width.Height;
|
||||
flbody.Controls.Add(width);
|
||||
width.Show();
|
||||
|
||||
EventHandler tc = (o, a) =>
|
||||
{
|
||||
try
|
||||
EventHandler tc = (o, a) =>
|
||||
{
|
||||
int x = Convert.ToInt32(width.Text);
|
||||
|
||||
int oldx = ((int)c.Field.GetValue(this.LoadedSkin));
|
||||
|
||||
if (x != oldx)
|
||||
try
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, x);
|
||||
CodepointValue += 75;
|
||||
int x = Convert.ToInt32(width.Text);
|
||||
int y = Convert.ToInt32(height.Text);
|
||||
|
||||
int oldx = ((Size)c.Field.GetValue(this.LoadedSkin)).Width;
|
||||
int oldy = ((Size)c.Field.GetValue(this.LoadedSkin)).Height;
|
||||
|
||||
if (x != oldx || y != oldy)
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, new Size(x, y));
|
||||
CodepointValue += 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch
|
||||
{
|
||||
width.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Width.ToString();
|
||||
height.Text = ((Size)c.Field.GetValue(this.LoadedSkin)).Height.ToString();
|
||||
}
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
width.TextChanged += tc;
|
||||
height.TextChanged += tc;
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(bool))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var check = new CheckBox();
|
||||
check.Checked = ((bool)c.Field.GetValue(LoadedSkin));
|
||||
labelHeight = check.Height;
|
||||
check.CheckedChanged += (o, a) =>
|
||||
{
|
||||
width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
|
||||
c.Field.SetValue(LoadedSkin, check.Checked);
|
||||
CodepointValue += 50;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
flbody.SetFlowBreak(check, true);
|
||||
|
||||
flbody.Controls.Add(check);
|
||||
check.Show();
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(Font))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var name = new ComboBox();
|
||||
var size = new TextBox();
|
||||
var style = new ComboBox();
|
||||
|
||||
name.Width = 120;
|
||||
labelHeight = name.Height;
|
||||
size.Width = 40;
|
||||
style.Width = 80;
|
||||
flbody.SetFlowBreak(style, true);
|
||||
|
||||
ControlManager.SetupControl(name);
|
||||
ControlManager.SetupControl(size);
|
||||
ControlManager.SetupControl(style);
|
||||
|
||||
//populate the font name box
|
||||
foreach (var font in FontFamily.Families)
|
||||
{
|
||||
name.Items.Add(font.Name);
|
||||
}
|
||||
InvokeSetup(cat);
|
||||
name.Text = ((Font)c.Field.GetValue(LoadedSkin)).Name;
|
||||
|
||||
};
|
||||
size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
|
||||
|
||||
width.TextChanged += tc;
|
||||
flbody.SetFlowBreak(width, true);
|
||||
//populate the style box
|
||||
foreach (var s in (FontStyle[])Enum.GetValues(typeof(FontStyle)))
|
||||
{
|
||||
style.Items.Add(s.ToString());
|
||||
}
|
||||
style.Text = ((Font)c.Field.GetValue(LoadedSkin)).Style.ToString();
|
||||
|
||||
name.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
|
||||
|
||||
var f = en[style.SelectedIndex];
|
||||
|
||||
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
|
||||
CodepointValue += 100;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
style.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
|
||||
|
||||
var f = en[style.SelectedIndex];
|
||||
|
||||
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
|
||||
CodepointValue += 50;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
size.TextChanged += (o, a) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var en = (FontStyle[])Enum.GetValues(typeof(FontStyle));
|
||||
|
||||
var f = en[style.SelectedIndex];
|
||||
|
||||
c.Field.SetValue(LoadedSkin, new Font(name.Text, (float)Convert.ToDouble(size.Text), f));
|
||||
}
|
||||
catch
|
||||
{
|
||||
size.Text = ((Font)c.Field.GetValue(LoadedSkin)).Size.ToString();
|
||||
}
|
||||
CodepointValue += 50;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
flbody.Controls.Add(name);
|
||||
flbody.Controls.Add(size);
|
||||
flbody.Controls.Add(style);
|
||||
|
||||
name.Show();
|
||||
size.Show();
|
||||
style.Show();
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(Color))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var color = new Button();
|
||||
color.Width = 40;
|
||||
labelHeight = color.Height;
|
||||
//just so it's flat like the system.
|
||||
ControlManager.SetupControl(color);
|
||||
|
||||
color.BackColor = ((Color)c.Field.GetValue(LoadedSkin));
|
||||
color.Click += (o, a) =>
|
||||
{
|
||||
AppearanceManager.SetupDialog(new ColorPicker((Color)c.Field.GetValue(LoadedSkin), c.Name, new Action<Color>((col) =>
|
||||
{
|
||||
color.BackColor = col;
|
||||
c.Field.SetValue(LoadedSkin, col);
|
||||
CodepointValue += 300;
|
||||
InvokeSetup(cat);
|
||||
|
||||
})));
|
||||
};
|
||||
flbody.SetFlowBreak(color, true);
|
||||
color.Tag = "keepbg";
|
||||
flbody.Controls.Add(color);
|
||||
color.Show();
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType.IsEnum == true)
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var cBox = new ComboBox();
|
||||
cBox.Width = 150;
|
||||
ControlManager.SetupControl(cBox);
|
||||
|
||||
foreach (var itm in Enum.GetNames(c.Field.FieldType))
|
||||
{
|
||||
cBox.Items.Add(itm);
|
||||
}
|
||||
|
||||
cBox.Text = c.Field.GetValue(LoadedSkin).ToString();
|
||||
|
||||
cBox.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, Enum.Parse(c.Field.FieldType, cBox.Text));
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
labelHeight = cBox.Height;
|
||||
|
||||
flbody.Controls.Add(cBox);
|
||||
cBox.Show();
|
||||
flbody.SetFlowBreak(cBox, true);
|
||||
});
|
||||
}
|
||||
else if (c.Field.FieldType == typeof(int))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
if (c.Field.HasShifterEnumMask())
|
||||
{
|
||||
var name = new ComboBox();
|
||||
name.Width = 120;
|
||||
ControlManager.SetupControl(name);
|
||||
string[] items = c.Field.GetShifterEnumMask();
|
||||
foreach (var item in items)
|
||||
{
|
||||
name.Items.Add(item);
|
||||
}
|
||||
name.SelectedIndex = (int)c.Field.GetValue(LoadedSkin);
|
||||
name.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, name.SelectedIndex);
|
||||
CodepointValue += 75;
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
labelHeight = name.Height;
|
||||
flbody.Controls.Add(name);
|
||||
name.Show();
|
||||
flbody.SetFlowBreak(name, true);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var width = new TextBox();
|
||||
width.Width = 30;
|
||||
width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
|
||||
ControlManager.SetupControl(width);
|
||||
labelHeight = width.Height;
|
||||
flbody.Controls.Add(width);
|
||||
width.Show();
|
||||
|
||||
EventHandler tc = (o, a) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
int x = Convert.ToInt32(width.Text);
|
||||
|
||||
int oldx = ((int)c.Field.GetValue(this.LoadedSkin));
|
||||
|
||||
if (x != oldx)
|
||||
{
|
||||
c.Field.SetValue(LoadedSkin, x);
|
||||
CodepointValue += 75;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
width.Text = ((int)c.Field.GetValue(this.LoadedSkin)).ToString();
|
||||
}
|
||||
InvokeSetup(cat);
|
||||
|
||||
};
|
||||
|
||||
width.TextChanged += tc;
|
||||
flbody.SetFlowBreak(width, true);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
lbl.AutoSize = false;
|
||||
lbl.Width = (int)this.CreateGraphics().MeasureString(lbl.Text, SkinEngine.LoadedSkin.MainFont).Width + 15;
|
||||
lbl.Height = labelHeight;
|
||||
lbl.TextAlign = ContentAlignment.MiddleLeft;
|
||||
});
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(c.Description))
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
var desc = new Label();
|
||||
flbody.SetFlowBreak(desc, true);
|
||||
desc.Text = c.Description;
|
||||
desc.AutoSize = true;
|
||||
flbody.Controls.Add(desc);
|
||||
desc.Show();
|
||||
});
|
||||
}
|
||||
}
|
||||
lbl.AutoSize = false;
|
||||
lbl.Width = (int)this.CreateGraphics().MeasureString(lbl.Text, SkinEngine.LoadedSkin.MainFont).Width + 15;
|
||||
lbl.Height = labelHeight;
|
||||
lbl.TextAlign = ContentAlignment.MiddleLeft;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(c.Description))
|
||||
{
|
||||
var desc = new Label();
|
||||
flbody.SetFlowBreak(desc, true);
|
||||
desc.Text = c.Description;
|
||||
desc.AutoSize = true;
|
||||
flbody.Controls.Add(desc);
|
||||
desc.Show();
|
||||
}
|
||||
}
|
||||
}).Start();
|
||||
}
|
||||
|
||||
public ImageLayout GetLayout(string name)
|
||||
|
|
|
@ -80,6 +80,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
txturl.Location = new Point(btnforward.Left + btnforward.Width + 2, 2);
|
||||
txturl.Width = flcontrols.Width - btnback.Width - 2 - btnforward.Width - 2 - (btngo.Width*2) - 2;
|
||||
btngo.Location = new Point(flcontrols.Width - btngo.Width - 2, 2);
|
||||
flcontrols.BackColor = SkinEngine.LoadedSkin.TitleBackgroundColor;
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
|
@ -147,6 +148,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public void NavigateToUrl(string url)
|
||||
{
|
||||
|
||||
txturl.Text = url;
|
||||
foreach(var exe in Directory.GetFiles(Environment.CurrentDirectory))
|
||||
{
|
||||
|
@ -171,7 +173,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
var obj = (IShiftnetSite)Activator.CreateInstance(type, null);
|
||||
obj.GoToUrl += (u) =>
|
||||
{
|
||||
History.Push(u);
|
||||
History.Push(CurrentUrl);
|
||||
NavigateToUrl(u);
|
||||
};
|
||||
obj.GoBack += () =>
|
||||
|
@ -188,6 +190,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
obj.OnUpgrade();
|
||||
obj.OnSkinLoad();
|
||||
obj.Setup();
|
||||
AppearanceManager.SetWindowTitle(this, attribute.Name + " - Shiftnet");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,16 +61,16 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.btnbuy = new System.Windows.Forms.Button();
|
||||
this.lbupgradetitle = new System.Windows.Forms.Label();
|
||||
this.pnllist = new System.Windows.Forms.Panel();
|
||||
this.lbnoupgrades = new System.Windows.Forms.Label();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.lblcategorytext = new System.Windows.Forms.Label();
|
||||
this.btncat_forward = new System.Windows.Forms.Button();
|
||||
this.btncat_back = new System.Windows.Forms.Button();
|
||||
this.lbcodepoints = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.pgupgradeprogress = new ShiftOS.WinForms.Controls.ShiftedProgressBar();
|
||||
this.lbupgrades = new System.Windows.Forms.ListBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.btncat_back = new System.Windows.Forms.Button();
|
||||
this.btncat_forward = new System.Windows.Forms.Button();
|
||||
this.lblcategorytext = new System.Windows.Forms.Label();
|
||||
this.lbnoupgrades = new System.Windows.Forms.Label();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
this.pnlupgradeactions.SuspendLayout();
|
||||
|
@ -159,6 +159,63 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.pnllist.Size = new System.Drawing.Size(406, 427);
|
||||
this.pnllist.TabIndex = 0;
|
||||
//
|
||||
// lbnoupgrades
|
||||
//
|
||||
this.lbnoupgrades.AutoSize = true;
|
||||
this.lbnoupgrades.Location = new System.Drawing.Point(69, 183);
|
||||
this.lbnoupgrades.Name = "lbnoupgrades";
|
||||
this.lbnoupgrades.Size = new System.Drawing.Size(71, 13);
|
||||
this.lbnoupgrades.TabIndex = 6;
|
||||
this.lbnoupgrades.Tag = "header2";
|
||||
this.lbnoupgrades.Text = "No upgrades!";
|
||||
this.lbnoupgrades.Visible = false;
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.lblcategorytext);
|
||||
this.panel3.Controls.Add(this.btncat_forward);
|
||||
this.panel3.Controls.Add(this.btncat_back);
|
||||
this.panel3.Location = new System.Drawing.Point(6, 76);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(394, 23);
|
||||
this.panel3.TabIndex = 5;
|
||||
//
|
||||
// lblcategorytext
|
||||
//
|
||||
this.lblcategorytext.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblcategorytext.Location = new System.Drawing.Point(29, 0);
|
||||
this.lblcategorytext.Name = "lblcategorytext";
|
||||
this.lblcategorytext.Size = new System.Drawing.Size(336, 23);
|
||||
this.lblcategorytext.TabIndex = 2;
|
||||
this.lblcategorytext.Text = "No Upgrades";
|
||||
this.lblcategorytext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// btncat_forward
|
||||
//
|
||||
this.btncat_forward.AutoSize = true;
|
||||
this.btncat_forward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btncat_forward.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btncat_forward.Location = new System.Drawing.Point(365, 0);
|
||||
this.btncat_forward.Name = "btncat_forward";
|
||||
this.btncat_forward.Size = new System.Drawing.Size(29, 23);
|
||||
this.btncat_forward.TabIndex = 1;
|
||||
this.btncat_forward.Text = "-->";
|
||||
this.btncat_forward.UseVisualStyleBackColor = true;
|
||||
this.btncat_forward.Click += new System.EventHandler(this.btncat_forward_Click);
|
||||
//
|
||||
// btncat_back
|
||||
//
|
||||
this.btncat_back.AutoSize = true;
|
||||
this.btncat_back.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btncat_back.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.btncat_back.Location = new System.Drawing.Point(0, 0);
|
||||
this.btncat_back.Name = "btncat_back";
|
||||
this.btncat_back.Size = new System.Drawing.Size(29, 23);
|
||||
this.btncat_back.TabIndex = 0;
|
||||
this.btncat_back.Text = "<--";
|
||||
this.btncat_back.UseVisualStyleBackColor = true;
|
||||
this.btncat_back.Click += new System.EventHandler(this.btncat_back_Click);
|
||||
//
|
||||
// lbcodepoints
|
||||
//
|
||||
this.lbcodepoints.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
|
@ -168,7 +225,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.lbcodepoints.Size = new System.Drawing.Size(135, 13);
|
||||
this.lbcodepoints.TabIndex = 3;
|
||||
this.lbcodepoints.Text = "You have: %cp Codepoints";
|
||||
this.lbcodepoints.Click += new System.EventHandler(this.lbcodepoints_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
|
@ -184,12 +240,10 @@ namespace ShiftOS.WinForms.Applications
|
|||
//
|
||||
this.pgupgradeprogress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pgupgradeprogress.BlockSize = 5;
|
||||
this.pgupgradeprogress.Location = new System.Drawing.Point(146, 390);
|
||||
this.pgupgradeprogress.Maximum = 100;
|
||||
this.pgupgradeprogress.Name = "pgupgradeprogress";
|
||||
this.pgupgradeprogress.Size = new System.Drawing.Size(254, 23);
|
||||
this.pgupgradeprogress.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pgupgradeprogress.TabIndex = 1;
|
||||
this.pgupgradeprogress.Value = 25;
|
||||
//
|
||||
|
@ -215,63 +269,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.label3.Size = new System.Drawing.Size(137, 13);
|
||||
this.label3.TabIndex = 2;
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.lblcategorytext);
|
||||
this.panel3.Controls.Add(this.btncat_forward);
|
||||
this.panel3.Controls.Add(this.btncat_back);
|
||||
this.panel3.Location = new System.Drawing.Point(6, 76);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(394, 23);
|
||||
this.panel3.TabIndex = 5;
|
||||
//
|
||||
// btncat_back
|
||||
//
|
||||
this.btncat_back.AutoSize = true;
|
||||
this.btncat_back.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btncat_back.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.btncat_back.Location = new System.Drawing.Point(0, 0);
|
||||
this.btncat_back.Name = "btncat_back";
|
||||
this.btncat_back.Size = new System.Drawing.Size(29, 23);
|
||||
this.btncat_back.TabIndex = 0;
|
||||
this.btncat_back.Text = "<--";
|
||||
this.btncat_back.UseVisualStyleBackColor = true;
|
||||
this.btncat_back.Click += new System.EventHandler(this.btncat_back_Click);
|
||||
//
|
||||
// btncat_forward
|
||||
//
|
||||
this.btncat_forward.AutoSize = true;
|
||||
this.btncat_forward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btncat_forward.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btncat_forward.Location = new System.Drawing.Point(365, 0);
|
||||
this.btncat_forward.Name = "btncat_forward";
|
||||
this.btncat_forward.Size = new System.Drawing.Size(29, 23);
|
||||
this.btncat_forward.TabIndex = 1;
|
||||
this.btncat_forward.Text = "-->";
|
||||
this.btncat_forward.UseVisualStyleBackColor = true;
|
||||
this.btncat_forward.Click += new System.EventHandler(this.btncat_forward_Click);
|
||||
//
|
||||
// lblcategorytext
|
||||
//
|
||||
this.lblcategorytext.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lblcategorytext.Location = new System.Drawing.Point(29, 0);
|
||||
this.lblcategorytext.Name = "lblcategorytext";
|
||||
this.lblcategorytext.Size = new System.Drawing.Size(336, 23);
|
||||
this.lblcategorytext.TabIndex = 2;
|
||||
this.lblcategorytext.Text = "label2";
|
||||
this.lblcategorytext.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lbnoupgrades
|
||||
//
|
||||
this.lbnoupgrades.AutoSize = true;
|
||||
this.lbnoupgrades.Location = new System.Drawing.Point(69, 183);
|
||||
this.lbnoupgrades.Name = "lbnoupgrades";
|
||||
this.lbnoupgrades.Size = new System.Drawing.Size(71, 13);
|
||||
this.lbnoupgrades.TabIndex = 6;
|
||||
this.lbnoupgrades.Tag = "header2";
|
||||
this.lbnoupgrades.Text = "No upgrades!";
|
||||
this.lbnoupgrades.Visible = false;
|
||||
//
|
||||
// ShiftoriumFrontend
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -281,7 +278,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
this.ForeColor = System.Drawing.Color.LightGreen;
|
||||
this.Name = "ShiftoriumFrontend";
|
||||
this.Size = new System.Drawing.Size(782, 427);
|
||||
this.Load += new System.EventHandler(this.Shiftorium_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.pnlupgradeactions.ResumeLayout(false);
|
||||
|
|
|
@ -30,6 +30,7 @@ using System.Drawing;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using ShiftOS.Engine;
|
||||
|
@ -46,19 +47,22 @@ namespace ShiftOS.WinForms.Applications
|
|||
public partial class ShiftoriumFrontend : UserControl, IShiftOSWindow
|
||||
{
|
||||
public int CategoryId = 0;
|
||||
public static System.Timers.Timer timer100;
|
||||
private string[] cats = backend.GetCategories();
|
||||
private ShiftoriumUpgrade[] avail;
|
||||
|
||||
|
||||
public void updatecounter()
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() => { lbcodepoints.Text = $"You have {SaveSystem.CurrentSave.Codepoints} Codepoints."; });
|
||||
}
|
||||
|
||||
public ShiftoriumFrontend()
|
||||
{
|
||||
cp_update = new System.Windows.Forms.Timer();
|
||||
cp_update.Tick += (o, a) =>
|
||||
{
|
||||
lbcodepoints.Text = $"You have {SaveSystem.CurrentSave.Codepoints} Codepoints.";
|
||||
};
|
||||
cp_update.Interval = 100;
|
||||
InitializeComponent();
|
||||
PopulateShiftorium();
|
||||
SaveSystem.CurrentSave.addSetCpCallback(updatecounter);
|
||||
updatecounter();
|
||||
Populate();
|
||||
SetList();
|
||||
lbupgrades.SelectedIndexChanged += (o, a) =>
|
||||
{
|
||||
try
|
||||
|
@ -81,55 +85,57 @@ namespace ShiftOS.WinForms.Applications
|
|||
public void SelectUpgrade(string name)
|
||||
{
|
||||
btnbuy.Show();
|
||||
var upg = upgrades[name];
|
||||
var upg = upgrades[CategoryId][name];
|
||||
lbupgradetitle.Text = Localization.Parse(upg.Name);
|
||||
lbupgradedesc.Text = Localization.Parse(upg.Description);
|
||||
}
|
||||
|
||||
Dictionary<string, ShiftoriumUpgrade> upgrades = new Dictionary<string, ShiftoriumUpgrade>();
|
||||
|
||||
public void PopulateShiftorium()
|
||||
Dictionary<string, ShiftoriumUpgrade>[] upgrades;
|
||||
|
||||
private void Populate()
|
||||
{
|
||||
upgrades = new Dictionary<string, ShiftoriumUpgrade>[cats.Length];
|
||||
int numComplete = 0;
|
||||
avail = backend.GetAvailable();
|
||||
foreach (var it in cats.Select((catName, catId) => new { catName, catId }))
|
||||
{
|
||||
var upl = new Dictionary<string, ShiftoriumUpgrade>();
|
||||
upgrades[it.catId] = upl;
|
||||
var t = new Thread((tupobj) =>
|
||||
{
|
||||
foreach (var upg in avail.Where(x => x.Category == it.catName))
|
||||
upl.Add(Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP", upg);
|
||||
numComplete++;
|
||||
});
|
||||
t.Start();
|
||||
}
|
||||
while (numComplete < cats.Length) { } // wait for all threads to finish their job
|
||||
}
|
||||
|
||||
private void SetList()
|
||||
{
|
||||
lbnoupgrades.Hide();
|
||||
lbupgrades.Items.Clear();
|
||||
try
|
||||
{
|
||||
lbnoupgrades.Hide();
|
||||
lbupgrades.Items.Clear();
|
||||
upgrades.Clear();
|
||||
Timer();
|
||||
|
||||
foreach (var upg in backend.GetAvailable().Where(x => x.Category == backend.GetCategories()[CategoryId]))
|
||||
{
|
||||
String name = Localization.Parse(upg.Name) + " - " + upg.Cost.ToString() + "CP";
|
||||
upgrades.Add(name, upg);
|
||||
lbupgrades.Items.Add(name);
|
||||
}
|
||||
|
||||
if (lbupgrades.Items.Count == 0)
|
||||
{
|
||||
lbnoupgrades.Show();
|
||||
lbnoupgrades.Location = new Point(
|
||||
(lbupgrades.Width - lbnoupgrades.Width) / 2,
|
||||
(lbupgrades.Height - lbnoupgrades.Height) / 2
|
||||
);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
lbnoupgrades.Hide();
|
||||
}
|
||||
lblcategorytext.Text = Shiftorium.GetCategories()[CategoryId];
|
||||
btncat_back.Visible = (CategoryId > 0);
|
||||
btncat_forward.Visible = (CategoryId < backend.GetCategories().Length - 1);
|
||||
lbupgrades.Items.AddRange(upgrades[CategoryId].Keys.ToArray());
|
||||
}
|
||||
catch
|
||||
{
|
||||
Engine.Infobox.Show("Shiftorium Machine Broke", "Category ID " + CategoryId.ToString() + " is invalid, modulo is broken, and the world is doomed. Please tell Declan about this.");
|
||||
return;
|
||||
}
|
||||
if (lbupgrades.Items.Count == 0)
|
||||
{
|
||||
lbnoupgrades.Show();
|
||||
lbnoupgrades.Location = new Point(
|
||||
(lbupgrades.Width - lbnoupgrades.Width) / 2,
|
||||
(lbupgrades.Height - lbnoupgrades.Height) / 2
|
||||
lbupgrades.Top + (lbupgrades.Height - lbnoupgrades.Height) / 2
|
||||
);
|
||||
|
||||
}
|
||||
else
|
||||
lbnoupgrades.Hide();
|
||||
lblcategorytext.Text = cats[CategoryId];
|
||||
}
|
||||
|
||||
public static bool UpgradeInstalled(string upg)
|
||||
|
@ -183,13 +189,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
private void btnbuy_Click(object sender, EventArgs e)
|
||||
{
|
||||
long cpCost = 0;
|
||||
ulong cpCost = 0;
|
||||
backend.Silent = true;
|
||||
Dictionary<string, long> UpgradesToBuy = new Dictionary<string, long>();
|
||||
Dictionary<string, ulong> UpgradesToBuy = new Dictionary<string, ulong>();
|
||||
foreach (var itm in lbupgrades.SelectedItems)
|
||||
{
|
||||
cpCost += upgrades[itm.ToString()].Cost;
|
||||
UpgradesToBuy.Add(upgrades[itm.ToString()].ID, upgrades[itm.ToString()].Cost);
|
||||
var upg = upgrades[CategoryId][itm.ToString()];
|
||||
cpCost += upg.Cost;
|
||||
UpgradesToBuy.Add(upg.ID, upg.Cost);
|
||||
}
|
||||
if (SaveSystem.CurrentSave.Codepoints < cpCost)
|
||||
{
|
||||
|
@ -200,22 +207,26 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
foreach(var upg in UpgradesToBuy)
|
||||
{
|
||||
backend.Buy(upg.Key, upg.Value);
|
||||
if (SaveSystem.CurrentSave.Upgrades.ContainsKey(upg.Key))
|
||||
{
|
||||
SaveSystem.CurrentSave.Upgrades[upg.Key] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveSystem.CurrentSave.Upgrades.Add(upg.Key, true);
|
||||
}
|
||||
SaveSystem.SaveGame();
|
||||
backend.InvokeUpgradeInstalled();
|
||||
}
|
||||
SaveSystem.CurrentSave.Codepoints -= cpCost;
|
||||
}
|
||||
|
||||
backend.Silent = false;
|
||||
PopulateShiftorium();
|
||||
btnbuy.Hide();
|
||||
}
|
||||
|
||||
private void Shiftorium_Load(object sender, EventArgs e) {
|
||||
|
||||
}
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
cp_update.Start();
|
||||
lbnoupgrades.Hide();
|
||||
}
|
||||
|
||||
|
@ -224,12 +235,9 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
}
|
||||
|
||||
Timer cp_update = new System.Windows.Forms.Timer();
|
||||
|
||||
public bool OnUnload()
|
||||
{
|
||||
cp_update.Stop();
|
||||
cp_update = null;
|
||||
SaveSystem.CurrentSave.removeSetCpCallback(updatecounter);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -237,38 +245,26 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
lbupgrades.SelectionMode = (UpgradeInstalled("shiftorium_gui_bulk_buy") == true) ? SelectionMode.MultiExtended : SelectionMode.One;
|
||||
lbcodepoints.Visible = Shiftorium.UpgradeInstalled("shiftorium_gui_codepoints_display");
|
||||
Populate();
|
||||
SetList();
|
||||
}
|
||||
|
||||
private void lbcodepoints_Click(object sender, EventArgs e)
|
||||
private void moveCat(short direction) // direction is -1 to move backwards or 1 to move forwards
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Timer()
|
||||
{
|
||||
timer100 = new System.Timers.Timer();
|
||||
timer100.Interval = 2000;
|
||||
//timer100.Elapsed += ???;
|
||||
timer100.AutoReset = true;
|
||||
timer100.Enabled = true;
|
||||
CategoryId += direction;
|
||||
CategoryId %= cats.Length;
|
||||
if (CategoryId < 0) CategoryId += cats.Length; // fix modulo on negatives
|
||||
SetList();
|
||||
}
|
||||
|
||||
private void btncat_back_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(CategoryId > 0)
|
||||
{
|
||||
CategoryId--;
|
||||
PopulateShiftorium();
|
||||
}
|
||||
moveCat(-1);
|
||||
}
|
||||
|
||||
private void btncat_forward_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(CategoryId < backend.GetCategories().Length - 1)
|
||||
{
|
||||
CategoryId++;
|
||||
PopulateShiftorium();
|
||||
}
|
||||
moveCat(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
Infobox.Show("No file chosen.", "Please select a file to sell.");
|
||||
return;
|
||||
}
|
||||
Item.Cost = Convert.ToInt32(txtcost.Text);
|
||||
Item.Cost = Convert.ToUInt64(txtcost.Text);
|
||||
Item.Description = txtdescription.Text;
|
||||
Item.Name = txtitemname.Text;
|
||||
Callback?.Invoke(Item);
|
||||
|
@ -101,7 +101,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
try
|
||||
{
|
||||
Item.Cost = Convert.ToInt32(txtcost.Text);
|
||||
Item.Cost = Convert.ToUInt64(txtcost.Text);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
@ -65,8 +65,11 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public void SetupUI()
|
||||
{
|
||||
SetupDesktop();
|
||||
Setup();
|
||||
if (LoadedSkin != null)
|
||||
{
|
||||
SetupDesktop();
|
||||
Setup();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetupDesktop()
|
||||
|
@ -78,7 +81,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
//upgrades
|
||||
|
||||
if (SaveSystem.CurrentSave != null)
|
||||
if (SaveSystem.CurrentSave != null && LoadedSkin != null)
|
||||
{
|
||||
desktoppanel.Visible = ShiftoriumFrontend.UpgradeInstalled("desktop");
|
||||
lbtime.Visible = ShiftoriumFrontend.UpgradeInstalled("desktop_clock_widget");
|
||||
|
@ -303,7 +306,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
System.IO.Directory.CreateDirectory(Paths.SharedFolder + "\\skins");
|
||||
}
|
||||
|
||||
string path = Paths.SharedFolder + "\\skins\\" + SaveSystem.CurrentSave.Username + "-" + fname;
|
||||
string path = Paths.SharedFolder + "\\skins\\" + SaveSystem.CurrentUser.Username + "-" + fname;
|
||||
System.IO.File.WriteAllText(path, JsonConvert.SerializeObject(LoadedSkin));
|
||||
|
||||
})));
|
||||
|
|
|
@ -130,25 +130,31 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
ResetAllKeywords();
|
||||
rtbterm.Text = "";
|
||||
if (!Shiftorium.UpgradeInstalled("desktop"))
|
||||
if (Shiftorium.UpgradeInstalled("first_steps"))
|
||||
{
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.InStory = false;
|
||||
TerminalBackend.PrintPrompt();
|
||||
if (Shiftorium.UpgradeInstalled("wm_free_placement"))
|
||||
if (!Shiftorium.UpgradeInstalled("desktop"))
|
||||
{
|
||||
this.ParentForm.Width = 640;
|
||||
this.ParentForm.Height = 480;
|
||||
this.ParentForm.Left = (Screen.PrimaryScreen.Bounds.Width - 640) / 2;
|
||||
this.ParentForm.Top = (Screen.PrimaryScreen.Bounds.Height - 480) / 2;
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.InStory = false;
|
||||
TerminalBackend.PrintPrompt();
|
||||
if (Shiftorium.UpgradeInstalled("wm_free_placement"))
|
||||
{
|
||||
this.ParentForm.Width = 640;
|
||||
this.ParentForm.Height = 480;
|
||||
this.ParentForm.Left = (Screen.PrimaryScreen.Bounds.Width - 640) / 2;
|
||||
this.ParentForm.Top = (Screen.PrimaryScreen.Bounds.Height - 480) / 2;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AppearanceManager.Close(this);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AppearanceManager.Close(this);
|
||||
Story.Start("first_steps");
|
||||
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -195,52 +201,6 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public static event TextSentEventHandler TextSent;
|
||||
|
||||
public void ResetAllKeywords()
|
||||
{
|
||||
string primary = SaveSystem.CurrentUser.Username + " ";
|
||||
string secondary = "shiftos ";
|
||||
|
||||
|
||||
var asm = Assembly.GetExecutingAssembly();
|
||||
|
||||
var types = asm.GetTypes();
|
||||
|
||||
foreach (var type in types)
|
||||
{
|
||||
foreach (var a in type.GetCustomAttributes(false))
|
||||
{
|
||||
if (ShiftoriumFrontend.UpgradeAttributesUnlocked(type))
|
||||
{
|
||||
if (a is Namespace)
|
||||
{
|
||||
var ns = a as Namespace;
|
||||
if (!primary.Contains(ns.name))
|
||||
{
|
||||
primary += ns.name + " ";
|
||||
}
|
||||
foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
|
||||
{
|
||||
if (ShiftoriumFrontend.UpgradeAttributesUnlocked(method))
|
||||
{
|
||||
foreach (var ma in method.GetCustomAttributes(false))
|
||||
{
|
||||
if (ma is Command)
|
||||
{
|
||||
var cmd = ma as Command;
|
||||
if (!secondary.Contains(cmd.name))
|
||||
secondary += cmd.name + " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void MakeWidget(Controls.TerminalBox txt)
|
||||
{
|
||||
AppearanceManager.StartConsoleOut();
|
||||
|
@ -260,11 +220,19 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
try
|
||||
{
|
||||
a.SuppressKeyPress = true;
|
||||
Console.WriteLine("");
|
||||
if (!TerminalBackend.InStory)
|
||||
a.SuppressKeyPress = false;
|
||||
if (!TerminalBackend.PrefixEnabled)
|
||||
{
|
||||
string textraw = txt.Lines[txt.Lines.Length - 1];
|
||||
TextSent?.Invoke(textraw);
|
||||
TerminalBackend.SendText(textraw);
|
||||
return;
|
||||
}
|
||||
var text = txt.Lines.ToArray();
|
||||
var text2 = text[text.Length - 2];
|
||||
var text2 = text[text.Length - 1];
|
||||
var text3 = "";
|
||||
txt.AppendText(Environment.NewLine);
|
||||
var text4 = Regex.Replace(text2, @"\t|\n|\r", "");
|
||||
|
||||
if (IsInRemoteSystem == true)
|
||||
|
@ -345,21 +313,24 @@ namespace ShiftOS.WinForms.Applications
|
|||
}
|
||||
else if (a.KeyCode == Keys.Left)
|
||||
{
|
||||
var getstring = txt.Lines[txt.Lines.Length - 1];
|
||||
var stringlen = getstring.Length + 1;
|
||||
var header = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ";
|
||||
var headerlen = header.Length + 1;
|
||||
var selstart = txt.SelectionStart;
|
||||
var remstrlen = txt.TextLength - stringlen;
|
||||
var finalnum = selstart - remstrlen;
|
||||
if (SaveSystem.CurrentSave != null)
|
||||
{
|
||||
var getstring = txt.Lines[txt.Lines.Length - 1];
|
||||
var stringlen = getstring.Length + 1;
|
||||
var header = $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ";
|
||||
var headerlen = header.Length + 1;
|
||||
var selstart = txt.SelectionStart;
|
||||
var remstrlen = txt.TextLength - stringlen;
|
||||
var finalnum = selstart - remstrlen;
|
||||
|
||||
if (finalnum != headerlen)
|
||||
{
|
||||
AppearanceManager.CurrentPosition--;
|
||||
}
|
||||
else
|
||||
{
|
||||
a.SuppressKeyPress = true;
|
||||
if (finalnum != headerlen)
|
||||
{
|
||||
AppearanceManager.CurrentPosition--;
|
||||
}
|
||||
else
|
||||
{
|
||||
a.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (a.KeyCode == Keys.Up)
|
||||
|
@ -367,6 +338,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
var tostring3 = txt.Lines[txt.Lines.Length - 1];
|
||||
if (tostring3 == $"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ")
|
||||
Console.Write(TerminalBackend.LastCommand);
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
a.SuppressKeyPress = true;
|
||||
|
||||
}
|
||||
|
@ -421,17 +393,212 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
if (SaveSystem.CurrentSave != null)
|
||||
{
|
||||
TerminalBackend.PrintPrompt();
|
||||
if (!ShiftoriumFrontend.UpgradeInstalled("window_manager"))
|
||||
{
|
||||
rtbterm.Select(rtbterm.TextLength, 0);
|
||||
}
|
||||
}
|
||||
|
||||
new Thread(() =>
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
public static string RemoteSystemName { get; set; }
|
||||
public static string RemoteUser { get; set; }
|
||||
public static string RemotePass { get; set; }
|
||||
|
||||
[Story("first_steps")]
|
||||
public static void FirstSteps()
|
||||
{
|
||||
TerminalBackend.PrefixEnabled = false;
|
||||
TerminalBackend.InStory = true;
|
||||
Console.WriteLine("Hey there, and welcome to ShiftOS.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("My name is DevX. I am the developer of this operating system.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Right now, I am using the Terminal application as a means of talking to you.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("ShiftOS is a very early operating system, but I have big plans for it.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("I can't reveal all my plans to you at this moment, but you play a big role.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Your role in all of this is to help me develop ShiftOS more.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("You may not know how to program, but that's perfectly fine. You don't need to.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("What you do need to do, is simply use the operating system - like you would a regular computer.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("As you use ShiftOS, you will earn a special currency called Codepoints.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("The more things you do, the more Codepoints you get! Simple, right?");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Once you rack up enough Codepoints, you can use them inside the Shiftorium to buy new features for ShiftOS.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("These features include new programs, system enhancements, Terminal commands, and so much more!");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Ahh, that reminds me. I suppose you don't know how to use the Terminal yet, do you...");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Well, the ShiftOS terminal is similar to a regular Linux terminal, however things are a bit... how you say.... primitive.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Let's just say.... I've been focusing more on function than form with this one.... Anyways, here's how the terminal works.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Each command is categorized into a \"Namespace\". All a namespace is, is a nice way of distinguishing between commands.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("...For example you may have a bunch of commands for managing files, and others for opening/closing programs.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("The three main namespaces you'll be using for the next while are the \"sos\", \"shiftorium\", and \"win\" namespaces.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("To run a command, simply type its namespace, followed by a period/full-stop, followed by the command name.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Give it a try! Type \"sos.help\" in the following prompt to view a list of all ShiftOS commands.");
|
||||
Thread.Sleep(2000);
|
||||
TerminalBackend.InStory = false;
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.PrintPrompt();
|
||||
}).Start();
|
||||
bool help_entered = false;
|
||||
TerminalBackend.CommandProcessed += (text, args) =>
|
||||
{
|
||||
if (text.EndsWith("sos.help") && help_entered == false)
|
||||
help_entered = true;
|
||||
};
|
||||
while (help_entered == false)
|
||||
Thread.Sleep(10);
|
||||
TerminalBackend.InStory = true;
|
||||
TerminalBackend.PrefixEnabled = false;
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Good job! Next, we will look at how to pass data to a command, such as win.open.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("In ShiftOS, passing data to a command is quite simple! After the command name, place an opening and closing curly brace, like so: \"win.open{}\".");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Everything between those two curly braces is treated as command data.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("However, you can't just spam a bunch of 1s and 0s and call it a day, nonono!");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Command data is split into a list of keys and values.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("The key tells the command the name of the data, and the value is what the command will see when it looks at the key.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("There are three main types of values. Booleans, which can be either \"true\" or \"false\", Numbers, which can be any integer number, positive or negative, and Strings - any piece of text as long as it is surrounded by double-quotes.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("For example, we could write every programmer's first program - by typing \"trm.echo{msg:\"Hello, world!\"}\". Running this will cause the Terminal to print, well, \"Hello, world!\"");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("To open an application in ShiftOS, you can use this principle with the \"win.open\" command.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("First, type \"win.open\" with no data to see a list of all installed programs.");
|
||||
Thread.Sleep(2000);
|
||||
TerminalBackend.InStory = false;
|
||||
bool winopenEntered = false;
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.PrintPrompt();
|
||||
TerminalBackend.CommandProcessed += (text, args) =>
|
||||
{
|
||||
if (help_entered == true)
|
||||
if (text.EndsWith("win.open") && winopenEntered == false)
|
||||
winopenEntered = true;
|
||||
};
|
||||
while (winopenEntered == false)
|
||||
Thread.Sleep(10);
|
||||
TerminalBackend.InStory = true;
|
||||
TerminalBackend.PrefixEnabled = false;
|
||||
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Pretty cool, it gave you a nice list of other win.open commands that will let you open each program.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("You've got the just of using ShiftOS. Now, for your goal.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("As you know, ShiftOS doesn't have very many features.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Using the applications you have, I need you to earn as many Codepoints as you can.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("You can use the Codepoints you earn to buy new applications and features in the Shiftorium, to help earn even more Codepoints.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("Once you earn 1,000 Codepoints, I will check back with you and see how well you've done.");
|
||||
Thread.Sleep(2000);
|
||||
Console.WriteLine("I'll leave you to it, you've got the hang of it! One last thing, if ever you find yourself in another program, and want to exit, simply press CTRL+T to return to the Terminal.");
|
||||
Thread.Sleep(2000);
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.InStory = false;
|
||||
SaveSystem.SaveGame();
|
||||
Thread.Sleep(1000);
|
||||
|
||||
Story.Context.AutoComplete = false;
|
||||
|
||||
Console.WriteLine(@"Welcome to the ShiftOS Newbie's Guide.
|
||||
|
||||
This tutorial will guide you through the more intermediate features of ShiftOS,
|
||||
such as earning Codepoints, buying Shiftoorium Upgrades, and using the objectives system.
|
||||
|
||||
Every now and then, you'll get a notification in your terminal of a ""NEW OBJECTIVE"".
|
||||
This means that someone has instructed you to do something inside ShiftOS. At any moment
|
||||
you may type ""sos.status"" in your Terminal to see your current objectives.
|
||||
|
||||
This command is very useful as not only does it allow you to see your current objectives
|
||||
but you can also see the amount of Codepoints you have as well as the upgrades you've
|
||||
installed and how many upgrades are available.
|
||||
|
||||
Now, onto your first objective! All you need to do is earn 200 Codepoints using any
|
||||
program on your system.");
|
||||
|
||||
Story.PushObjective("First Steps: Your First Codepoints", "Play a few rounds of Pong, or use another program to earn 200 Codepoints.", () =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.Codepoints >= 200;
|
||||
}, () =>
|
||||
{
|
||||
Desktop.InvokeOnWorkerThread(() =>
|
||||
{
|
||||
AppearanceManager.SetupWindow(new Terminal());
|
||||
});
|
||||
Console.WriteLine("Good job! You've earned " + SaveSystem.CurrentSave.Codepoints + @" Codepoints! You can use these inside the
|
||||
Shiftorium to buy new upgrades inside ShiftOS.
|
||||
|
||||
These upgrades can give ShiftOS more features, fixes and programs,
|
||||
which can make the operating system easier to use and navigate around
|
||||
and also make it easier for you to earn more Codepoints and thus upgrade
|
||||
te system further.
|
||||
|
||||
Be cautious though! Only certain upgrades offer the ability to earn more
|
||||
Codepoints. These upgrades are typically in the form of new programs.
|
||||
|
||||
So, try to get as many new programs as possible for your computer, and save
|
||||
the system feature upgrades for later unless you absolutely need them.
|
||||
|
||||
The worst thing that could happen is you end up stuck with very little Codepoints
|
||||
and only a few small programs to use to earn very little amounts of Codepoints.
|
||||
|
||||
Now, let's get you your first Shiftorium upgrade!");
|
||||
|
||||
Story.PushObjective("First Steps: The Shiftorium", "Buy your first Shiftorium upgrade with your new Codepoints using shiftorium.list, shiftorium.info and shiftorium.buy.",
|
||||
() =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.CountUpgrades() > 0;
|
||||
}, () =>
|
||||
{
|
||||
Console.WriteLine("This concludes the ShiftOS Newbie's Guide! Now, go, and shift it your way!");
|
||||
Console.WriteLine(@"
|
||||
Your goal: Earn 1,000 Codepoints.");
|
||||
Story.Context.MarkComplete();
|
||||
Story.Start("first_steps_transition");
|
||||
});
|
||||
TerminalBackend.PrintPrompt();
|
||||
});
|
||||
|
||||
TerminalBackend.PrintPrompt();
|
||||
}
|
||||
|
||||
|
||||
[Story("first_steps_transition")]
|
||||
public static void FirstStepsTransition()
|
||||
{
|
||||
Story.PushObjective("Earn 1000 Codepoints", "You now know the basics of ShiftOS. Let's get your system up and running with a few upgrades, and get a decent amount of Codepoints.", () =>
|
||||
{
|
||||
return SaveSystem.CurrentSave.Codepoints >= 1000;
|
||||
},
|
||||
() =>
|
||||
{
|
||||
Story.Context.MarkComplete();
|
||||
Story.Start("victortran_shiftnet");
|
||||
});
|
||||
|
||||
Story.Context.AutoComplete = false;
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
|
|
312
ShiftOS.WinForms/Applications/TriPresent.Designer.cs
generated
Normal file
312
ShiftOS.WinForms/Applications/TriPresent.Designer.cs
generated
Normal file
|
@ -0,0 +1,312 @@
|
|||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
partial class TriPresent
|
||||
{
|
||||
/// <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.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.addLabelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.addLabel = new System.Windows.Forms.Panel();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
this.checkBox1 = new System.Windows.Forms.CheckBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.yLabel = new System.Windows.Forms.Label();
|
||||
this.xLabel = new System.Windows.Forms.Label();
|
||||
this.yPosition = new System.Windows.Forms.NumericUpDown();
|
||||
this.xPosition = new System.Windows.Forms.NumericUpDown();
|
||||
this.labelContents = new System.Windows.Forms.TextBox();
|
||||
this.addItemLabel = new System.Windows.Forms.Label();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.designerPanel = new System.Windows.Forms.Panel();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.addLabel.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.yPosition)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.xPosition)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem,
|
||||
this.editToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(758, 24);
|
||||
this.menuStrip1.TabIndex = 0;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.openToolStripMenuItem,
|
||||
this.saveToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
this.fileToolStripMenuItem.Text = "&File";
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
|
||||
this.openToolStripMenuItem.Text = "&Open";
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
|
||||
this.saveToolStripMenuItem.Text = "&Save";
|
||||
//
|
||||
// editToolStripMenuItem
|
||||
//
|
||||
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addToolStripMenuItem});
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
|
||||
this.editToolStripMenuItem.Text = "&Edit";
|
||||
//
|
||||
// addToolStripMenuItem
|
||||
//
|
||||
this.addToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addLabelToolStripMenuItem});
|
||||
this.addToolStripMenuItem.Name = "addToolStripMenuItem";
|
||||
this.addToolStripMenuItem.Size = new System.Drawing.Size(96, 22);
|
||||
this.addToolStripMenuItem.Text = "Add";
|
||||
//
|
||||
// addLabelToolStripMenuItem
|
||||
//
|
||||
this.addLabelToolStripMenuItem.Name = "addLabelToolStripMenuItem";
|
||||
this.addLabelToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
|
||||
this.addLabelToolStripMenuItem.Text = "Add Label";
|
||||
this.addLabelToolStripMenuItem.Click += new System.EventHandler(this.addLabelToolStripMenuItem_Click);
|
||||
//
|
||||
// addLabel
|
||||
//
|
||||
this.addLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.addLabel.Controls.Add(this.checkBox2);
|
||||
this.addLabel.Controls.Add(this.checkBox1);
|
||||
this.addLabel.Controls.Add(this.label1);
|
||||
this.addLabel.Controls.Add(this.panel1);
|
||||
this.addLabel.Controls.Add(this.yLabel);
|
||||
this.addLabel.Controls.Add(this.xLabel);
|
||||
this.addLabel.Controls.Add(this.yPosition);
|
||||
this.addLabel.Controls.Add(this.xPosition);
|
||||
this.addLabel.Controls.Add(this.labelContents);
|
||||
this.addLabel.Controls.Add(this.addItemLabel);
|
||||
this.addLabel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.addLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.addLabel.Name = "addLabel";
|
||||
this.addLabel.Size = new System.Drawing.Size(252, 456);
|
||||
this.addLabel.TabIndex = 1;
|
||||
this.addLabel.Visible = false;
|
||||
//
|
||||
// checkBox2
|
||||
//
|
||||
this.checkBox2.AutoSize = true;
|
||||
this.checkBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.checkBox2.Location = new System.Drawing.Point(6, 163);
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.Size = new System.Drawing.Size(48, 17);
|
||||
this.checkBox2.TabIndex = 11;
|
||||
this.checkBox2.Text = "Italic";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// checkBox1
|
||||
//
|
||||
this.checkBox1.AutoSize = true;
|
||||
this.checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.checkBox1.Location = new System.Drawing.Point(6, 140);
|
||||
this.checkBox1.Name = "checkBox1";
|
||||
this.checkBox1.Size = new System.Drawing.Size(51, 17);
|
||||
this.checkBox1.TabIndex = 10;
|
||||
this.checkBox1.Text = "Bold";
|
||||
this.checkBox1.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(115, 144);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(58, 13);
|
||||
this.label1.TabIndex = 9;
|
||||
this.label1.Text = "Text Color:";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BackColor = System.Drawing.Color.Black;
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.ForeColor = System.Drawing.Color.Black;
|
||||
this.panel1.Location = new System.Drawing.Point(179, 141);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(35, 20);
|
||||
this.panel1.TabIndex = 8;
|
||||
this.panel1.Click += new System.EventHandler(this.panel1_Click);
|
||||
//
|
||||
// yLabel
|
||||
//
|
||||
this.yLabel.AutoSize = true;
|
||||
this.yLabel.Location = new System.Drawing.Point(200, 96);
|
||||
this.yLabel.Name = "yLabel";
|
||||
this.yLabel.Size = new System.Drawing.Size(14, 13);
|
||||
this.yLabel.TabIndex = 5;
|
||||
this.yLabel.Text = "Y";
|
||||
//
|
||||
// xLabel
|
||||
//
|
||||
this.xLabel.AutoSize = true;
|
||||
this.xLabel.Location = new System.Drawing.Point(3, 95);
|
||||
this.xLabel.Name = "xLabel";
|
||||
this.xLabel.Size = new System.Drawing.Size(14, 13);
|
||||
this.xLabel.TabIndex = 4;
|
||||
this.xLabel.Text = "X";
|
||||
//
|
||||
// yPosition
|
||||
//
|
||||
this.yPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.yPosition.Location = new System.Drawing.Point(127, 114);
|
||||
this.yPosition.Maximum = new decimal(new int[] {
|
||||
999999999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.yPosition.Name = "yPosition";
|
||||
this.yPosition.Size = new System.Drawing.Size(87, 20);
|
||||
this.yPosition.TabIndex = 3;
|
||||
//
|
||||
// xPosition
|
||||
//
|
||||
this.xPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.xPosition.Location = new System.Drawing.Point(3, 114);
|
||||
this.xPosition.Maximum = new decimal(new int[] {
|
||||
999999999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.xPosition.Name = "xPosition";
|
||||
this.xPosition.Size = new System.Drawing.Size(87, 20);
|
||||
this.xPosition.TabIndex = 2;
|
||||
//
|
||||
// labelContents
|
||||
//
|
||||
this.labelContents.Location = new System.Drawing.Point(3, 26);
|
||||
this.labelContents.Multiline = true;
|
||||
this.labelContents.Name = "labelContents";
|
||||
this.labelContents.Size = new System.Drawing.Size(211, 67);
|
||||
this.labelContents.TabIndex = 1;
|
||||
this.labelContents.Text = "Text";
|
||||
//
|
||||
// addItemLabel
|
||||
//
|
||||
this.addItemLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.addItemLabel.Name = "addItemLabel";
|
||||
this.addItemLabel.Size = new System.Drawing.Size(214, 23);
|
||||
this.addItemLabel.TabIndex = 0;
|
||||
this.addItemLabel.Text = "{ADD_ITEM_LABEL}";
|
||||
this.addItemLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 24);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.addLabel);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.designerPanel);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(758, 456);
|
||||
this.splitContainer1.SplitterDistance = 252;
|
||||
this.splitContainer1.TabIndex = 2;
|
||||
//
|
||||
// designerPanel
|
||||
//
|
||||
this.designerPanel.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.designerPanel.Location = new System.Drawing.Point(0, 0);
|
||||
this.designerPanel.Name = "designerPanel";
|
||||
this.designerPanel.Size = new System.Drawing.Size(502, 456);
|
||||
this.designerPanel.TabIndex = 0;
|
||||
this.designerPanel.Click += new System.EventHandler(this.designerPanel_Click);
|
||||
//
|
||||
// TriPresent
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.Name = "TriPresent";
|
||||
this.Size = new System.Drawing.Size(758, 480);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.addLabel.ResumeLayout(false);
|
||||
this.addLabel.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.yPosition)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.xPosition)).EndInit();
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem addLabelToolStripMenuItem;
|
||||
private System.Windows.Forms.Panel addLabel;
|
||||
private System.Windows.Forms.Label addItemLabel;
|
||||
private System.Windows.Forms.Label yLabel;
|
||||
private System.Windows.Forms.Label xLabel;
|
||||
private System.Windows.Forms.NumericUpDown yPosition;
|
||||
private System.Windows.Forms.NumericUpDown xPosition;
|
||||
private System.Windows.Forms.TextBox labelContents;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
private System.Windows.Forms.CheckBox checkBox1;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.Panel designerPanel;
|
||||
}
|
||||
}
|
91
ShiftOS.WinForms/Applications/TriPresent.cs
Normal file
91
ShiftOS.WinForms/Applications/TriPresent.cs
Normal file
|
@ -0,0 +1,91 @@
|
|||
#define BETA_2_5
|
||||
|
||||
using ShiftOS.Objects.ShiftFS;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using ShiftOS.Engine;
|
||||
using System.Threading;
|
||||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
#if !BETA_2_5
|
||||
[WinOpen("tripresent")]
|
||||
[AppscapeEntry("TriPresent", "Part of the trilogy of office applications for enhancement of your system. TriPresent is easliy the best presentation creator out there for ShiftOS.", 2048, 1500, "file_skimmer", "Office")]
|
||||
[DefaultTitle("TriPresent")]
|
||||
[Launcher("TriPresent", false, null, "Office")]
|
||||
#endif
|
||||
public partial class TriPresent : UserControl, IShiftOSWindow
|
||||
{
|
||||
public TriPresent()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void addLabelToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
addItemLabel.Text = "Add Label";
|
||||
addLabel.Show();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
addLabel.Hide();
|
||||
}
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
panel1.ForeColor = Color.Black;
|
||||
panel1.BackColor = Color.Black;
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void placeAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void panel1_Click(object sender, EventArgs e)
|
||||
{
|
||||
AppearanceManager.SetupDialog(new ColorPicker(panel1.BackColor, "Text Color", new Action<Color>((col) =>
|
||||
{
|
||||
panel1.ForeColor = col;
|
||||
panel1.BackColor = col;
|
||||
})));
|
||||
}
|
||||
|
||||
private void designerPanel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (addLabel.Visible == true)
|
||||
{
|
||||
Label label = new Label();
|
||||
label.Parent = designerPanel;
|
||||
label.BackColor = Color.Transparent;
|
||||
label.ForeColor = panel1.BackColor;
|
||||
label.Text = labelContents.Text;
|
||||
label.Location = new Point(Cursor.Position.X / 3, Cursor.Position.Y);
|
||||
label.Text = labelContents.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
123
ShiftOS.WinForms/Applications/TriPresent.resx
Normal file
123
ShiftOS.WinForms/Applications/TriPresent.resx
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?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="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
65
ShiftOS.WinForms/Applications/TriSheet.Designer.cs
generated
Normal file
65
ShiftOS.WinForms/Applications/TriSheet.Designer.cs
generated
Normal file
|
@ -0,0 +1,65 @@
|
|||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
partial class TriSheet
|
||||
{
|
||||
/// <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.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
|
||||
this.toolStripContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// toolStripContainer1
|
||||
//
|
||||
//
|
||||
// toolStripContainer1.ContentPanel
|
||||
//
|
||||
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(710, 464);
|
||||
this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.toolStripContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.toolStripContainer1.Name = "toolStripContainer1";
|
||||
this.toolStripContainer1.Size = new System.Drawing.Size(710, 489);
|
||||
this.toolStripContainer1.TabIndex = 0;
|
||||
this.toolStripContainer1.Text = "toolStripContainer1";
|
||||
//
|
||||
// TriSheet
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.toolStripContainer1);
|
||||
this.Name = "TriSheet";
|
||||
this.Size = new System.Drawing.Size(710, 489);
|
||||
this.toolStripContainer1.ResumeLayout(false);
|
||||
this.toolStripContainer1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
|
||||
}
|
||||
}
|
22
ShiftOS.WinForms/Applications/TriSheet.cs
Normal file
22
ShiftOS.WinForms/Applications/TriSheet.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
#define BETA_2_5
|
||||
|
||||
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.WinForms.Applications
|
||||
{
|
||||
public partial class TriSheet : UserControl
|
||||
{
|
||||
public TriSheet()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
ShiftOS.WinForms/Applications/TriSheet.resx
Normal file
120
ShiftOS.WinForms/Applications/TriSheet.resx
Normal 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>
|
197
ShiftOS.WinForms/Applications/TriWrite.Designer.cs
generated
197
ShiftOS.WinForms/Applications/TriWrite.Designer.cs
generated
|
@ -36,15 +36,27 @@
|
|||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.txtbody = new System.Windows.Forms.Label();
|
||||
this.lbtitle = new System.Windows.Forms.Label();
|
||||
this.txtcontents = new System.Windows.Forms.TextBox();
|
||||
this.menuStrip2 = new System.Windows.Forms.MenuStrip();
|
||||
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.menuStrip3 = new System.Windows.Forms.MenuStrip();
|
||||
this.txtcontents = new System.Windows.Forms.RichTextBox();
|
||||
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
|
||||
this.bold = new System.Windows.Forms.ToolStripButton();
|
||||
this.italic = new System.Windows.Forms.ToolStripButton();
|
||||
this.underline = new System.Windows.Forms.ToolStripButton();
|
||||
this.strikethrough = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.fonts = new System.Windows.Forms.ToolStripComboBox();
|
||||
this.size = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.left = new System.Windows.Forms.ToolStripButton();
|
||||
this.center = new System.Windows.Forms.ToolStripButton();
|
||||
this.right = new System.Windows.Forms.ToolStripButton();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.menuStrip2.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
|
@ -61,16 +73,17 @@
|
|||
// addContactToolStripMenuItem
|
||||
//
|
||||
this.addContactToolStripMenuItem.Name = "addContactToolStripMenuItem";
|
||||
this.addContactToolStripMenuItem.Size = new System.Drawing.Size(32, 19);
|
||||
this.addContactToolStripMenuItem.Size = new System.Drawing.Size(12, 20);
|
||||
//
|
||||
// removeToolStripMenuItem
|
||||
//
|
||||
this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(32, 19);
|
||||
this.removeToolStripMenuItem.Size = new System.Drawing.Size(12, 20);
|
||||
//
|
||||
// tvcontacts
|
||||
//
|
||||
this.tvcontacts.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.tvcontacts.LineColor = System.Drawing.Color.Empty;
|
||||
this.tvcontacts.Location = new System.Drawing.Point(0, 24);
|
||||
this.tvcontacts.Name = "tvcontacts";
|
||||
this.tvcontacts.Size = new System.Drawing.Size(224, 551);
|
||||
|
@ -107,16 +120,6 @@
|
|||
this.lbtitle.Tag = "header1";
|
||||
this.lbtitle.Text = "TriWrite";
|
||||
//
|
||||
// txtcontents
|
||||
//
|
||||
this.txtcontents.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtcontents.Location = new System.Drawing.Point(0, 53);
|
||||
this.txtcontents.Multiline = true;
|
||||
this.txtcontents.Name = "txtcontents";
|
||||
this.txtcontents.Size = new System.Drawing.Size(527, 460);
|
||||
this.txtcontents.TabIndex = 1;
|
||||
this.txtcontents.TabStop = false;
|
||||
//
|
||||
// menuStrip2
|
||||
//
|
||||
this.menuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
|
@ -125,7 +128,7 @@
|
|||
this.saveToolStripMenuItem});
|
||||
this.menuStrip2.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip2.Name = "menuStrip2";
|
||||
this.menuStrip2.Size = new System.Drawing.Size(527, 24);
|
||||
this.menuStrip2.Size = new System.Drawing.Size(652, 24);
|
||||
this.menuStrip2.TabIndex = 2;
|
||||
this.menuStrip2.Text = "menuStrip2";
|
||||
//
|
||||
|
@ -134,40 +137,173 @@
|
|||
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
|
||||
this.newToolStripMenuItem.Size = new System.Drawing.Size(43, 20);
|
||||
this.newToolStripMenuItem.Text = "New";
|
||||
this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
|
||||
this.openToolStripMenuItem.Text = "Open";
|
||||
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(43, 20);
|
||||
this.saveToolStripMenuItem.Text = "Save";
|
||||
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
|
||||
//
|
||||
// menuStrip3
|
||||
// txtcontents
|
||||
//
|
||||
this.menuStrip3.Location = new System.Drawing.Point(0, 30);
|
||||
this.menuStrip3.Name = "menuStrip3";
|
||||
this.menuStrip3.Size = new System.Drawing.Size(527, 24);
|
||||
this.menuStrip3.TabIndex = 3;
|
||||
this.menuStrip3.Text = "menuStrip3";
|
||||
this.txtcontents.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.txtcontents.Location = new System.Drawing.Point(0, 49);
|
||||
this.txtcontents.Name = "txtcontents";
|
||||
this.txtcontents.Size = new System.Drawing.Size(652, 365);
|
||||
this.txtcontents.TabIndex = 4;
|
||||
this.txtcontents.Text = "";
|
||||
this.txtcontents.SelectionChanged += new System.EventHandler(this.txtcontents_SelectionChanged);
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.bold,
|
||||
this.italic,
|
||||
this.underline,
|
||||
this.strikethrough,
|
||||
this.toolStripSeparator1,
|
||||
this.fonts,
|
||||
this.size,
|
||||
this.toolStripSeparator2,
|
||||
this.left,
|
||||
this.center,
|
||||
this.right});
|
||||
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
|
||||
this.toolStrip1.Name = "toolStrip1";
|
||||
this.toolStrip1.Size = new System.Drawing.Size(652, 25);
|
||||
this.toolStrip1.TabIndex = 5;
|
||||
this.toolStrip1.Text = "toolStrip1";
|
||||
//
|
||||
// bold
|
||||
//
|
||||
this.bold.CheckOnClick = true;
|
||||
this.bold.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.bold.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
|
||||
this.bold.Image = ((System.Drawing.Image)(resources.GetObject("bold.Image")));
|
||||
this.bold.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.bold.Name = "bold";
|
||||
this.bold.Size = new System.Drawing.Size(23, 22);
|
||||
this.bold.Text = "B";
|
||||
this.bold.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
|
||||
//
|
||||
// italic
|
||||
//
|
||||
this.italic.CheckOnClick = true;
|
||||
this.italic.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.italic.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Italic);
|
||||
this.italic.Image = ((System.Drawing.Image)(resources.GetObject("italic.Image")));
|
||||
this.italic.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.italic.Name = "italic";
|
||||
this.italic.Size = new System.Drawing.Size(23, 22);
|
||||
this.italic.Text = "I";
|
||||
this.italic.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
|
||||
//
|
||||
// underline
|
||||
//
|
||||
this.underline.CheckOnClick = true;
|
||||
this.underline.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.underline.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Underline);
|
||||
this.underline.Image = ((System.Drawing.Image)(resources.GetObject("underline.Image")));
|
||||
this.underline.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.underline.Name = "underline";
|
||||
this.underline.Size = new System.Drawing.Size(23, 22);
|
||||
this.underline.Text = "U";
|
||||
this.underline.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
|
||||
//
|
||||
// strikethrough
|
||||
//
|
||||
this.strikethrough.CheckOnClick = true;
|
||||
this.strikethrough.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.strikethrough.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Strikeout, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.strikethrough.Image = ((System.Drawing.Image)(resources.GetObject("strikethrough.Image")));
|
||||
this.strikethrough.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.strikethrough.Name = "strikethrough";
|
||||
this.strikethrough.Size = new System.Drawing.Size(23, 22);
|
||||
this.strikethrough.Text = "S";
|
||||
this.strikethrough.CheckedChanged += new System.EventHandler(this.bold_CheckedChanged);
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// fonts
|
||||
//
|
||||
this.fonts.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.fonts.Name = "fonts";
|
||||
this.fonts.Size = new System.Drawing.Size(121, 25);
|
||||
this.fonts.SelectedIndexChanged += new System.EventHandler(this.fonts_SelectedIndexChanged);
|
||||
//
|
||||
// size
|
||||
//
|
||||
this.size.AutoSize = false;
|
||||
this.size.MaxLength = 3;
|
||||
this.size.Name = "size";
|
||||
this.size.Size = new System.Drawing.Size(40, 25);
|
||||
this.size.TextChanged += new System.EventHandler(this.size_Click);
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
this.toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// left
|
||||
//
|
||||
this.left.CheckOnClick = true;
|
||||
this.left.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.left.Image = ((System.Drawing.Image)(resources.GetObject("left.Image")));
|
||||
this.left.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.left.Name = "left";
|
||||
this.left.Size = new System.Drawing.Size(31, 22);
|
||||
this.left.Text = "Left";
|
||||
this.left.Click += new System.EventHandler(this.left_Click);
|
||||
//
|
||||
// center
|
||||
//
|
||||
this.center.CheckOnClick = true;
|
||||
this.center.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.center.Image = ((System.Drawing.Image)(resources.GetObject("center.Image")));
|
||||
this.center.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.center.Name = "center";
|
||||
this.center.Size = new System.Drawing.Size(46, 22);
|
||||
this.center.Text = "Center";
|
||||
this.center.Click += new System.EventHandler(this.center_Click);
|
||||
//
|
||||
// right
|
||||
//
|
||||
this.right.CheckOnClick = true;
|
||||
this.right.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
|
||||
this.right.Image = ((System.Drawing.Image)(resources.GetObject("right.Image")));
|
||||
this.right.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.right.Name = "right";
|
||||
this.right.Size = new System.Drawing.Size(39, 22);
|
||||
this.right.Text = "Right";
|
||||
this.right.Click += new System.EventHandler(this.right_Click);
|
||||
//
|
||||
// TriWrite
|
||||
//
|
||||
this.Controls.Add(this.txtcontents);
|
||||
this.Controls.Add(this.menuStrip3);
|
||||
this.Controls.Add(this.toolStrip1);
|
||||
this.Controls.Add(this.menuStrip2);
|
||||
this.Name = "TriWrite";
|
||||
this.Size = new System.Drawing.Size(527, 513);
|
||||
this.Size = new System.Drawing.Size(652, 414);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.menuStrip2.ResumeLayout(false);
|
||||
this.menuStrip2.PerformLayout();
|
||||
this.toolStrip1.ResumeLayout(false);
|
||||
this.toolStrip1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -182,11 +318,22 @@
|
|||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Label txtbody;
|
||||
private System.Windows.Forms.Label lbtitle;
|
||||
private System.Windows.Forms.TextBox txtcontents;
|
||||
private System.Windows.Forms.MenuStrip menuStrip2;
|
||||
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
|
||||
private System.Windows.Forms.MenuStrip menuStrip3;
|
||||
private System.Windows.Forms.RichTextBox txtcontents;
|
||||
private System.Windows.Forms.ToolStrip toolStrip1;
|
||||
private System.Windows.Forms.ToolStripButton bold;
|
||||
private System.Windows.Forms.ToolStripButton italic;
|
||||
private System.Windows.Forms.ToolStripButton underline;
|
||||
private System.Windows.Forms.ToolStripButton strikethrough;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripComboBox fonts;
|
||||
private System.Windows.Forms.ToolStripTextBox size;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripButton left;
|
||||
private System.Windows.Forms.ToolStripButton center;
|
||||
private System.Windows.Forms.ToolStripButton right;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ using ShiftOS.Engine;
|
|||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
[WinOpen("triwrite")]
|
||||
[AppscapeEntry("TriWrite", "Part of the trilogy of office applications for enhancement of your system. TriWrite is easliy the best text editor out there for ShiftOS.", 1024, 750, null, "Office")]
|
||||
[AppscapeEntry("TriWrite", "Part of the trilogy of office applications for enhancement of your system. TriWrite is easliy the best text editor out there for ShiftOS.", 1024, 750, "file_skimmer;textpad", "Office")]
|
||||
[DefaultTitle("TriWrite")]
|
||||
[Launcher("TriWrite", false, null, "Office")]
|
||||
public partial class TriWrite : UserControl, IShiftOSWindow
|
||||
|
@ -21,7 +21,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public TriWrite()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeComponent(); //From the library of babel: "FIRST COMMIT FROM A MAC WOOOO TURIANS ARE COOL"
|
||||
}
|
||||
|
||||
private void newToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -32,35 +32,54 @@ namespace ShiftOS.WinForms.Applications
|
|||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var txt = new List<string>();
|
||||
txt.Add(".txt");
|
||||
txt.Add(".rtf");
|
||||
|
||||
AppearanceManager.SetupDialog(new FileDialog(txt.ToArray(), FileOpenerStyle.Open, new Action<string>((file) => this.LoadFile(file))));
|
||||
FileSkimmerBackend.GetFile(txt.ToArray(), FileOpenerStyle.Open, (path) => LoadFile(path));
|
||||
}
|
||||
|
||||
public void LoadFile(string file)
|
||||
{
|
||||
txtcontents.Text = Utils.ReadAllText(file);
|
||||
txtcontents.Rtf = Utils.ReadAllText(file);
|
||||
}
|
||||
|
||||
public void SaveFile(string file)
|
||||
{
|
||||
Utils.WriteAllText(file, txtcontents.Text);
|
||||
if (file.ToLower().EndsWith(".rtf"))
|
||||
{
|
||||
Utils.WriteAllText(file, txtcontents.Rtf);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.WriteAllText(file, txtcontents.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var txt = new List<string>();
|
||||
txt.Add(".rtf");
|
||||
txt.Add(".txt");
|
||||
|
||||
AppearanceManager.SetupDialog(new FileDialog(txt.ToArray(), FileOpenerStyle.Save, new Action<string>((file) => this.SaveFile(file))));
|
||||
FileSkimmerBackend.GetFile(txt.ToArray(), FileOpenerStyle.Save, (path) => SaveFile(path));
|
||||
}
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
ResetFonts();
|
||||
}
|
||||
|
||||
public void ResetFonts()
|
||||
{
|
||||
fonts.Items.Clear();
|
||||
foreach(var font in FontFamily.Families)
|
||||
{
|
||||
fonts.Items.Add(font.Name);
|
||||
}
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
|
@ -72,5 +91,92 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
}
|
||||
|
||||
public void UpdateUI()
|
||||
{
|
||||
bold.Checked = txtcontents.SelectionFont.Bold;
|
||||
italic.Checked = txtcontents.SelectionFont.Italic;
|
||||
underline.Checked = txtcontents.SelectionFont.Underline;
|
||||
strikethrough.Checked = txtcontents.SelectionFont.Strikeout;
|
||||
fonts.Text = txtcontents.SelectionFont.Name;
|
||||
size.Text = txtcontents.SelectionFont.Size.ToString();
|
||||
left.Checked = txtcontents.SelectionAlignment == HorizontalAlignment.Left;
|
||||
center.Checked = txtcontents.SelectionAlignment == HorizontalAlignment.Center;
|
||||
right.Checked = txtcontents.SelectionAlignment == HorizontalAlignment.Right;
|
||||
|
||||
}
|
||||
|
||||
private void txtcontents_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
public void SetFontStyle(bool bold, bool italic, bool underline, bool strikethrough)
|
||||
{
|
||||
FontStyle fs = FontStyle.Regular;
|
||||
if (bold)
|
||||
fs |= FontStyle.Bold;
|
||||
if (italic)
|
||||
fs |= FontStyle.Italic;
|
||||
if (underline)
|
||||
fs |= FontStyle.Underline;
|
||||
if (strikethrough)
|
||||
fs |= FontStyle.Strikeout;
|
||||
txtcontents.SelectionFont = new Font(txtcontents.SelectionFont, fs);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
private void bold_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetFontStyle(bold.Checked, italic.Checked, underline.Checked, strikethrough.Checked);
|
||||
}
|
||||
|
||||
public void SetFontFamily(string family, float emSize)
|
||||
{
|
||||
var style = txtcontents.SelectionFont.Style;
|
||||
var size = emSize;
|
||||
txtcontents.SelectionFont = new Font(family, size, style);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
private void fonts_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetFontFamily(fonts.Text, Convert.ToSingle(size.Text));
|
||||
}
|
||||
|
||||
private void left_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtcontents.SelectionAlignment = HorizontalAlignment.Left;
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
private void center_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtcontents.SelectionAlignment = HorizontalAlignment.Center;
|
||||
UpdateUI();
|
||||
|
||||
}
|
||||
|
||||
private void right_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtcontents.SelectionAlignment = HorizontalAlignment.Right;
|
||||
UpdateUI();
|
||||
|
||||
}
|
||||
|
||||
private void size_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
float s = Convert.ToSingle(size.Text);
|
||||
if(s != txtcontents.SelectionFont.Size)
|
||||
{
|
||||
SetFontFamily(fonts.Text, s);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
UpdateUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -130,7 +130,113 @@ To add a contact, simply click "Add Contact", and to remove one, click "Remove".
|
|||
<metadata name="menuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>132, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>247, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="bold.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="italic.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="underline.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="strikethrough.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="left.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="center.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="right.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
|
@ -64,12 +64,10 @@
|
|||
//
|
||||
this.pgdownload.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pgdownload.BlockSize = 5;
|
||||
this.pgdownload.Location = new System.Drawing.Point(86, 4);
|
||||
this.pgdownload.Maximum = 100;
|
||||
this.pgdownload.Name = "pgdownload";
|
||||
this.pgdownload.Size = new System.Drawing.Size(427, 23);
|
||||
this.pgdownload.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pgdownload.TabIndex = 2;
|
||||
this.pgdownload.Text = "Updating...";
|
||||
this.pgdownload.Value = 0;
|
||||
|
|
|
@ -91,12 +91,10 @@
|
|||
//
|
||||
// pgplaytime
|
||||
//
|
||||
this.pgplaytime.BlockSize = 5;
|
||||
this.pgplaytime.Location = new System.Drawing.Point(46, 3);
|
||||
this.pgplaytime.Maximum = 100;
|
||||
this.pgplaytime.Name = "pgplaytime";
|
||||
this.pgplaytime.Size = new System.Drawing.Size(749, 23);
|
||||
this.pgplaytime.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pgplaytime.TabIndex = 1;
|
||||
this.pgplaytime.Tag = "keepbg";
|
||||
this.pgplaytime.Text = "shiftedProgressBar1";
|
||||
|
|
153
ShiftOS.WinForms/Applications/WebBrowser.Designer.cs
generated
Normal file
153
ShiftOS.WinForms/Applications/WebBrowser.Designer.cs
generated
Normal file
|
@ -0,0 +1,153 @@
|
|||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
partial class WebBrowser
|
||||
{
|
||||
/// <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.flcontrols = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.btnback = new System.Windows.Forms.Button();
|
||||
this.btnforward = new System.Windows.Forms.Button();
|
||||
this.txturl = new System.Windows.Forms.TextBox();
|
||||
this.btngo = new System.Windows.Forms.Button();
|
||||
this.pnlcanvas = new System.Windows.Forms.Panel();
|
||||
this.wbmain = new System.Windows.Forms.WebBrowser();
|
||||
this.flcontrols.SuspendLayout();
|
||||
this.pnlcanvas.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// flcontrols
|
||||
//
|
||||
this.flcontrols.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.flcontrols.Controls.Add(this.btnback);
|
||||
this.flcontrols.Controls.Add(this.btnforward);
|
||||
this.flcontrols.Controls.Add(this.txturl);
|
||||
this.flcontrols.Controls.Add(this.btngo);
|
||||
this.flcontrols.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.flcontrols.Location = new System.Drawing.Point(0, 0);
|
||||
this.flcontrols.Name = "flcontrols";
|
||||
this.flcontrols.Size = new System.Drawing.Size(539, 29);
|
||||
this.flcontrols.TabIndex = 2;
|
||||
//
|
||||
// btnback
|
||||
//
|
||||
this.btnback.AutoSize = true;
|
||||
this.btnback.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnback.Location = new System.Drawing.Point(3, 3);
|
||||
this.btnback.Name = "btnback";
|
||||
this.btnback.Size = new System.Drawing.Size(23, 23);
|
||||
this.btnback.TabIndex = 0;
|
||||
this.btnback.Text = "<";
|
||||
this.btnback.UseVisualStyleBackColor = true;
|
||||
this.btnback.Click += new System.EventHandler(this.btnback_Click);
|
||||
//
|
||||
// btnforward
|
||||
//
|
||||
this.btnforward.AutoSize = true;
|
||||
this.btnforward.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnforward.Location = new System.Drawing.Point(32, 3);
|
||||
this.btnforward.Name = "btnforward";
|
||||
this.btnforward.Size = new System.Drawing.Size(23, 23);
|
||||
this.btnforward.TabIndex = 1;
|
||||
this.btnforward.Text = ">";
|
||||
this.btnforward.UseVisualStyleBackColor = true;
|
||||
this.btnforward.Click += new System.EventHandler(this.btnforward_Click);
|
||||
//
|
||||
// txturl
|
||||
//
|
||||
this.txturl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txturl.Location = new System.Drawing.Point(61, 3);
|
||||
this.txturl.Name = "txturl";
|
||||
this.txturl.Size = new System.Drawing.Size(435, 20);
|
||||
this.txturl.TabIndex = 2;
|
||||
this.txturl.WordWrap = false;
|
||||
this.txturl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txturl_KeyDown);
|
||||
//
|
||||
// btngo
|
||||
//
|
||||
this.btngo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btngo.AutoSize = true;
|
||||
this.btngo.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btngo.Location = new System.Drawing.Point(502, 3);
|
||||
this.btngo.Name = "btngo";
|
||||
this.btngo.Size = new System.Drawing.Size(31, 23);
|
||||
this.btngo.TabIndex = 3;
|
||||
this.btngo.Text = "Go";
|
||||
this.btngo.UseVisualStyleBackColor = true;
|
||||
this.btngo.Click += new System.EventHandler(this.btngo_Click);
|
||||
//
|
||||
// pnlcanvas
|
||||
//
|
||||
this.pnlcanvas.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.pnlcanvas.Controls.Add(this.wbmain);
|
||||
this.pnlcanvas.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnlcanvas.Location = new System.Drawing.Point(0, 29);
|
||||
this.pnlcanvas.Name = "pnlcanvas";
|
||||
this.pnlcanvas.Size = new System.Drawing.Size(539, 374);
|
||||
this.pnlcanvas.TabIndex = 3;
|
||||
//
|
||||
// wbmain
|
||||
//
|
||||
this.wbmain.AllowWebBrowserDrop = false;
|
||||
this.wbmain.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.wbmain.IsWebBrowserContextMenuEnabled = false;
|
||||
this.wbmain.Location = new System.Drawing.Point(0, 0);
|
||||
this.wbmain.MinimumSize = new System.Drawing.Size(20, 20);
|
||||
this.wbmain.Name = "wbmain";
|
||||
this.wbmain.ScriptErrorsSuppressed = true;
|
||||
this.wbmain.Size = new System.Drawing.Size(537, 372);
|
||||
this.wbmain.TabIndex = 0;
|
||||
this.wbmain.WebBrowserShortcutsEnabled = false;
|
||||
this.wbmain.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.wbmain_Navigated);
|
||||
this.wbmain.NewWindow += new System.ComponentModel.CancelEventHandler(this.wbmain_NewWindow);
|
||||
//
|
||||
// WebBrowser
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.pnlcanvas);
|
||||
this.Controls.Add(this.flcontrols);
|
||||
this.Name = "WebBrowser";
|
||||
this.Size = new System.Drawing.Size(539, 403);
|
||||
this.flcontrols.ResumeLayout(false);
|
||||
this.flcontrols.PerformLayout();
|
||||
this.pnlcanvas.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.FlowLayoutPanel flcontrols;
|
||||
private System.Windows.Forms.Button btnback;
|
||||
private System.Windows.Forms.Button btnforward;
|
||||
private System.Windows.Forms.TextBox txturl;
|
||||
private System.Windows.Forms.Button btngo;
|
||||
private System.Windows.Forms.Panel pnlcanvas;
|
||||
private System.Windows.Forms.WebBrowser wbmain;
|
||||
}
|
||||
}
|
97
ShiftOS.WinForms/Applications/WebBrowser.cs
Normal file
97
ShiftOS.WinForms/Applications/WebBrowser.cs
Normal file
|
@ -0,0 +1,97 @@
|
|||
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;
|
||||
using ShiftOS.Engine;
|
||||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
[WinOpen("web_browser")]
|
||||
[AppscapeEntry("Web Browser", "We're going surfing on the Internet! This application allows you to break the bounds of the Digital Society and connect to the outer Internet inside ShiftOS.",
|
||||
4096, 10000, "color_depth_24_bits", "Networking")]
|
||||
[Launcher("Web Browser", false, null, "Networking")]
|
||||
[DefaultTitle("Web Browser")]
|
||||
[DefaultIcon("iconShiftnet")]
|
||||
public partial class WebBrowser : UserControl, IShiftOSWindow
|
||||
{
|
||||
public WebBrowser()
|
||||
{
|
||||
InitializeComponent();
|
||||
uiupdate = new Timer();
|
||||
uiupdate.Tick += (o, a) =>
|
||||
{
|
||||
btnback.Location = new Point(2, 2);
|
||||
btnforward.Location = new Point(btnback.Left + btnback.Width + 2, 2);
|
||||
txturl.Location = new Point(btnforward.Left + btnforward.Width + 2, 2);
|
||||
txturl.Width = flcontrols.Width - btnback.Width - 2 - btnforward.Width - 2 - (btngo.Width * 2) - 2;
|
||||
btngo.Location = new Point(flcontrols.Width - btngo.Width - 2, 2);
|
||||
btnback.Enabled = wbmain.CanGoBack;
|
||||
btnforward.Enabled = wbmain.CanGoForward;
|
||||
};
|
||||
uiupdate.Interval = 100;
|
||||
}
|
||||
|
||||
Timer uiupdate = null;
|
||||
|
||||
public void OnLoad()
|
||||
{
|
||||
uiupdate.Start();
|
||||
wbmain.Url = new Uri("http://getshiftos.ml/");
|
||||
}
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
{
|
||||
uiupdate.Stop();
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
}
|
||||
|
||||
private void btnback_Click(object sender, EventArgs e)
|
||||
{
|
||||
wbmain.GoBack();
|
||||
}
|
||||
|
||||
private void btnforward_Click(object sender, EventArgs e)
|
||||
{
|
||||
wbmain.GoForward();
|
||||
}
|
||||
|
||||
private void btngo_Click(object sender, EventArgs e)
|
||||
{
|
||||
wbmain.Navigate(txturl.Text);
|
||||
}
|
||||
|
||||
private void wbmain_NewWindow(object sender, CancelEventArgs e)
|
||||
{
|
||||
e.Cancel = true;
|
||||
if (Shiftorium.UpgradeInstalled("web_browser_new_window"))
|
||||
{
|
||||
AppearanceManager.SetupWindow(new WebBrowser());
|
||||
}
|
||||
}
|
||||
|
||||
private void txturl_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
btngo_Click(sender, EventArgs.Empty);
|
||||
}
|
||||
|
||||
private void wbmain_Navigated(object sender, WebBrowserNavigatedEventArgs e)
|
||||
{
|
||||
txturl.Text = wbmain.Url.ToString();
|
||||
AppearanceManager.SetWindowTitle(this, wbmain.DocumentTitle + " - " + NameChangerBackend.GetNameRaw(this.GetType()));
|
||||
}
|
||||
}
|
||||
}
|
120
ShiftOS.WinForms/Applications/WebBrowser.resx
Normal file
120
ShiftOS.WinForms/Applications/WebBrowser.resx
Normal 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>
|
|
@ -24,8 +24,10 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ShiftOS.WinForms
|
||||
|
@ -37,5 +39,101 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
internal static byte[] GetRandomSong()
|
||||
{
|
||||
var r = new Random().Next(1, 10);
|
||||
switch (r)
|
||||
{
|
||||
case 1:
|
||||
return Properties.Resources.Ambient1;
|
||||
case 2:
|
||||
return Properties.Resources.Ambient2;
|
||||
case 3:
|
||||
return Properties.Resources.Ambient3;
|
||||
case 4:
|
||||
return Properties.Resources.Ambient4;
|
||||
case 5:
|
||||
return Properties.Resources.Ambient5;
|
||||
case 6:
|
||||
return Properties.Resources.Ambient6;
|
||||
case 7:
|
||||
return Properties.Resources.Ambient7;
|
||||
case 8:
|
||||
return Properties.Resources.Ambient8;
|
||||
default:
|
||||
return Properties.Resources.Ambient9;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
internal static void StartAmbientLoop()
|
||||
{
|
||||
var athread = new Thread(() =>
|
||||
{
|
||||
MemoryStream str = null;
|
||||
NAudio.Wave.Mp3FileReader mp3 = null;
|
||||
NAudio.Wave.WaveOut o = null;
|
||||
bool shuttingDown = false;
|
||||
|
||||
Engine.AppearanceManager.OnExit += () =>
|
||||
{
|
||||
shuttingDown = true;
|
||||
o?.Stop();
|
||||
o?.Dispose();
|
||||
mp3?.Close();
|
||||
mp3?.Dispose();
|
||||
str?.Close();
|
||||
str?.Dispose();
|
||||
};
|
||||
while (shuttingDown == false)
|
||||
{
|
||||
if (Engine.SaveSystem.CurrentSave != null)
|
||||
{
|
||||
if (Engine.SaveSystem.CurrentSave.MusicEnabled)
|
||||
{
|
||||
str = new MemoryStream(GetRandomSong());
|
||||
mp3 = new NAudio.Wave.Mp3FileReader(str);
|
||||
o = new NAudio.Wave.WaveOut();
|
||||
o.Init(mp3);
|
||||
bool c = false;
|
||||
o.Play();
|
||||
o.PlaybackStopped += (s, a) =>
|
||||
{
|
||||
c = true;
|
||||
};
|
||||
|
||||
while (!c)
|
||||
{
|
||||
if (Engine.SaveSystem.CurrentSave.MusicEnabled)
|
||||
{
|
||||
try
|
||||
{
|
||||
o.Volume = (float)Engine.SaveSystem.CurrentSave.MusicVolume / 100;
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
o.Stop();
|
||||
c = true;
|
||||
}
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
}
|
||||
});
|
||||
athread.IsBackground = true;
|
||||
athread.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,6 @@ namespace ShiftOS.WinForms
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
[Namespace("coherence")]
|
||||
[RequiresUpgrade("kernel_coherence")]
|
||||
public static class CoherenceCommands
|
||||
|
|
|
@ -31,6 +31,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using ShiftOS.Engine;
|
||||
|
||||
namespace ShiftOS.WinForms.Controls
|
||||
{
|
||||
|
@ -46,7 +47,7 @@ namespace ShiftOS.WinForms.Controls
|
|||
t.Interval = 100;
|
||||
t.Tick += (o, a) =>
|
||||
{
|
||||
if(this._style == ProgressBarStyle.Marquee)
|
||||
if(this.Style == ProgressBarStyle.Marquee)
|
||||
{
|
||||
if(_marqueePos >= this.Width)
|
||||
{
|
||||
|
@ -89,47 +90,115 @@ namespace ShiftOS.WinForms.Controls
|
|||
}
|
||||
}
|
||||
|
||||
public ProgressBarStyle _style = ProgressBarStyle.Continuous;
|
||||
|
||||
public ProgressBarStyle Style
|
||||
{
|
||||
get { return _style; }
|
||||
set { _style = value; this.Refresh(); }
|
||||
get
|
||||
{
|
||||
return SkinEngine.LoadedSkin.ProgressBarStyle;
|
||||
}
|
||||
}
|
||||
|
||||
private int _blocksize = 5;
|
||||
|
||||
public int BlockSize
|
||||
{
|
||||
get { return _blocksize; }
|
||||
set
|
||||
get
|
||||
{
|
||||
_blocksize = value;
|
||||
this.Refresh();
|
||||
return SkinEngine.LoadedSkin.ProgressBarBlockSize;
|
||||
}
|
||||
}
|
||||
|
||||
public Color RealBackColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return SkinEngine.LoadedSkin.ProgressBarBackgroundColor;
|
||||
}
|
||||
}
|
||||
|
||||
public Image RealBackgroundImage
|
||||
{
|
||||
get
|
||||
{
|
||||
return SkinEngine.GetImage("progressbarbg");
|
||||
}
|
||||
}
|
||||
|
||||
public Image ProgressImage
|
||||
{
|
||||
get
|
||||
{
|
||||
return SkinEngine.GetImage("progress");
|
||||
}
|
||||
}
|
||||
|
||||
public Color ProgressColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return SkinEngine.LoadedSkin.ProgressColor;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pe)
|
||||
{
|
||||
pe.Graphics.Clear(Color.Black);
|
||||
switch (_style)
|
||||
try
|
||||
{
|
||||
case ProgressBarStyle.Continuous:
|
||||
double width = linear(this.Value, 0, this.Maximum, 0, this.Width);
|
||||
pe.Graphics.FillRectangle(new SolidBrush(Color.Green), new RectangleF(0, 0, (float)width, this.Height));
|
||||
break;
|
||||
case ProgressBarStyle.Blocks:
|
||||
int block_count = this.Width / (this._blocksize + 2);
|
||||
int blocks = (int)linear(this.Value, 0, this.Maximum, 0, block_count);
|
||||
for(int i = 0; i < blocks - 1; i++)
|
||||
{
|
||||
int position = i * (_blocksize + 2);
|
||||
pe.Graphics.FillRectangle(new SolidBrush(Color.Green), new Rectangle(position, 0, _blocksize, this.Height));
|
||||
}
|
||||
break;
|
||||
case ProgressBarStyle.Marquee:
|
||||
pe.Graphics.FillRectangle(new SolidBrush(Color.Green), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height));
|
||||
break;
|
||||
pe.Graphics.Clear(this.RealBackColor);
|
||||
if (RealBackgroundImage != null)
|
||||
{
|
||||
pe.Graphics.FillRectangle(new TextureBrush(RealBackgroundImage), new Rectangle(0, 0, this.Width, this.Height));
|
||||
}
|
||||
switch (Style)
|
||||
{
|
||||
case ProgressBarStyle.Continuous:
|
||||
double width = linear(this.Value, 0, this.Maximum, 0, this.Width);
|
||||
if (ProgressImage != null)
|
||||
{
|
||||
pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new RectangleF(0, 0, (float)width, this.Height));
|
||||
}
|
||||
else
|
||||
{
|
||||
pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new RectangleF(0, 0, (float)width, this.Height));
|
||||
}
|
||||
break;
|
||||
case ProgressBarStyle.Blocks:
|
||||
int block_count = this.Width / (this.BlockSize + 2);
|
||||
int blocks = (int)linear(this.Value, 0, this.Maximum, 0, block_count);
|
||||
for (int i = 0; i < blocks - 1; i++)
|
||||
{
|
||||
int position = i * (BlockSize + 2);
|
||||
if (ProgressImage != null)
|
||||
{
|
||||
pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(position, 0, BlockSize, this.Height));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(position, 0, BlockSize, this.Height));
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ProgressBarStyle.Marquee:
|
||||
if (ProgressImage != null)
|
||||
{
|
||||
pe.Graphics.FillRectangle(new TextureBrush(ProgressImage), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height));
|
||||
}
|
||||
else
|
||||
{
|
||||
pe.Graphics.FillRectangle(new SolidBrush(ProgressColor), new Rectangle(_marqueePos, 0, this.Width / 4, this.Height));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
pe.Graphics.Clear(Color.Black);
|
||||
string text = "Preview mode. This control can't be drawn without an initiated ShiftOS engine.";
|
||||
SizeF sz = pe.Graphics.MeasureString(text, this.Font);
|
||||
PointF loc = new PointF(
|
||||
(this.Width - sz.Width) / 2,
|
||||
(this.Height - sz.Height) / 2
|
||||
);
|
||||
pe.Graphics.DrawString(text, Font, new SolidBrush(Color.White), loc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,9 +64,9 @@ namespace ShiftOS.WinForms.Controls
|
|||
public void Write(string text)
|
||||
{
|
||||
this.HideSelection = true;
|
||||
this.SelectionFont = ConstructFont();
|
||||
this.SelectionColor = ControlManager.ConvertColor(ConsoleEx.ForegroundColor);
|
||||
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);
|
||||
this.SelectionFont = ConstructFont();
|
||||
this.AppendText(Localization.Parse(text));
|
||||
this.HideSelection = false;
|
||||
}
|
||||
|
@ -86,17 +86,20 @@ namespace ShiftOS.WinForms.Controls
|
|||
|
||||
public void WriteLine(string text)
|
||||
{
|
||||
Engine.AudioManager.PlayStream(Properties.Resources.writesound);
|
||||
this.HideSelection = true;
|
||||
this.Select(this.TextLength, 0);
|
||||
this.SelectionFont = ConstructFont();
|
||||
this.SelectionColor = ControlManager.ConvertColor(ConsoleEx.ForegroundColor);
|
||||
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);
|
||||
this.SelectionFont = ConstructFont();
|
||||
this.Select(this.TextLength, 0);
|
||||
this.AppendText(Localization.Parse(text) + Environment.NewLine);
|
||||
this.HideSelection = false;
|
||||
}
|
||||
|
||||
bool quickCopying = false;
|
||||
|
||||
bool busy = false;
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
//if right-clicking, then we initiate a quick-copy.
|
||||
|
@ -119,8 +122,140 @@ namespace ShiftOS.WinForms.Controls
|
|||
base.OnMouseUp(mevent);
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
if (!TerminalBackend.InStory)
|
||||
{
|
||||
switch (e.KeyCode) {
|
||||
case Keys.Add:
|
||||
case Keys.Alt:
|
||||
case Keys.Apps:
|
||||
case Keys.Attn:
|
||||
case Keys.BrowserBack:
|
||||
case Keys.BrowserFavorites:
|
||||
case Keys.BrowserForward:
|
||||
case Keys.BrowserHome:
|
||||
case Keys.BrowserRefresh:
|
||||
case Keys.BrowserSearch:
|
||||
case Keys.BrowserStop:
|
||||
case Keys.Cancel:
|
||||
case Keys.Capital:
|
||||
case Keys.Clear:
|
||||
case Keys.Control:
|
||||
case Keys.ControlKey:
|
||||
case Keys.Crsel:
|
||||
case Keys.Decimal:
|
||||
case Keys.Divide:
|
||||
case Keys.Down:
|
||||
case Keys.End:
|
||||
case Keys.Enter:
|
||||
case Keys.EraseEof:
|
||||
case Keys.Escape:
|
||||
case Keys.Execute:
|
||||
case Keys.Exsel:
|
||||
case Keys.F1:
|
||||
case Keys.F10:
|
||||
case Keys.F11:
|
||||
case Keys.F12:
|
||||
case Keys.F13:
|
||||
case Keys.F14:
|
||||
case Keys.F15:
|
||||
case Keys.F16:
|
||||
case Keys.F17:
|
||||
case Keys.F18:
|
||||
case Keys.F19:
|
||||
case Keys.F2:
|
||||
case Keys.F20:
|
||||
case Keys.F21:
|
||||
case Keys.F22:
|
||||
case Keys.F23:
|
||||
case Keys.F24:
|
||||
case Keys.F3:
|
||||
case Keys.F4:
|
||||
case Keys.F5:
|
||||
case Keys.F6:
|
||||
case Keys.F7:
|
||||
case Keys.F8:
|
||||
case Keys.F9:
|
||||
case Keys.FinalMode:
|
||||
case Keys.HanguelMode:
|
||||
case Keys.HanjaMode:
|
||||
case Keys.Help:
|
||||
case Keys.Home:
|
||||
case Keys.IMEAccept:
|
||||
case Keys.IMEConvert:
|
||||
case Keys.IMEModeChange:
|
||||
case Keys.IMENonconvert:
|
||||
case Keys.Insert:
|
||||
case Keys.JunjaMode:
|
||||
case Keys.KeyCode:
|
||||
case Keys.LaunchApplication1:
|
||||
case Keys.LaunchApplication2:
|
||||
case Keys.LaunchMail:
|
||||
case Keys.LButton:
|
||||
case Keys.LControlKey:
|
||||
case Keys.Left:
|
||||
case Keys.LineFeed:
|
||||
case Keys.LMenu:
|
||||
case Keys.LShiftKey:
|
||||
case Keys.LWin:
|
||||
case Keys.MButton:
|
||||
case Keys.MediaNextTrack:
|
||||
case Keys.MediaPlayPause:
|
||||
case Keys.MediaPreviousTrack:
|
||||
case Keys.MediaStop:
|
||||
case Keys.Menu:
|
||||
case Keys.Modifiers:
|
||||
case Keys.Multiply:
|
||||
case Keys.Next:
|
||||
case Keys.NoName:
|
||||
case Keys.None:
|
||||
case Keys.NumLock:
|
||||
case Keys.Pa1:
|
||||
case Keys.Packet:
|
||||
case Keys.PageUp:
|
||||
case Keys.Pause:
|
||||
case Keys.Play:
|
||||
case Keys.Print:
|
||||
case Keys.PrintScreen:
|
||||
case Keys.ProcessKey:
|
||||
case Keys.RButton:
|
||||
case Keys.RControlKey:
|
||||
case Keys.Right:
|
||||
case Keys.RMenu:
|
||||
case Keys.RShiftKey:
|
||||
case Keys.RWin:
|
||||
case Keys.Scroll:
|
||||
case Keys.Select:
|
||||
case Keys.SelectMedia:
|
||||
case Keys.Separator:
|
||||
case Keys.Shift:
|
||||
case Keys.ShiftKey:
|
||||
case Keys.Sleep:
|
||||
case Keys.Subtract:
|
||||
case Keys.Tab:
|
||||
case Keys.Up:
|
||||
case Keys.VolumeDown:
|
||||
case Keys.VolumeMute:
|
||||
case Keys.VolumeUp:
|
||||
case Keys.XButton1:
|
||||
case Keys.XButton2:
|
||||
case Keys.Zoom:
|
||||
|
||||
break;
|
||||
default:
|
||||
//Engine.AudioManager.PlayStream(Properties.Resources.typesound); // infernal beeping noise only enable for the trailers
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string ThreadId = "";
|
||||
|
||||
public TerminalBox() : base()
|
||||
{
|
||||
ThreadId = Thread.CurrentThread.ManagedThreadId.ToString();
|
||||
this.Tag = "keepbg keepfg keepfont";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,13 +24,13 @@ namespace ShiftOS.WinForms.DesktopWidgets
|
|||
if(ts != ServerManager.DigitalSocietyPing)
|
||||
{
|
||||
ts = ServerManager.DigitalSocietyPing;
|
||||
lbheartbeat.Text = "Server ping: " + ts.ToString();
|
||||
lbheartbeat.Text = "Server ping: " + ts.ToString() + " MS";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
//Fun fact. I misspelled this as "TimeSpam."
|
||||
TimeSpan ts;
|
||||
long ts = 0;
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
|
|
|
@ -34,13 +34,11 @@
|
|||
//
|
||||
// pgupgrades
|
||||
//
|
||||
this.pgupgrades.BlockSize = 5;
|
||||
this.pgupgrades.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.pgupgrades.Location = new System.Drawing.Point(0, 99);
|
||||
this.pgupgrades.Maximum = 100;
|
||||
this.pgupgrades.Name = "pgupgrades";
|
||||
this.pgupgrades.Size = new System.Drawing.Size(227, 23);
|
||||
this.pgupgrades.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pgupgrades.TabIndex = 0;
|
||||
this.pgupgrades.Text = "shiftedProgressBar1";
|
||||
this.pgupgrades.Value = 0;
|
||||
|
|
2
ShiftOS.WinForms/DownloadControl.Designer.cs
generated
2
ShiftOS.WinForms/DownloadControl.Designer.cs
generated
|
@ -83,12 +83,10 @@ namespace ShiftOS.WinForms
|
|||
//
|
||||
this.pgprogress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.pgprogress.BlockSize = 5;
|
||||
this.pgprogress.Location = new System.Drawing.Point(4, 52);
|
||||
this.pgprogress.Maximum = 100;
|
||||
this.pgprogress.Name = "pgprogress";
|
||||
this.pgprogress.Size = new System.Drawing.Size(371, 23);
|
||||
this.pgprogress.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.pgprogress.TabIndex = 0;
|
||||
this.pgprogress.Text = "shiftedProgressBar1";
|
||||
this.pgprogress.Value = 0;
|
||||
|
|
135
ShiftOS.WinForms/GUILogin.Designer.cs
generated
Normal file
135
ShiftOS.WinForms/GUILogin.Designer.cs
generated
Normal file
|
@ -0,0 +1,135 @@
|
|||
namespace ShiftOS.WinForms
|
||||
{
|
||||
partial class GUILogin
|
||||
{
|
||||
/// <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.pnlloginform = new System.Windows.Forms.Panel();
|
||||
this.btnlogin = new System.Windows.Forms.Button();
|
||||
this.txtpassword = new System.Windows.Forms.TextBox();
|
||||
this.txtusername = new System.Windows.Forms.TextBox();
|
||||
this.lblogintitle = new System.Windows.Forms.Label();
|
||||
this.btnshutdown = new System.Windows.Forms.Button();
|
||||
this.pnlloginform.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnlloginform
|
||||
//
|
||||
this.pnlloginform.Controls.Add(this.btnlogin);
|
||||
this.pnlloginform.Controls.Add(this.txtpassword);
|
||||
this.pnlloginform.Controls.Add(this.txtusername);
|
||||
this.pnlloginform.Location = new System.Drawing.Point(13, 13);
|
||||
this.pnlloginform.Name = "pnlloginform";
|
||||
this.pnlloginform.Size = new System.Drawing.Size(358, 236);
|
||||
this.pnlloginform.TabIndex = 0;
|
||||
this.pnlloginform.Tag = "";
|
||||
//
|
||||
// btnlogin
|
||||
//
|
||||
this.btnlogin.AutoSize = true;
|
||||
this.btnlogin.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnlogin.Location = new System.Drawing.Point(159, 163);
|
||||
this.btnlogin.Name = "btnlogin";
|
||||
this.btnlogin.Size = new System.Drawing.Size(43, 23);
|
||||
this.btnlogin.TabIndex = 2;
|
||||
this.btnlogin.Text = "Login";
|
||||
this.btnlogin.UseVisualStyleBackColor = true;
|
||||
this.btnlogin.Click += new System.EventHandler(this.btnlogin_Click);
|
||||
//
|
||||
// txtpassword
|
||||
//
|
||||
this.txtpassword.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtpassword.Location = new System.Drawing.Point(69, 115);
|
||||
this.txtpassword.Name = "txtpassword";
|
||||
this.txtpassword.Size = new System.Drawing.Size(300, 20);
|
||||
this.txtpassword.TabIndex = 1;
|
||||
this.txtpassword.UseSystemPasswordChar = true;
|
||||
//
|
||||
// txtusername
|
||||
//
|
||||
this.txtusername.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtusername.Location = new System.Drawing.Point(3, 14);
|
||||
this.txtusername.Name = "txtusername";
|
||||
this.txtusername.Size = new System.Drawing.Size(300, 20);
|
||||
this.txtusername.TabIndex = 0;
|
||||
//
|
||||
// lblogintitle
|
||||
//
|
||||
this.lblogintitle.AutoSize = true;
|
||||
this.lblogintitle.Location = new System.Drawing.Point(99, 553);
|
||||
this.lblogintitle.Name = "lblogintitle";
|
||||
this.lblogintitle.Size = new System.Drawing.Size(103, 13);
|
||||
this.lblogintitle.TabIndex = 1;
|
||||
this.lblogintitle.Tag = "header1 keepbg";
|
||||
this.lblogintitle.Text = "Welcome to ShiftOS";
|
||||
//
|
||||
// btnshutdown
|
||||
//
|
||||
this.btnshutdown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btnshutdown.AutoSize = true;
|
||||
this.btnshutdown.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.btnshutdown.Location = new System.Drawing.Point(924, 652);
|
||||
this.btnshutdown.Name = "btnshutdown";
|
||||
this.btnshutdown.Size = new System.Drawing.Size(65, 23);
|
||||
this.btnshutdown.TabIndex = 2;
|
||||
this.btnshutdown.Text = "Shutdown";
|
||||
this.btnshutdown.UseVisualStyleBackColor = true;
|
||||
this.btnshutdown.Click += new System.EventHandler(this.btnshutdown_Click);
|
||||
//
|
||||
// GUILogin
|
||||
//
|
||||
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(1001, 687);
|
||||
this.Controls.Add(this.btnshutdown);
|
||||
this.Controls.Add(this.lblogintitle);
|
||||
this.Controls.Add(this.pnlloginform);
|
||||
this.ForeColor = System.Drawing.Color.White;
|
||||
this.Name = "GUILogin";
|
||||
this.Text = "GUILogin";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.GUILogin_FormClosing);
|
||||
this.Load += new System.EventHandler(this.GUILogin_Load);
|
||||
this.pnlloginform.ResumeLayout(false);
|
||||
this.pnlloginform.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pnlloginform;
|
||||
private System.Windows.Forms.Button btnlogin;
|
||||
private System.Windows.Forms.TextBox txtpassword;
|
||||
private System.Windows.Forms.TextBox txtusername;
|
||||
private System.Windows.Forms.Label lblogintitle;
|
||||
private System.Windows.Forms.Button btnshutdown;
|
||||
}
|
||||
}
|
136
ShiftOS.WinForms/GUILogin.cs
Normal file
136
ShiftOS.WinForms/GUILogin.cs
Normal file
|
@ -0,0 +1,136 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.Objects;
|
||||
using ShiftOS.WinForms.Tools;
|
||||
|
||||
namespace ShiftOS.WinForms
|
||||
{
|
||||
public partial class GUILogin : Form
|
||||
{
|
||||
public GUILogin()
|
||||
{
|
||||
InitializeComponent();
|
||||
uiTimer.Tick += (o, a) =>
|
||||
{
|
||||
btnlogin.Left = txtusername.Left + ((txtusername.Width - btnlogin.Width) / 2);
|
||||
btnlogin.Top = txtpassword.Top + txtpassword.Height + 5;
|
||||
|
||||
lblogintitle.Left = pnlloginform.Left + ((pnlloginform.Width - lblogintitle.Width) / 2);
|
||||
lblogintitle.Top = pnlloginform.Top - lblogintitle.Width - 5;
|
||||
|
||||
};
|
||||
uiTimer.Interval = 100;
|
||||
this.FormBorderStyle = FormBorderStyle.None;
|
||||
this.WindowState = FormWindowState.Maximized;
|
||||
this.TopMost = true;
|
||||
}
|
||||
|
||||
Timer uiTimer = new Timer();
|
||||
|
||||
public event Action<ClientSave> LoginComplete;
|
||||
|
||||
private void GUILogin_Load(object sender, EventArgs e)
|
||||
{
|
||||
uiTimer.Start();
|
||||
ControlManager.SetupControl(lblogintitle);
|
||||
ControlManager.SetupControls(pnlloginform);
|
||||
ControlManager.SetupControl(btnshutdown);
|
||||
pnlloginform.CenterParent();
|
||||
txtusername.CenterParent();
|
||||
txtusername.Location = new System.Drawing.Point(txtusername.Location.X, 77);
|
||||
txtpassword.CenterParent();
|
||||
btnlogin.CenterParent();
|
||||
btnlogin.Location = new System.Drawing.Point(btnlogin.Location.X, 143);
|
||||
this.BackColor = SkinEngine.LoadedSkin.LoginScreenColor;
|
||||
this.BackgroundImage = SkinEngine.GetImage("login");
|
||||
this.BackgroundImageLayout = SkinEngine.GetImageLayout("login");
|
||||
}
|
||||
|
||||
private ClientSave User = null;
|
||||
|
||||
bool userRequestClose = true;
|
||||
bool shuttingdown = false;
|
||||
|
||||
private void GUILogin_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
e.Cancel = userRequestClose;
|
||||
if (!e.Cancel)
|
||||
{
|
||||
uiTimer.Stop();
|
||||
if (shuttingdown == false)
|
||||
{
|
||||
LoginComplete?.Invoke(User);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void btnlogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(txtusername.Text))
|
||||
{
|
||||
Infobox.Show("Enter a username", "You must enter your username to login.");
|
||||
return;
|
||||
}
|
||||
|
||||
//Don't check for blank passwords.
|
||||
|
||||
var user = SaveSystem.CurrentSave.Users.FirstOrDefault(x => x.Username == txtusername.Text);
|
||||
if(user == null)
|
||||
{
|
||||
Infobox.Show("Invalid username", "That username was not found on your system.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.Password != txtpassword.Text)
|
||||
{
|
||||
Infobox.Show("Access denied.", "That password didn't work. Please try a different one.");
|
||||
return;
|
||||
}
|
||||
|
||||
User = user;
|
||||
userRequestClose = false;
|
||||
shuttingdown = false;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnshutdown_Click(object sender, EventArgs e)
|
||||
{
|
||||
userRequestClose = false;
|
||||
shuttingdown = true;
|
||||
this.Close();
|
||||
SaveSystem.CurrentUser = SaveSystem.CurrentSave.Users.FirstOrDefault(x => x.Username == "root");
|
||||
TerminalBackend.InvokeCommand("sos.shutdown");
|
||||
}
|
||||
}
|
||||
|
||||
public class GUILoginFrontend : ILoginFrontend
|
||||
{
|
||||
public bool UseGUILogin
|
||||
{
|
||||
get
|
||||
{
|
||||
return Shiftorium.UpgradeInstalled("gui_based_login_screen");
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<ClientSave> LoginComplete;
|
||||
|
||||
public void Login()
|
||||
{
|
||||
var lform = new GUILogin();
|
||||
lform.LoginComplete += (user) =>
|
||||
{
|
||||
LoginComplete?.Invoke(user);
|
||||
};
|
||||
lform.Show();
|
||||
}
|
||||
}
|
||||
}
|
120
ShiftOS.WinForms/GUILogin.resx
Normal file
120
ShiftOS.WinForms/GUILogin.resx
Normal 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>
|
|
@ -2,12 +2,14 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.Objects;
|
||||
using ShiftOS.Objects.ShiftFS;
|
||||
using ShiftOS.WinForms.Applications;
|
||||
using static ShiftOS.Objects.ShiftFS.Utils;
|
||||
|
||||
|
@ -107,7 +109,7 @@ namespace ShiftOS.WinForms
|
|||
Thread.Sleep(2000);
|
||||
writeSlow($"Hello there, fellow multi-user domain user.");
|
||||
writeSlow("My name, as you can tell, is hacker101.");
|
||||
writeSlow("And yours must be... don't say it... it's " + SaveSystem.CurrentSave.Username + "@" + SaveSystem.CurrentSave.SystemName + ", right?");
|
||||
writeSlow("And yours must be... don't say it... it's " + SaveSystem.CurrentUser.Username + "@" + SaveSystem.CurrentSave.SystemName + ", right?");
|
||||
writeSlow("Of course it is.");
|
||||
writeSlow("And I bet you 10,000 Codepoints that you have... " + SaveSystem.CurrentSave.Codepoints.ToString() + " Codepoints.");
|
||||
writeSlow("Oh, and how much upgrades have you installed since you first started using ShiftOS?");
|
||||
|
@ -135,7 +137,7 @@ namespace ShiftOS.WinForms
|
|||
Console.Write(" ..done");
|
||||
TerminalBackend.InStory = false;
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
Console.Write($"{SaveSystem.CurrentSave.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
|
||||
Console.Write($"{SaveSystem.CurrentUser.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
|
||||
StartHackerTutorial();
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.PrintPrompt();
|
||||
|
@ -454,7 +456,7 @@ namespace ShiftOS.WinForms
|
|||
var sve = JsonConvert.DeserializeObject<Save>(msg.Contents);
|
||||
if(sve.Password == pass)
|
||||
{
|
||||
Console.WriteLine("Username: " + sve.Username);
|
||||
Console.WriteLine("Username: " + SaveSystem.CurrentUser.Username);
|
||||
Console.WriteLine("Password: " + sve.Password);
|
||||
Console.WriteLine("System name: " + sve.SystemName);
|
||||
Console.WriteLine();
|
||||
|
@ -504,7 +506,7 @@ namespace ShiftOS.WinForms
|
|||
string usr = args["user"].ToString();
|
||||
string sys = args["sys"].ToString();
|
||||
string pass = args["pass"].ToString();
|
||||
long amount = (long)args["amount"];
|
||||
ulong amount = (ulong)args["amount"];
|
||||
if(amount < 0)
|
||||
{
|
||||
Console.WriteLine("--invalid codepoint amount - halting...");
|
||||
|
@ -531,7 +533,7 @@ namespace ShiftOS.WinForms
|
|||
}
|
||||
|
||||
sve.Codepoints -= amount;
|
||||
SaveSystem.TransferCodepointsFrom(sve.Username, amount);
|
||||
SaveSystem.TransferCodepointsFrom(SaveSystem.CurrentUser.Username, amount);
|
||||
ServerManager.SendMessage("mud_save_allow_dead", JsonConvert.SerializeObject(sve));
|
||||
SaveSystem.SaveGame();
|
||||
}
|
||||
|
@ -674,6 +676,34 @@ namespace ShiftOS.WinForms
|
|||
return true;
|
||||
}
|
||||
|
||||
[Command("list", description ="Lists all story IDs.")]
|
||||
public static bool ListIds()
|
||||
{
|
||||
foreach(var exec in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
|
||||
{
|
||||
if(exec.ToLower().EndsWith(".exe") || exec.ToLower().EndsWith(".dll"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var asm = Assembly.LoadFile(exec);
|
||||
{
|
||||
foreach(var type in asm.GetTypes())
|
||||
{
|
||||
foreach(var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
|
||||
{
|
||||
var attr = method.GetCustomAttributes(false).FirstOrDefault(x => x is StoryAttribute);
|
||||
if (attr != null)
|
||||
Console.WriteLine(" - " + (attr as StoryAttribute).StoryID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
[Command("unexperience", description = "Marks a story plot as not-experienced yet.", usage ="id:string")]
|
||||
[RemoteLock]
|
||||
[RequiresArgument("id")]
|
||||
|
|
|
@ -35,12 +35,12 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
public class AcquireCodepointsJobTask : JobTask
|
||||
{
|
||||
public AcquireCodepointsJobTask(int amount)
|
||||
public AcquireCodepointsJobTask(uint amount)
|
||||
{
|
||||
CodepointsRequired = SaveSystem.CurrentSave.Codepoints + amount;
|
||||
}
|
||||
|
||||
public long CodepointsRequired { get; private set; }
|
||||
public ulong CodepointsRequired { get; private set; }
|
||||
|
||||
public override bool IsComplete
|
||||
{
|
||||
|
|
|
@ -91,6 +91,7 @@ namespace ShiftOS.WinForms
|
|||
slashcount++;
|
||||
if (slashcount == 5)
|
||||
slashcount = 1;
|
||||
Engine.AudioManager.PlayStream(Properties.Resources.writesound);
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
rtext += Environment.NewLine;
|
||||
|
@ -126,28 +127,28 @@ namespace ShiftOS.WinForms
|
|||
this.Invoke(new Action(() =>
|
||||
{
|
||||
lblHijack.Hide();
|
||||
lblhackwords.Font = new Font("Courier New", lblhackwords.Font.Size, FontStyle.Bold);
|
||||
}));
|
||||
|
||||
TextType(@"Throughout many years, man has tried to develop
|
||||
a digital environment usable by anyone that never goes
|
||||
offline, full of AIs and humans alike, thinking, interacting,
|
||||
innovating.
|
||||
TextType("Hello, unsuspecting user.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("Welcome to the Shifted Operating System.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("Your computer has been taken over by ShiftOS, and is currently being wiped clean of all existing files and programs.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("I will not share my identity or my intentions at this moment.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("I will just proceed with the installation.There’s nothing you can do to stop it.");
|
||||
Thread.Sleep(2000);
|
||||
Clear();
|
||||
TextType("All I will say, is I need your help.Once ShiftOS is installed, I will explain.");
|
||||
|
||||
No one has ever come close to a digital society of such
|
||||
properties yet, except for one sentient being. It does not
|
||||
have a life, a gender, an age or a body, but simply one name.
|
||||
|
||||
They call it ""DevX"".
|
||||
|
||||
If anyone sees this message, my identity is anonymous, but I
|
||||
need your help. I am trapped within ""DevX""'s digital society
|
||||
with no way out, constantly under attack.
|
||||
|
||||
You must join the digital society, rise up the ranks, and save us.
|
||||
|
||||
- undisclosed_0x1DDFB5977.");
|
||||
|
||||
Thread.Sleep(5000);
|
||||
Thread.Sleep(5000);
|
||||
while(this.Opacity > 0f)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
|
@ -210,14 +211,15 @@ You must join the digital society, rise up the ranks, and save us.
|
|||
ServerMessageReceived smr = null;
|
||||
smr = (msg) =>
|
||||
{
|
||||
ServerManager.MessageReceived -= smr;
|
||||
if (msg.Name == "mud_savefile")
|
||||
{
|
||||
ServerManager.MessageReceived -= smr;
|
||||
SaveSystem.CurrentSave = JsonConvert.DeserializeObject<Save>(msg.Contents);
|
||||
SaveSystem.SaveGame();
|
||||
}
|
||||
else if(msg.Name=="mud_login_denied")
|
||||
{
|
||||
ServerManager.MessageReceived -= smr;
|
||||
LinkSaveFile(token);
|
||||
}
|
||||
};
|
||||
|
@ -312,11 +314,15 @@ You must join the digital society, rise up the ranks, and save us.
|
|||
sve.Codepoints = 0;
|
||||
sve.Upgrades = new Dictionary<string, bool>();
|
||||
sve.ID = Guid.NewGuid();
|
||||
sve.StoriesExperienced = new List<string>();
|
||||
sve.StoriesExperienced.Add("mud_fundamentals");
|
||||
Infobox.Show("Welcome to ShiftOS.", "Welcome to ShiftOS, " + client.GetDisplayName() + ". We have created a save file for you. Now, go on and Shift It Your Way.", () =>
|
||||
{
|
||||
sve.StoryPosition = 8675309;
|
||||
SaveSystem.CurrentSave = sve;
|
||||
Shiftorium.Silent = true;
|
||||
SaveSystem.SaveGame();
|
||||
Shiftorium.Silent = false;
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -111,6 +111,7 @@ namespace ShiftOS.WinForms
|
|||
ConsoleEx.Bold = false;
|
||||
ConsoleEx.BackgroundColor = ConsoleColor.Black;
|
||||
Console.Write("Formatting: [");
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
int formatProgress = 3;
|
||||
while (formatProgress <= 100)
|
||||
{
|
||||
|
@ -118,9 +119,10 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
ConsoleEx.BackgroundColor = ConsoleColor.White;
|
||||
Console.Write(" ");
|
||||
ConsoleEx.OnFlush?.Invoke();
|
||||
ConsoleEx.BackgroundColor = ConsoleColor.Black;
|
||||
}
|
||||
Engine.AudioManager.PlayStream(Properties.Resources.typesound);
|
||||
Desktop.InvokeOnWorkerThread(() => Engine.AudioManager.PlayStream(Properties.Resources.typesound));
|
||||
formatProgress++;
|
||||
Thread.Sleep(175);
|
||||
}
|
||||
|
@ -135,15 +137,15 @@ namespace ShiftOS.WinForms
|
|||
{
|
||||
Console.WriteLine("Creating: " + dir);
|
||||
Thread.Sleep(125);
|
||||
Engine.AudioManager.PlayStream(Properties.Resources.writesound);
|
||||
Desktop.InvokeOnWorkerThread(() => Engine.AudioManager.PlayStream(Properties.Resources.writesound));
|
||||
}
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Next, let's get user information.");
|
||||
Console.WriteLine();
|
||||
ShiftOS.Engine.OutOfBoxExperience.PromptForLogin();
|
||||
|
||||
}
|
||||
|
||||
private static bool isValid(string text, string chars)
|
||||
{
|
||||
foreach(var c in text)
|
||||
|
|
|
@ -49,15 +49,26 @@ namespace ShiftOS.WinForms
|
|||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
//if ANYONE puts code before those two winforms config lines they will be declared a drunky. - Michael
|
||||
SkinEngine.SetPostProcessor(new DitheringSkinPostProcessor());
|
||||
SaveSystem.PreDigitalSocietyConnection += () =>
|
||||
{
|
||||
Action completed = null;
|
||||
completed = () =>
|
||||
{
|
||||
SaveSystem.Ready = true;
|
||||
Engine.AudioManager.PlayCompleted -= completed;
|
||||
AudioManager.StartAmbientLoop();
|
||||
};
|
||||
Engine.AudioManager.PlayCompleted += completed;
|
||||
Engine.AudioManager.PlayStream(Properties.Resources.dial_up_modem_02);
|
||||
|
||||
};
|
||||
LoginManager.Init(new GUILoginFrontend());
|
||||
CrashHandler.SetGameMetadata(Assembly.GetExecutingAssembly());
|
||||
SkinEngine.SetIconProber(new ShiftOSIconProvider());
|
||||
ShiftOS.Engine.AudioManager.Init(new ShiftOSAudioProvider());
|
||||
Localization.RegisterProvider(new WFLanguageProvider());
|
||||
AppearanceManager.OnExit += () =>
|
||||
{
|
||||
Environment.Exit(0);
|
||||
};
|
||||
|
||||
|
||||
TutorialManager.RegisterTutorial(new Oobe());
|
||||
|
||||
TerminalBackend.TerminalRequested += () =>
|
||||
|
|
130
ShiftOS.WinForms/Properties/Resources.Designer.cs
generated
130
ShiftOS.WinForms/Properties/Resources.Designer.cs
generated
|
@ -69,6 +69,96 @@ namespace ShiftOS.WinForms.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient1 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient1", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient2", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient3 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient3", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient4 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient4", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient5 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient5", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient6 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient6", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient7 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient7", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient8 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient8", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] Ambient9 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("Ambient9", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -857,6 +947,16 @@ namespace ShiftOS.WinForms.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap iconSpeaker {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("iconSpeaker", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -958,6 +1058,16 @@ namespace ShiftOS.WinForms.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap notestate_connection_full {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("notestate_connection_full", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@ -994,22 +1104,18 @@ namespace ShiftOS.WinForms.Properties {
|
|||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [
|
||||
/// //TEMPORARY
|
||||
/// {
|
||||
/// Name: "Desktop Widgets",
|
||||
/// Cost: 0,
|
||||
/// Description: "Temporary upgrade. Will be replaced by either a Shiftnet app or a story element.",
|
||||
/// Dependencies: "advanced_app_launcher;wm_free_placement",
|
||||
/// Category: "Work-in-progress"
|
||||
/// },
|
||||
///
|
||||
///
|
||||
///
|
||||
///// SCREENSAVER
|
||||
/// {
|
||||
/// Name: "Screensavers",
|
||||
/// Cost: 750,
|
||||
/// Description: "Like to leave your PC idle for long periods of time? Save some energy and keep your screen from being tired by hiding the desktop behind a black screen with an image on it." [rest of string was truncated]";.
|
||||
/// Description: "Like to leave your PC idle for long periods of time? Save some energy and keep your screen from being tired by hiding the desktop behind a black screen with an image on it.",
|
||||
/// Dependencies: "desktop",
|
||||
/// Category: "Enhancements",
|
||||
/// },
|
||||
/// {
|
||||
/// Name: "Shift Progress Bar",
|
||||
/// Cost: 150,
|
||||
/// Description: "Want to customize the look of all ShiftOS Progress Bars? Buy this upgrade today and you'll get the ability to set the foreground an [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string Shiftorium {
|
||||
get {
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uSU8uTWVtb3J5U3RyZWFtCgAAAAdfYnVmZmVyB19v
|
||||
cmlnaW4JX3Bvc2l0aW9uB19sZW5ndGgJX2NhcGFjaXR5C19leHBhbmRhYmxlCV93cml0YWJsZQpfZXhw
|
||||
b3NhYmxlB19pc09wZW4dTWFyc2hhbEJ5UmVmT2JqZWN0K19faWRlbnRpdHkHAAAAAAAAAAACAggICAgB
|
||||
AQEBCQIAAAAAAAAAAAAAAJKjAACSowAAAAEAAQoPAgAAAJKjAAACUklGRoqjAABXQVZFZm10IBAAAAAB
|
||||
AQEBCQIAAAAAAAAAkqMAAJKjAACSowAAAAEAAQoPAgAAAJKjAAACUklGRoqjAABXQVZFZm10IBAAAAAB
|
||||
AAEARKwAAIhYAQACABAAZGF0YWajAAABAP7/AgD9/wMA/f8DAPz/BAD8/wQA/f8BAP//AAABAAAA//8C
|
||||
AP3/BAD9/wIAAAD//wIA//8BAAAAAAABAP//AQAAAAEAAAACAP7/AQABAAAAAQAAAAEAAAACAP7/AwD+
|
||||
/wIAAAD//wIA/v8DAP7/AwD9/wMA//8AAAIA/f8DAAAA//8BAAAA/v8CAP////8CAPz/BAD8/wMA/f8A
|
||||
|
@ -838,7 +838,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uSU8uTWVtb3J5U3RyZWFtCgAAAAdfYnVmZmVyB19v
|
||||
cmlnaW4JX3Bvc2l0aW9uB19sZW5ndGgJX2NhcGFjaXR5C19leHBhbmRhYmxlCV93cml0YWJsZQpfZXhw
|
||||
b3NhYmxlB19pc09wZW4dTWFyc2hhbEJ5UmVmT2JqZWN0K19faWRlbnRpdHkHAAAAAAAAAAACAggICAgB
|
||||
AQEBCQIAAAAAAAAAAAAAAEwYAABMGAAAAAEAAQoPAgAAAEwYAAACUklGRkQYAABXQVZFZm10IBAAAAAB
|
||||
AQEBCQIAAAAAAAAATBgAAEwYAABMGAAAAAEAAQoPAgAAAEwYAAACUklGRkQYAABXQVZFZm10IBAAAAAB
|
||||
AAEARKwAAIhYAQACABAAZGF0YSAYAAD/X5Vil2TRZUJmF2ZLZadjS2FqXt9aj1awUVtMc0b4PyQ57DFS
|
||||
KmUiSxoDEo4JEQGO+Bzwweee35zX9c+pyK7BGLsYtZqvlqoipneiW5/YnBCbFZq3mfOZEJvknD6fSqIg
|
||||
poaqcK/rtAq7i8FvyMrPgNdo347n7e9h+N8AXwnPERoaQSIlKrcx+zjmP0lGKUykUYJWs1pKXlJhpWMl
|
||||
|
@ -964,7 +964,7 @@
|
|||
<value>..\Resources\SweeperNormalFace.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="strings_en" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\strings_en.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
<value>..\Resources\strings_en.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;iso-8859-1</value>
|
||||
</data>
|
||||
<data name="SweeperTile5" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\SweeperTile5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
|
@ -974,7 +974,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uSU8uTWVtb3J5U3RyZWFtCgAAAAdfYnVmZmVyB19v
|
||||
cmlnaW4JX3Bvc2l0aW9uB19sZW5ndGgJX2NhcGFjaXR5C19leHBhbmRhYmxlCV93cml0YWJsZQpfZXhw
|
||||
b3NhYmxlB19pc09wZW4dTWFyc2hhbEJ5UmVmT2JqZWN0K19faWRlbnRpdHkHAAAAAAAAAAACAggICAgB
|
||||
AQEBCQIAAAAAAAAAAAAAAPwBHgD8AR4AAAEAAQoPAgAAAPwBHgACUklGRvQBHgBXQVZFZm10IBAAAAAB
|
||||
AQEBCQIAAAAAAAAA/AEeAPwBHgD8AR4AAAEAAQoPAgAAAPwBHgACUklGRvQBHgBXQVZFZm10IBAAAAAB
|
||||
AAIAgLsAAADuAgAEABAATElTVBQAAABJTkZPSUFSVAgAAABQaGlsaXAAAGRhdGG0AR4A//8CAAwA5v8a
|
||||
APT/8P8sAMf/OADX/xoA5v8bAPL/8/8aAOb/DQAOANb/KgDk/w4AAQDh/zwAt/9HAMj/GwACAPH/DgDy
|
||||
/w0AAQDy/xwA1f8sAO//5v84ALn/OQDk//7/AwD+/xAA4v8dANX/LADw//T/GgDl/w4AAADx/x4A4f8R
|
||||
|
@ -33831,7 +33831,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uSU8uTWVtb3J5U3RyZWFtCgAAAAdfYnVmZmVyB19v
|
||||
cmlnaW4JX3Bvc2l0aW9uB19sZW5ndGgJX2NhcGFjaXR5C19leHBhbmRhYmxlCV93cml0YWJsZQpfZXhw
|
||||
b3NhYmxlB19pc09wZW4dTWFyc2hhbEJ5UmVmT2JqZWN0K19faWRlbnRpdHkHAAAAAAAAAAACAggICAgB
|
||||
AQEBCQIAAAAAAAAAAAAAAPBWAADwVgAAAAEAAQoPAgAAAPBWAAACUklGRuhWAABXQVZFZm10IBAAAAAB
|
||||
AQEBCQIAAAAAAAAA8FYAAPBWAADwVgAAAAEAAQoPAgAAAPBWAAACUklGRuhWAABXQVZFZm10IBAAAAAB
|
||||
AAEARKwAAIhYAQACABAAZGF0YcRWAAAAAGQL6gtkDL8MEA3kDLUMaAwUDKULKwuYCvcJQAl4CJ0Hrwaw
|
||||
BaAEfgNQAg4Bwf9p/v/8mfsn+rD4OPe59T/0wPJH8dPvYu7+7JzrTeoG6dLnreaX5Z/kruPl4jHinOEk
|
||||
4cTgh+Bl4GLgguDC4B7hpeFC4g3j7uP35B/mZufO6FXq9eu67ZHviPGT87L15/cr+oL84f5QAcMDPwa9
|
||||
|
@ -34456,7 +34456,7 @@
|
|||
AAEAAAD/////AQAAAAAAAAAEAQAAABZTeXN0ZW0uSU8uTWVtb3J5U3RyZWFtCgAAAAdfYnVmZmVyB19v
|
||||
cmlnaW4JX3Bvc2l0aW9uB19sZW5ndGgJX2NhcGFjaXR5C19leHBhbmRhYmxlCV93cml0YWJsZQpfZXhw
|
||||
b3NhYmxlB19pc09wZW4dTWFyc2hhbEJ5UmVmT2JqZWN0K19faWRlbnRpdHkHAAAAAAAAAAACAggICAgB
|
||||
AQEBCQIAAAAAAAAAAAAAAIwWAACMFgAAAAEAAQoPAgAAAIwWAAACUklGRoQWAABXQVZFZm10IBAAAAAB
|
||||
AQEBCQIAAAAAAAAAjBYAAIwWAACMFgAAAAEAAQoPAgAAAIwWAAACUklGRoQWAABXQVZFZm10IBAAAAAB
|
||||
AAEARKwAAIhYAQACABAAZGF0YWAWAAAAAKYLIxdYIhQtQjexQFBJ81CUVwddTmFLZP9lXmZqZSRjl1/J
|
||||
WtFUu02mRao84jJzKHsdJRKPBub6TO/q4+XYZM6FxG67ObMCrOel8aA9ncuar5nimWybQZ5eoq+nKa6t
|
||||
tTC+hcec0U3cbefr8on+MQq6FfQgxSsFNo8/R0gRUMpWblzSYAFk2WVlZpxlfmMbYHJboVWsTrdG1D0l
|
||||
|
@ -34573,4 +34573,37 @@
|
|||
<data name="SuperDesk screenshot" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\SuperDesk screenshot.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Ambient1" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient1.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient2.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient3" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient3.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient4" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient4.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient5" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient5.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient6" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient6.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient7" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient7.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient8" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient8.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="Ambient9" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Ambient9.mp3;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="notestate_connection_full" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\notestate_connection_full.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="iconSpeaker" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\iconSpeaker.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
ShiftOS.WinForms/Resources/Ambient1.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient1.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient2.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient2.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient3.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient3.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient4.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient4.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient5.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient5.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient6.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient6.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient7.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient7.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient8.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient8.mp3
Normal file
Binary file not shown.
BIN
ShiftOS.WinForms/Resources/Ambient9.mp3
Normal file
BIN
ShiftOS.WinForms/Resources/Ambient9.mp3
Normal file
Binary file not shown.
|
@ -11,21 +11,22 @@ With Freebie Solutions from ShiftSoft, you'll be able to traverse the Shiftnet w
|
|||
{
|
||||
Company: "Shiftcast",
|
||||
Name: "NetXtreme Hyper Edition",
|
||||
CostPerMonth: 1500,
|
||||
CostPerMonth: 150,
|
||||
DownloadSpeed: 524288, //512 kb/s
|
||||
Description: "It's time to supercharge your Shiftnet experience. With all the multimedia available, fast download speeds are a must on the Shiftnet. Start your subscription today for the low price of 1500 Codepoints and become a hyper-traveller today."
|
||||
},
|
||||
{
|
||||
Company: "Plumb Corp.",
|
||||
Name: "youConnect",
|
||||
CostPerMonth: 6000,
|
||||
Company: "Bit Communications",
|
||||
Name: "EncoderNet",
|
||||
CostPerMonth: 600,
|
||||
DownloadSpeed: 1048576, //1 mb/s
|
||||
Description: "The most reliable service provider on the Shiftnet."
|
||||
},
|
||||
{
|
||||
Company: "theCorp",
|
||||
Name: "theNet",
|
||||
CostPerMonth: 3000,
|
||||
Company: "SOL Communications",
|
||||
Name: "ShiftOS Online",
|
||||
CostPerMonth: 300,
|
||||
DownloadSpeed: 786342, //768 kb/s
|
||||
Description: "theNet is not *just* a Shiftnet service provider. It is theGateway to all of theShiftnet and your needs. It is also theValue service provider with theGreatest price and download speed."
|
||||
Description: "SOL is the Shiftnet."
|
||||
},
|
||||
]
|
|
@ -7,6 +7,41 @@
|
|||
Dependencies: "desktop",
|
||||
Category: "Enhancements",
|
||||
},
|
||||
{
|
||||
Name: "Icon Manager",
|
||||
Cost: 450,
|
||||
Description: "This tool allows you to add and edit application icons within ShiftOS for the small prive of 450 Codepoints!",
|
||||
Dependencies: "skinning",
|
||||
Category: "Application"
|
||||
},
|
||||
{
|
||||
Name: "AL Icon Manager",
|
||||
Costs: 150,
|
||||
Description: "Add an App Launcher entry for the Icon Manager.",
|
||||
Dependencies: "icon_manager;app_launcher",
|
||||
Category: "Customization"
|
||||
},
|
||||
{
|
||||
Name: "Shift Progress Bar",
|
||||
Cost: 150,
|
||||
Description: "Want to customize the look of all ShiftOS Progress Bars? Buy this upgrade today and you'll get the ability to set the foreground and background color of the progress bar, and many more things!.",
|
||||
Dependencies: "shifter;shift_buttons",
|
||||
Category: "Customization"
|
||||
},
|
||||
{
|
||||
Name: "Shift Buttons",
|
||||
Cost: 150,
|
||||
Description: "Want to customize the look of all ShiftOS buttons? This Shifter upgrade gives you a new \"Buttons\" category in the System category to do just that.",
|
||||
Dependencies: "shifter",
|
||||
Category: "Customization"
|
||||
},
|
||||
{
|
||||
Name: "GUI Based Login Screen",
|
||||
Cost: 500,
|
||||
Description: "Tired of using the text-based login screen in ShiftOS? Well, we have a functioning window manager, and a functioning desktop, why not use these tools to create a functioning and awesome-looking login screen?",
|
||||
Dependencies: "skinning;desktop;wm_free_placement",
|
||||
Category: "Kernel & System"
|
||||
},
|
||||
{
|
||||
Name: "Shift Screensavers",
|
||||
Cost: 100,
|
||||
|
@ -130,13 +165,6 @@
|
|||
},
|
||||
|
||||
// SHIFTLETTERS AND WORDLISTS
|
||||
{
|
||||
Name: "ShiftLetters",
|
||||
Cost: 150,
|
||||
Dependencies: null,
|
||||
Category: "Applications",
|
||||
Description: "Sick and tired of playing Pong? Buy this upgrade to get a whole new game!"
|
||||
},
|
||||
{
|
||||
Name: "AL ShiftLetters",
|
||||
Cost: 150,
|
||||
|
@ -269,7 +297,7 @@
|
|||
Name: "AL Widget Manager",
|
||||
Cost: 125,
|
||||
Description: "Desktop Widgets are a huge advancement in ShiftOS technology, allowing access to system information, and quick control of your system, without even opening a window. However, we still need to be able to modify each widget. This upgrade adds an App Launcher entry for the Desktop Widget Manager.",
|
||||
Description: "app_launcher;desktop_widgets",
|
||||
Dependencies: "app_launcher;desktop_widgets",
|
||||
Category: "GUI"
|
||||
},
|
||||
{
|
||||
|
@ -690,7 +718,8 @@
|
|||
Name: "Artpad",
|
||||
Cost: 7500,
|
||||
Category: "Applications",
|
||||
Description: "ArtPad is a very extensible tool that allows you to draw images within ShiftOS. Buy this upgrade to gain access to it through win.open{}!"
|
||||
Description: "ArtPad is a very extensible tool that allows you to draw images within ShiftOS. Buy this upgrade to gain access to it through win.open{}!",
|
||||
Dependencies: "color_depth_8_bits"
|
||||
},
|
||||
{
|
||||
Name: "AL Artpad",
|
||||
|
@ -1007,13 +1036,6 @@
|
|||
|
||||
// SHIFTSWEEPER
|
||||
|
||||
{
|
||||
Name: "ShiftSweeper",
|
||||
Cost: 800,
|
||||
Dependencies: "shiftletters",
|
||||
Category: "Applications",
|
||||
Description: "Getting bored with Pong and ShiftLetters? Try this BRAND NEW game called ShiftSweeper!"
|
||||
},
|
||||
{
|
||||
Name: "AL ShiftSweeper",
|
||||
Cost: 100,
|
||||
|
|
BIN
ShiftOS.WinForms/Resources/iconSpeaker.bmp
Normal file
BIN
ShiftOS.WinForms/Resources/iconSpeaker.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
ShiftOS.WinForms/Resources/notestate_connection_full.bmp
Normal file
BIN
ShiftOS.WinForms/Resources/notestate_connection_full.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
161
ShiftOS.WinForms/Servers/RemoteTerminalServer.cs
Normal file
161
ShiftOS.WinForms/Servers/RemoteTerminalServer.cs
Normal file
|
@ -0,0 +1,161 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.Objects;
|
||||
|
||||
namespace ShiftOS.WinForms.Servers
|
||||
{
|
||||
[Namespace("rts")]
|
||||
[Server("Remote Terminal Server", 21)]
|
||||
//[RequiresUpgrade("story_hacker101_breakingthebonds")] //Uncomment when story is implemented.
|
||||
public class RemoteTerminalServer : Server
|
||||
{
|
||||
public void MessageReceived(ServerMessage msg)
|
||||
{
|
||||
var rtsMessage = JsonConvert.DeserializeObject<RTSMessage>(msg.Contents);
|
||||
if (msg.Name == "disconnected")
|
||||
{
|
||||
if (Applications.Terminal.IsInRemoteSystem == true)
|
||||
{
|
||||
if (Applications.Terminal.RemoteSystemName == rtsMessage.SenderSystemName)
|
||||
{
|
||||
if(Applications.Terminal.RemoteUser == rtsMessage.Username)
|
||||
if(Applications.Terminal.RemotePass == rtsMessage.Password)
|
||||
{
|
||||
Applications.Terminal.IsInRemoteSystem = false;
|
||||
Applications.Terminal.RemoteSystemName = "";
|
||||
Applications.Terminal.RemoteUser = "";
|
||||
Applications.Terminal.RemotePass = "";
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
TerminalBackend.PrintPrompt();
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
string currentUserName = SaveSystem.CurrentUser.Username;
|
||||
|
||||
var user = SaveSystem.CurrentSave.Users.FirstOrDefault(x => x.Username == rtsMessage.Username && x.Password == rtsMessage.Password);
|
||||
|
||||
if(user == null)
|
||||
{
|
||||
ServerManager.SendMessageToIngameServer(rtsMessage.SenderSystemName, 0, "Access denied.", "The username and password you have provided was denied.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveSystem.CurrentUser = user;
|
||||
|
||||
string cmd = rtsMessage.Namespace + "." + rtsMessage.Command + JsonConvert.SerializeObject(rtsMessage.Arguments);
|
||||
TerminalBackend.InvokeCommand(cmd, true);
|
||||
ServerManager.SendMessageToIngameServer(rtsMessage.SenderSystemName, 1, "writeline", TerminalBackend.LastCommandBuffer);
|
||||
ServerManager.SendMessageToIngameServer(rtsMessage.SenderSystemName, 1, "write", $"{rtsMessage.Username}@{SaveSystem.CurrentSave.SystemName}:~$ ");
|
||||
|
||||
SaveSystem.CurrentUser = SaveSystem.Users.FirstOrDefault(x => x.Username == currentUserName);
|
||||
}
|
||||
}
|
||||
|
||||
[Command("connect")]
|
||||
[RequiresArgument("sysname")]
|
||||
[RequiresArgument("username")]
|
||||
[RequiresArgument("password")]
|
||||
public static bool Connect(Dictionary<string, object> args)
|
||||
{
|
||||
string sysname = args["sysname"].ToString();
|
||||
string username = args["username"].ToString();
|
||||
string password = args["password"].ToString();
|
||||
|
||||
bool connectionFinished = false;
|
||||
|
||||
|
||||
new Thread(() =>
|
||||
{
|
||||
Thread.Sleep(10000);
|
||||
if (connectionFinished == false)
|
||||
{
|
||||
Applications.Terminal.IsInRemoteSystem = false;
|
||||
Applications.Terminal.RemoteSystemName = "";
|
||||
Applications.Terminal.RemoteUser = "";
|
||||
Applications.Terminal.RemotePass = "";
|
||||
TerminalBackend.PrefixEnabled = true;
|
||||
Console.WriteLine("[rts] Connection failed, target system did not respond.");
|
||||
TerminalBackend.PrintPrompt();
|
||||
|
||||
}
|
||||
}).Start();
|
||||
|
||||
ServerMessageReceived smr = null;
|
||||
smr = (msg) =>
|
||||
{
|
||||
if (msg.Name == "msgtosys")
|
||||
{
|
||||
var m = JsonConvert.DeserializeObject<ServerMessage>(msg.Contents);
|
||||
if (m.GUID.Split('|')[2] != ServerManager.thisGuid.ToString())
|
||||
{
|
||||
connectionFinished = true;
|
||||
ServerManager.MessageReceived -= smr;
|
||||
}
|
||||
}
|
||||
};
|
||||
ServerManager.MessageReceived += smr;
|
||||
ServerManager.SendMessageToIngameServer(sysname, 21, "cmd", JsonConvert.SerializeObject(new RTSMessage
|
||||
{
|
||||
SenderSystemName = SaveSystem.CurrentSave.SystemName,
|
||||
Username = username,
|
||||
Password = password,
|
||||
Namespace = "trm",
|
||||
Command = "clear"
|
||||
}));
|
||||
Applications.Terminal.IsInRemoteSystem = true;
|
||||
Applications.Terminal.RemoteSystemName = sysname;
|
||||
Applications.Terminal.RemoteUser = username;
|
||||
Applications.Terminal.RemotePass = password;
|
||||
TerminalBackend.PrefixEnabled = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Server("Generic port 0", 0)]
|
||||
public class InfoboxServer : Server
|
||||
{
|
||||
public void MessageReceived(ServerMessage msg)
|
||||
{
|
||||
Infobox.Show(msg.Name, msg.Contents);
|
||||
}
|
||||
}
|
||||
|
||||
[Server("Generic port 1", 1)]
|
||||
public class ConsoleServer : Server
|
||||
{
|
||||
public void MessageReceived(ServerMessage msg)
|
||||
{
|
||||
switch (msg.Name)
|
||||
{
|
||||
case "write":
|
||||
Console.Write(msg.Contents);
|
||||
break;
|
||||
case "writeline":
|
||||
Console.WriteLine(msg.Contents);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class RTSMessage
|
||||
{
|
||||
public string SenderSystemName { get; set; }
|
||||
|
||||
public string Namespace { get; set; }
|
||||
public string Command { get; set; }
|
||||
public Dictionary<string, object> Arguments { get; set; }
|
||||
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
|
@ -70,6 +70,24 @@
|
|||
<Compile Include="Applications\About.Designer.cs">
|
||||
<DependentUpon>About.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\IconManager.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Applications\IconManager.Designer.cs">
|
||||
<DependentUpon>IconManager.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\TriPresent.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Applications\TriPresent.Designer.cs">
|
||||
<DependentUpon>TriPresent.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\TriSheet.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Applications\TriSheet.Designer.cs">
|
||||
<DependentUpon>TriSheet.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\TriWrite.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -262,6 +280,12 @@
|
|||
<Compile Include="Applications\VideoPlayer.Designer.cs">
|
||||
<DependentUpon>VideoPlayer.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\WebBrowser.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Applications\WebBrowser.Designer.cs">
|
||||
<DependentUpon>WebBrowser.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\WidgetManagerFrontend.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -323,6 +347,12 @@
|
|||
<DependentUpon>DownloadControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIFunctions.cs" />
|
||||
<Compile Include="GUILogin.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GUILogin.Designer.cs">
|
||||
<DependentUpon>GUILogin.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HackerCommands.cs" />
|
||||
<Compile Include="IDesktopWidget.cs" />
|
||||
<Compile Include="JobTasks.cs" />
|
||||
|
@ -339,6 +369,7 @@
|
|||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ScriptingTestFunctions.cs" />
|
||||
<Compile Include="Servers\RemoteTerminalServer.cs" />
|
||||
<Compile Include="ShiftnetSites\AppscapeMain.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -357,9 +388,46 @@
|
|||
<Compile Include="ShiftnetSites\MainHomepage.Designer.cs">
|
||||
<DependentUpon>MainHomepage.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShiftnetSites\ShiftGames.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ShiftnetSites\ShiftGames.Designer.cs">
|
||||
<DependentUpon>ShiftGames.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShiftnetSites\ShiftSoft.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ShiftnetSites\ShiftSoft.Designer.cs">
|
||||
<DependentUpon>ShiftSoft.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShiftnetSites\ShiftSoft_Ping.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ShiftnetSites\ShiftSoft_Ping.Designer.cs">
|
||||
<DependentUpon>ShiftSoft_Ping.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShiftOSAudioProvider.cs" />
|
||||
<Compile Include="ShiftOSConfigFile.cs" />
|
||||
<Compile Include="SkinCommands.cs" />
|
||||
<Compile Include="StatusIcons\ShiftnetStatus.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="StatusIcons\ShiftnetStatus.Designer.cs">
|
||||
<DependentUpon>ShiftnetStatus.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StatusIcons\TestStatus.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="StatusIcons\TestStatus.Designer.cs">
|
||||
<DependentUpon>TestStatus.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="StatusIcons\Volume.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="StatusIcons\Volume.Designer.cs">
|
||||
<DependentUpon>Volume.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Stories\DevXSkinningStory.cs" />
|
||||
<Compile Include="Stories\LegionStory.cs" />
|
||||
<Compile Include="TestCommandsForUpgrades.cs" />
|
||||
<Compile Include="Tools\ColorPickerDataBackend.cs" />
|
||||
|
@ -406,6 +474,15 @@
|
|||
<EmbeddedResource Include="Applications\About.resx">
|
||||
<DependentUpon>About.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\IconManager.resx">
|
||||
<DependentUpon>IconManager.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\TriPresent.resx">
|
||||
<DependentUpon>TriPresent.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\TriSheet.resx">
|
||||
<DependentUpon>TriSheet.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\TriWrite.resx">
|
||||
<DependentUpon>TriWrite.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -499,6 +576,9 @@
|
|||
<EmbeddedResource Include="Applications\VideoPlayer.resx">
|
||||
<DependentUpon>VideoPlayer.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\WebBrowser.resx">
|
||||
<DependentUpon>WebBrowser.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\WidgetManagerFrontend.resx">
|
||||
<DependentUpon>WidgetManagerFrontend.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -520,6 +600,9 @@
|
|||
<EmbeddedResource Include="DownloadControl.resx">
|
||||
<DependentUpon>DownloadControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GUILogin.resx">
|
||||
<DependentUpon>GUILogin.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Oobe.resx">
|
||||
<DependentUpon>Oobe.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -537,6 +620,24 @@
|
|||
<EmbeddedResource Include="ShiftnetSites\MainHomepage.resx">
|
||||
<DependentUpon>MainHomepage.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ShiftnetSites\ShiftGames.resx">
|
||||
<DependentUpon>ShiftGames.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ShiftnetSites\ShiftSoft.resx">
|
||||
<DependentUpon>ShiftSoft.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="ShiftnetSites\ShiftSoft_Ping.resx">
|
||||
<DependentUpon>ShiftSoft_Ping.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="StatusIcons\ShiftnetStatus.resx">
|
||||
<DependentUpon>ShiftnetStatus.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="StatusIcons\TestStatus.resx">
|
||||
<DependentUpon>TestStatus.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="StatusIcons\Volume.resx">
|
||||
<DependentUpon>Volume.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UniteLoginDialog.resx">
|
||||
<DependentUpon>UniteLoginDialog.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -748,11 +849,22 @@
|
|||
<None Include="Resources\ShiftnetServices.txt" />
|
||||
<None Include="Resources\3beepvirus.wav" />
|
||||
<None Include="Resources\dial-up-modem-02.wav" />
|
||||
<None Include="Resources\Ambient1.mp3" />
|
||||
<None Include="Resources\Ambient2.mp3" />
|
||||
<None Include="Resources\Ambient3.mp3" />
|
||||
<None Include="Resources\Ambient4.mp3" />
|
||||
<None Include="Resources\Ambient5.mp3" />
|
||||
<None Include="Resources\Ambient6.mp3" />
|
||||
<None Include="Resources\Ambient7.mp3" />
|
||||
<None Include="Resources\Ambient8.mp3" />
|
||||
<None Include="Resources\Ambient9.mp3" />
|
||||
<Content Include="Resources\fileiconcf.bmp" />
|
||||
<None Include="Resources\infobox.wav" />
|
||||
<None Include="Resources\typesound.wav" />
|
||||
<None Include="Resources\writesound.wav" />
|
||||
<None Include="Resources\SuperDesk screenshot.png" />
|
||||
<None Include="Resources\notestate_connection_full.bmp" />
|
||||
<None Include="Resources\iconSpeaker.bmp" />
|
||||
<Content Include="SystemIcons\iconArtpad.png" />
|
||||
<Content Include="SystemIcons\iconAudioPlayer.png" />
|
||||
<Content Include="SystemIcons\iconBitnoteDigger.png" />
|
||||
|
|
|
@ -372,7 +372,7 @@ namespace ShiftOS.WinForms
|
|||
/// </summary>
|
||||
public class AppscapeEntryAttribute : RequiresUpgradeAttribute
|
||||
{
|
||||
public AppscapeEntryAttribute(string name, string description, int downloadSize, long cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_'))
|
||||
public AppscapeEntryAttribute(string name, string description, int downloadSize, ulong cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_'))
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
|
@ -385,7 +385,7 @@ namespace ShiftOS.WinForms
|
|||
public string Name { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
public string Category { get; private set; }
|
||||
public long Cost { get; private set; }
|
||||
public ulong Cost { get; private set; }
|
||||
public string DependencyString { get; private set; }
|
||||
public int DownloadSize { get; private set; }
|
||||
}
|
||||
|
|
74
ShiftOS.WinForms/ShiftnetSites/ShiftGames.Designer.cs
generated
Normal file
74
ShiftOS.WinForms/ShiftnetSites/ShiftGames.Designer.cs
generated
Normal file
|
@ -0,0 +1,74 @@
|
|||
namespace ShiftOS.WinForms.ShiftnetSites
|
||||
{
|
||||
partial class ShiftGames
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShiftGames));
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(571, 65);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Tag = "header2";
|
||||
this.label1.Text = "ShiftGames/Minimatch";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label2.Location = new System.Drawing.Point(0, 65);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(571, 309);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = resources.GetString("label2.Text");
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// ShiftGames
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "ShiftGames";
|
||||
this.Size = new System.Drawing.Size(571, 374);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
}
|
||||
}
|
39
ShiftOS.WinForms/ShiftnetSites/ShiftGames.cs
Normal file
39
ShiftOS.WinForms/ShiftnetSites/ShiftGames.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
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;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.WinForms.Tools;
|
||||
|
||||
namespace ShiftOS.WinForms.ShiftnetSites
|
||||
{
|
||||
[ShiftnetSite("shiftnet/main/shiftgames", "ShiftGames (formerly Minimatch)", "The one true Shiftnet site for virus-free, quality games.")]
|
||||
public partial class ShiftGames : UserControl, IShiftnetSite
|
||||
{
|
||||
public ShiftGames()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public event Action GoBack;
|
||||
public event Action<string> GoToUrl;
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
ControlManager.SetupControls(this);
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
125
ShiftOS.WinForms/ShiftnetSites/ShiftGames.resx
Normal file
125
ShiftOS.WinForms/ShiftnetSites/ShiftGames.resx
Normal file
|
@ -0,0 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="label2.Text" xml:space="preserve">
|
||||
<value>ShiftGames has been shut down as of May 2016. We have moved our inventory to the Appscape Repository. Thanks for being with us, and apologies for the inconvenience.
|
||||
|
||||
Copyright (c) 2014-2016 Maureen Fenn</value>
|
||||
</data>
|
||||
</root>
|
61
ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs
generated
Normal file
61
ShiftOS.WinForms/ShiftnetSites/ShiftSoft.Designer.cs
generated
Normal file
|
@ -0,0 +1,61 @@
|
|||
namespace ShiftOS.WinForms.ShiftnetSites
|
||||
{
|
||||
partial class ShiftSoft
|
||||
{
|
||||
/// <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.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("Franklin Gothic Heavy", 24.75F, System.Drawing.FontStyle.Italic);
|
||||
this.label1.Location = new System.Drawing.Point(13, 17);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(152, 38);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Tag = "keepfont";
|
||||
this.label1.Text = "Shiftsoft";
|
||||
//
|
||||
// ShiftSoft
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "ShiftSoft";
|
||||
this.Size = new System.Drawing.Size(523, 384);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
38
ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs
Normal file
38
ShiftOS.WinForms/ShiftnetSites/ShiftSoft.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
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;
|
||||
using ShiftOS.Engine;
|
||||
|
||||
namespace ShiftOS.WinForms.ShiftnetSites
|
||||
{
|
||||
[ShiftnetSite("shiftnet/shiftsoft", "ShiftSoft", "What do you want to shift today?")]
|
||||
[ShiftnetFundamental]
|
||||
public partial class ShiftSoft : UserControl, IShiftnetSite
|
||||
{
|
||||
public ShiftSoft()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public event Action GoBack;
|
||||
public event Action<string> GoToUrl;
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
120
ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx
Normal file
120
ShiftOS.WinForms/ShiftnetSites/ShiftSoft.resx
Normal 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>
|
89
ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.Designer.cs
generated
Normal file
89
ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.Designer.cs
generated
Normal file
|
@ -0,0 +1,89 @@
|
|||
namespace ShiftOS.WinForms.ShiftnetSites
|
||||
{
|
||||
partial class ShiftSoft_Ping
|
||||
{
|
||||
/// <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.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.fllist = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.label1.Size = new System.Drawing.Size(48, 33);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Tag = "header2";
|
||||
this.label1.Text = "Ping";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label2.Location = new System.Drawing.Point(0, 33);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Padding = new System.Windows.Forms.Padding(10);
|
||||
this.label2.Size = new System.Drawing.Size(734, 56);
|
||||
this.label2.TabIndex = 1;
|
||||
this.label2.Text = "Ping is a simple service that lets you see all the sites on the shiftnet/ cluster" +
|
||||
". These sites are safe for you to use and do not contain malware or other threat" +
|
||||
"s.";
|
||||
//
|
||||
// fllist
|
||||
//
|
||||
this.fllist.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.fllist.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
|
||||
this.fllist.Location = new System.Drawing.Point(0, 89);
|
||||
this.fllist.Name = "fllist";
|
||||
this.fllist.Size = new System.Drawing.Size(734, 389);
|
||||
this.fllist.TabIndex = 2;
|
||||
//
|
||||
// ShiftSoft_Ping
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.fllist);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "ShiftSoft_Ping";
|
||||
this.Size = new System.Drawing.Size(734, 478);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.FlowLayoutPanel fllist;
|
||||
}
|
||||
}
|
97
ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs
Normal file
97
ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.cs
Normal file
|
@ -0,0 +1,97 @@
|
|||
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;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using ShiftOS.Engine;
|
||||
using ShiftOS.WinForms.Tools;
|
||||
|
||||
namespace ShiftOS.WinForms.ShiftnetSites
|
||||
{
|
||||
[ShiftnetSite("shiftnet/shiftsoft/ping", "Ping", "A site listing hosted by ShiftSoft.")]
|
||||
public partial class ShiftSoft_Ping : UserControl, IShiftnetSite
|
||||
{
|
||||
public ShiftSoft_Ping()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public event Action GoBack;
|
||||
public event Action<string> GoToUrl;
|
||||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
ControlManager.SetupControls(this);
|
||||
SetupListing();
|
||||
}
|
||||
|
||||
public void SetupListing()
|
||||
{
|
||||
fllist.Controls.Clear();
|
||||
foreach(var exec in Directory.GetFiles(Environment.CurrentDirectory))
|
||||
{
|
||||
if(exec.ToLower().EndsWith(".exe") || exec.ToLower().EndsWith(".dll"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var asm = Assembly.LoadFile(exec);
|
||||
var types = asm.GetTypes();
|
||||
foreach (var type in types)
|
||||
{
|
||||
if (type.GetInterfaces().Contains(typeof(IShiftnetSite)))
|
||||
{
|
||||
var attr = type.GetCustomAttributes(false).FirstOrDefault(x => x is ShiftnetSiteAttribute) as ShiftnetSiteAttribute;
|
||||
if (attr != null)
|
||||
{
|
||||
if (attr.Url.StartsWith("shiftnet/"))
|
||||
{
|
||||
var lnk = new LinkLabel();
|
||||
lnk.LinkColor = SkinEngine.LoadedSkin.ControlTextColor;
|
||||
lnk.Text = attr.Name;
|
||||
var desc = new Label();
|
||||
desc.AutoSize = true;
|
||||
lnk.AutoSize = true;
|
||||
desc.MaximumSize = new Size(this.Width / 3, 0);
|
||||
desc.Text = attr.Description;
|
||||
desc.Padding = new Padding
|
||||
{
|
||||
Bottom = 25,
|
||||
Top = 0,
|
||||
Left = 10,
|
||||
Right = 10
|
||||
};
|
||||
lnk.Click += (o, a) =>
|
||||
{
|
||||
GoToUrl?.Invoke(attr.Url);
|
||||
};
|
||||
fllist.Controls.Add(lnk);
|
||||
fllist.Controls.Add(desc);
|
||||
ControlManager.SetupControls(lnk);
|
||||
lnk.Show();
|
||||
desc.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnUpgrade()
|
||||
{
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
SetupListing();
|
||||
}
|
||||
}
|
||||
}
|
120
ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.resx
Normal file
120
ShiftOS.WinForms/ShiftnetSites/ShiftSoft_Ping.resx
Normal 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>
|
90
ShiftOS.WinForms/StatusIcons/ShiftnetStatus.Designer.cs
generated
Normal file
90
ShiftOS.WinForms/StatusIcons/ShiftnetStatus.Designer.cs
generated
Normal file
|
@ -0,0 +1,90 @@
|
|||
namespace ShiftOS.WinForms.StatusIcons
|
||||
{
|
||||
partial class ShiftnetStatus
|
||||
{
|
||||
/// <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.label1 = new System.Windows.Forms.Label();
|
||||
this.lbserviceprovider = new System.Windows.Forms.Label();
|
||||
this.lbstatus = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.label1.Size = new System.Drawing.Size(53, 23);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Tag = "header2";
|
||||
this.label1.Text = "Shiftnet";
|
||||
//
|
||||
// lbserviceprovider
|
||||
//
|
||||
this.lbserviceprovider.AutoSize = true;
|
||||
this.lbserviceprovider.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.lbserviceprovider.Location = new System.Drawing.Point(0, 23);
|
||||
this.lbserviceprovider.Name = "lbserviceprovider";
|
||||
this.lbserviceprovider.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.lbserviceprovider.Size = new System.Drawing.Size(98, 23);
|
||||
this.lbserviceprovider.TabIndex = 1;
|
||||
this.lbserviceprovider.Tag = "header3";
|
||||
this.lbserviceprovider.Text = "Freebie Solutions";
|
||||
//
|
||||
// lbstatus
|
||||
//
|
||||
this.lbstatus.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.lbstatus.Location = new System.Drawing.Point(0, 46);
|
||||
this.lbstatus.Name = "lbstatus";
|
||||
this.lbstatus.Padding = new System.Windows.Forms.Padding(5);
|
||||
this.lbstatus.Size = new System.Drawing.Size(331, 144);
|
||||
this.lbstatus.TabIndex = 2;
|
||||
this.lbstatus.Text = "This will show the Shiftnet status.";
|
||||
//
|
||||
// ShiftnetStatus
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.lbstatus);
|
||||
this.Controls.Add(this.lbserviceprovider);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "ShiftnetStatus";
|
||||
this.Size = new System.Drawing.Size(331, 190);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label lbserviceprovider;
|
||||
private System.Windows.Forms.Label lbstatus;
|
||||
}
|
||||
}
|
33
ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs
Normal file
33
ShiftOS.WinForms/StatusIcons/ShiftnetStatus.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
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;
|
||||
using ShiftOS.Engine;
|
||||
|
||||
namespace ShiftOS.WinForms.StatusIcons
|
||||
{
|
||||
[DefaultIcon("iconShiftnet")]
|
||||
[RequiresUpgrade("victortran_shiftnet")]
|
||||
public partial class ShiftnetStatus : UserControl, IStatusIcon
|
||||
{
|
||||
public ShiftnetStatus()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
var subscription = Applications.DownloadManager.GetAllSubscriptions()[SaveSystem.CurrentSave.ShiftnetSubscription];
|
||||
float kilobytes = (float)subscription.DownloadSpeed / 1024F;
|
||||
lbserviceprovider.Text = subscription.Name;
|
||||
lbstatus.Text = $@"Company: {subscription.Company}
|
||||
Download speed (KB/s): {kilobytes}";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
120
ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx
Normal file
120
ShiftOS.WinForms/StatusIcons/ShiftnetStatus.resx
Normal 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>
|
60
ShiftOS.WinForms/StatusIcons/TestStatus.Designer.cs
generated
Normal file
60
ShiftOS.WinForms/StatusIcons/TestStatus.Designer.cs
generated
Normal file
|
@ -0,0 +1,60 @@
|
|||
namespace ShiftOS.WinForms.StatusIcons
|
||||
{
|
||||
partial class TestStatus
|
||||
{
|
||||
/// <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.label1 = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.label1.Location = new System.Drawing.Point(0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(264, 52);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Tag = "header1";
|
||||
this.label1.Text = "This is a test.";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// TestStatus
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label1);
|
||||
this.Name = "TestStatus";
|
||||
this.Size = new System.Drawing.Size(264, 52);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
26
ShiftOS.WinForms/StatusIcons/TestStatus.cs
Normal file
26
ShiftOS.WinForms/StatusIcons/TestStatus.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
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;
|
||||
using ShiftOS.Engine;
|
||||
|
||||
namespace ShiftOS.WinForms.StatusIcons
|
||||
{
|
||||
[DefaultIcon("iconShiftorium")]
|
||||
public partial class TestStatus : UserControl, IStatusIcon
|
||||
{
|
||||
public TestStatus()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue