39 #include "table/strings.h"
57 if (_game_mode != GM_EDITOR)
return;
74 if (_game_mode != GM_EDITOR)
return;
206 ShowBuildTreesToolbar();
218 default: NOT_REACHED();
249 default: NOT_REACHED();
268 switch (select_proc) {
269 default: NOT_REACHED();
301 static Hotkey terraform_hotkeys[] = {
314 static const NWidgetPart _nested_terraform_widgets[] = {
322 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_DOWN, STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND),
324 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_UP, STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND),
326 SetFill(0, 1),
SetDataTip(SPR_IMG_LEVEL_LAND, STR_LANDSCAPING_LEVEL_LAND_TOOLTIP),
333 SetFill(0, 1),
SetDataTip(SPR_IMG_BUY_LAND, STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND),
340 SetFill(0, 1),
SetDataTip(SPR_IMG_TRANSMITTER, STR_SCENEDIT_TOOLBAR_PLACE_OBJECT),
349 _nested_terraform_widgets,
lengthof(_nested_terraform_widgets),
350 &TerraformToolbarWindow::hotkeys
364 w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
370 w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
382 static byte _terraform_size = 1;
395 if (_terraform_size == 1) {
397 mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE;
401 assert(_terraform_size != 0);
402 TileArea ta(tile, _terraform_size, _terraform_size);
405 if (ta.
w == 0 || ta.
h == 0)
return;
432 static const int8 _multi_terraform_coords[][2] = {
434 { 4, 0}, { -4, 0}, { 0, 2},
435 { -8, 2}, { -4, 4}, { 0, 6}, { 4, 4}, { 8, 2},
436 {-12, 0}, { -8, -2}, { -4, -4}, { 0, -6}, { 4, -4}, { 8, -2}, { 12, 0},
437 {-16, 2}, {-12, 4}, { -8, 6}, { -4, 8}, { 0, 10}, { 4, 8}, { 8, 6}, { 12, 4}, { 16, 2},
438 {-20, 0}, {-16, -2}, {-12, -4}, { -8, -6}, { -4, -8}, { 0,-10}, { 4, -8}, { 8, -6}, { 12, -4}, { 16, -2}, { 20, 0},
439 {-24, 2}, {-20, 4}, {-16, 6}, {-12, 8}, { -8, 10}, { -4, 12}, { 0, 14}, { 4, 12}, { 8, 10}, { 12, 8}, { 16, 6}, { 20, 4}, { 24, 2},
440 {-28, 0}, {-24, -2}, {-20, -4}, {-16, -6}, {-12, -8}, { -8,-10}, { -4,-12}, { 0,-14}, { 4,-12}, { 8,-10}, { 12, -8}, { 16, -6}, { 20, -4}, { 24, -2}, { 28, 0},
443 static const NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
456 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_DOWN, STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND),
458 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_UP, STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND),
460 SetFill(0, 1),
SetDataTip(SPR_IMG_LEVEL_LAND, STR_LANDSCAPING_LEVEL_LAND_TOOLTIP),
462 SetFill(0, 1),
SetDataTip(SPR_IMG_ROCKS, STR_TERRAFORM_TOOLTIP_PLACE_ROCKY_AREAS_ON_LANDSCAPE),
465 SetFill(0, 1),
SetDataTip(SPR_IMG_DESERT, STR_TERRAFORM_TOOLTIP_DEFINE_DESERT_AREA),
468 SetFill(0, 1),
SetDataTip(SPR_IMG_TRANSMITTER, STR_SCENEDIT_TOOLBAR_PLACE_OBJECT),
506 FOR_ALL_COMPANIES(c) {
515 FOR_ALL_BASE_STATIONS(st) {
555 size->height = max<uint>(size->height,
ScaleGUITrad(31));
562 int center_x =
RoundDivSU(r.left + r.right, 2);
563 int center_y =
RoundDivSU(r.top + r.bottom, 2);
565 int n = _terraform_size * _terraform_size;
566 const int8 *coords = &_multi_terraform_coords[0][0];
618 size += _terraform_size;
621 _terraform_size = size;
637 default: NOT_REACHED();
679 default: NOT_REACHED();
691 switch (select_proc) {
692 default: NOT_REACHED();
727 static Hotkey terraform_editor_hotkeys[] = {
741 WDP_AUTO,
"toolbar_landscape_scen", 0, 0,
744 _nested_scen_edit_land_gen_widgets,
lengthof(_nested_scen_edit_land_gen_widgets),
745 &ScenarioEditorLandscapeGenerationWindow::hotkeys
754 return AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);