mirror of
https://github.com/seriocomedy/ShiftOS-C-.git
synced 2025-02-02 04:57:34 +00:00
Move ShiftUI designer to ShiftOS and add
prober for ShiftOS to allow ShiftUI designer to design ShiftOS forms.
This commit is contained in:
parent
64aae03a9b
commit
b52090021f
9 changed files with 80 additions and 73 deletions
|
@ -12,6 +12,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI", "ShiftUI\ShiftUI.csproj", "{C56E34D0-4749-4A73-9469-BCCD063569CD}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI", "ShiftUI\ShiftUI.csproj", "{C56E34D0-4749-4A73-9469-BCCD063569CD}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShiftUI Designer", "..\..\Project-Circle\ShiftUI Designer\ShiftUI Designer.csproj", "{20C1A600-B5C2-4226-B5B6-3F17716D2669}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -26,6 +28,10 @@ Global
|
||||||
{C56E34D0-4749-4A73-9469-BCCD063569CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{C56E34D0-4749-4A73-9469-BCCD063569CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.Build.0 = Release|Any CPU
|
{C56E34D0-4749-4A73-9469-BCCD063569CD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{20C1A600-B5C2-4226-B5B6-3F17716D2669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{20C1A600-B5C2-4226-B5B6-3F17716D2669}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{20C1A600-B5C2-4226-B5B6-3F17716D2669}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{20C1A600-B5C2-4226-B5B6-3F17716D2669}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace ShiftUI.ShiftOS
|
||||||
public Color ButtonBorderColor = Color.Black;
|
public Color ButtonBorderColor = Color.Black;
|
||||||
public Color ButtonBackColor = Color.White;
|
public Color ButtonBackColor = Color.White;
|
||||||
public Color ButtonBackColor_Pressed = Color.Gray;
|
public Color ButtonBackColor_Pressed = Color.Gray;
|
||||||
|
public Color ButtonBackColor_Checked = Color.Black;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Global
|
#region Global
|
||||||
|
@ -55,6 +56,10 @@ namespace ShiftUI.ShiftOS
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ListView
|
||||||
|
public Color ListViewBackground = Color.White;
|
||||||
|
#endregion
|
||||||
|
|
||||||
// No reason to have ShiftOS deal with window borders itself
|
// No reason to have ShiftOS deal with window borders itself
|
||||||
// when I can do it inside ShiftUI.
|
// when I can do it inside ShiftUI.
|
||||||
#region Form
|
#region Form
|
||||||
|
|
|
@ -2973,7 +2973,7 @@ namespace ShiftUI
|
||||||
// border is drawn directly in the Paint method
|
// border is drawn directly in the Paint method
|
||||||
if (details && control.HeaderStyle != ColumnHeaderStyle.None)
|
if (details && control.HeaderStyle != ColumnHeaderStyle.None)
|
||||||
{
|
{
|
||||||
dc.FillRectangle(SystemBrushes.Control,
|
dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ListViewBackground),
|
||||||
0, 0, control.TotalWidth, control.Font.Height + 5);
|
0, 0, control.TotalWidth, control.Font.Height + 5);
|
||||||
if (control.Columns.Count > 0)
|
if (control.Columns.Count > 0)
|
||||||
{
|
{
|
||||||
|
@ -6923,67 +6923,64 @@ namespace ShiftUI
|
||||||
private void CPDrawButtonInternal(Graphics dc, Rectangle rectangle, ButtonState state, Pen DarkPen, Pen NormalPen, Pen LightPen)
|
private void CPDrawButtonInternal(Graphics dc, Rectangle rectangle, ButtonState state, Pen DarkPen, Pen NormalPen, Pen LightPen)
|
||||||
{
|
{
|
||||||
// sadly enough, the rectangle gets always filled with a hatchbrush
|
// sadly enough, the rectangle gets always filled with a hatchbrush
|
||||||
dc.FillRectangle(ResPool.GetHatchBrush(HatchStyle.Percent50,
|
dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ButtonBackColor),
|
||||||
Color.FromArgb(Clamp(ColorControl.R + 3, 0, 255),
|
|
||||||
ColorControl.G, ColorControl.B),
|
|
||||||
ColorControl),
|
|
||||||
rectangle.X + 1, rectangle.Y + 1, rectangle.Width - 2, rectangle.Height - 2);
|
rectangle.X + 1, rectangle.Y + 1, rectangle.Width - 2, rectangle.Height - 2);
|
||||||
|
|
||||||
if ((state & ButtonState.All) == ButtonState.All || ((state & ButtonState.Checked) == ButtonState.Checked && (state & ButtonState.Flat) == ButtonState.Flat))
|
if ((state & ButtonState.All) == ButtonState.All || ((state & ButtonState.Checked) == ButtonState.Checked && (state & ButtonState.Flat) == ButtonState.Flat))
|
||||||
{
|
{
|
||||||
dc.FillRectangle(ResPool.GetHatchBrush(HatchStyle.Percent50, ColorControlLight, ColorControl), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4);
|
dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ButtonBackColor_Checked), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4);
|
||||||
|
|
||||||
dc.DrawRectangle(SystemPens.ControlDark, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1);
|
dc.DrawRectangle(new Pen(new SolidBrush(Application.CurrentSkin.ButtonBorderColor), Application.CurrentSkin.ButtonBorderWidth), rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ((state & ButtonState.Flat) == ButtonState.Flat)
|
if ((state & ButtonState.Flat) == ButtonState.Flat)
|
||||||
{
|
{
|
||||||
dc.DrawRectangle(SystemPens.ControlDark, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1);
|
dc.DrawRectangle(new Pen(new SolidBrush(Application.CurrentSkin.ButtonBorderColor), Application.CurrentSkin.ButtonBorderWidth), rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if ((state & ButtonState.Checked) == ButtonState.Checked)
|
if ((state & ButtonState.Checked) == ButtonState.Checked)
|
||||||
{
|
{
|
||||||
dc.FillRectangle(ResPool.GetHatchBrush(HatchStyle.Percent50, ColorControlLight, ColorControl), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4);
|
dc.FillRectangle(new SolidBrush(Application.CurrentSkin.ButtonBackColor_Checked), rectangle.X + 2, rectangle.Y + 2, rectangle.Width - 4, rectangle.Height - 4);
|
||||||
|
|
||||||
Pen pen = DarkPen;
|
Pen pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DTopLeftInner));
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2);
|
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2);
|
||||||
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y, rectangle.Right - 2, rectangle.Y);
|
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y, rectangle.Right - 2, rectangle.Y);
|
||||||
|
|
||||||
pen = NormalPen;
|
pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRight));
|
||||||
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y + 1, rectangle.X + 1, rectangle.Bottom - 3);
|
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y + 1, rectangle.X + 1, rectangle.Bottom - 3);
|
||||||
dc.DrawLine(pen, rectangle.X + 2, rectangle.Y + 1, rectangle.Right - 3, rectangle.Y + 1);
|
dc.DrawLine(pen, rectangle.X + 2, rectangle.Y + 1, rectangle.Right - 3, rectangle.Y + 1);
|
||||||
|
|
||||||
pen = LightPen;
|
pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRightInner));
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 2, rectangle.Bottom - 1);
|
dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 2, rectangle.Bottom - 1);
|
||||||
dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 1);
|
dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (((state & ButtonState.Pushed) == ButtonState.Pushed) && ((state & ButtonState.Normal) == ButtonState.Normal))
|
if (((state & ButtonState.Pushed) == ButtonState.Pushed) && ((state & ButtonState.Normal) == ButtonState.Normal))
|
||||||
{
|
{
|
||||||
Pen pen = DarkPen;
|
Pen pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DTopLeftInner));
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2);
|
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2);
|
||||||
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y, rectangle.Right - 2, rectangle.Y);
|
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y, rectangle.Right - 2, rectangle.Y);
|
||||||
|
|
||||||
pen = NormalPen;
|
pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRight));
|
||||||
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y + 1, rectangle.X + 1, rectangle.Bottom - 3);
|
dc.DrawLine(pen, rectangle.X + 1, rectangle.Y + 1, rectangle.X + 1, rectangle.Bottom - 3);
|
||||||
dc.DrawLine(pen, rectangle.X + 2, rectangle.Y + 1, rectangle.Right - 3, rectangle.Y + 1);
|
dc.DrawLine(pen, rectangle.X + 2, rectangle.Y + 1, rectangle.Right - 3, rectangle.Y + 1);
|
||||||
|
|
||||||
pen = LightPen;
|
pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRightInner));
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 2, rectangle.Bottom - 1);
|
dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 2, rectangle.Bottom - 1);
|
||||||
dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 1);
|
dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (((state & ButtonState.Inactive) == ButtonState.Inactive) || ((state & ButtonState.Normal) == ButtonState.Normal))
|
if (((state & ButtonState.Inactive) == ButtonState.Inactive) || ((state & ButtonState.Normal) == ButtonState.Normal))
|
||||||
{
|
{
|
||||||
Pen pen = LightPen;
|
Pen pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DTopLeftInner));
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.Right - 2, rectangle.Y);
|
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.Right - 2, rectangle.Y);
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2);
|
dc.DrawLine(pen, rectangle.X, rectangle.Y, rectangle.X, rectangle.Bottom - 2);
|
||||||
|
|
||||||
pen = NormalPen;
|
pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRight));
|
||||||
dc.DrawLine(pen, rectangle.X + 1, rectangle.Bottom - 2, rectangle.Right - 2, rectangle.Bottom - 2);
|
dc.DrawLine(pen, rectangle.X + 1, rectangle.Bottom - 2, rectangle.Right - 2, rectangle.Bottom - 2);
|
||||||
dc.DrawLine(pen, rectangle.Right - 2, rectangle.Y + 1, rectangle.Right - 2, rectangle.Bottom - 3);
|
dc.DrawLine(pen, rectangle.Right - 2, rectangle.Y + 1, rectangle.Right - 2, rectangle.Bottom - 3);
|
||||||
|
|
||||||
pen = DarkPen;
|
pen = new Pen(new SolidBrush(Application.CurrentSkin.Border3DBottomRightInner));
|
||||||
dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 1, rectangle.Bottom - 1);
|
dc.DrawLine(pen, rectangle.X, rectangle.Bottom - 1, rectangle.Right - 1, rectangle.Bottom - 1);
|
||||||
dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 2);
|
dc.DrawLine(pen, rectangle.Right - 1, rectangle.Y, rectangle.Right - 1, rectangle.Bottom - 2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1926,6 +1926,7 @@ namespace ShiftOS
|
||||||
public static Color[] yellowmemory = new Color[16];
|
public static Color[] yellowmemory = new Color[16];
|
||||||
public static Color[] pinkmemory = new Color[16];
|
public static Color[] pinkmemory = new Color[16];
|
||||||
internal static Dictionary<string, Dictionary<string, object>> LuaShifterRegistry = null;
|
internal static Dictionary<string, Dictionary<string, object>> LuaShifterRegistry = null;
|
||||||
|
public static bool ShouldLoadEngine = true;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,17 @@ namespace ShiftOS
|
||||||
public BitnoteWallet()
|
public BitnoteWallet()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Clients = new List<BitnoteClient>();
|
if (API.ShouldLoadEngine)
|
||||||
foreach(var c in Package_Grabber.clients)
|
|
||||||
{
|
{
|
||||||
if(c.Value.IsConnected)
|
Clients = new List<BitnoteClient>();
|
||||||
|
foreach (var c in Package_Grabber.clients)
|
||||||
{
|
{
|
||||||
var client = new BitnoteClient(c.Key);
|
if (c.Value.IsConnected)
|
||||||
client.GetBank();
|
{
|
||||||
Clients.Add(client);
|
var client = new BitnoteClient(c.Key);
|
||||||
|
client.GetBank();
|
||||||
|
Clients.Add(client);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,7 +443,6 @@ namespace ShiftOS
|
||||||
this.pnlshifterintro.SuspendLayout();
|
this.pnlshifterintro.SuspendLayout();
|
||||||
this.pnldesktopoptions.SuspendLayout();
|
this.pnldesktopoptions.SuspendLayout();
|
||||||
this.pnldesktoppaneloptions.SuspendLayout();
|
this.pnldesktoppaneloptions.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).BeginInit();
|
|
||||||
this.pnlapplauncheroptions.SuspendLayout();
|
this.pnlapplauncheroptions.SuspendLayout();
|
||||||
this.pnldesktopintro.SuspendLayout();
|
this.pnldesktopintro.SuspendLayout();
|
||||||
this.pnlpanelbuttonsoptions.SuspendLayout();
|
this.pnlpanelbuttonsoptions.SuspendLayout();
|
||||||
|
@ -453,7 +452,6 @@ namespace ShiftOS
|
||||||
this.predesktoppanel.SuspendLayout();
|
this.predesktoppanel.SuspendLayout();
|
||||||
this.prepnlpanelbuttonholder.SuspendLayout();
|
this.prepnlpanelbuttonholder.SuspendLayout();
|
||||||
this.prepnlpanelbutton.SuspendLayout();
|
this.prepnlpanelbutton.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pretbicon)).BeginInit();
|
|
||||||
this.pretimepanel.SuspendLayout();
|
this.pretimepanel.SuspendLayout();
|
||||||
this.preapplaunchermenuholder.SuspendLayout();
|
this.preapplaunchermenuholder.SuspendLayout();
|
||||||
this.predesktopappmenu.SuspendLayout();
|
this.predesktopappmenu.SuspendLayout();
|
||||||
|
@ -472,7 +470,6 @@ namespace ShiftOS
|
||||||
this.prepgleft.SuspendLayout();
|
this.prepgleft.SuspendLayout();
|
||||||
this.prepgright.SuspendLayout();
|
this.prepgright.SuspendLayout();
|
||||||
this.pretitlebar.SuspendLayout();
|
this.pretitlebar.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.prepnlicon)).BeginInit();
|
|
||||||
this.pnlreset.SuspendLayout();
|
this.pnlreset.SuspendLayout();
|
||||||
this.pgcontents.SuspendLayout();
|
this.pgcontents.SuspendLayout();
|
||||||
this.pnldesktopcomposition.SuspendLayout();
|
this.pnldesktopcomposition.SuspendLayout();
|
||||||
|
@ -5123,7 +5120,7 @@ namespace ShiftOS
|
||||||
this.pnldesktopoptions.ResumeLayout(false);
|
this.pnldesktopoptions.ResumeLayout(false);
|
||||||
this.pnldesktoppaneloptions.ResumeLayout(false);
|
this.pnldesktoppaneloptions.ResumeLayout(false);
|
||||||
this.pnldesktoppaneloptions.PerformLayout();
|
this.pnldesktoppaneloptions.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).EndInit();
|
//((System.ComponentModel.ISupportInitialize)(this.txtdesktoppanelheight)).EndInit();
|
||||||
this.pnlapplauncheroptions.ResumeLayout(false);
|
this.pnlapplauncheroptions.ResumeLayout(false);
|
||||||
this.pnlapplauncheroptions.PerformLayout();
|
this.pnlapplauncheroptions.PerformLayout();
|
||||||
this.pnldesktopintro.ResumeLayout(false);
|
this.pnldesktopintro.ResumeLayout(false);
|
||||||
|
@ -5139,7 +5136,7 @@ namespace ShiftOS
|
||||||
this.prepnlpanelbuttonholder.ResumeLayout(false);
|
this.prepnlpanelbuttonholder.ResumeLayout(false);
|
||||||
this.prepnlpanelbutton.ResumeLayout(false);
|
this.prepnlpanelbutton.ResumeLayout(false);
|
||||||
this.prepnlpanelbutton.PerformLayout();
|
this.prepnlpanelbutton.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.pretbicon)).EndInit();
|
//((System.ComponentModel.ISupportInitialize)(this.pretbicon)).EndInit();
|
||||||
this.pretimepanel.ResumeLayout(false);
|
this.pretimepanel.ResumeLayout(false);
|
||||||
this.pretimepanel.PerformLayout();
|
this.pretimepanel.PerformLayout();
|
||||||
this.preapplaunchermenuholder.ResumeLayout(false);
|
this.preapplaunchermenuholder.ResumeLayout(false);
|
||||||
|
@ -5169,7 +5166,7 @@ namespace ShiftOS
|
||||||
this.prepgright.ResumeLayout(false);
|
this.prepgright.ResumeLayout(false);
|
||||||
this.pretitlebar.ResumeLayout(false);
|
this.pretitlebar.ResumeLayout(false);
|
||||||
this.pretitlebar.PerformLayout();
|
this.pretitlebar.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.prepnlicon)).EndInit();
|
//((System.ComponentModel.ISupportInitialize)(this.prepnlicon)).EndInit();
|
||||||
this.pnlreset.ResumeLayout(false);
|
this.pnlreset.ResumeLayout(false);
|
||||||
this.pgcontents.ResumeLayout(false);
|
this.pgcontents.ResumeLayout(false);
|
||||||
this.pgcontents.PerformLayout();
|
this.pgcontents.PerformLayout();
|
||||||
|
|
|
@ -102,13 +102,7 @@ namespace ShiftOS
|
||||||
get { return _MaxValue; }
|
get { return _MaxValue; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value > this.MinValue)
|
_MaxValue = value;
|
||||||
{
|
|
||||||
_MaxValue = value;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new ArgumentOutOfRangeException("The maximum value must be more than the minimum value.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1466,9 +1466,7 @@ end");
|
||||||
/// <returns>The converted widget.</returns>
|
/// <returns>The converted widget.</returns>
|
||||||
public static Widget ToWidget(this System.Windows.Forms.Control ctrl)
|
public static Widget ToWidget(this System.Windows.Forms.Control ctrl)
|
||||||
{
|
{
|
||||||
string json = JsonConvert.SerializeObject(ctrl);
|
return new Controls.WinFormsHost(ctrl);
|
||||||
json = json.Replace("Control", "Widget");
|
|
||||||
return JsonConvert.DeserializeObject<Widget>(json);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,24 +12,24 @@ using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace ShiftOS
|
namespace ShiftOS
|
||||||
{
|
{
|
||||||
static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
//Extract all dependencies before starting the engine.
|
//Extract all dependencies before starting the engine.
|
||||||
ExtractDependencies();
|
ExtractDependencies();
|
||||||
var poolThread = new Thread(new ThreadStart(new Action(() => {
|
var poolThread = new Thread(new ThreadStart(new Action(() =>
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Download ShiftOS server startup-pool
|
//Download ShiftOS server startup-pool
|
||||||
string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool");
|
string pool = new WebClient().DownloadString("http://playshiftos.ml/server/startup_pool");
|
||||||
string[] splitter = pool.Split(';');
|
string[] splitter = pool.Split(';');
|
||||||
foreach (string address in splitter)
|
foreach (string address in splitter)
|
||||||
{
|
{
|
||||||
|
@ -55,13 +55,14 @@ namespace ShiftOS
|
||||||
//Start the Windows Forms backend
|
//Start the Windows Forms backend
|
||||||
Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS.
|
Paths.RegisterPaths(); //Sets ShiftOS path variables based on the current OS.
|
||||||
SaveSystem.Utilities.CheckForOlderSaves(); //Backs up C:\ShiftOS on Windows systems if it exists and doesn't contain a _engineInfo.txt file telling ShiftOS what engine created it.
|
SaveSystem.Utilities.CheckForOlderSaves(); //Backs up C:\ShiftOS on Windows systems if it exists and doesn't contain a _engineInfo.txt file telling ShiftOS what engine created it.
|
||||||
//If there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save.
|
//If there isn't a save folder at the directory specified by ShiftOS.Paths.SaveRoot, create a new save.
|
||||||
//If not, load that save.
|
//If not, load that save.
|
||||||
if (Directory.Exists(Paths.SaveRoot))
|
if (Directory.Exists(Paths.SaveRoot))
|
||||||
{
|
{
|
||||||
API.Log("Loading ShiftOS save...");
|
API.Log("Loading ShiftOS save...");
|
||||||
SaveSystem.Utilities.loadGame();
|
SaveSystem.Utilities.loadGame();
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SaveSystem.Utilities.NewGame();
|
SaveSystem.Utilities.NewGame();
|
||||||
}
|
}
|
||||||
|
@ -80,44 +81,48 @@ namespace ShiftOS
|
||||||
Skinning.Utilities.loadskin();
|
Skinning.Utilities.loadskin();
|
||||||
SaveSystem.ShiftoriumRegistry.UpdateShiftorium();
|
SaveSystem.ShiftoriumRegistry.UpdateShiftorium();
|
||||||
//Lua bootscreen.
|
//Lua bootscreen.
|
||||||
if(File.Exists(Paths.SaveRoot + "BOOT"))
|
if (File.Exists(Paths.SaveRoot + "BOOT"))
|
||||||
{
|
{
|
||||||
string lua = File.ReadAllText(Paths.SaveRoot + "BOOT");
|
string lua = File.ReadAllText(Paths.SaveRoot + "BOOT");
|
||||||
var l = new LuaInterpreter();
|
var l = new LuaInterpreter();
|
||||||
l.mod(lua);
|
l.mod(lua);
|
||||||
}
|
}
|
||||||
//Start recieving calls from the Modding API...
|
//Start recieving calls from the Modding API...
|
||||||
Application.Run(new ShiftOSDesktop());
|
if (!args.Contains("nodisplay"))
|
||||||
//By now, the API receiver has been loaded,
|
|
||||||
//and the desktop is shown. So, let's check
|
|
||||||
//for auto-start mods.
|
|
||||||
if(Directory.Exists(Paths.AutoStart))
|
|
||||||
{
|
{
|
||||||
foreach(string file in Directory.GetFiles(Paths.AutoStart))
|
Application.Run(new ShiftOSDesktop());
|
||||||
|
//By now, the API receiver has been loaded,
|
||||||
|
//and the desktop is shown. So, let's check
|
||||||
|
//for auto-start mods.
|
||||||
|
if (Directory.Exists(Paths.AutoStart))
|
||||||
{
|
{
|
||||||
var inf = new FileInfo(file);
|
foreach (string file in Directory.GetFiles(Paths.AutoStart))
|
||||||
switch(inf.Extension)
|
|
||||||
{
|
{
|
||||||
case ".saa":
|
var inf = new FileInfo(file);
|
||||||
if (API.Upgrades["shiftnet"] == true)
|
switch (inf.Extension)
|
||||||
{
|
{
|
||||||
API.Log("Starting start-up mod \"" + inf.FullName + "\"...");
|
case ".saa":
|
||||||
API.LaunchMod(inf.FullName);
|
if (API.Upgrades["shiftnet"] == true)
|
||||||
}
|
{
|
||||||
break;
|
API.Log("Starting start-up mod \"" + inf.FullName + "\"...");
|
||||||
case ".trm":
|
API.LaunchMod(inf.FullName);
|
||||||
var t = new Terminal();
|
}
|
||||||
t.runterminalfile(inf.FullName);
|
break;
|
||||||
API.Log("Started terminal file \"" + inf.FullName + "\"...");
|
case ".trm":
|
||||||
break;
|
var t = new Terminal();
|
||||||
} }
|
t.runterminalfile(inf.FullName);
|
||||||
|
API.Log("Started terminal file \"" + inf.FullName + "\"...");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//Now, for some ShiftOS launcher integration.
|
//Now, for some ShiftOS launcher integration.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(args[0] != null)
|
if (args[0] != null)
|
||||||
{
|
{
|
||||||
if(args[0] != "")
|
if (args[0] != "")
|
||||||
{
|
{
|
||||||
API.CurrentSave.username = args[0];
|
API.CurrentSave.username = args[0];
|
||||||
//Username set.
|
//Username set.
|
||||||
|
@ -130,6 +135,7 @@ namespace ShiftOS
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ExtractDependencies()
|
static void ExtractDependencies()
|
||||||
{
|
{
|
||||||
//Wow. This'll make it easy for people...
|
//Wow. This'll make it easy for people...
|
||||||
|
|
Loading…
Add table
Reference in a new issue