Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #5835: Add keyboard shortcut for scenery remover #5857

Merged
merged 3 commits into from
Jul 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/language/en-GB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4442,6 +4442,7 @@ STR_6130 :Copy entire list to clipboard
STR_6131 :Object source
STR_6132 :Ignore research status
STR_6133 :{SMALLFONT}{BLACK}Access rides and scenery that have not yet been invented
STR_6134 :Clear Scenery

#############
# Scenarios #
Expand Down
1 change: 1 addition & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.1.1 (in development)
------------------------------------------------------------------------
- Feature: [#5815] Add cheat to ignore research status and access rides/scenery not yet invented.
- Feature: [#5857] Keyboard shortcut for clear scenery.
- Feature: [#5877] Allow up to 16 stations to be synchronised
- Feature: [#5970] The Bobsleigh Roller Coaster now supports on-ride photos.
- Feature: [#5991] Allow all tracked rides that can be tested without guests to the Track Designer
Expand Down
1 change: 1 addition & 0 deletions src/openrct2-ui/input/KeyboardShortcuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,5 @@ const uint16 KeyboardShortcuts::DefaultKeys[SHORTCUT_COUNT] =
SDL_SCANCODE_KP_0, // SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT
SDL_SCANCODE_KP_MINUS, // SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT
PLATFORM_MODIFIER | SDL_SCANCODE_L, // SHORTCUT_LOAD_GAME
SDL_SCANCODE_B, // SHORTCUT_CLEAR_SCENERY
};
1 change: 1 addition & 0 deletions src/openrct2-ui/input/KeyboardShortcuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ enum
SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT,
SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT,
SHORTCUT_LOAD_GAME,
SHORTCUT_CLEAR_SCENERY,

SHORTCUT_COUNT,

Expand Down
18 changes: 18 additions & 0 deletions src/openrct2-ui/input/keyboard_shortcut.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,23 @@ static void shortcut_open_cheat_window()
window_cheats_open();
}

static void shortcut_clear_scenery()
{
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
return;

if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gS6Info.editor_step == EDITOR_STEP_LANDSCAPE_EDITOR) {
if (!(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))) {
rct_window *window = window_find_by_class(WC_TOP_TOOLBAR);
if (window != NULL) {
window_invalidate(window);
window_event_mouse_up_call(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY);
}
}
}
}


static void shortcut_open_chat_window()
{
if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)
Expand Down Expand Up @@ -722,6 +739,7 @@ static const shortcut_action shortcut_table[SHORTCUT_COUNT] = {
shortcut_ride_construction_build_current,
shortcut_ride_construction_demolish_current,
shortcut_load_game,
shortcut_clear_scenery,
};

#pragma endregion
1 change: 1 addition & 0 deletions src/openrct2-ui/windows/shortcut_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ const rct_string_id ShortcutStringIds[] = {
STR_SHORTCUT_RIDE_CONSTRUCTION_BUILD_CURRENT,
STR_SHORTCUT_RIDE_CONSTRUCTION_DEMOLISH_CURRENT,
STR_LOAD_GAME,
STR_SHORTCUT_CLEAR_SCENERY,
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/openrct2/interface/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ enum {
#define WC_TOP_TOOLBAR__WIDX_WATER 9
#define WC_TOP_TOOLBAR__WIDX_SCENERY 10
#define WC_TOP_TOOLBAR__WIDX_PATH 11
#define WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY 17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an accompanying validate_global_widx(WC_TOP_TOOLBAR, WIDX_CLEAR_SCENERY) in windows/top_toolbar.c

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate_global_widx(WC_TOP_TOOLBAR, WIDX_CLEAR_SCENERY) has been added to top_toolbar.c

#define WC_RIDE_CONSTRUCTION__WIDX_CONSTRUCT 23
#define WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE 29
#define WC_RIDE_CONSTRUCTION__WIDX_EXIT 30
Expand Down
3 changes: 3 additions & 0 deletions src/openrct2/localisation/string_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,7 @@ enum {
STR_SHORTCUT_SHOW_MAP = 2523,
STR_SHORTCUT_SCREENSHOT = 2524,
STR_SHORTCUT_KEY_UNKNOWN = 2525,

// STR_2525 :???
// STR_2526 :???
// STR_2527 :???
Expand Down Expand Up @@ -3804,6 +3805,8 @@ enum {
STR_CHEAT_IGNORE_RESEARCH_STATUS = 6132,
STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP = 6133,

STR_SHORTCUT_CLEAR_SCENERY = 6134,

// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};
Expand Down
1 change: 1 addition & 0 deletions src/openrct2/windows/top_toolbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ validate_global_widx(WC_TOP_TOOLBAR, WIDX_LAND);
validate_global_widx(WC_TOP_TOOLBAR, WIDX_WATER);
validate_global_widx(WC_TOP_TOOLBAR, WIDX_SCENERY);
validate_global_widx(WC_TOP_TOOLBAR, WIDX_PATH);
validate_global_widx(WC_TOP_TOOLBAR, WIDX_CLEAR_SCENERY);

typedef enum {
DDIDX_NEW_GAME = 0,
Expand Down