* add quotes around strings containing {{ game }}
* do the actually correct thing instead of a hack
thanks berserker66 for pointing out to me that I was doing this the
completly wrong way, so I fixed it up
* Clean up filenames to prevent illegal chars
* Use %s substitution instead of concatenation
* whoops
somehow i removed a space from the comment for the regex, so this adds
it back
* Use pre-existing function in Utils.py
* Test: add test for option yaml with colon
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* make yaml_output arg a bool instead of number
* make yaml_output dump all player options as csv
* it sorts by game so swap those columns
* capitalize game and name headers
* use a list and just add an if before adding instead of sorting
* skip options that the world doesn't want displayed
* check if the class is a subclass of Removed specifically instead of the none flag
* don't create empty rows
* add a header for every game option that isn't from the common ones even if they have the same name
* add to webhost gen args so it can still gen
* Options: Always verify keys for VerifyKeys options
* fix PlandoTexts
* use OptionError and give a slightly better error message for which option it is
* add the player name to the error
* don't create an unnecessary list
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* rename locations accessibility to "full" and make old locations accessibility debug only
* fix a bug in oot
* reorder lttp tests to not override its overrides
* changed the wrong word in the dict
* :forehead:
* update the manual lttp yaml
* use __debug__
* update pokemon and messenger
* fix conflicts from 993
* fix stardew presets
* add that locations may be inaccessible to description
* use reST format and make the items description one line so that it renders correctly on webhost
* forgot i renamed that
* add aliases for back compat
* some cleanup
* fix imports
* fix test failure
* only check "items" players when the item is progression
* Revert "only check "items" players when the item is progression"
This reverts commit ecbf986145e6194aa99a39c481d8ecd0736d5a4c.
* remove some unnecessary diffs
* CV64: Add ItemsAccessibility
* put items description at the bottom of the docstring since that's it's visual order
* :
* rename accessibility reference in pokemon rb dexsanity
* make the rendered tooltips look nicer
* Render option documentation as reStructuredText in the WebView
This means that options can use the standard Python documentation
format, while producing much nicer-looking documentation in the
WebView with things like emphasis, lists, and so on.
* Opt existing worlds out of rich option docs
This avoids breaking the rendering of existing option docs which were
written with the old plain text rendering in mind, while also allowing
new options to default to the rich text rendering instead.
* Use reStructuredText formatting for Lingo Options docstrings
* Disable raw and file insertion RST directives
* Update doc comments per code review
* Make rich text docs opt-in
* Put rich_text_options_doc on WebWorld
* Document rich text API
* Code review
* Update docs/options api.md
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Update Options.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
---------
Co-authored-by: Chris Wilson <chris@legendserver.info>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Player Options: Fix Named Range displays
* Also add validation to the NamedRange class itself
* Don't break Stardew
* Comment
* Do replace first so title works correctly
* Bring change to Weighted Options as well
* allow option groups to specify whether they should be hidden or not
* allow worlds to override whether game options starts collapsed
* remove Game Options assert so the visibility of that group can be changed
* if "Game Options" or "Item & Location Options" groups are specified, fix casing
* don't allow item & location options to have duplicates of the auto added options
* use a generator instead of a comprehension
* use consistent naming
* move item_and_loc_options out of the meta class and into the Options module
* don't allow empty world specified option groups
* reuse option_group generation code instead of rewriting it
* delete the default group if it's empty
* indent
* Implement support for option groups. WebHost options pages still need to be updated.
* Remove debug output
* In-progress conversion of player-options to Jinja rendering
* Support "Randomize" button without JS, transpile SCSS to CSS, include map file for later editors
* Un-alphabetize options, add default group name for item/location Option classes, implement more option types
* Re-flow UI generation to avoid printing rows with unsupported or invalid option types, add support for TextChoice options
* Support all remaining option types
* Rendering improvements and CSS fixes for prettiness
* Wrap options in a form, update button styles, fix labels, disable inputs where the default is random, nuke the JS
* Minor CSS tweaks, as recommended by the designer
* Hide JS-required elements in noscript tag. Add JS reactivity to range, named-range, and randomize buttons.
* Fix labels, add JS handling for TextChoice
* Make option groups collapsable
* PEP8 current option_groups progress (#2604)
* Make the python more PEP8 and remove unneeded imports
* remove LocationSet from `Item & Location Options` group
* It's ugly, but YAML generation is working
* Stop generating JSON files for player-options pages
* Do not include ItemDict entries whose values are zero
* Properly format yaml output
* Save options when form is submitted, load options on page load
* Fix options being omitted from the page if a group has an even number of options
* Implement generate-game, escape option descriptions
* Fix "randomize" checkboxes not properly setting YAML options to "random"
* Add a separator between item/location groups and items/locations in their respective lists
* Implement option presets
* Fix docs to detail what actually ended up happening
* implement option groups on webworld to allow dev sorting (#2616)
* Force extremely long item/location/option names with no spaces to text-wrap
* Fix "randomize" button being too wide in single-column display, change page header to include game name
* Update preset select to read "custom" when updating form inputs. Show error message if the user doesn't input a name
* Un-break weighted-options, add option group names to weighted options
* Nuke weighted-options. Set up framework to rebuild it in Jinja.
* Generate styles with scss, remove styles which will be replaced, add placeholders for worlds
* Support Toggle, DefaultOnToggle, and Choice options in weighted-options
* Implement expand/collapse without JS for worlds and option groups
* Properly style set options
* Implement Range and NamedRange. Also, CSS is hard.
* Add support for remaining option types. JS and backend still forthcoming.
* Add JS functionality for collapsing game divs, populating span values on range updates. Add <noscript> tag to warn users with JS disabled.
* Support showing/hiding game divs based on range value for game
* Add support for adding/deleting range rows
* Save settings to localStorage on form submission
* Save deleted options on form submission
* Break weighted-options into a per-game page.
- Break weighted-options into a per-game page
- Add "advanced options" links to supported games page
- Use details/summary tags on supported games, player-options, and weighted-options
- Fix bug preventing previously deleted rows from being removed on page load if JS is enabled
- Move route handling for options pages to options.py
- Remove world handling from weighted-options
* Implement loading previous settings from localStorage on page load if JS is enabled
* Weighted options can now generate YAML files and single-player games
* options pages now respect option visibility settings for simple and complex pages
* Remove `/weighted-settings` redirect, fix weighted-options link on player-options page
* Fix instance of AutoWorld not having access to proper `random`
* Catch instances of frozenset along with set
* Restore word-wrap in tooltips
* Fix word wrap in player-options labels
* Add `dedent` filter to help with formatting tooltips in player-options
* Do not change the ordering of keys when printing yaml files
* Move necessary import out of conditional statement
* Expand only the first option group by default on both options pages
* Respect option visibility when generating yaml template files
* Swap to double quotes
* Replace instances of `/weighted-settings` with `/weighted-options`, swap out incomplete links
* Strip newlines and spaces after applying dedent filter
* Fix documentation for option groups
* Update site map
* Update various docs
* Sort OptionSet lists alphabetically
* Minor style tweak
* Fix extremely long text overflowing tooltips
* Convert player-options to use CSS grid instead of tables
* Do not display link to weighted-options page on supported games if the options page is an external link
* Update worlds/AutoWorld.py
Bugfix by @alwaysintreble
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Fix NamedRange options not being properly set if a preset it loaded
* Move option-presets route into options.py
* Include preset name in YAML if not "default" and not "custom"
* Removed macros for PlandoBosses and DefaultOnToggle, as they were handled by their parent classes
* Fix not disabling custom inputs when the randomize button is clicked
* Only sort OptionList and OptionSet valid_keys if they are unordered
* Quick style fixes for player-settings to give `select` elements `text-overflow: ellipsis` and increase base size of left-column
* Prevent showing a horizontal scroll bar on player-options if the browser width was beneath a certain threshold
* Fix a bug in weighted-options which prevented inputting a negative value for new range inputs
---------
Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
* Options: Add an OptionError to specify bad options caused the failure
* inherit from ValueError instead of RuntimeError since this error should be thrown via bad input
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* Core: typing for `Option.default` and a few other `Option` class variables
This is a replacement for https://github.com/ArchipelagoMW/Archipelago/pull/2173
You can read discussion there for issues we found for why we can't have more specific typing on `default`
instead of setting a default in `Option` (where we don't know the type), we check in the metaclass to make sure they have a default.
* NumericOption doesn't need the type annotation that brings out the mypy bug
* SoE default ClassVar
* fix, maybe
* typegard for iterable of any
* wow I'm so tired I just changed the method name without changing what it actually does...
* also exclude bytes in is_iterable_but_str
* apply pr comments
* Update Utils.py
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Revert "also exclude bytes in is_iterable_but_str"
This reverts commit cf087d2ee20727dbbe561c8c0f90aa85ef0a5d4b.
---------
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* allow common collection in set and list option constructors
* allow any iterable of strings
* add return None
---------
Co-authored-by: beauxq <beauxq@yahoo.com>
🤞
* map option objects to a `World.options` dict
* convert RoR2 to options dict system for testing
* add temp behavior for lttp with notes
* copy/paste bad
* convert `set_default_common_options` to a namespace property
* reorganize test call order
* have fill_restrictive use the new options system
* update world api
* update soe tests
* fix world api
* core: auto initialize a dataclass on the World class with the option results
* core: auto initialize a dataclass on the World class with the option results: small tying improvement
* add `as_dict` method to the options dataclass
* fix namespace issues with tests
* have current option updates use `.value` instead of changing the option
* update ror2 to use the new options system again
* revert the junk pool dict since it's cased differently
* fix begin_with_loop typo
* write new and old options to spoiler
* change factorio option behavior back
* fix comparisons
* move common and per_game_common options to new system
* core: automatically create missing options_dataclass from legacy option_definitions
* remove spoiler special casing and add back the Factorio option changing but in new system
* give ArchipIDLE the default options_dataclass so its options get generated and spoilered properly
* reimplement `inspect.get_annotations`
* move option info generation for webhost to new system
* need to include Common and PerGame common since __annotations__ doesn't include super
* use get_type_hints for the options dictionary
* typing.get_type_hints returns the bases too.
* forgot to sweep through generate
* sweep through all the tests
* swap to a metaclass property
* move remaining usages from get_type_hints to metaclass property
* move remaining usages from __annotations__ to metaclass property
* move remaining usages from legacy dictionaries to metaclass property
* remove legacy dictionaries
* cache the metaclass property
* clarify inheritance in world api
* move the messenger to new options system
* add an assert for my dumb
* update the doc
* rename o to options
* missed a spot
* update new messenger options
* comment spacing
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* fix tests
* fix missing import
* make the documentation definition more accurate
* use options system for loc creation
* type cast MessengerWorld
* fix typo and use quotes for cast
* LTTP: set random seed in tests
* ArchipIdle: remove change here as it's default on AutoWorld
* Stardew: Need to set state because `set_default_common_options` used to
* The Messenger: update shop rando and helpers to new system; optimize imports
* Add a kwarg to `as_dict` to do the casing for you
* RoR2: use new kwarg for less code
* RoR2: revert some accidental reverts
* The Messenger: remove an unnecessary variable
* remove TypeVar that isn't used
* CommonOptions not abstract
* Docs: fix mistake in options api.md
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* create options for item link worlds
* revert accidental doc removals
* Item Links: set default options on group
* change Zillion to new options dataclass
* remove unused parameter to function
* use TypeGuard for Literal narrowing
* move dlc quest to new api
* move overcooked 2 to new api
* fixed some missed code in oc2
* - Tried to be compliant with 993 (WIP?)
* - I think it all works now
* - Removed last trace of me touching core
* typo
* It now passes all tests!
* Improve options, fix all issues I hope
* - Fixed init options
* dlcquest: fix bad imports
* missed a file
* - Reduce code duplication
* add as_dict documentation
* - Use .items(), get option name more directly, fix slot data content
* - Remove generic options from the slot data
* improve slot data documentation
* remove `CommonOptions.get_value` (#21)
* better slot data description
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: el-u <109771707+el-u@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@yahoo.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
Co-authored-by: Alex Gilbert <alexgilbert@yahoo.com>
* Options: Add support for `items()` and `__getitem__` to OptionDict
* Options: have OptionDict inherit from Mapping
* add typing to __getitem__
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
---------
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* Options.py cleanup
* TextChoice cleanup
* make Option.current_option_name a property
* title the TextChoce option names
* satisfy the linter
* a little more options cleanup
* move the typing import
* typing should be PlandoSettings
* fix incorrect conflict merging
* make imports local
* the tests seem to want me to import these twice though i hate it.
* changes from review. Make the various Location verifying Options `LocationSet`
* remove unnecessary fluff
* begrudgingly support get_current_option_name. Leave a comment that worlds shouldn't be touching this
* log a deprecation warning and return the property for `get_current_option_name()`
---------
Co-authored-by: beauxq <beauxq@yahoo.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
* add min and max comments for named special_range options
* comment all special range options and dictate the min and max in comment block
* make it cleaner
* make it cleanerer
* make it cleanererer
* Reformat template for more consistent comments.
* Fixed missing note on some special settings.
* Small tweak to template.
* Update playerSettings.yaml to match auto-generated template with all ALTTP options.
* Fix edge case with `special_range_cutoff` and revert playerSettings.yaml.
Co-authored-by: Zach Parks <zach@alliware.com>
* Early Items option
* Early Items description update
* Change Early Items to dict
* Rewrite early items as extra fill steps
* Move if statement up
* Document early_items
* Move early_items handling before fill_hook
* Apply suggestions from code review
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* Subnautica pre-fill moved to early_items
* Subnautica early items fix
* Remove unit test bug workaround
* beauxq's pr
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
* world test base class
* game not instance property
* I would have guessed that this only collected 1.
* game property
* move SoE tests into worlds
* don't force auto world setup