From 31c56b69948cf7e6f640d4b574d0d2517518d227 Mon Sep 17 00:00:00 2001 From: Tee Date: Wed, 22 Nov 2023 09:18:37 +0100 Subject: [PATCH] icons --- assets/templates/manifest.template.xml.js | 1 + src/client-src/components/AlertModal.jsx | 11 ++++++ src/client-src/page/Icons.jsx | 47 +++++++++++++++++++++++ src/client-src/page/Preview.jsx | 2 +- src/rpc_client-src/index.js | 31 ++++++++------- 5 files changed, 75 insertions(+), 17 deletions(-) create mode 100644 src/client-src/components/AlertModal.jsx create mode 100644 src/client-src/page/Icons.jsx diff --git a/assets/templates/manifest.template.xml.js b/assets/templates/manifest.template.xml.js index 156f05b..a87912a 100644 --- a/assets/templates/manifest.template.xml.js +++ b/assets/templates/manifest.template.xml.js @@ -90,6 +90,7 @@ module.exports = (props) => + diff --git a/src/client-src/components/AlertModal.jsx b/src/client-src/components/AlertModal.jsx new file mode 100644 index 0000000..c27b248 --- /dev/null +++ b/src/client-src/components/AlertModal.jsx @@ -0,0 +1,11 @@ +import React, {useState, useEffect} from 'react'; +import defaultAvatar from "../../assets/default.png"; +import { dispatchEvent } from '..'; +export default function AlertModal({className}) { + + return ( +
+
+
+ ) +} \ No newline at end of file diff --git a/src/client-src/page/Icons.jsx b/src/client-src/page/Icons.jsx new file mode 100644 index 0000000..51abfc2 --- /dev/null +++ b/src/client-src/page/Icons.jsx @@ -0,0 +1,47 @@ +import AEFT from "../../assets/AEFT.png"; +import AEFT1 from "../../assets/AEFT1.png"; +import AICY from "../../assets/AICY.png"; +import AICY1 from "../../assets/AICY1.png"; +import AUDT from "../../assets/AUDT.png"; +import AUDT1 from "../../assets/AUDT1.png"; +import DRWV from "../../assets/DRWV.png"; +import DRWV1 from "../../assets/DRWV1.png"; +import FLPR from "../../assets/FLPR.png"; +import FLPR1 from "../../assets/FLPR1.png"; +import MEDIA_ENCODER from "../../assets/MEDIA_ENCODER.png"; +import MEDIA_ENCODER1 from "../../assets/MEDIA_ENCODER1.png"; +import PHXS from "../../assets/PHXS.png"; +import PHXS1 from "../../assets/PHXS1.png"; +import PPRO from "../../assets/PPRO.png"; +import PPRO1 from "../../assets/PPRO1.png"; +import PRLD from "../../assets/PRLD.png"; + +export { + AEFT, + AEFT1, + AICY, + AICY1, + AUDT, + AUDT1, + DRWV, + DRWV1, + FLPR, + FLPR1, + MEDIA_ENCODER, + MEDIA_ENCODER1, + PHXS, + PHXS1, + PPRO, + PPRO1, + PRLD, +}; + +export function setCustom({url}){ + +} + +export function getIcon({ appId, className }) { + // + + return ; +} diff --git a/src/client-src/page/Preview.jsx b/src/client-src/page/Preview.jsx index fb03ed6..1bcd5c9 100644 --- a/src/client-src/page/Preview.jsx +++ b/src/client-src/page/Preview.jsx @@ -53,7 +53,7 @@ export default function Preview() {

PLAYING A GAME

- +
{activity.name != "" &&

{activity.name}

} {activity.details != "" &&

{activity.details}

} diff --git a/src/rpc_client-src/index.js b/src/rpc_client-src/index.js index 6418ff8..12ac8fe 100644 --- a/src/rpc_client-src/index.js +++ b/src/rpc_client-src/index.js @@ -40,20 +40,6 @@ const props = { partyMax: 0, } -csInterface.addEventListener('com.tee.rpc.reset', () => { - console.log("reset") - resetConfiguration() -}) - -csInterface.addEventListener('com.tee.rpc.config', (e) => { - console.log(e.data) - if (e.data.property) { - setConfiguration(e.data.property, e.data.config) - configurations = getConfigurations() - } -}) - - let presence = {} let configurations = getConfigurations() let status = true; @@ -72,6 +58,19 @@ if (csInterface.getApplicationID() === "AEFT") { throw new Error("Started as dynamic link"); } +csInterface.addEventListener('com.tee.rpc.reset', () => { + console.log("reset") + resetConfiguration() +}) + +csInterface.addEventListener('com.tee.rpc.config', (e) => { + console.log(e.data) + if (e.data.property) { + setConfiguration(e.data.property, e.data.config) + configurations = getConfigurations() + } +}) + if (!configurations.rpc) { setConfiguration("rpc", rpcConfigurationTemplate); configurations.rpc = getConfiguration("rpc"); @@ -141,7 +140,7 @@ function main() { } setTimeout(main, interval); - function callScript(func, variable) { + function callScript(func) { if (configurations["rpc"][func.replace('()', '')]["enabled"]) { csInterface.evalScript(func, (e) => { props[func.replace('()', '')] = e @@ -149,7 +148,7 @@ function main() { } } - function callScriptNumber(func, variable) { + function callScriptNumber(func) { if (configurations["rpc"][func.replace('()', '')]["enabled"]) { csInterface.evalScript(func, (e) => { props[func.replace('()', '')] = parseInt(e)