68 lines
2.1 KiB
HTML
68 lines
2.1 KiB
HTML
<div class="grid">
|
|
<span class="a container card" id="aw-sp">
|
|
<span class="title">Singleplayer</span>
|
|
<span class="content img" style="background-image: url(./img/s1x-sp.png)"></span>
|
|
</span>
|
|
|
|
<span class="a container card" id="aw-mp">
|
|
<span class="title">Multiplayer</span>
|
|
<span class="content img" style="background-image: url(./img/s1x-mp.png)"></span>
|
|
</span>
|
|
|
|
<span class="a container card" id="aw-zm">
|
|
<span class="title">Zombies</span>
|
|
<span class="content img" style="background-image: url(./img/s1x-zm.png)"></span>
|
|
</span>
|
|
|
|
<span class="a container card" id="aw-survival">
|
|
<span class="title">Survival</span>
|
|
<span class="content img" style="background-image: url(./img/s1x-survival.png)"></span>
|
|
</span>
|
|
</div>
|
|
|
|
<style>
|
|
#content>.grid {
|
|
flex: 1 1 auto;
|
|
width: 100%;
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
grid-auto-rows: minmax(100px, auto);
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
(function () {
|
|
function launchAWVariant(id) {
|
|
executeCommand('launch-aw', id);
|
|
}
|
|
|
|
function showConfigureWarning() {
|
|
window.showMessageBox("⚙ S1x not configured",
|
|
"You have not configured your <b>Advanced Warfare installation</b> path.<br><br>Please do so in the settings!",
|
|
["Ok"]).then(index => {
|
|
window.showSettings();
|
|
});
|
|
}
|
|
|
|
function handleAW() {
|
|
const el = this;
|
|
const id = el.id;
|
|
|
|
executeCommand('get-property', 'aw-install').then(folder => {
|
|
console.log(folder);
|
|
if (!folder) {
|
|
showConfigureWarning();
|
|
}
|
|
else {
|
|
launchAWVariant(id);
|
|
}
|
|
});
|
|
}
|
|
|
|
const awNnodes = document.querySelectorAll("#content>.grid>.a");
|
|
for (var i = 0; i < awNnodes.length; ++i) {
|
|
const node = awNnodes[i];
|
|
node.onclick = handleAW;
|
|
}
|
|
})();
|
|
</script> |