Tweaks and Stream Lining

This commit is contained in:
2024-09-09 15:38:22 -07:00
parent 8051318d25
commit ff0decdbf6
5 changed files with 321 additions and 110 deletions

View File

@@ -8,31 +8,37 @@ namespace FakeeDeck.ButtonType
{
internal class Button
{
public static string getButtonHTML(string icon, string image, string name, string action, Dictionary<string, string> parameters)
public static string getButtonHTML(string icon, string image, string name, string action, Dictionary<string, string> parameters = null)
{
string body = "<div class=\"m-2\">";
string body = "";
body += "<div class=\"m-2\">";
body += "<form style=\"margin-bottom: 0px;\" method=\"post\" action=\"" + action + "\">";
foreach (var parameter in parameters)
if (parameters is not null)
{
body += "<input type=\"hidden\" name=\"" + parameter.Key + "\" value=\"" + parameter.Value + "\">";
foreach (var parameter in parameters)
{
body += "<input type=\"hidden\" name=\"" + parameter.Key + "\" value=\"" + parameter.Value + "\">";
}
}
body += "<button type=\"submit\" value=\"submit\" style=\"background-size: cover; " + (!string.IsNullOrEmpty(image) ? "background-image: url('" + image + "');" : "") + " width: 150px;height: 150px; background-color: aquamarine;\" >";
body += (!string.IsNullOrEmpty(icon) ? "<i class=\"fa-solid " + icon + "\"></i>" : name);
body += "</button>";
body += "</form>";
body += "</div>";
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");
return getButtonHTML(null, "https://docs.itego.cz/uploads/images/system/2022-04/OdRTPJ4iTTInmhdP-jagq7dfjpi2lilfg-imageedit-2-6604933313.gif", "Test", "test/test");
}
public static bool invokeAction(string Key)
{
return false;

View File

@@ -1,4 +1,5 @@
using System;
using FakeeDeck.Class;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -14,7 +15,7 @@ namespace FakeeDeck.ButtonType
public static Dictionary<string, uint[]> stratogems = new Dictionary<string, uint[]>
{
{ "reinforce", new uint[] { 0x65, 0x68, 0x62, 0x66, 0x64, 0x68}},
{ "reinforce", new uint[] { KeyboardCode.NUMPAD5, 0x68, 0x62, 0x66, 0x64, 0x68}},
{ "resupply", new uint[] { 0x65, 0x62, 0x62, 0x68, 0x66 }},
//Patriotic Administration Center
{ "anti-material", new uint[] { 0x65, 0x62, 0x64, 0x66, 0x68, 0x62}},

View File

@@ -7,7 +7,6 @@ using System.Threading.Tasks;
namespace FakeeDeck.ButtonType
{
internal class KeyboardMacro
{
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]