mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
Feature: Purchase land multiple tiles at a time
This commit is contained in:
parent
8e6ed8d5e9
commit
f7eb0ffc37
@ -87,7 +87,7 @@ struct CompanyProperties {
|
|||||||
uint32 terraform_limit; ///< Amount of tileheights we can (still) terraform (times 65536).
|
uint32 terraform_limit; ///< Amount of tileheights we can (still) terraform (times 65536).
|
||||||
uint32 clear_limit; ///< Amount of tiles we can (still) clear (times 65536).
|
uint32 clear_limit; ///< Amount of tiles we can (still) clear (times 65536).
|
||||||
uint32 tree_limit; ///< Amount of trees we can (still) plant (times 65536).
|
uint32 tree_limit; ///< Amount of trees we can (still) plant (times 65536).
|
||||||
uint32 build_object_limit; ///< Amount of tiles we can (still) build objects on (times 65536).
|
uint32 build_object_limit; ///< Amount of tiles we can (still) build objects on (times 65536). Also applies to buying land.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If \c true, the company is (also) controlled by the computer (a NoAI program).
|
* If \c true, the company is (also) controlled by the computer (a NoAI program).
|
||||||
|
@ -2812,7 +2812,7 @@ STR_LANDSCAPING_TOOLBAR :{WHITE}Landscap
|
|||||||
STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND :{BLACK}Lower a corner of land. Dragging lowers the first selected corner and levels the selected area to the new corner height. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
STR_LANDSCAPING_TOOLTIP_LOWER_A_CORNER_OF_LAND :{BLACK}Lower a corner of land. Dragging lowers the first selected corner and levels the selected area to the new corner height. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
||||||
STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND :{BLACK}Raise a corner of land. Dragging raises the first selected corner and levels the selected area to the new corner height. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
STR_LANDSCAPING_TOOLTIP_RAISE_A_CORNER_OF_LAND :{BLACK}Raise a corner of land. Dragging raises the first selected corner and levels the selected area to the new corner height. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
||||||
STR_LANDSCAPING_LEVEL_LAND_TOOLTIP :{BLACK}Level an area of land to the height of the first selected corner. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
STR_LANDSCAPING_LEVEL_LAND_TOOLTIP :{BLACK}Level an area of land to the height of the first selected corner. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
||||||
STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Purchase land for future use. Shift toggles building/showing cost estimate
|
STR_LANDSCAPING_TOOLTIP_PURCHASE_LAND :{BLACK}Purchase land for future use. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
|
||||||
|
|
||||||
# Object construction window
|
# Object construction window
|
||||||
STR_OBJECT_BUILD_CAPTION :{WHITE}Object Selection
|
STR_OBJECT_BUILD_CAPTION :{WHITE}Object Selection
|
||||||
|
@ -355,8 +355,8 @@ struct ConstructionSettings {
|
|||||||
uint16 clear_frame_burst; ///< how many tiles may, over a short period, be cleared?
|
uint16 clear_frame_burst; ///< how many tiles may, over a short period, be cleared?
|
||||||
uint32 tree_per_64k_frames; ///< how many trees may, over a long period, be planted per 65536 frames?
|
uint32 tree_per_64k_frames; ///< how many trees may, over a long period, be planted per 65536 frames?
|
||||||
uint16 tree_frame_burst; ///< how many trees may, over a short period, be planted?
|
uint16 tree_frame_burst; ///< how many trees may, over a short period, be planted?
|
||||||
uint32 build_object_per_64k_frames; ///< how many tiles may, over a long period, have objects built on them per 65536 frames?
|
uint32 build_object_per_64k_frames; ///< how many tiles may, over a long period, be purchased or have objects built on them per 65536 frames?
|
||||||
uint16 build_object_frame_burst; ///< how many tiles may, over a short period, have objects built on them?
|
uint16 build_object_frame_burst; ///< how many tiles may, over a short period, be purchased or have objects built on them?
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Settings related to the AI. */
|
/** Settings related to the AI. */
|
||||||
|
@ -201,7 +201,7 @@ struct TerraformToolbarWindow : Window {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_TT_BUY_LAND: // Buy land button
|
case WID_TT_BUY_LAND: // Buy land button
|
||||||
HandlePlacePushButton(this, WID_TT_BUY_LAND, SPR_CURSOR_BUY_LAND, HT_RECT);
|
HandlePlacePushButton(this, WID_TT_BUY_LAND, SPR_CURSOR_BUY_LAND, HT_RECT | HT_DIAGONAL);
|
||||||
this->last_user_action = widget;
|
this->last_user_action = widget;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ struct TerraformToolbarWindow : Window {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_TT_BUY_LAND: // Buy land button
|
case WID_TT_BUY_LAND: // Buy land button
|
||||||
Command<CMD_BUILD_OBJECT>::Post(STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL, tile, OBJECT_OWNED_LAND, 0);
|
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_BUILD_OBJECT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_TT_PLACE_SIGN: // Place sign button
|
case WID_TT_PLACE_SIGN: // Place sign button
|
||||||
@ -276,6 +276,16 @@ struct TerraformToolbarWindow : Window {
|
|||||||
case DDSP_LEVEL_AREA:
|
case DDSP_LEVEL_AREA:
|
||||||
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
|
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
|
||||||
break;
|
break;
|
||||||
|
case DDSP_BUILD_OBJECT:
|
||||||
|
if (!_settings_game.construction.freeform_edges) {
|
||||||
|
/* When end_tile is MP_VOID, the error tile will not be visible to the
|
||||||
|
* user. This happens when terraforming at the southern border. */
|
||||||
|
if (TileX(end_tile) == MapMaxX()) end_tile += TileDiffXY(-1, 0);
|
||||||
|
if (TileY(end_tile) == MapMaxY()) end_tile += TileDiffXY(0, -1);
|
||||||
|
}
|
||||||
|
Command<CMD_BUILD_OBJECT_AREA>::Post(STR_ERROR_CAN_T_PURCHASE_THIS_LAND, CcPlaySound_CONSTRUCTION_RAIL,
|
||||||
|
end_tile, start_tile, OBJECT_OWNED_LAND, 0, (_ctrl_pressed ? true : false));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user