diff --git a/src/graphics/TeamGameIOU.tsx b/src/graphics/TeamGameIOU.tsx index 1505e23..a8c98de 100644 --- a/src/graphics/TeamGameIOU.tsx +++ b/src/graphics/TeamGameIOU.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { useReplicant } from 'use-nodecg'; //@ts-ignore import StreamOverlay from './2v2IOU.png' @@ -21,26 +21,42 @@ export function TeamGameIOU() { const [showSpoilerOverlay, set_showSpoilerOverlay] = useReplicant('showSpoilerOverlay', true); const [betweenText, set_betweenText] = useReplicant('betweenText', '') + const [flipScore, set_flipScore] = useReplicant('flipScore', false); + // const [leftName, set_leftName] = useReplicant('leftName', '', { namespace: 'aoe-4-civ-draft' }); const [rightName, set_rightName] = useReplicant('rightName', '', { namespace: 'aoe-4-civ-draft' }); + const [extraInfo1, set_extraInfo1] = useReplicant('extraInfo1', '') + const [extraInfo2, set_extraInfo2] = useReplicant('extraInfo2', '') + //Used if you have the Aoe-4-team-games bundle const [leftSideIcon, set_leftSideIcon] = useReplicant('leftSideIcon', { value: '', label: '' }, { namespace: 'aoe-4-team-games' }); const [rightSideIcon, set_rightSideIcon] = useReplicant('rightSideIcon', { value: '', label: '' }, { namespace: 'aoe-4-team-games' }); const [showIcons, set_showIcons] = useReplicant('showIcons', true, { namespace: 'aoe-4-team-games' }); + const [theme, set_theme] = useReplicant<{ value: string; label: string; }>('theme', { value: '../../../assets/nodecg-themer/themes/default.css', label: 'default' }, { namespace: 'nodecg-themer' }); + + const [themeDiv, set_themeDiv] = useState(<>) + + useEffect(() => { + console.log(theme) + if (!theme) return; + console.log(theme) + set_themeDiv() + }, [theme]) return ( <> - -

{leftName}

-

{rightName}

+

{leftName}

+

{rightName}

{showScore ?
- - + +
-

{betweenText}

+

{betweenText}

: <> } {showIcons ?
- + - +
: <> } + +

{extraInfo1}

+

{extraInfo2}

); } diff --git a/src/graphics/TeamGameNoUI.html b/src/graphics/TeamGameNoUI.html index 243cdd9..8e90a27 100644 --- a/src/graphics/TeamGameNoUI.html +++ b/src/graphics/TeamGameNoUI.html @@ -4,118 +4,7 @@ diff --git a/src/graphics/TeamGameNoUI.tsx b/src/graphics/TeamGameNoUI.tsx index b556413..1616c4c 100644 --- a/src/graphics/TeamGameNoUI.tsx +++ b/src/graphics/TeamGameNoUI.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { useReplicant } from 'use-nodecg'; //@ts-ignore import StreamOverlay from './2v2NO_IOU.png' @@ -30,32 +30,45 @@ export function TeamGameNoUI() { const [rightSideIcon, set_rightSideIcon] = useReplicant('rightSideIcon', { value: '', label: '' }, { namespace: 'aoe-4-team-games' }); const [showIcons, set_showIcons] = useReplicant('showIcons', true, { namespace: 'aoe-4-team-games' }); + const [flipScore, set_flipScore] = useReplicant('flipScore', false); + + const [theme, set_theme] = useReplicant<{ value: string; label: string; }>('theme', { value: '../../../assets/nodecg-themer/themes/default.css', label: 'default' }, { namespace: 'nodecg-themer' }); + + const [themeDiv, set_themeDiv] = useState(<>) + + useEffect(() => { + console.log(theme) + if (!theme) return; + console.log(theme) + set_themeDiv() + }, [theme]) return ( <> - -

{leftName}

-

{rightName}

+

{leftName}

+

{rightName}

{showScore ?
- - + +
-

{betweenText}

+

{betweenText}

: <> } {showIcons ?
- + - +
: <> }