Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
Added support for base64 icons in the button object
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed Mar 11, 2022
1 parent 06a2e9b commit 64900e0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
15 changes: 11 additions & 4 deletions Macro Deck Client.Android/Assets/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,14 @@ function connect(url) {

this.buttons = obj.Buttons;
for (var i = 0; i < this.buttons.length; i++) {
if (!this.buttons[i]) {
continue;
}
var button = document.getElementById(this.buttons[i].Position_Y + "_" + this.buttons[i].Position_X);
var label = document.getElementById("label_" + this.buttons[i].Position_Y + "_" + this.buttons[i].Position_X);

if (button) {
if (this.buttons[i] && this.buttons[i].Icon) {
if (this.buttons[i].Icon) {
var iconPack;
var icon;

Expand Down Expand Up @@ -157,10 +161,11 @@ function connect(url) {
}

button.style.backgroundImage = 'url(data:image/gif;base64,' + icon.IconBase64 + ')';
}
} else if (this.buttons[i].IconBase64) {
button.style.backgroundImage = 'url(data:image/gif;base64,' + this.buttons[i].IconBase64 + ')';
}
}

var label = document.getElementById("label_" + this.buttons[i].Position_Y + "_" + this.buttons[i].Position_X);
if (label) {
if (this.buttons[i].Label && this.buttons[i].Label.LabelBase64) {
label.style.backgroundImage = 'url(data:image/gif;base64,' + this.buttons[i].Label.LabelBase64 + ')';
Expand Down Expand Up @@ -205,7 +210,9 @@ function connect(url) {


button.style.backgroundImage = 'url(data:image/gif;base64,' + icon.IconBase64 + ')';
} else {
} else if (obj.Buttons[0].IconBase64) {
button.style.backgroundImage = 'url(data:image/gif;base64,' + obj.Buttons[0].IconBase64 + ')';
} else {
button.style.backgroundImage = '';
}
}
Expand Down
5 changes: 0 additions & 5 deletions Macro Deck Client.Android/Assets/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
html {
}

body {
padding: 10px;
}
Expand All @@ -18,8 +15,6 @@ p, h1, h2, h3, h4, h5, h6, label {
transition: all .3s linear;
}



.button-row {
display: -ms-flexbox;
display: flex;
Expand Down
1 change: 1 addition & 0 deletions Macro Deck Client.Android/Macro Deck Client.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<AndroidSigningStorePass>Emily0704</AndroidSigningStorePass>
<AndroidSigningKeyAlias>SuchByte</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>Emily0704</AndroidSigningKeyPass>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion Macro Deck Client.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="220" android:versionName="2.2.0-beta" package="com.suchbyte.macrodeck" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="230" android:versionName="2.3.0-beta" package="com.suchbyte.macrodeck" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<application android:label="Macro Deck" android:theme="@style/MainTheme" android:usesCleartextTraffic="true" android:icon="@mipmap/launcher_foreground"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
2 changes: 1 addition & 1 deletion Macro Deck Client/Macro Deck Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<Version>2.2.0-beta</Version>
<Version>2.3.0-beta</Version>
<Authors>Manuel Mayer</Authors>
<ApplicationIcon>Macro Deck 2021.ico</ApplicationIcon>
<RootNamespace>SuchByte.MacroDeck</RootNamespace>
Expand Down

0 comments on commit 64900e0

Please sign in to comment.