39 #include "table/strings.h"
57 if (_game_mode != GM_EDITOR)
return;
74 if (_game_mode != GM_EDITOR)
return;
204 ShowBuildTreesToolbar();
214 if (ObjectClass::GetUIClassCount() == 0)
return;
221 default: NOT_REACHED();
256 default: NOT_REACHED();
275 switch (select_proc) {
276 default: NOT_REACHED();
309 static Hotkey terraform_hotkeys[] = {
322 static const NWidgetPart _nested_terraform_widgets[] = {
330 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_DOWN, STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND),
332 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_UP, STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND),
334 SetFill(0, 1),
SetDataTip(SPR_IMG_LEVEL_LAND, STR_LANDSCAPING_LEVEL_LAND_TOOLTIP),
341 SetFill(0, 1),
SetDataTip(SPR_IMG_BUY_LAND, STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND),
348 SetFill(0, 1),
SetDataTip(SPR_IMG_TRANSMITTER, STR_SCENEDIT_TOOLBAR_PLACE_OBJECT),
357 _nested_terraform_widgets,
lengthof(_nested_terraform_widgets),
358 &TerraformToolbarWindow::hotkeys
372 w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
378 w = AllocateWindowDescFront<TerraformToolbarWindow>(&_terraform_desc, 0);
390 static byte _terraform_size = 1;
403 if (_terraform_size == 1) {
405 mode ? STR_ERROR_CAN_T_RAISE_LAND_HERE : STR_ERROR_CAN_T_LOWER_LAND_HERE;
409 assert(_terraform_size != 0);
410 TileArea ta(tile, _terraform_size, _terraform_size);
413 if (ta.
w == 0 || ta.
h == 0)
return;
440 static const int8 _multi_terraform_coords[][2] = {
442 { 4, 0}, { -4, 0}, { 0, 2},
443 { -8, 2}, { -4, 4}, { 0, 6}, { 4, 4}, { 8, 2},
444 {-12, 0}, { -8, -2}, { -4, -4}, { 0, -6}, { 4, -4}, { 8, -2}, { 12, 0},
445 {-16, 2}, {-12, 4}, { -8, 6}, { -4, 8}, { 0, 10}, { 4, 8}, { 8, 6}, { 12, 4}, { 16, 2},
446 {-20, 0}, {-16, -2}, {-12, -4}, { -8, -6}, { -4, -8}, { 0,-10}, { 4, -8}, { 8, -6}, { 12, -4}, { 16, -2}, { 20, 0},
447 {-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},
448 {-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},
451 static const NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
464 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_DOWN, STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND),
466 SetFill(0, 1),
SetDataTip(SPR_IMG_TERRAFORM_UP, STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND),
468 SetFill(0, 1),
SetDataTip(SPR_IMG_LEVEL_LAND, STR_LANDSCAPING_LEVEL_LAND_TOOLTIP),
470 SetFill(0, 1),
SetDataTip(SPR_IMG_ROCKS, STR_TERRAFORM_TOOLTIP_PLACE_ROCKY_AREAS_ON_LANDSCAPE),
473 SetFill(0, 1),
SetDataTip(SPR_IMG_DESERT, STR_TERRAFORM_TOOLTIP_DEFINE_DESERT_AREA),
476 SetFill(0, 1),
SetDataTip(SPR_IMG_TRANSMITTER, STR_SCENEDIT_TOOLBAR_PLACE_OBJECT),
514 FOR_ALL_COMPANIES(c) {
523 FOR_ALL_BASE_STATIONS(st) {
563 size->height = max<uint>(size->height,
ScaleGUITrad(31));
570 int center_x =
RoundDivSU(r.left + r.right, 2);
571 int center_y =
RoundDivSU(r.top + r.bottom, 2);
573 int n = _terraform_size * _terraform_size;
574 const int8 *coords = &_multi_terraform_coords[0][0];
629 size += _terraform_size;
632 _terraform_size = size;
648 default: NOT_REACHED();
694 default: NOT_REACHED();
706 switch (select_proc) {
707 default: NOT_REACHED();
743 static Hotkey terraform_editor_hotkeys[] = {
757 WDP_AUTO,
"toolbar_landscape_scen", 0, 0,
760 _nested_scen_edit_land_gen_widgets,
lengthof(_nested_scen_edit_land_gen_widgets),
761 &ScenarioEditorLandscapeGenerationWindow::hotkeys
770 return AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);