Compare commits
14 Commits
7699f5c6b9
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
83f2e08bb5 | ||
|
4c07938a0d | ||
|
df80ce37ed | ||
|
50c6c9a1de | ||
|
0b3822b8da | ||
a63133a7a5 | |||
600a08dd51 | |||
|
9d33f9a223 | ||
|
ed334a7cf9 | ||
7fb6b4c89c | |||
|
1666be73b3 | ||
6ab18fdf70 | |||
|
987ccad5b9 | ||
|
027ec1f0d9 |
@@ -33,9 +33,11 @@ namespace FakeDeck.ButtonType
|
||||
|
||||
//Offensive: Orbital Strikes
|
||||
{ "orbital-precision-strike", new uint[] { 0x65, Key_Right, Key_Right, Key_Up}},
|
||||
{ "orbital-380-barrage", new uint[] { 0x65, Key_Right, Key_Down, Key_Up, Key_Up, Key_Left, Key_Down, Key_Down}},
|
||||
|
||||
|
||||
//Defensive
|
||||
{ "mortar-sentry", new uint[] { 0x65, Key_Down, Key_Up, Key_Right, Key_Down}},
|
||||
{ "mortar-sentry", new uint[] { 0x65, Key_Down, Key_Up, Key_Right, Key_Right, Key_Down }},
|
||||
{ "gatling-sentry", new uint[] { 0x65, Key_Down, Key_Up, Key_Right, Key_Left}},
|
||||
|
||||
|
||||
@@ -61,6 +63,7 @@ namespace FakeDeck.ButtonType
|
||||
{ "autocannon", "https://static.wikia.nocookie.net/helldivers_gamepedia/images/c/c6/AC-8_Autocannon_Icon.png"},
|
||||
{ "grenade-launcher","https://static.wikia.nocookie.net/helldivers_gamepedia/images/6/66/GL-21_Grenade_Launcher_Icon.png"},
|
||||
{ "orbital-precision-strike", "https://static.wikia.nocookie.net/helldivers_gamepedia/images/4/47/Orbital_Precision_Strike_Icon.png"},
|
||||
{ "orbital-380-barrage", "https://static.wikia.nocookie.net/helldivers_gamepedia/images/f/f4/Orbital_380MM_HE_Barrage_Icon.png"},
|
||||
{ "mortar-sentry", "https://static.wikia.nocookie.net/helldivers_gamepedia/images/1/1d/A_M-12_Mortar_Sentry_Icon.png"},
|
||||
{ "gatling-sentry","https://static.wikia.nocookie.net/helldivers_gamepedia/images/4/48/A_G-16_Gatling_Sentry_Icon.png"},
|
||||
|
||||
|
54
FakeDeckUI/FakeDeck/ButtonType/ProcessMacro.cs
Normal file
54
FakeDeckUI/FakeDeck/ButtonType/ProcessMacro.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using static System.Text.Json.JsonElement;
|
||||
|
||||
namespace FakeDeck.ButtonType
|
||||
{
|
||||
class ProcessMacro : Button
|
||||
{
|
||||
public static string getButton(string process, string arguments = "", string? icon = null, string? image = null)
|
||||
{
|
||||
Dictionary<string, string> parameters = new Dictionary<string, string>() { { "process", process } };
|
||||
if (!string.IsNullOrEmpty(arguments))
|
||||
{
|
||||
parameters.Add("arguments", arguments);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(icon) || !string.IsNullOrEmpty(image))
|
||||
{
|
||||
process = null;
|
||||
}
|
||||
|
||||
return getButtonHTML(icon, image, process, "button\\ProcessMacro", null, parameters);
|
||||
}
|
||||
|
||||
public static bool invokeAction(string process, string arguments = "")
|
||||
{
|
||||
if (!File.ReadAllText("./configuration.yaml").Contains(process))
|
||||
{
|
||||
Debug.WriteLine("not known process");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!File.ReadAllText("./configuration.yaml").Contains(arguments))
|
||||
{
|
||||
Debug.WriteLine("not known arguments");
|
||||
return false;
|
||||
}
|
||||
|
||||
Process notePad = new Process();
|
||||
notePad.StartInfo.FileName = process;
|
||||
notePad.StartInfo.Arguments = arguments;
|
||||
notePad.Start();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@@ -20,7 +20,8 @@ namespace FakeDeck.Class
|
||||
AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
|
||||
AutoUpdater.Synchronous = true;
|
||||
AutoUpdater.ShowRemindLaterButton = false;
|
||||
AutoUpdater.ReportErrors = Debugger.IsAttached;
|
||||
AutoUpdater.ClearAppDirectory = false;
|
||||
//AutoUpdater.ReportErrors = Debugger.IsAttached;
|
||||
AutoUpdater.HttpUserAgent = ("FakeDeck-v" + Assembly.GetExecutingAssembly().GetName().Version);
|
||||
AutoUpdater.Start("https://api.github.com/repos/GamerClassN7/FakeDeck/releases/latest");
|
||||
}
|
||||
|
@@ -14,19 +14,20 @@ namespace FakeDeck.Class
|
||||
{
|
||||
private static string cachePath = "./cache/";
|
||||
public static string pageHeader =
|
||||
"<!DOCTYPE>" +
|
||||
"<html lang=\"en\">" +
|
||||
" <head>" +
|
||||
" <title>HttpListener Example</title>" +
|
||||
" <meta charset=\"utf-8\">" +
|
||||
" <meta name = \"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=yes\">" +
|
||||
" <link href=\"https://yarnpkg.com/en/package/normalize.css\" rel=\"stylesheet\">" +
|
||||
" <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css\" rel=\"stylesheet\">" +
|
||||
" <link href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css\" rel=\"stylesheet\">" +
|
||||
" <link href=\"StaticFiles/style.css\" rel=\"stylesheet\">" +
|
||||
" </head>" +
|
||||
" <body>" +
|
||||
" <div id=\"main\" class=\"d-flex flex-wrap\" style=\"transform-origin: left top;\">";
|
||||
"<!DOCTYPE>" +
|
||||
"<html lang=\"en\">" +
|
||||
" <head>" +
|
||||
" <title>HttpListener Example</title>" +
|
||||
" <meta charset=\"utf-8\">" +
|
||||
" <meta name = \"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=yes\">" +
|
||||
" <link href=\"https://yarnpkg.com/en/package/normalize.css\" rel=\"stylesheet\">" +
|
||||
" <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css\" rel=\"stylesheet\">" +
|
||||
" <link href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css\" rel=\"stylesheet\">" +
|
||||
" <link href=\"StaticFiles/style.css\" rel=\"stylesheet\">" +
|
||||
" <link rel=\"manifest\" href=\"StaticFiles/manifest.json\" />" +
|
||||
" </head>" +
|
||||
" <body>" +
|
||||
" <div id=\"main\" class=\"d-flex flex-wrap\" style=\"transform-origin: left top;\">";
|
||||
public static string pageFooter =
|
||||
" </div>" +
|
||||
" <script src=\"StaticFiles/app.js\"></script>" +
|
||||
@@ -161,7 +162,13 @@ namespace FakeDeck.Class
|
||||
string pageContent = "";
|
||||
foreach (JsonElement button in selectedPage.GetProperty("buttons").EnumerateArray())
|
||||
{
|
||||
pageContent += AbstractionHelper.getButtonVisual(button);
|
||||
try
|
||||
{
|
||||
pageContent += AbstractionHelper.getButtonVisual(button);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (Directory.Exists(cachePath))
|
||||
|
@@ -56,6 +56,7 @@ namespace FakeDeck.Class
|
||||
{".img", "application/octet-stream"},
|
||||
{".iso", "application/octet-stream"},
|
||||
{".jar", "application/java-archive"},
|
||||
{".json", "application/json"},
|
||||
{".jardiff", "application/x-java-archive-diff"},
|
||||
{".jng", "image/x-jng"},
|
||||
{".jnlp", "application/x-java-jnlp-file"},
|
||||
|
@@ -19,6 +19,9 @@
|
||||
<None Update="StaticFiles\app.js">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="StaticFiles\manifest.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="StaticFiles\style.css">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@@ -5,13 +5,16 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FakeDeck"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow"Activated="FakeDeckUI_Activated" WindowStartupLocation="CenterScreen">
|
||||
Title="MainWindow"
|
||||
Activated="FakeDeckUI_Activated"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Width="280" Height="340">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="270"/>
|
||||
<RowDefinition Height="50*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Image x:Name="qr_code" Margin="10,10,10,10"/>
|
||||
<TextBox Margin="10,10,10,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Grid.Row="1"/>
|
||||
<Image x:Name="qr_code" Margin="10,10,10,0"/>
|
||||
<TextBox Margin="10,10,10,10" TextWrapping="Wrap" Text="TextBox" Grid.Row="1" Height="20" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@@ -17,6 +17,7 @@ using static System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
using System.Drawing;
|
||||
using Color = System.Drawing.Color;
|
||||
using AutoUpdaterDotNET;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace FakeDeck
|
||||
{
|
||||
@@ -32,6 +33,7 @@ namespace FakeDeck
|
||||
|
||||
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;
|
||||
|
||||
@@ -41,7 +43,14 @@ namespace FakeDeck
|
||||
QRCode qrCode = new QRCode(qrCodeData);
|
||||
qr_code.Source = GeneralHelper.BitmapToImageSource(qrCode.GetGraphic(20, Color.Black, Color.White, false));
|
||||
|
||||
AutoUpdateHelper updater = new AutoUpdateHelper();
|
||||
try
|
||||
{
|
||||
AutoUpdateHelper updater = new AutoUpdateHelper();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -13,8 +13,12 @@ function urlencodeFormData(fd){
|
||||
function resizeGrid(){
|
||||
var width = document.body.clientWidth;
|
||||
var height = document.body.clientHeight;
|
||||
var biggerSizeW = (width / 5);
|
||||
var biggerSizeH = (height / 3);
|
||||
width = window.screen.availWidth;
|
||||
height = window.screen.availHeight;
|
||||
|
||||
|
||||
var biggerSizeW = (width / 7);
|
||||
var biggerSizeH = (height / 5);
|
||||
|
||||
var biggerSize = biggerSizeW;
|
||||
if(biggerSizeW < biggerSizeH){
|
||||
@@ -64,6 +68,8 @@ function formToAjax(){
|
||||
const target = event.currentTarget;
|
||||
target.style.opacity = "0.5"
|
||||
|
||||
navigator.vibrate(200);
|
||||
|
||||
console.log(target.method, target.action);
|
||||
console.log(form.method, form.action);
|
||||
console.log(form === target);
|
||||
|
10
FakeDeckUI/FakeDeck/StaticFiles/manifest.json
Normal file
10
FakeDeckUI/FakeDeck/StaticFiles/manifest.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "FakeDeck",
|
||||
"short_name": "FakeDeck",
|
||||
"theme_color": "#fff",
|
||||
"background_color": "#fff",
|
||||
"display": "fullscreen",
|
||||
"orientation": "landscape",
|
||||
"scope": "/",
|
||||
"start_url": "/"
|
||||
}
|
@@ -11,6 +11,50 @@ pages:
|
||||
- name: Key
|
||||
value: "reinforce"
|
||||
|
||||
- button: flamethrower
|
||||
function: HelldiversTwoMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "flamethrower"
|
||||
|
||||
- button: anti-material
|
||||
function: HelldiversTwoMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "anti-material"
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
|
||||
- button: strafing-run
|
||||
function: HelldiversTwoMacro
|
||||
parameters:
|
||||
@@ -52,20 +96,23 @@ pages:
|
||||
parameters:
|
||||
- name: Key
|
||||
value: bomb
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: orange
|
||||
- button: spacer
|
||||
|
||||
- button: full-screen
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "full-screen"
|
||||
- name: Color
|
||||
value: orange
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: orange
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
@@ -73,6 +120,7 @@ pages:
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
@@ -80,6 +128,7 @@ pages:
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
parameters:
|
||||
@@ -87,13 +136,12 @@ pages:
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
- button: spacer
|
||||
function: FakeDeckMacro
|
||||
|
||||
- button: orbital-380-barrage
|
||||
function: HelldiversTwoMacro
|
||||
parameters:
|
||||
- name: Key
|
||||
value: "spacer"
|
||||
- name: Color
|
||||
value: red
|
||||
value: orbital-380-barrage
|
||||
|
||||
- button: page
|
||||
function: FakeDeckMacro
|
||||
@@ -108,6 +156,24 @@ pages:
|
||||
|
||||
- page: media
|
||||
buttons:
|
||||
- button: notepad
|
||||
function: ProcessMacro
|
||||
parameters:
|
||||
- name: process
|
||||
value: "notepad.exe"
|
||||
- name: image
|
||||
value: "https://www.club386.com/wp-content/uploads/2021/12/notepad-icon-696x632.jpg"
|
||||
|
||||
- button: cmd
|
||||
function: ProcessMacro
|
||||
parameters:
|
||||
- name: process
|
||||
value: "cmd.exe"
|
||||
- name: arguments
|
||||
value: "/C ping google.com -t"
|
||||
- name: image
|
||||
value: "https://winaero.com/blog/wp-content/uploads/2019/06/WIndows-Terminal-icon.png"
|
||||
|
||||
- button: mute
|
||||
function: MediaMacro
|
||||
parameters:
|
||||
|
10
README.md
10
README.md
@@ -124,6 +124,16 @@ Just add desired macros to `configuration.yaml` and start the application, tahn
|
||||
- name: Key
|
||||
value: spacer
|
||||
```
|
||||
### Process Macro
|
||||
```yaml
|
||||
- button: cmd
|
||||
function: ProcessMacro
|
||||
parameters:
|
||||
- name: process
|
||||
value: "cmd.exe"
|
||||
- name: arguments #Optional Proces Arguments
|
||||
value: "/C ipconfig"
|
||||
```
|
||||
### Comon Macro Parameters
|
||||
```yaml
|
||||
...
|
||||
|
Reference in New Issue
Block a user