* Core: warn if a yaml is empty
* WebHost: ignore empty yaml
Generate: log which yaml documents are empty
* Actually remove empty yamls from weight_cache
* More verbose variable name
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
* Also makes adjustments to the style for these slots by italicizing its names (including multi-tracker).
* Player-specific trackers do not link to ItemLink player trackers (they do not exist).
* Fixes a bug on Factorio multi-tracker when item links exist.
* WebHost: use new safe yaml template filename
this mirrors the change in ArchipelagoMW/#4106 in WebHost
* WebHost: install docs into safe filename and require docs to be named safe
* Test: update doc test for safe name
* WebHost: fix import order to not break ModuleUpdate
Previously, because `default(..., true)` only checks if the
left-hand-side is falsey, not just `None`, this always forced options
to render in non-rich mode if they were explicitly set to
`rich_text_doc = None`. Now it matches the intended and documented
behavior, where `None` falls back to the world's
`rich_text_options_doc` setting.
* WebHost: restore fragment links for glossary and faq
such as /faq/en/#what-does-multi-game-mean
* WebHost: faq, glossary: make markdown titles clickable
* WebHost: reduce precision and optimize header-logo.svg
technically those files will not produce an identical output when rendered
however the difference is virtually impossible to see even when rendered to w=4096
* WebHost: keep original svg
* Added contained games of a seed to the user content page as tooltip.
* Changed sort handling.
* Limited amount of shown games.
* Added missing dashes.
Co-authored-by: Kory Dondzila <kory.dondzila@atomicobject.com>
* Closing a-tags.
Co-authored-by: Kory Dondzila <kory.dondzila@atomicobject.com>
* Closing a-tags.
Co-authored-by: Kory Dondzila <kory.dondzila@atomicobject.com>
* Moved games list to table cell level.
Co-authored-by: Kory Dondzila <kory.dondzila@atomicobject.com>
* Moved games list to table cell level.
---------
Co-authored-by: Kory Dondzila <kory.dondzila@atomicobject.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
* WebHost: add spinner to room command
and show error message if fetch fails due to NetworkError
* WebHost: don't update room log while tab is inactive
* WebHost: don't include log for automated requests
* WebHost: refresh room also for re-spinups
and do that from javascript
* Test, WebHost: send fake user-agent where required
* WebHost: remove wrong comment in host room
* Core: have webhost slot name links go through the launcher so that components can use them
* fix query handling, remove debug prints, and change mousover text for new behavior
* remove a missed debug and unused function
* filter room id to suuid since that's what everything else uses
* pass args to common client correctly
* add GUI to select which client to open
* remove args parsing and "require" components to parse it themselves
* support for messenger since it was basically already done
* use "proper" args argparsing and clean up uri handling
* use a timer and auto launch text client if no component is found
* change the timer to be a bit more appealing. also found a bug lmao
* don't hold 5 hostage and capitalize URI ig
---------
Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
If a NamedRange has a `special_range_names` entry outside the
`range_start` and `range_end`, the HTML5 range input will clamp the
submitted value to the closest value in the range.
These means that, for example, Pokemon RB's "HM Compatibility" option's
"Vanilla (-1)" option would instead get posted as "0" rather than "-1".
This change updates NamedRange to behave like TextChoice, where the
select element has a `name` attribute matching the option, and there is
an additional element to be able to provide an option other than the
select element's choices.
This uses a different suffix of `-range` rather than `-custom` that
TextChoice uses. The reason is we need some way to decide whether to use
the custom value or the select value, and that method needs to work
without JavaScript. For TextChoice this is easy, if the custom field is
empty use the select element. For NamedRange this is more difficult as
the browser will always submit *something*. My choice was to only use
the value from the range if the select box is set to "custom". Since
this only happens with JS as "custom' is hidden, I made the range hidden
under no-JS. If it's preferred, I could make the select box hidden
instead. Let me know.
This PR also makes the `js-required` class set `display: none` with
`!important` as otherwise the class wouldn't work on any rule that
had `display: flex` with more specificity than a single class.
* add Range= to log, making responses a lot smaller for massive rooms
* switch xhr to fetch
* post the form using fetch if possible
* also refresh log faster while waiting for command echo / response
* do not follow redirect, saving a request
* do not post empty body
* smooth-scroll the log view
* paste the log into the div when loading the HTML (up to 1MB, rest will be `fetch`ed)
* fix duplicate charset in display_log response
* 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
* WebHost: Fix "Add" button for Progression Balancing causing a weird redirect
This "add" button is part of a form, which causes it to submit the form, because the default type for a button is "submit".
This PR changes the type of the button to "button", which causes it to not submit the form and just execute its normal effect.
(An alternative would be `event.preventDefault()` but that seems less clean to me, but also I'm not a HTML/JS dev)
* There's also multiple.
* Test: add hosting simulation test
* WebHost: add weak typing to get_app()
* MultiServer: add typing to auto_saver_thread
* MultiServer: don't cancel task, properly end it
* customserver: stop auto-save thread from saving after shutdown
and make sure it stops, another potential memory leak
* MultiServer, customserver: make datapackage small again
* customserver: collect/finish room tasks
Hopefully fixes the memory leak we are seeing
* CI: test hosting
* Test: hosting: verify autohoster saves on Ctrl+C
* customserver: save when stopping via Ctrl+C