This commit is contained in:
JonatanRek 2024-09-06 16:56:06 +02:00
parent dac4fcebcb
commit e82472be0c
2 changed files with 29 additions and 18 deletions

View File

@ -46,5 +46,32 @@ namespace FakeeDeck.ButtonType
{ "rocket-pods","https://static.wikia.nocookie.net/helldivers_gamepedia/images/e/e3/Eagle_110MM_Rocket_Pods_Icon.png"}, { "rocket-pods","https://static.wikia.nocookie.net/helldivers_gamepedia/images/e/e3/Eagle_110MM_Rocket_Pods_Icon.png"},
{ "bomb","https://static.wikia.nocookie.net/helldivers_gamepedia/images/5/5a/Eagle_500KG_Bomb_Icon.png"}, { "bomb","https://static.wikia.nocookie.net/helldivers_gamepedia/images/5/5a/Eagle_500KG_Bomb_Icon.png"},
}; };
public static string getButton(string Key)
{
return
"<div class=\"m-2\">" +
" <form style=\"margin-bottom: 0px;\" method=\"post\" action=\"keyboard\\stratogem\">" +
" <input type=\"hidden\" name=\"stratogem\" value=\"" + Key + "\">" +
" <input style=\"background-image: url('" + stratogemsIcons[Key].ToString() + "'); width: 200px;height: 200px;background-color: aquamarine;\" type=\"submit\" value=\"" + FirstLetterToUpper(Key) + "\">" +
" </form>" +
"</div>";
}
public static bool invokeAction(string Key)
{
return false;
}
public static string FirstLetterToUpper(string str)
{
if (str == null)
return null;
if (str.Length > 1)
return char.ToUpper(str[0]) + str.Substring(1);
return str.ToUpper();
}
} }
} }

View File

@ -128,14 +128,7 @@ namespace FakeeDeck
{ {
foreach (var stratogem in HelldiversTwoMacro.stratogems) foreach (var stratogem in HelldiversTwoMacro.stratogems)
{ {
Console.WriteLine(HelldiversTwoMacro.stratogemsIcons[stratogem.Key]); pageData += HelldiversTwoMacro.getButton(stratogem.Key);
pageData +=
"<div class=\"m-2\">" +
" <form style=\"margin-bottom: 0px;\" method=\"post\" action=\"keyboard\\stratogem\">" +
" <input type=\"hidden\" name=\"stratogem\" value=\"" + stratogem.Key + "\">" +
" <input style=\"background-image: url('"+ HelldiversTwoMacro.stratogemsIcons[stratogem.Key].ToString() + "'); width: 200px;height: 200px;background-color: aquamarine;\" type=\"submit\" value=\"" + FirstLetterToUpper(stratogem.Key) + "\">" +
" </form>" +
"</div>";
} }
@ -153,15 +146,6 @@ namespace FakeeDeck
listener.Close(); listener.Close();
} }
public static string FirstLetterToUpper(string str)
{
if (str == null)
return null;
if (str.Length > 1)
return char.ToUpper(str[0]) + str.Substring(1);
return str.ToUpper();
}
} }
} }