From 1fe82b1312788dfa6ea96b7ef10a9d5f70fa3fc1 Mon Sep 17 00:00:00 2001 From: KonoTyran Date: Tue, 12 Apr 2022 14:37:05 -0700 Subject: [PATCH] Add bug report link to WebWorld (#440) * Add bug report link to WebWorld * change bug_report_page to an optional reword bug report link text. * update Minecraft bug report page to a template. * change wording of link. * add `bug_report_page` documentation to api.md --- WebHostLib/templates/supportedGames.html | 4 ++++ docs/api.md | 9 +++++++-- worlds/AutoWorld.py | 3 +++ worlds/minecraft/__init__.py | 9 ++++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/WebHostLib/templates/supportedGames.html b/WebHostLib/templates/supportedGames.html index c87b5919..00f49d6d 100644 --- a/WebHostLib/templates/supportedGames.html +++ b/WebHostLib/templates/supportedGames.html @@ -21,6 +21,10 @@ {% elif world.web.settings_page %} Settings Page {% endif %} + {% if world.web.bug_report_page %} + | + Report a Bug + {% endif %}

{% endfor %} diff --git a/docs/api.md b/docs/api.md index 2f330eb9..cb1b1e4b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -56,12 +56,17 @@ game. ### WebWorld Class A `WebWorld` class contains specific attributes and methods that can be modified -for your world specifically on the webhost. At the moment this comprises of `settings_page` -which can be changed to a link instead of an AP generated settings page, and a `theme` to be used for your game specific AP pages. Available themes: +for your world specifically on the webhost. + +`settings_page` which can be changed to a link instead of an AP generated settings page. + +`theme` to be used for your game specific AP pages. Available themes: | dirt | grass (default) | grassFlowers | ice | jungle | ocean | partyTime | |---|---|---|---|---|---|---| | | | | | | | | +`bug_report_page` (optional) can be a link to a bug reporting page, most likely a GitHub issue page, that will be placed by the site to help direct users to report bugs. + ### MultiWorld Object The `MultiWorld` object references the whole multiworld (all items and locations diff --git a/worlds/AutoWorld.py b/worlds/AutoWorld.py index 6e326897..b2df8486 100644 --- a/worlds/AutoWorld.py +++ b/worlds/AutoWorld.py @@ -93,6 +93,9 @@ class WebWorld: # Available: dirt, grass, grassFlowers, ice, jungle, ocean, partyTime theme = "grass" + # display a link to a bug report page, most likely a link to a GitHub issue page. + bug_report_page: Optional[str] + class World(metaclass=AutoWorldRegister): """A World object encompasses a game's Items, Locations, Rules and additional data or functionality required. diff --git a/worlds/minecraft/__init__.py b/worlds/minecraft/__init__.py index 6c7594f1..af57296a 100644 --- a/worlds/minecraft/__init__.py +++ b/worlds/minecraft/__init__.py @@ -11,11 +11,17 @@ from worlds.generic.Rules import exclusion_rules from BaseClasses import Region, Entrance, Item from .Options import minecraft_options -from ..AutoWorld import World +from ..AutoWorld import World, WebWorld client_version = 7 minecraft_version = "1.17.1" + +class MinecraftWebWorld(WebWorld): + theme = "jungle" + bug_report_page = "https://github.com/KonoTyran/Minecraft_AP_Randomizer/issues/new?assignees=&labels=bug&template=bug_report.yaml&title=%5BBug%5D%3A+Brief+Description+of+bug+here" + + class MinecraftWorld(World): """ Minecraft is a game about creativity. In a world made entirely of cubes, you explore, discover, mine, @@ -26,6 +32,7 @@ class MinecraftWorld(World): game: str = "Minecraft" options = minecraft_options topology_present = True + web = MinecraftWebWorld() item_name_to_id = {name: data.code for name, data in item_table.items()} location_name_to_id = {name: data.id for name, data in advancement_table.items()}