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:
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
import typing
|
||||
import math
|
||||
import settings
|
||||
import threading
|
||||
|
||||
from BaseClasses import Item, MultiWorld, Tutorial, ItemClassification
|
||||
@@ -17,6 +18,16 @@ from worlds.AutoWorld import WebWorld, World
|
||||
from .Rom import LocalRom, patch_rom, get_base_rom_path, SMWDeltaPatch
|
||||
|
||||
|
||||
class SMWSettings(settings.Group):
|
||||
class RomFile(settings.SNESRomPath):
|
||||
"""File name of the SMW US rom"""
|
||||
description = "Super Mario World (USA) ROM File"
|
||||
copy_to = "Super Mario World (USA).sfc"
|
||||
md5s = [SMWDeltaPatch.hash]
|
||||
|
||||
rom_file: RomFile = RomFile(RomFile.copy_to)
|
||||
|
||||
|
||||
class SMWWeb(WebWorld):
|
||||
theme = "grass"
|
||||
|
||||
@@ -40,6 +51,7 @@ class SMWWorld(World):
|
||||
"""
|
||||
game: str = "Super Mario World"
|
||||
option_definitions = smw_options
|
||||
settings: typing.ClassVar[SMWSettings]
|
||||
topology_present = False
|
||||
data_version = 3
|
||||
required_client_version = (0, 3, 5)
|
||||
|
||||
Reference in New Issue
Block a user