diff --git a/WebHostLib/static/assets/weightedSettings.js b/WebHostLib/static/assets/weightedSettings.js index 8dced389..7f6afcd2 100644 --- a/WebHostLib/static/assets/weightedSettings.js +++ b/WebHostLib/static/assets/weightedSettings.js @@ -35,6 +35,8 @@ window.addEventListener('load', () => {

Click here to return to safety!

` }); + document.getElementById('generate-game').addEventListener('click', () => generateGame()); + document.getElementById('generate-race').addEventListener('click', () => generateGame(true)); }); const fetchPlayerSettingsYaml = () => new Promise((resolve, reject) => { @@ -432,3 +434,15 @@ const buildSpritePicker = () => { spritePicker.appendChild(sprites); return spritePicker; }; + +const generateGame = (raceMode = false) => { + const presetNumber = document.getElementById('preset-number').value; + axios.post('/api/generate', { + weights: { player: localStorage.getItem(`weightedSettings${presetNumber}`) }, + presetData: { player: localStorage.getItem(`weightedSettings${presetNumber}`) }, + playerCount: 1, + race: raceMode ? '1' : '0', + }).then((response) => { + window.location.href = response.data.url; + }); +}; diff --git a/WebHostLib/static/styles/landing.css b/WebHostLib/static/styles/landing.css index 7c8b8f2e..46d98d7d 100644 --- a/WebHostLib/static/styles/landing.css +++ b/WebHostLib/static/styles/landing.css @@ -73,7 +73,7 @@ html{ padding-top: 35px; } -#generate-button{ +#player-settings-button{ top: 350px; left: calc(50% - 100px); background-image: url("/static/static/button-images/button-a.png"); @@ -94,7 +94,7 @@ html{ padding-left: 20px; } -#player-settings-button{ +#generate-button{ top: 75px; left: calc(50% + 416px + 75px); background-image: url("/static/static/button-images/button-b.png"); diff --git a/WebHostLib/templates/generate.html b/WebHostLib/templates/generate.html index 15f32955..865f0c23 100644 --- a/WebHostLib/templates/generate.html +++ b/WebHostLib/templates/generate.html @@ -11,26 +11,28 @@ {% include 'header/oceanHeader.html' %}
-

Start Game{% if race %} (Race Mode){% endif %}

+

Upload Config{% if race %} (Race Mode){% endif %}

+

+ This page allows you to generate a game by uploading a yaml file or a zip file containing yaml files. + If you do not have a config (yaml) file yet, you may create one on the + Player Settings page. If you would like more advanced options, + the Weighted Settings page might be what you're looking for. +

- This page accepts a yaml file containing generator options. - You can find a documented example - here. - This file can be saved as .yaml, edited to your liking and then supplied to the generator. - You can also upload a .zip with multiple YAMLs. - A proper menu is in the works. {% if race -%} - Race Mode means the spoiler log will be unavailable, roms will be encrypted and single-player has no multidata. + This game will be generated in race mode, meaning the spoiler log will be unavailable, + roms will be encrypted, and single-player games will have no multidata files. {%- else -%} - You can go to race mode to create a game without - spoiler log and with encryption. + If you would like to generate a race game, + click here. Race games are generated without + a spoiler log, the ROMs are encrypted, and single-player games will not include a multidata file. {%- endif -%}

After generation is complete, you will have the option to download a patch file. - This patch file can be opened with the client to create a rom file. - In-Browser patching will come. + This patch file can be opened with the + client, which can be + used to to create a rom file. In-browser patching is planned for the future.

diff --git a/WebHostLib/templates/header/baseHeader.html b/WebHostLib/templates/header/baseHeader.html index edea7edb..1c58aa2a 100644 --- a/WebHostLib/templates/header/baseHeader.html +++ b/WebHostLib/templates/header/baseHeader.html @@ -11,10 +11,10 @@ multiworld randomizer
diff --git a/WebHostLib/templates/landing.html b/WebHostLib/templates/landing.html index ae91221c..daffe859 100644 --- a/WebHostLib/templates/landing.html +++ b/WebHostLib/templates/landing.html @@ -12,10 +12,10 @@

MULTIWORLD RANDOMIZER

diff --git a/WebHostLib/templates/playerSettings.html b/WebHostLib/templates/playerSettings.html index 4f2f6307..8bb787bc 100644 --- a/WebHostLib/templates/playerSettings.html +++ b/WebHostLib/templates/playerSettings.html @@ -11,7 +11,7 @@ {% block body %} {% include 'header/grassHeader.html' %}
-

Player Settings

+

Start Game

Choose the options you would like to play with! You may generate a single-player game from this page, or download a settings file you can use to participate in a MultiWorld. If you would like to make your settings extra random, check out the weighted settings diff --git a/WebHostLib/templates/weightedSettings.html b/WebHostLib/templates/weightedSettings.html index 2bde5dd5..3bbf0c9f 100644 --- a/WebHostLib/templates/weightedSettings.html +++ b/WebHostLib/templates/weightedSettings.html @@ -3,6 +3,7 @@ {% block head %} Player Settings + {% endblock %} @@ -67,6 +68,8 @@

+ +
{% endblock %}