1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 18:25:16 +01:00

Add a button to the map generator window in the Map window (#4098)

Includes many fixes by @Wirlie
This commit is contained in:
Michael Steenbeek
2016-07-30 21:10:04 +02:00
committed by GitHub
parent 3399a67ccb
commit 19220cbbce
4 changed files with 27 additions and 9 deletions

View File

@@ -4213,6 +4213,7 @@ STR_5901 :Show segment heights
STR_5902 :Show bounding boxes
STR_5903 :Show paint debug window
STR_5904 :Reset date
STR_5905 :{SMALLFONT}{BLACK}A map generation tool that automatically creates a custom landscape
#############
# Scenarios #

View File

@@ -3337,6 +3337,8 @@ enum {
STR_DEBUG_DROPDOWN_DEBUG_PAINT = 5903,
STR_CHEAT_RESET_DATE = 5904,
STR_MAP_GENERATOR_TIP = 5905,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};

View File

@@ -63,7 +63,8 @@ enum WINDOW_MAP_WIDGET_IDX {
WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX = 17,
WIDX_LAND_SALE_CHECKBOX = 18,
WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX = 19,
WIDX_ROTATE_90 = 20
WIDX_ROTATE_90 = 20,
WIDX_MAP_GENERATOR = 21
};
static rct_widget window_map_widgets[] = {
@@ -88,6 +89,7 @@ static rct_widget window_map_widgets[] = {
{ WWT_CHECKBOX, 1, 58, 241, 197, 208, STR_LAND_SALE, STR_SET_LAND_TO_BE_AVAILABLE_TIP },
{ WWT_CHECKBOX, 1, 58, 231, 197, 208, STR_CONSTRUCTION_RIGHTS_SALE, STR_SET_CONSTRUCTION_RIGHTS_TO_BE_AVAILABLE_TIP },
{ WWT_FLATBTN, 1, 218, 241, 45, 68, SPR_ROTATE_ARROW, STR_ROTATE_OBJECTS_90 },
{ WWT_DROPDOWN_BUTTON, 1, 110, 240, 190, 201, STR_MAPGEN_WINDOW_TITLE, STR_MAP_GENERATOR_TIP},
{ WIDGETS_END },
};
@@ -212,7 +214,8 @@ void window_map_open()
(1 << WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX) |
(1 << WIDX_BUILD_PARK_ENTRANCE) |
(1 << WIDX_ROTATE_90) |
(1 << WIDX_PEOPLE_STARTING_POSITION);
(1 << WIDX_PEOPLE_STARTING_POSITION) |
(1 << WIDX_MAP_GENERATOR);
w->hold_down_widgets =
(1 << WIDX_MAP_SIZE_SPINNER_UP) |
@@ -349,12 +352,18 @@ static void window_map_mouseup(rct_window *w, int widgetIndex)
if (widgetIndex == w->selected_tab)
break;
w->selected_tab = widgetIndex;
w->list_information_type = 0;
}
break;
}
}
w->selected_tab = widgetIndex;
w->list_information_type = 0;
break;
case WIDX_MAP_GENERATOR:
window_mapgen_open();
break;
}
break;
}
}
/**
*
@@ -730,7 +739,7 @@ static void window_map_invalidate(rct_window *w)
}
// Disable all scenario editor related widgets
for (i = WIDX_MAP_SIZE_SPINNER; i <= WIDX_ROTATE_90; i++) {
for (i = WIDX_MAP_SIZE_SPINNER; i <= WIDX_MAP_GENERATOR; i++) {
w->widgets[i].type = WWT_EMPTY;
}
@@ -938,6 +947,11 @@ static void window_map_show_default_scenario_editor_buttons(rct_window *w) {
w->widgets[WIDX_MAP_SIZE_SPINNER].type = WWT_SPINNER;
w->widgets[WIDX_MAP_SIZE_SPINNER_UP].type = WWT_DROPDOWN_BUTTON;
w->widgets[WIDX_MAP_SIZE_SPINNER_DOWN].type = WWT_DROPDOWN_BUTTON;
// Only show this in the scenario editor, even when in sandbox mode.
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
w->widgets[WIDX_MAP_GENERATOR].type = WWT_DROPDOWN_BUTTON;
set_format_arg(2, uint16, gMapSize - 2);
}

View File

@@ -26,6 +26,7 @@
#include "../world/scenery.h"
#include "dropdown.h"
#include "../interface/themes.h"
#include "../localisation/string_ids.h"
enum {
WINDOW_MAPGEN_PAGE_BASE,