// Download latest version fetch("https://api.github.com/repos/ActualMandM/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", "mc": "Minecraft", "slw": "Sonic Lost World", "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", // easter eggs "breath of the dicknut": "The Legend of Zelda: Breath of the Wild", "f-zero": "FAST Racing NEO", "m&m": "Sonic", "mimi": "Sonic", "best game": "Meme Run" }; 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((window.location.origin+window.location.pathname)+"/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 let resultsHintSearch = []; if (Object.keys(altNames).includes(searchString.toLowerCase())) searchString = altNames[searchString.toLowerCase()]; if (searchString.toLowerCase() == "digital foundry") { document.title = "Home - CEMU Hacks"; document.getElementsByClassName("display-4")[0].innerText="CEMU Hacks"; document.getElementsByClassName("lead")[0].innerText = "Get your online CEMU hax here!!"; } if (searchString != "*") resultsHintSearch = supportedGamesSearchSet.get(searchString); else { for (supportedGame in supportedGames) { resultsHintSearch.push([0, supportedGame]); } } 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