// Download latest version fetch("https://api.github.com/repos/slashiee/cemu_graphic_packs/releases/latest").then(fetchRes => fetchRes.json()).then(fetchJson => { console.debug("Fetched releases from github..."); document.getElementById("primary_download").href = fetchJson.assets[0].browser_download_url; return; }).catch(fetchErr => { console.error("Seems like something isn't working...", fetchErr); }); // Search Supported Games var supportedGames = undefined; var supportedGamesSearchSet = undefined; var supportedGamesSearchSetHalfTitles = {}; const altNames = { "botw": "The Legend of Zelda: Breath of the Wild", "hw": "Hyrule Warriors", "smm": "Super Mario Maker", "mk8": "Mario Kart 8", "tphd": "The Legend of Zelda: Twilight Princess HD", "wwhd": "The Legend of Zelda: The Wind Waker HD", "breath of the dicknut": "The Legend of Zelda: Breath of the Wild" }; async function searchSupportedGames(searchString) { document.getElementById("supported-games-search").classList.add("loading"); document.getElementById("supported-games-search-results").innerHTML = ""; if (!supportedGames) { supportedGames = true; await fetch("/supported_titles.json", {cache: "no-store"}).then(fetchRes => fetchRes.json()).then(fetchJson => { console.debug("Fetched supported titles from '/supported_titles.json'."); supportedGames = fetchJson; supportedGamesSearchSet = FuzzySet([], false, 2, 3); for (supportedGame in supportedGames) { supportedGamesSearchSet.add(supportedGame); } return; }).catch(fetchErr => { console.error("Seems like something bad happened!", fetchErr); }); } if (supportedGames === true) return; // Fix race errors with input if (Object.keys(altNames).includes(searchString.toLowerCase())) searchString = altNames[searchString.toLowerCase()]; resultsHintSearch = supportedGamesSearchSet.get(searchString); if (resultsHintSearch != undefined && resultsHintSearch != null) { for (let i=0; i fetchRes.json()).then(fetchJson => { console.debug(`Fetched ${clickedGame}'s(=${supportedGames[clickedGame].compatLink.split("http://compat.cemu.info/wiki/")[1]}) compat wiki`, fetchJson); let compatTemplates = new DOMParser().parseFromString(fetchJson.parse.parsetree["*"], "application/xml").documentElement.getElementsByTagName("template"); let compatJson = []; for (let i=0; i