From 6b804f03ebcdd1c5aa145f29ae71b62bd61f8cb9 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Tue, 19 Jul 2016 21:53:26 -0400 Subject: Full ShiftUI conversion The only bugs are that windows don't show in the center of the screen, and Gecko webbrowsers are not serializing properly to be converted to ShiftUI widgets (you can use the ToWidget() extension method to convert a WinForms control to a ShiftUI widget) Also multiple desktop panels are removed due to some odd bug I can't diagnose. Will add them back in the future. Promise. I loved creating GNOME2 skins. --- source/WindowsFormsApplication1/Gameplay/HackUI.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/WindowsFormsApplication1/Gameplay/HackUI.cs') diff --git a/source/WindowsFormsApplication1/Gameplay/HackUI.cs b/source/WindowsFormsApplication1/Gameplay/HackUI.cs index a1c1555..9767c7c 100644 --- a/source/WindowsFormsApplication1/Gameplay/HackUI.cs +++ b/source/WindowsFormsApplication1/Gameplay/HackUI.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows.Forms; +using ShiftUI; namespace ShiftOS { @@ -288,7 +288,7 @@ namespace ShiftOS newModule.Transmitter = transmitter; transmitter?.send_message(Online.Hacking.NetTransmitter.Messages.PlaceModule, new Online.Hacking.Module { Grade = newModule.Grade, Hostname = newModule.Hostname, HP = newModule.HP, Type = (int)newModule.Type, X = newModule.Left, Y = newModule.Top }); } - pnlyou.Controls.Add(newModule); + pnlyou.Widgets.Add(newModule); int hp = newModule.HP; WriteLine($"[Network] Welcome to the network, {newModule.Hostname}!"); TotalPlayerHP += newModule.HP; @@ -939,7 +939,7 @@ namespace ShiftOS private void btnpoweroff_Click(object sender, EventArgs e) { //Remove the computer from the game. - pnlyou.Controls.Remove(SelectedPlayerComputer); + pnlyou.Widgets.Remove(SelectedPlayerComputer); AllPlayerComputers.Remove(SelectedPlayerComputer); btnpoweroff.Hide(); } @@ -1219,7 +1219,7 @@ namespace ShiftOS newModule.Top = (pnlenemy.Height - newModule.Height) / 2; } var rnd = new Random(); - pnlenemy.Controls.Add(newModule); + pnlenemy.Widgets.Add(newModule); foreach (var pc in AllEnemyComputers) { while (newModule.Bounds.IntersectsWith(pc.Bounds)) @@ -1827,7 +1827,7 @@ namespace ShiftOS } } - private void pongMain_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) + private void pongMain_MouseMove(object sender, ShiftUI.MouseEventArgs e) { paddleHuman.Location = new Point(paddleHuman.Location.X, (MousePosition.Y - pgpong.Location.Y) - (paddleHuman.Height / 2)); } @@ -1938,7 +1938,7 @@ namespace ShiftOS if(module_to_steal.Parent != pnlyou) { - module_to_steal.Parent.Controls.Remove(module_to_steal); + module_to_steal.Parent.Widgets.Remove(module_to_steal); module_to_steal.Dispose(); } tmrcountdown.Stop(); @@ -1981,7 +1981,7 @@ namespace ShiftOS if (module_to_steal.Parent != pnlenemy) { - module_to_steal.Parent.Controls.Remove(module_to_steal); + module_to_steal.Parent.Widgets.Remove(module_to_steal); module_to_steal.Dispose(); } tmrcountdown.Stop(); -- cgit v1.2.3