From ec5834d771432dba37ed91b4079501dd4e5dd146 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 13 Jun 2019 22:24:05 -0700 Subject: [PATCH] Derive JSX from the skin file --- experiments/modern/src/App.js | 227 +++++++++------------------------- 1 file changed, 58 insertions(+), 169 deletions(-) diff --git a/experiments/modern/src/App.js b/experiments/modern/src/App.js index 5c57440d..c81c3217 100644 --- a/experiments/modern/src/App.js +++ b/experiments/modern/src/App.js @@ -1,9 +1,26 @@ import React from "react"; import JSZip from "jszip"; import "./App.css"; -import { xml2js } from "xml-js"; import * as Utils from "./utils"; +const IGNORE_IDS = new Set([ + // The maki script shows/hides these depending on which corner you are in + "main2", + "main3", + "main4", + "Title2", + "Title3", + "Title4", + "mask2", + "mask3", + "mask4", + // These need the maki script to get sized + "volumethumb", + "seekfull", + "seek1", + "Repeat", +]); + const SkinContext = React.createContext(null); async function getSkin() { @@ -37,7 +54,11 @@ async function getSkin() { } } } - return images; + + const player = await Utils.readXml(zip, "xml/player-normal.xml"); + // Gross hack returing a tuple here. We're just doing some crazy stuff to get + // some data returned in the laziest way possible + return [player, images]; } function Layout({ @@ -127,6 +148,38 @@ function ToggleButton(props) { return