From 8ae918118a07722489b444d19ee0f1ece9449e9a Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 5 Sep 2021 13:56:52 +0200 Subject: [PATCH] Add a bug-report item in file dropdown menu --- data/language/en-GB.txt | 1 + distribution/changelog.txt | 3 ++- src/openrct2-ui/windows/TopToolbar.cpp | 25 ++++++++++++++++++++++--- src/openrct2/localisation/StringIds.h | 2 ++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index a64c2f6992..d78cd83530 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3654,6 +3654,7 @@ STR_6453 :Copy version info STR_6454 :Can’t rename banner… STR_6455 :Can’t rename sign… STR_6456 :Giant Screenshot +STR_6457 :Report a bug on GitHub ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 564b7fc02b..a800039df6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,7 +6,8 @@ - Feature: [#15164] Highlight elements selected by the Tile Inspector, tracks are currently not supported. - Feature: [#15165] [Plugin] Add the ability to create entities using "map.createEntity". - Feature: [#15194] [Plugin] Add guest properties, ride downtime and park casualty penalty. -- Feature: [#15294] New vehicle animation type: flying animal +- Feature: [#15195] Added a bug-report item in file dropdown menu. +- Feature: [#15294] New vehicle animation type: flying animal. - Fix: [#13465] Creating a scenario based on a won save game results in a scenario that’s instantly won. - Fix: [#14316] Closing the Track Designs Manager window causes broken state. - Fix: [#14667] “Extreme Hawaiian Island” has unpurchaseable land tiles (original bug). diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index d702b8994b..870ec0f40a 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -119,10 +121,12 @@ enum FILE_MENU_DDIDX { DDIDX_SCREENSHOT = 7, DDIDX_GIANT_SCREENSHOT = 8, // separator - DDIDX_QUIT_TO_MENU = 10, - DDIDX_EXIT_OPENRCT2 = 11, + DDIDX_FILE_BUG_ON_GITHUB = 10, // separator - DDIDX_UPDATE_AVAILABLE = 13, + DDIDX_QUIT_TO_MENU = 12, + DDIDX_EXIT_OPENRCT2 = 13, + // separator + DDIDX_UPDATE_AVAILABLE = 15, }; enum TOP_TOOLBAR_VIEW_MENU_DDIDX { @@ -435,6 +439,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_TRACK_DESIGNS_MANAGER; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; @@ -451,6 +457,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_SCENARIO_EDITOR; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; } @@ -466,6 +474,8 @@ static void window_top_toolbar_mousedown(rct_window* w, rct_widgetindex widgetIn gDropdownItemsFormat[numItems++] = STR_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_GIANT_SCREENSHOT; gDropdownItemsFormat[numItems++] = STR_EMPTY; + gDropdownItemsFormat[numItems++] = STR_FILE_BUG_ON_GITHUB; + gDropdownItemsFormat[numItems++] = STR_EMPTY; gDropdownItemsFormat[numItems++] = STR_QUIT_TO_MENU; gDropdownItemsFormat[numItems++] = STR_EXIT_OPENRCT2; if (OpenRCT2::GetContext()->HasNewVersionInfo()) @@ -577,6 +587,15 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd case DDIDX_GIANT_SCREENSHOT: screenshot_giant(); break; + case DDIDX_FILE_BUG_ON_GITHUB: + { + std::string url = "https://github.com/OpenRCT2/OpenRCT2/issues/" + "new?assignees=&labels=bug&template=bug_report.yaml"; + auto versionStr = String::URLEncode(gVersionInfoFull); + url.append("&openrct2_build=" + versionStr); + OpenRCT2::GetContext()->GetUiContext()->OpenURL(url); + } + break; case DDIDX_QUIT_TO_MENU: { window_close_by_class(WC_MANAGE_TRACK_DESIGN); diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 64b53a5e8f..66bf283cc2 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -3909,6 +3909,8 @@ enum STR_SHORTCUT_GIANT_SCREENSHOT = 6456, + STR_FILE_BUG_ON_GITHUB = 6457, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings };