From 8051318d25cafb2165ee43378eabfdd2e11cafa2 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Mon, 9 Sep 2024 13:56:27 -0700 Subject: [PATCH] Refactoring --- FakeeDeck/ButtonType/Button.cs | 30 ++++++++++++++++------ FakeeDeck/ButtonType/HelldiversTwoMacro.cs | 8 +----- FakeeDeck/ButtonType/MediaMacro.cs | 12 ++------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/FakeeDeck/ButtonType/Button.cs b/FakeeDeck/ButtonType/Button.cs index a7b1782..15ca58c 100644 --- a/FakeeDeck/ButtonType/Button.cs +++ b/FakeeDeck/ButtonType/Button.cs @@ -8,17 +8,31 @@ namespace FakeeDeck.ButtonType { internal class Button { - public static string getButton(string Key) + public static string getButtonHTML(string icon, string image, string name, string action, Dictionary parameters) { - return - "
" + - "
" + - " " + - " " + - "
" + - "
"; + string body = "
"; + body += "
"; + + foreach (var parameter in parameters) + { + body += ""; + } + + body += ""; + body += "
"; + body += "
"; + return body; } + public static string getButton(string Key) + { + return ""; //getButtonHTML(null, "https://docs.itego.cz/uploads/images/system/2022-04/OdRTPJ4iTTInmhdP-jagq7dfjpi2lilfg-imageedit-2-6604933313.gif"); + + + } public static bool invokeAction(string Key) { return false; diff --git a/FakeeDeck/ButtonType/HelldiversTwoMacro.cs b/FakeeDeck/ButtonType/HelldiversTwoMacro.cs index 09e63ec..5442c67 100644 --- a/FakeeDeck/ButtonType/HelldiversTwoMacro.cs +++ b/FakeeDeck/ButtonType/HelldiversTwoMacro.cs @@ -49,13 +49,7 @@ namespace FakeeDeck.ButtonType public static string getButton(string Key) { - return - "
" + - "
" + - " " + - " " + - "
" + - "
"; + return getButtonHTML(null, stratogemsIcons[Key].ToString(), Key, "button\\HelldiversTwoMacro", new Dictionary() { { "stratogem", Key } }); } public static bool invokeAction(string stratogem) diff --git a/FakeeDeck/ButtonType/MediaMacro.cs b/FakeeDeck/ButtonType/MediaMacro.cs index 171a01c..2c35a6b 100644 --- a/FakeeDeck/ButtonType/MediaMacro.cs +++ b/FakeeDeck/ButtonType/MediaMacro.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace FakeeDeck.ButtonType { - internal class MediaMacro + internal class MediaMacro : Button { public static Dictionary mediaControls = new Dictionary { @@ -22,15 +22,7 @@ namespace FakeeDeck.ButtonType public static string getButton(string Key) { - return - "
" + - "
" + - " " + - " " + - "
" + - "
"; + return getButtonHTML(mediaIcons[Key], null, Key, "button\\MediaMacro", new Dictionary() { { "control_action", Key } }); } public static bool invokeAction(string control_action)