Core: Add settings API ("auto settings") for host.yaml (#1871)

* Add settings API ("auto settings") for host.yaml

* settings: no BOM when saving

* settings: fix saving / groups resetting themselves

* settings: fix AutoWorldRegister import

Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>

* Lufia2: settings: clean up imports

* settings: more consistent class naming

* Docs: update world api for settings api refactor

* settings: fix access from World instance

* settings: update migration timeline

* Docs: Apply suggestions from code review

Co-authored-by: Zach Parks <zach@alliware.com>

* Settings: correctly resolve .exe in UserPath and LocalPath

---------

Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
Co-authored-by: Zach Parks <zach@alliware.com>
This commit is contained in:
black-sliver
2023-07-05 22:39:35 +02:00
committed by GitHub
parent d8a8997684
commit 827444f5a4
34 changed files with 1455 additions and 412 deletions

View File

@@ -1,6 +1,8 @@
import base64
import itertools
import os
import settings
from enum import IntFlag
from random import Random
from typing import Any, ClassVar, Dict, get_type_hints, Iterator, List, Set, Tuple
@@ -22,6 +24,16 @@ from .basepatch import apply_basepatch
CHESTS_PER_SPHERE: int = 5
class L2ACSettings(settings.Group):
class RomFile(settings.SNESRomPath):
"""File name of the US rom"""
description = "Lufia II ROM File"
copy_to = "Lufia II - Rise of the Sinistrals (USA).sfc"
md5s = [L2ACDeltaPatch.hash]
rom_file: RomFile = RomFile(RomFile.copy_to)
class L2ACWeb(WebWorld):
tutorials = [Tutorial(
"Multiworld Setup Guide",
@@ -45,6 +57,7 @@ class L2ACWorld(World):
web: ClassVar[WebWorld] = L2ACWeb()
option_definitions: ClassVar[Dict[str, AssembleOptions]] = get_type_hints(L2ACOptions)
settings: ClassVar[L2ACSettings]
item_name_to_id: ClassVar[Dict[str, int]] = l2ac_item_name_to_id
location_name_to_id: ClassVar[Dict[str, int]] = l2ac_location_name_to_id
item_name_groups: ClassVar[Dict[str, Set[str]]] = {