1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix file menu for editor, restore menu order, add shortcut for quick saving

This commit is contained in:
Gymnasiast
2015-08-20 12:13:08 +02:00
parent c0ac3ba06d
commit 93d49e314e
7 changed files with 40 additions and 18 deletions

View File

@@ -131,6 +131,7 @@ const rct_string_id ShortcutStringIds[] = {
STR_SHORTCUT_SCROLL_MAP_DOWN,
STR_SHORTCUT_SCROLL_MAP_RIGHT,
STR_SEND_MESSAGE,
STR_SHORTCUT_QUICK_SAVE_GAME,
};
/**
@@ -262,4 +263,4 @@ static void window_shortcut_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, i
RCT2_GLOBAL(0x13CE956, uint16) = templateStringId;
gfx_draw_string_left(dpi, format, (void*)0x13CE952, 0, 0, y - 1);
}
}
}

View File

@@ -72,9 +72,9 @@ enum {
};
typedef enum {
DDIDX_SAVE_GAME = 0,
DDIDX_SAVE_GAME_AS = 1,
DDIDX_LOAD_GAME = 2,
DDIDX_LOAD_GAME = 0,
DDIDX_SAVE_GAME = 1,
DDIDX_SAVE_GAME_AS = 2,
// separator
DDIDX_ABOUT = 4,
DDIDX_OPTIONS = 5,
@@ -378,9 +378,9 @@ static void window_top_toolbar_mousedown(int widgetIndex, rct_window*w, rct_widg
gDropdownItemsFormat[9] = STR_EXIT_OPENRCT2;
numItems = 10;
} else {
gDropdownItemsFormat[0] = STR_SAVE_GAME;
gDropdownItemsFormat[1] = STR_SAVE_GAME_AS;
gDropdownItemsFormat[2] = STR_LOAD_GAME;
gDropdownItemsFormat[0] = STR_LOAD_GAME;
gDropdownItemsFormat[1] = STR_SAVE_GAME;
gDropdownItemsFormat[2] = STR_SAVE_GAME_AS;
gDropdownItemsFormat[3] = 0;
gDropdownItemsFormat[4] = STR_ABOUT;
gDropdownItemsFormat[5] = STR_OPTIONS;
@@ -487,6 +487,12 @@ static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int drop
{
switch (widgetIndex) {
case WIDX_FILE_MENU:
// Quicksave is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of the other modes.
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_SCENARIO_EDITOR) && dropdownIndex > DDIDX_LOAD_GAME)
dropdownIndex += 1;
// Track designer and track designs manager start with About, not Load/save
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER))
dropdownIndex += DDIDX_ABOUT;
@@ -494,6 +500,10 @@ static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int drop
case DDIDX_LOAD_GAME:
game_do_command(0, 1, 0, 0, GAME_COMMAND_LOAD_OR_QUIT, 0, 0);
break;
case DDIDX_SAVE_GAME:
tool_cancel();
save_game();
break;
case DDIDX_SAVE_GAME_AS:
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) {
rct_s6_info *s6Info = (rct_s6_info*)0x0141F570;
@@ -504,16 +514,6 @@ static void window_top_toolbar_dropdown(rct_window *w, int widgetIndex, int drop
save_game_as();
}
break;
case DDIDX_SAVE_GAME:
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR) {
rct_s6_info *s6Info = (rct_s6_info*)0x0141F570;
window_loadsave_open(LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE, s6Info->name);
}
else {
tool_cancel();
save_game();
}
break;
case DDIDX_ABOUT:
window_about_open();
break;