diff --git a/FakeDeckUI/FakeDeck/App.xaml b/FakeDeckUI/FakeDeck/App.xaml new file mode 100644 index 0000000..d271c4e --- /dev/null +++ b/FakeDeckUI/FakeDeck/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/FakeDeckUI/FakeDeck/App.xaml.cs b/FakeDeckUI/FakeDeck/App.xaml.cs new file mode 100644 index 0000000..59bb2a5 --- /dev/null +++ b/FakeDeckUI/FakeDeck/App.xaml.cs @@ -0,0 +1,32 @@ +using FakeeDeck.Class; +using Microsoft.VisualBasic.Logging; +using System.Configuration; +using System.Data; +using System.Drawing; +using System.Windows; +using System.Windows.Forms; +using Application = System.Windows.Application; + +namespace FakeDeck +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public YamlHelper yaml; + + protected override void OnStartup(StartupEventArgs e) + { + yaml = new YamlHelper(); + + new Thread(() => + { + Thread.CurrentThread.IsBackground = true; + FakeDeckMain fakeDeck = new FakeDeckMain(yaml); + }).Start(); + + base.OnStartup(e); + } + } +} diff --git a/FakeDeckUI/FakeDeck/AssemblyInfo.cs b/FakeDeckUI/FakeDeck/AssemblyInfo.cs new file mode 100644 index 0000000..b0ec827 --- /dev/null +++ b/FakeDeckUI/FakeDeck/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/FakeeDeck/ButtonType/Button.cs b/FakeDeckUI/FakeDeck/ButtonType/Button.cs similarity index 100% rename from FakeeDeck/ButtonType/Button.cs rename to FakeDeckUI/FakeDeck/ButtonType/Button.cs diff --git a/FakeeDeck/ButtonType/HelldiversTwoMacro.cs b/FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs similarity index 98% rename from FakeeDeck/ButtonType/HelldiversTwoMacro.cs rename to FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs index 19e41dc..e162191 100644 --- a/FakeeDeck/ButtonType/HelldiversTwoMacro.cs +++ b/FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs @@ -1,6 +1,7 @@ using FakeeDeck.Class; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -83,7 +84,7 @@ namespace FakeeDeck.ButtonType foreach (var key in stratogems[stratogem]) { KeyboardMacro.SendKey(key); - Console.WriteLine(key); + Debug.WriteLine(key); } return true; } diff --git a/FakeeDeck/ButtonType/KeyboardMacro.cs b/FakeDeckUI/FakeDeck/ButtonType/KeyboardMacro.cs similarity index 88% rename from FakeeDeck/ButtonType/KeyboardMacro.cs rename to FakeDeckUI/FakeDeck/ButtonType/KeyboardMacro.cs index 449f8a5..b112e65 100644 --- a/FakeeDeck/ButtonType/KeyboardMacro.cs +++ b/FakeDeckUI/FakeDeck/ButtonType/KeyboardMacro.cs @@ -9,6 +9,8 @@ namespace FakeeDeck.ButtonType { internal class KeyboardMacro { + //https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes + [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)] public static extern void keybd_event(uint bVk, uint bScan, uint dwFlags, uint dwExtraInfo); diff --git a/FakeeDeck/ButtonType/MediaMacro.cs b/FakeDeckUI/FakeDeck/ButtonType/MediaMacro.cs similarity index 86% rename from FakeeDeck/ButtonType/MediaMacro.cs rename to FakeDeckUI/FakeDeck/ButtonType/MediaMacro.cs index 2c35a6b..bdc9834 100644 --- a/FakeeDeck/ButtonType/MediaMacro.cs +++ b/FakeDeckUI/FakeDeck/ButtonType/MediaMacro.cs @@ -12,12 +12,17 @@ namespace FakeeDeck.ButtonType { { "play/pause", new uint[] { 0xB3}}, { "mute", new uint[] { 0xAD }}, + { "next", new uint[] { 0xB0 }}, + { "previous", new uint[] { 0xB1 }}, + }; public static Dictionary mediaIcons = new Dictionary { { "play/pause", "fa-play"}, { "mute", "fa-volume-xmark"}, + { "next", "fa-forward"}, + { "previous", "fa-backward"}, }; public static string getButton(string Key) diff --git a/FakeeDeck/Class/AbstractionHelper.cs b/FakeDeckUI/FakeDeck/Class/AbstractionHelper.cs similarity index 100% rename from FakeeDeck/Class/AbstractionHelper.cs rename to FakeDeckUI/FakeDeck/Class/AbstractionHelper.cs diff --git a/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs b/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs new file mode 100644 index 0000000..a677e7b --- /dev/null +++ b/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs @@ -0,0 +1,38 @@ +using AutoUpdaterDotNET; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http.Json; +using System.Reflection; +using System.Text; +using System.Text.Json; +using System.Threading.Tasks; +using System.Windows; + +namespace FakeeDeck.Class +{ + public class AutoUpdateHelper + { + public AutoUpdateHelper() { + AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent; + AutoUpdater.Synchronous = true; + AutoUpdater.ShowRemindLaterButton = false; + AutoUpdater.ReportErrors = Debugger.IsAttached; + AutoUpdater.HttpUserAgent = ("FakeDeck-v" + Assembly.GetExecutingAssembly().GetName().Version); + AutoUpdater.Start("https://api.github.com/repos/GamerClassN7/FakeDeck/releases/latest"); + } + private void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args) + { + JsonElement json = JsonDocument.Parse(args.RemoteData).RootElement; + args.UpdateInfo = new UpdateInfoEventArgs + { + CurrentVersion = json.GetProperty("tag_name").ToString().TrimStart('v')+ ".0", + DownloadURL = json.GetProperty("zipball_url").ToString(), + }; + Debug.WriteLine("calling Updater"); + } + } +} diff --git a/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs b/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs new file mode 100644 index 0000000..dd14957 --- /dev/null +++ b/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs @@ -0,0 +1,133 @@ +using System.Diagnostics; +using System.Net; +using System.Reflection; +using System.Reflection.PortableExecutable; +using System.Text; +using System.Text.Json; + +namespace FakeeDeck.Class +{ + internal class FakeDeckMain + { + public static string pageHeader = + "" + + "" + + " " + + " HttpListener Example" + + " " + + " " + + " " + + " " + + " " + + "
" + + "
" + + "

Page Views: {0}

" + + "
"; + public static string pageFooter = + "
" + + " " + + "
" + + "
" + + " " + + " " + + ""; + public string pageData = ""; + public FakeDeckMain(YamlHelper yaml) + { + HttpServer server = new HttpServer(yaml.getData().GetProperty("server").GetProperty("port").ToString()); + + foreach (JsonElement item in yaml.getData().GetProperty("pages").EnumerateArray()) + { + Debug.WriteLine("PAGE: " + item.GetProperty("page")); + foreach (JsonElement button in item.GetProperty("buttons").EnumerateArray()) + { + pageData += AbstractionHelper.getButtonVisual(button); + } + } + + server.addRoute(servViewResponseAsync, "GET", "/"); + server.addRoute(servButtonResponseAsync, "POST", "/button/"); + + /*foreach (var stratogem in HelldiversTwoMacro.stratogems) + { + server.pageData += HelldiversTwoMacro.getButton(stratogem.Key); + } + + foreach (var control in MediaMacro.mediaControls) + { + server.pageData += MediaMacro.getButton(control.Key); + }*/ + + server.serv(); + } + + private static void callButtonAction(string module, Dictionary postParams) + { + string cleanClass = "FakeeDeck.ButtonType." + module.Trim('/'); + + Type? buttonClass = Type.GetType(cleanClass, true); + + if (buttonClass is null) + return; + + MethodInfo? method = buttonClass.GetMethod("invokeAction"); + + if (method is null) + return; + + ParameterInfo[] pars = method.GetParameters(); + List parameters = new List(); + + foreach (ParameterInfo p in pars) + { + if (p == null) + { + continue; + } + + if (p.Name != null && postParams.ContainsKey(p.Name)) + { + parameters.Insert(p.Position, postParams[p.Name]); + } + else if (p.IsOptional && p.DefaultValue != null) + { + parameters.Insert(p.Position, p.DefaultValue); + } + } + + _ = method.Invoke(null, [.. parameters]).ToString(); + } + + private async Task servViewResponseAsync(HttpListenerRequest req, HttpListenerResponse resp) + { + string disableSubmit = false ? "disabled" : ""; + byte[] data = Encoding.UTF8.GetBytes(string.Format(pageHeader + this.pageData + pageFooter, 0, disableSubmit)); + resp.ContentType = "text/html"; + resp.ContentEncoding = Encoding.UTF8; + resp.ContentLength64 = data.LongLength; + await resp.OutputStream.WriteAsync(data, 0, data.Length); + } + + private async Task servButtonResponseAsync(HttpListenerRequest req, HttpListenerResponse resp, Dictionary postParams) + { + try + { + string module = req.Url.AbsolutePath.Replace("/button", ""); + Console.WriteLine("Call module " + module); + callButtonAction(module, postParams); + resp.StatusCode = (int)HttpStatusCode.OK; + } + catch (Exception ex) + { + byte[] errorData = Encoding.UTF8.GetBytes(ex.Message); + resp.ContentType = "text/html"; + resp.ContentEncoding = Encoding.UTF8; + resp.ContentLength64 = errorData.LongLength; + resp.StatusCode = (int)HttpStatusCode.InternalServerError; + await resp.OutputStream.WriteAsync(errorData, 0, errorData.Length); + } + } + } +} diff --git a/FakeDeckUI/FakeDeck/Class/GeneralHelper.cs b/FakeDeckUI/FakeDeck/Class/GeneralHelper.cs new file mode 100644 index 0000000..6cac593 --- /dev/null +++ b/FakeDeckUI/FakeDeck/Class/GeneralHelper.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media.Imaging; + +namespace FakeDeck.Class +{ + class GeneralHelper + { + public static BitmapImage BitmapToImageSource(System.Drawing.Bitmap bitmap) + { + using (MemoryStream memory = new MemoryStream()) + { + bitmap.Save(memory, System.Drawing.Imaging.ImageFormat.Bmp); + memory.Position = 0; + BitmapImage bitmapimage = new BitmapImage(); + bitmapimage.BeginInit(); + bitmapimage.StreamSource = memory; + bitmapimage.CacheOption = BitmapCacheOption.OnLoad; + bitmapimage.EndInit(); + return bitmapimage; + } + } + } +} diff --git a/FakeeDeck/Class/HttpServer.cs b/FakeDeckUI/FakeDeck/Class/HttpServer.cs similarity index 58% rename from FakeeDeck/Class/HttpServer.cs rename to FakeDeckUI/FakeDeck/Class/HttpServer.cs index 50844f4..99f4680 100644 --- a/FakeeDeck/Class/HttpServer.cs +++ b/FakeDeckUI/FakeDeck/Class/HttpServer.cs @@ -18,11 +18,19 @@ using System.Xml.Linq; using System.Reflection; using System.Text.Json; using System.Collections; +using System.Diagnostics; +using System.Text.RegularExpressions; namespace FakeeDeck.Class { internal class HttpServer { + public string port = "8000"; + public HttpServer(string port) + { + port = port; + } + private static IDictionary mimeTypes = new Dictionary(StringComparer.InvariantCultureIgnoreCase) { {".asf", "video/x-ms-asf"}, {".asx", "video/x-ms-asf"}, @@ -89,37 +97,21 @@ namespace FakeeDeck.Class {".xpi", "application/x-xpinstall"}, {".zip", "application/zip"}, }; + private Dictionary> routes = new Dictionary>(); public static HttpListener listener; - public static string url = "http://*:8000/"; public static int pageViews = 0; public static int requestCount = 0; - public static string pageHeader = - "" + - "" + - " " + - " HttpListener Example" + - " " + - " " + - " " + - " " + - " " + - "
" + - "
" + - "

Page Views: {0}

" + - "
"; - public static string pageFooter = - "
" + - " " + - "
" + - "
" + - " " + - " " + - ""; - public string pageData = ""; - private Dictionary> routes; + + public void addRoute(Delegate callback, string method = "GET", string route = "/") + { + if (!routes.ContainsKey(method)) + { + routes.Add(method, new Dictionary()); + } + + routes[method].Add(route, callback); + } public async Task HandleIncomingConnections() { bool runServer = true; @@ -135,66 +127,51 @@ namespace FakeeDeck.Class HttpListenerResponse resp = ctx.Response; // Print out some info about the request - Console.WriteLine("Request #: {0}", ++requestCount); - Console.WriteLine(req.Url.ToString()); - Console.WriteLine(req.HttpMethod); - Console.WriteLine(req.UserHostName); - Console.WriteLine(req.UserAgent); - Console.WriteLine(); + /*Debug.WriteLine("Request #: {0}", ++requestCount); + Debug.WriteLine(req.Url.ToString()); + Debug.WriteLine(req.HttpMethod); + Debug.WriteLine(req.UserHostName); + Debug.WriteLine(req.UserAgent);*/ - if (req.HttpMethod == "POST") + if (req.HttpMethod == "GET" && req.Url.AbsolutePath.Contains(".")) { - //Parse Port Parameters - Dictionary postParams = parsePostRequestParameters(req); - // If `shutdown` url requested w/ POST, then shutdown the server after serving the page - if (req.Url.AbsolutePath == "/shutdown") + await servFileResponseAsync(req, resp); + } + else + { + bool isMatch = false; + foreach (var route in routes[req.HttpMethod]) { - Console.WriteLine("Shutdown requested"); - runServer = false; + isMatch = Regex.IsMatch(req.Url.AbsolutePath, route.Key, RegexOptions.IgnoreCase); + if (isMatch) + { + Debug.WriteLine(route.Key); + Delegate gelegate = route.Value; + if (req.HttpMethod == "POST") + { + Dictionary postParams = parsePostRequestParameters(req); + gelegate.DynamicInvoke([req, resp, postParams]); + } + else + { + gelegate.DynamicInvoke([req, resp]); + } + } } - else if (req.Url.AbsolutePath.StartsWith("/button")) + + if (!isMatch) { - try - { - string module = req.Url.AbsolutePath.Replace("/button", ""); - Console.WriteLine("Call module " + module); - callButtonAction(module, postParams); - resp.StatusCode = (int)HttpStatusCode.OK; - } - catch (Exception ex) - { - byte[] errorData = Encoding.UTF8.GetBytes(ex.Message); - resp.ContentType = "text/html"; - resp.ContentEncoding = Encoding.UTF8; - resp.ContentLength64 = errorData.LongLength; - resp.StatusCode = (int)HttpStatusCode.InternalServerError; - await resp.OutputStream.WriteAsync(errorData, 0, errorData.Length); - } - finally - { - resp.Close(); - } - continue; + resp.StatusCode = (int)HttpStatusCode.NotFound; + await resp.OutputStream.FlushAsync(); } } - else if (req.HttpMethod == "GET") - { - if (req.Url.AbsolutePath.Contains(".")) - { - await servFileResponseAsync(req, resp); - } - else - { - await servViewResponseAsync(req, resp); - } - resp.Close(); - continue; - } + resp.Close(); } } public void serv() { + string url = "http://*:" + port + "/"; // Create a Http server and start listening for incoming connections listener = new HttpListener(); listener.Prefixes.Add(url); @@ -209,50 +186,13 @@ namespace FakeeDeck.Class listener.Close(); } - private static void callButtonAction(string module, Dictionary postParams) - { - string cleanClass = "FakeeDeck.ButtonType." + module.Trim('/'); - - Type? buttonClass = Type.GetType(cleanClass, true); - - if (buttonClass is null) - return; - - MethodInfo? method = buttonClass.GetMethod("invokeAction"); - - if (method is null) - return; - - ParameterInfo[] pars = method.GetParameters(); - List parameters = new List(); - - foreach (ParameterInfo p in pars) - { - if (p == null) - { - continue; - } - - if (p.Name != null && postParams.ContainsKey(p.Name)) - { - parameters.Insert(p.Position, postParams[p.Name]); - } - else if (p.IsOptional && p.DefaultValue != null) - { - parameters.Insert(p.Position, p.DefaultValue); - } - } - - _ = method.Invoke(null, [.. parameters]).ToString(); - } - private static async Task servFileResponseAsync(HttpListenerRequest req, HttpListenerResponse resp) { string filename = Path.Combine("./", req.Url.AbsolutePath.Substring(1)); if (!File.Exists(filename)) { resp.StatusCode = (int)HttpStatusCode.NotFound; - resp.Close(); + return; } try @@ -286,16 +226,6 @@ namespace FakeeDeck.Class } } - private async Task servViewResponseAsync(HttpListenerRequest req, HttpListenerResponse resp) - { - string disableSubmit = false ? "disabled" : ""; - byte[] data = Encoding.UTF8.GetBytes(string.Format(pageHeader + this.pageData + pageFooter, pageViews, disableSubmit)); - resp.ContentType = "text/html"; - resp.ContentEncoding = Encoding.UTF8; - resp.ContentLength64 = data.LongLength; - await resp.OutputStream.WriteAsync(data, 0, data.Length); - } - private static Dictionary parsePostRequestParameters(HttpListenerRequest req) { Dictionary postParams = new Dictionary(); diff --git a/FakeeDeck/Class/KeyboardCode.cs b/FakeDeckUI/FakeDeck/Class/KeyboardCode.cs similarity index 100% rename from FakeeDeck/Class/KeyboardCode.cs rename to FakeDeckUI/FakeDeck/Class/KeyboardCode.cs diff --git a/FakeeDeck/Class/YamlHelper.cs b/FakeDeckUI/FakeDeck/Class/YamlHelper.cs similarity index 93% rename from FakeeDeck/Class/YamlHelper.cs rename to FakeDeckUI/FakeDeck/Class/YamlHelper.cs index d38d842..dff4d38 100644 --- a/FakeeDeck/Class/YamlHelper.cs +++ b/FakeDeckUI/FakeDeck/Class/YamlHelper.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Text.Json; @@ -8,7 +9,7 @@ using YamlDotNet.Serialization; namespace FakeeDeck.Class { - internal class YamlHelper + public class YamlHelper { JsonDocument jsonObjecz; public YamlHelper() diff --git a/FakeeDeck/FakeeDeck.csproj b/FakeDeckUI/FakeDeck/FakeDeck.csproj similarity index 56% rename from FakeeDeck/FakeeDeck.csproj rename to FakeDeckUI/FakeDeck/FakeDeck.csproj index 9983fff..cdd83a5 100644 --- a/FakeeDeck/FakeeDeck.csproj +++ b/FakeDeckUI/FakeDeck/FakeDeck.csproj @@ -1,20 +1,17 @@  - Exe - net8.0 - enable + WinExe + net8.0-windows enable + enable + true - - - - - - - - - + + + + + PreserveNewest diff --git a/FakeDeckUI/FakeDeck/MainWindow.xaml b/FakeDeckUI/FakeDeck/MainWindow.xaml new file mode 100644 index 0000000..260e03c --- /dev/null +++ b/FakeDeckUI/FakeDeck/MainWindow.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/FakeDeckUI/FakeDeck/MainWindow.xaml.cs b/FakeDeckUI/FakeDeck/MainWindow.xaml.cs new file mode 100644 index 0000000..f38b24c --- /dev/null +++ b/FakeDeckUI/FakeDeck/MainWindow.xaml.cs @@ -0,0 +1,47 @@ +using FakeDeck.Class; +using FakeeDeck.Class; +using QRCoder; +using System.Reflection.Emit; +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using static QRCoder.QRCodeGenerator; +using static System.Runtime.CompilerServices.RuntimeHelpers; +using System.Drawing; +using Color = System.Drawing.Color; +using AutoUpdaterDotNET; + +namespace FakeDeck +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + private void FakeDeckUI_Activated(object sender, EventArgs e) + { + string port = ((App)Application.Current).yaml.getData().GetProperty("server").GetProperty("port").ToString(); + string url = "http://localhost:" + port; + + PayloadGenerator.Url qrCodePayload = new PayloadGenerator.Url(url); + QRCodeGenerator qrCodeGenerator = new QRCodeGenerator(); + QRCodeData qrCodeData = qrCodeGenerator.CreateQrCode(qrCodePayload.ToString(), 0); + QRCode qrCode = new QRCode(qrCodeData); + qr_code.Source = GeneralHelper.BitmapToImageSource(qrCode.GetGraphic(20, Color.Black, Color.White, false)); + + AutoUpdateHelper updater = new AutoUpdateHelper(); + } + } +} \ No newline at end of file diff --git a/FakeeDeck/StaticFiles/app.js b/FakeDeckUI/FakeDeck/StaticFiles/app.js similarity index 100% rename from FakeeDeck/StaticFiles/app.js rename to FakeDeckUI/FakeDeck/StaticFiles/app.js diff --git a/FakeeDeck/configuration.yaml b/FakeDeckUI/FakeDeck/configuration.yaml similarity index 76% rename from FakeeDeck/configuration.yaml rename to FakeDeckUI/FakeDeck/configuration.yaml index 9cd2bc1..04a79cd 100644 --- a/FakeeDeck/configuration.yaml +++ b/FakeDeckUI/FakeDeck/configuration.yaml @@ -57,4 +57,22 @@ pages: function: MediaMacro parameters: - name: Key - value: "mute" \ No newline at end of file + value: "mute" + + - button: mute + function: MediaMacro + parameters: + - name: Key + value: "previous" + + - button: mute + function: MediaMacro + parameters: + - name: Key + value: "play/pause" + + - button: mute + function: MediaMacro + parameters: + - name: Key + value: "next" \ No newline at end of file diff --git a/FakeeDeck.sln b/FakeeDeck.sln index 28dc9b3..5cd68ea 100644 --- a/FakeeDeck.sln +++ b/FakeeDeck.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.11.35219.272 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FakeeDeck", "FakeeDeck\FakeeDeck.csproj", "{D8C79B08-1920-426A-9138-CF0C8BAE0EF7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FakeDeck", "FakeDeckUI\FakeDeck\FakeDeck.csproj", "{D04AFC99-A929-4336-BD2C-1D49D149DB18}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D8C79B08-1920-426A-9138-CF0C8BAE0EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8C79B08-1920-426A-9138-CF0C8BAE0EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8C79B08-1920-426A-9138-CF0C8BAE0EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8C79B08-1920-426A-9138-CF0C8BAE0EF7}.Release|Any CPU.Build.0 = Release|Any CPU + {D04AFC99-A929-4336-BD2C-1D49D149DB18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D04AFC99-A929-4336-BD2C-1D49D149DB18}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D04AFC99-A929-4336-BD2C-1D49D149DB18}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D04AFC99-A929-4336-BD2C-1D49D149DB18}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/FakeeDeck/Class/FakeDeck.cs b/FakeeDeck/Class/FakeDeck.cs deleted file mode 100644 index e40fccc..0000000 --- a/FakeeDeck/Class/FakeDeck.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using YamlDotNet.Serialization.NamingConventions; -using YamlDotNet.Serialization; -using System.Diagnostics; -using System.IO; -using System.Text.Json; -using System.Reflection; -using FakeeDeck.ButtonType; -using YamlDotNet.Serialization; - -namespace FakeeDeck.Class -{ - internal class FakeDeck - { - public FakeDeck() - { - - YamlHelper yaml = new YamlHelper(); - HttpServer server = new HttpServer(); - - foreach (JsonElement item in yaml.getData().GetProperty("pages").EnumerateArray()) - { - Debug.WriteLine("PAGE: " + item.GetProperty("page")); - foreach (JsonElement button in item.GetProperty("buttons").EnumerateArray()) - { - server.pageData += AbstractionHelper.getButtonVisual(button); - } - } - - /*foreach (var stratogem in HelldiversTwoMacro.stratogems) - { - server.pageData += HelldiversTwoMacro.getButton(stratogem.Key); - } - - foreach (var control in MediaMacro.mediaControls) - { - server.pageData += MediaMacro.getButton(control.Key); - }*/ - - server.serv(); - } - - - } -} diff --git a/FakeeDeck/Program.cs b/FakeeDeck/Program.cs deleted file mode 100644 index 54648cc..0000000 --- a/FakeeDeck/Program.cs +++ /dev/null @@ -1,7 +0,0 @@ -using FakeeDeck; -using FakeeDeck.Class; -using System.Diagnostics; -using System.Text.Json; - - -FakeDeck fakeDeck = new FakeDeck(); \ No newline at end of file