diff --git a/WebHostLib/downloads.py b/WebHostLib/downloads.py index 4ba358cc..77dc179e 100644 --- a/WebHostLib/downloads.py +++ b/WebHostLib/downloads.py @@ -73,9 +73,9 @@ def download_slot_file(room_id, player_id: int): @app.route("/templates") @cache.cached() def list_yaml_templates(): - import os files = [] - for file in os.scandir(os.path.join(app.static_folder, "generated")): - if file.is_file() and file.name.endswith(".yaml"): - files.append(file.name) + from worlds.AutoWorld import AutoWorldRegister + for world_name, world in AutoWorldRegister.world_types.items(): + if not world.hidden: + files.append(world_name) return render_template("templates.html", files=files) \ No newline at end of file diff --git a/WebHostLib/templates/options.yaml b/WebHostLib/templates/options.yaml index 105cd895..746ff8be 100644 --- a/WebHostLib/templates/options.yaml +++ b/WebHostLib/templates/options.yaml @@ -68,4 +68,5 @@ progression_balancing: {%- else %} {{ yaml_dump(option.default) | indent(4, first=False) }} {%- endif -%} - {%- endfor -%} \ No newline at end of file + {%- endfor -%} + {% if not options %}{}{% endif %} \ No newline at end of file diff --git a/WebHostLib/templates/templates.html b/WebHostLib/templates/templates.html index 0f5920df..5c5fe5f1 100644 --- a/WebHostLib/templates/templates.html +++ b/WebHostLib/templates/templates.html @@ -14,7 +14,7 @@

Option Templates (YAML)