4 * This file is part of OpenTTD.
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
10 /** @file object_gui.cpp The GUI for objects. */
13 #include "command_func.h"
15 #include "newgrf_object.h"
16 #include "newgrf_text.h"
17 #include "strings_func.h"
18 #include "viewport_func.h"
19 #include "window_gui.h"
20 #include "window_func.h"
22 #include "widgets/object_widget.h"
24 #include "table/strings.h"
26 static ObjectClassID _selected_object_class
; ///< the currently visible object class
27 static int _selected_object_index
; ///< the index of the selected object in the current class or -1
28 static uint8 _selected_object_view
; ///< the view of the selected object
29 static uint _matrix_col_count
; ///< Number of columns of the object type matrix
30 static uint _list_row_count
; ///< Number of rows of the object class list
32 /** The window used for building objects. */
33 class BuildObjectWindow
: public PickerWindowBase
{
34 static const int OBJECT_MARGIN
= 4; ///< The margin (in pixels) around an object.
35 int line_height
; ///< The height of a single line.
36 int info_height
; ///< The height of the info box.
37 Scrollbar
*vscroll
; ///< The scrollbar.
39 /** Scroll #WID_BO_CLASS_LIST so that the selected object class is visible. */
40 void EnsureSelectedObjectClassIsVisible()
43 for (int i
= 0; i
< _selected_object_class
; i
++) {
44 if (ObjectClass::Get((ObjectClassID
) i
)->GetUISpecCount() == 0) continue;
47 this->vscroll
->ScrollTowards(pos
);
51 * Tests whether the previously selected object can be selected.
52 * @return \c true if the selected object is available, \c false otherwise.
54 bool CanRestoreSelectedObject()
56 if (_selected_object_index
== -1) return false;
58 ObjectClass
*sel_objclass
= ObjectClass::Get(_selected_object_class
);
59 if ((int)sel_objclass
->GetSpecCount() <= _selected_object_index
) return false;
61 return sel_objclass
->GetSpec(_selected_object_index
)->IsAvailable();
65 * Calculate the number of columns of the #WID_BO_SELECT_MATRIX widget.
66 * @return Number of columns in the matrix.
68 uint
GetMatrixColumnCount()
70 const NWidgetBase
*matrix
= this->GetWidget
<NWidgetBase
>(WID_BO_SELECT_MATRIX
);
71 return 1 + (matrix
->current_x
- matrix
->smallest_x
) / matrix
->resize_x
;
75 BuildObjectWindow(WindowDesc
*desc
, Window
*w
) : PickerWindowBase(desc
, w
), info_height(1)
77 this->CreateNestedTree();
79 this->vscroll
= this->GetScrollbar(WID_BO_SCROLLBAR
);
80 this->vscroll
->SetCapacity(5);
81 this->vscroll
->SetPosition(0);
82 this->vscroll
->SetCount(ObjectClass::GetUIClassCount());
84 this->FinishInitNested(0);
86 if (this->CanRestoreSelectedObject()) {
87 this->SelectOtherObject(_selected_object_index
);
89 this->SelectFirstAvailableObject(true);
91 assert(ObjectClass::Get(_selected_object_class
)->GetUISpecCount() > 0); // object GUI should be disables elsewise
92 this->EnsureSelectedObjectClassIsVisible();
93 this->GetWidget
<NWidgetMatrix
>(WID_BO_OBJECT_MATRIX
)->SetCount(4);
95 NWidgetMatrix
*matrix
= this->GetWidget
<NWidgetMatrix
>(WID_BO_SELECT_MATRIX
);
96 matrix
->SetScrollbar(this->GetScrollbar(WID_BO_SELECT_SCROLL
));
97 matrix
->SetCount(ObjectClass::Get(_selected_object_class
)->GetUISpecCount());
99 /* If needed restore the window previous size with the stored values.*/
100 uint default_num_cols
= this->GetMatrixColumnCount();
101 uint default_num_rows
= this->vscroll
->GetCapacity();
102 int delta_x
= (_matrix_col_count
> default_num_cols
) ? (_matrix_col_count
- default_num_cols
) * this->resize
.step_width
: 0;
103 int delta_y
= (_list_row_count
> default_num_rows
) ? (_list_row_count
- default_num_rows
) * this->resize
.step_height
: 0;
104 if (delta_x
> 0 || delta_y
> 0) {
105 ResizeWindow(this, delta_x
, delta_y
, false);
106 /* The window may be linked to the toolbars, thus positioned at the left-bottom of the toolbars.
107 * If the resized window is wider than the toolbars, its position need te be adjusted to ensure all
108 * matrix columns are visible. */
109 this->FindWindowPlacementAndResize(this->width
, this->height
);
112 if (_selected_object_index
!= -1) matrix
->SetClicked(_selected_object_index
);
115 virtual ~BuildObjectWindow()
117 /* Store the number of columns of the object type matrix and the number of rows of the object class list
118 * to restore them on the next window invocation. */
119 _matrix_col_count
= this->GetMatrixColumnCount();
120 _list_row_count
= this->vscroll
->GetCapacity();
123 virtual void SetStringParameters(int widget
) const
126 case WID_BO_OBJECT_NAME
: {
127 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
128 SetDParam(0, spec
!= NULL
? spec
->name
: STR_EMPTY
);
132 case WID_BO_OBJECT_SIZE
: {
133 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
134 int size
= spec
== NULL
? 0 : spec
->size
;
135 SetDParam(0, GB(size
, HasBit(_selected_object_view
, 0) ? 4 : 0, 4));
136 SetDParam(1, GB(size
, HasBit(_selected_object_view
, 0) ? 0 : 4, 4));
144 virtual void UpdateWidgetSize(int widget
, Dimension
*size
, const Dimension
&padding
, Dimension
*fill
, Dimension
*resize
)
147 case WID_BO_CLASS_LIST
: {
148 for (uint i
= 0; i
< ObjectClass::GetClassCount(); i
++) {
149 ObjectClass
*objclass
= ObjectClass::Get((ObjectClassID
)i
);
150 if (objclass
->GetUISpecCount() == 0) continue;
151 size
->width
= max(size
->width
, GetStringBoundingBox(objclass
->name
).width
);
153 size
->width
+= padding
.width
;
154 this->line_height
= FONT_HEIGHT_NORMAL
+ WD_MATRIX_TOP
+ WD_MATRIX_BOTTOM
;
155 resize
->height
= this->line_height
;
156 size
->height
= this->vscroll
->GetCapacity() * this->line_height
;
160 case WID_BO_OBJECT_NAME
:
161 case WID_BO_OBJECT_SIZE
:
162 /* We do not want the window to resize when selecting objects; better clip texts */
166 case WID_BO_OBJECT_MATRIX
: {
167 /* Get the right amount of buttons based on the current spec. */
168 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
170 if (spec
->views
>= 2) size
->width
+= resize
->width
;
171 if (spec
->views
>= 4) size
->height
+= resize
->height
;
178 case WID_BO_OBJECT_SPRITE
: {
179 bool two_wide
= false; // Whether there will be two widgets next to each other in the matrix or not.
180 int height
[2] = {0, 0}; // The height for the different views; in this case views 1/2 and 4.
182 /* Get the height and view information. */
183 for (int i
= 0; i
< NUM_OBJECTS
; i
++) {
184 const ObjectSpec
*spec
= ObjectSpec::Get(i
);
185 if (!spec
->IsEverAvailable()) continue;
186 two_wide
|= spec
->views
>= 2;
187 height
[spec
->views
/ 4] = max
<int>(ObjectSpec::Get(i
)->height
, height
[spec
->views
/ 4]);
190 /* Determine the pixel heights. */
191 for (size_t i
= 0; i
< lengthof(height
); i
++) {
192 height
[i
] *= TILE_HEIGHT
;
193 height
[i
] += TILE_PIXELS
+ 2 * OBJECT_MARGIN
;
196 /* Now determine the size of the minimum widgets. When there are two columns, then
197 * we want these columns to be slightly less wide. When there are two rows, then
198 * determine the size of the widgets based on the maximum size for a single row
199 * of widgets, or just the twice the widget height of the two row ones. */
200 size
->height
= max(height
[0], height
[1] * 2 + 2);
202 size
->width
= (3 * TILE_PIXELS
+ 2 * OBJECT_MARGIN
) * 2 + 2;
204 size
->width
= 4 * TILE_PIXELS
+ 2 * OBJECT_MARGIN
;
207 /* Get the right size for the single widget based on the current spec. */
208 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
210 if (spec
->views
>= 2) size
->width
= size
->width
/ 2 - 1;
211 if (spec
->views
>= 4) size
->height
= size
->height
/ 2 - 1;
217 size
->height
= this->info_height
;
220 case WID_BO_SELECT_MATRIX
:
229 virtual void DrawWidget(const Rect
&r
, int widget
) const
231 switch (GB(widget
, 0, 16)) {
232 case WID_BO_CLASS_LIST
: {
235 for (uint i
= 0; i
< ObjectClass::GetClassCount(); i
++) {
236 ObjectClass
*objclass
= ObjectClass::Get((ObjectClassID
)i
);
237 if (objclass
->GetUISpecCount() == 0) continue;
238 if (!this->vscroll
->IsVisible(pos
++)) continue;
239 SetDParam(0, objclass
->name
);
240 DrawString(r
.left
+ WD_MATRIX_LEFT
, r
.right
+ WD_MATRIX_RIGHT
, y
+ WD_MATRIX_TOP
, STR_JUST_STRING
,
241 ((int)i
== _selected_object_class
) ? TC_WHITE
: TC_BLACK
);
242 y
+= this->line_height
;
247 case WID_BO_OBJECT_SPRITE
: {
248 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
249 if (spec
== NULL
) break;
251 /* Height of the selection matrix.
252 * Depending on the number of views, the matrix has a 1x1, 1x2, 2x1 or 2x2 layout. To make the previews
253 * look nice in all layouts, we use the 4x4 layout (smallest previews) as starting point. For the bigger
254 * previews in the layouts with less views we add space homogeneously on all sides, so the 4x4 preview-rectangle
255 * is centered in the 2x1, 1x2 resp. 1x1 buttons. */
256 uint matrix_height
= this->GetWidget
<NWidgetMatrix
>(WID_BO_OBJECT_MATRIX
)->current_y
;
258 DrawPixelInfo tmp_dpi
;
259 /* Set up a clipping area for the preview. */
260 if (FillDrawPixelInfo(&tmp_dpi
, r
.left
, r
.top
, r
.right
- r
.left
+ 1, r
.bottom
- r
.top
+ 1)) {
261 DrawPixelInfo
*old_dpi
= _cur_dpi
;
263 if (spec
->grf_prop
.grffile
== NULL
) {
264 extern const DrawTileSprites _objects
[];
265 const DrawTileSprites
*dts
= &_objects
[spec
->grf_prop
.local_id
];
266 DrawOrigTileSeqInGUI((r
.right
- r
.left
) / 2 - 1, (r
.bottom
- r
.top
+ matrix_height
/ 2) / 2 - OBJECT_MARGIN
- TILE_PIXELS
, dts
, PAL_NONE
);
268 DrawNewObjectTileInGUI((r
.right
- r
.left
) / 2 - 1, (r
.bottom
- r
.top
+ matrix_height
/ 2) / 2 - OBJECT_MARGIN
- TILE_PIXELS
, spec
, GB(widget
, 16, 16));
275 case WID_BO_SELECT_IMAGE
: {
276 ObjectClass
*objclass
= ObjectClass::Get(_selected_object_class
);
277 int obj_index
= objclass
->GetIndexFromUI(GB(widget
, 16, 16));
278 if (obj_index
< 0) break;
279 const ObjectSpec
*spec
= objclass
->GetSpec(obj_index
);
280 if (spec
== NULL
) break;
282 if (!spec
->IsAvailable()) {
283 GfxFillRect(r
.left
+ 1, r
.top
+ 1, r
.right
- 1, r
.bottom
- 1, PC_BLACK
, FILLRECT_CHECKER
);
285 DrawPixelInfo tmp_dpi
;
286 /* Set up a clipping area for the preview. */
287 if (FillDrawPixelInfo(&tmp_dpi
, r
.left
+ 1, r
.top
, (r
.right
- 1) - (r
.left
+ 1) + 1, r
.bottom
- r
.top
+ 1)) {
288 DrawPixelInfo
*old_dpi
= _cur_dpi
;
290 if (spec
->grf_prop
.grffile
== NULL
) {
291 extern const DrawTileSprites _objects
[];
292 const DrawTileSprites
*dts
= &_objects
[spec
->grf_prop
.local_id
];
293 DrawOrigTileSeqInGUI((r
.right
- r
.left
) / 2 - 1, r
.bottom
- r
.top
- OBJECT_MARGIN
- TILE_PIXELS
, dts
, PAL_NONE
);
295 DrawNewObjectTileInGUI((r
.right
- r
.left
) / 2 - 1, r
.bottom
- r
.top
- OBJECT_MARGIN
- TILE_PIXELS
, spec
,
296 min(_selected_object_view
, spec
->views
- 1));
304 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
305 if (spec
== NULL
) break;
307 /* Get the extra message for the GUI */
308 if (HasBit(spec
->callback_mask
, CBM_OBJ_FUND_MORE_TEXT
)) {
309 uint16 callback_res
= GetObjectCallback(CBID_OBJECT_FUND_MORE_TEXT
, 0, 0, spec
, NULL
, INVALID_TILE
, _selected_object_view
);
310 if (callback_res
!= CALLBACK_FAILED
&& callback_res
!= 0x400) {
311 if (callback_res
> 0x400) {
312 ErrorUnknownCallbackResult(spec
->grf_prop
.grffile
->grfid
, CBID_OBJECT_FUND_MORE_TEXT
, callback_res
);
314 StringID message
= GetGRFStringID(spec
->grf_prop
.grffile
->grfid
, 0xD000 + callback_res
);
315 if (message
!= STR_NULL
&& message
!= STR_UNDEFINED
) {
316 StartTextRefStackUsage(6);
317 /* Use all the available space left from where we stand up to the
318 * end of the window. We ALSO enlarge the window if needed, so we
319 * can 'go' wild with the bottom of the window. */
320 int y
= DrawStringMultiLine(r
.left
, r
.right
, r
.top
, UINT16_MAX
, message
, TC_ORANGE
) - r
.top
;
321 StopTextRefStackUsage();
322 if (y
> this->info_height
) {
323 BuildObjectWindow
*bow
= const_cast<BuildObjectWindow
*>(this);
324 bow
->info_height
= y
+ 2;
336 * Select the specified object in #_selected_object_class class.
337 * @param object_index Object index to select, \c -1 means select nothing.
339 void SelectOtherObject(int object_index
)
341 _selected_object_index
= object_index
;
342 if (_selected_object_index
!= -1) {
343 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
344 _selected_object_view
= min(_selected_object_view
, spec
->views
- 1);
347 _selected_object_view
= 0;
350 this->GetWidget
<NWidgetMatrix
>(WID_BO_OBJECT_MATRIX
)->SetClicked(_selected_object_view
);
351 this->GetWidget
<NWidgetMatrix
>(WID_BO_SELECT_MATRIX
)->SetClicked(_selected_object_index
!= -1 ? ObjectClass::Get(_selected_object_class
)->GetUIFromIndex(_selected_object_index
) : -1);
352 this->UpdateSelectSize();
356 void UpdateSelectSize()
358 if (_selected_object_index
== -1) {
359 SetTileSelectSize(1, 1);
361 const ObjectSpec
*spec
= ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
);
362 int w
= GB(spec
->size
, HasBit(_selected_object_view
, 0) ? 4 : 0, 4);
363 int h
= GB(spec
->size
, HasBit(_selected_object_view
, 0) ? 0 : 4, 4);
364 SetTileSelectSize(w
, h
);
368 virtual void OnResize()
370 this->vscroll
->SetCapacityFromWidget(this, WID_BO_CLASS_LIST
);
371 this->GetWidget
<NWidgetCore
>(WID_BO_CLASS_LIST
)->widget_data
= (this->vscroll
->GetCapacity() << MAT_ROW_START
) + (1 << MAT_COL_START
);
374 virtual void OnClick(Point pt
, int widget
, int click_count
)
376 switch (GB(widget
, 0, 16)) {
377 case WID_BO_CLASS_LIST
: {
378 int num_clicked
= this->vscroll
->GetPosition() + (pt
.y
- this->nested_array
[widget
]->pos_y
) / this->line_height
;
379 if (num_clicked
>= (int)ObjectClass::GetUIClassCount()) break;
381 _selected_object_class
= ObjectClass::GetUIClass(num_clicked
);
382 this->GetWidget
<NWidgetMatrix
>(WID_BO_SELECT_MATRIX
)->SetCount(ObjectClass::Get(_selected_object_class
)->GetUISpecCount());
383 this->SelectFirstAvailableObject(false);
387 case WID_BO_SELECT_IMAGE
: {
388 ObjectClass
*objclass
= ObjectClass::Get(_selected_object_class
);
389 int num_clicked
= objclass
->GetIndexFromUI(GB(widget
, 16, 16));
390 if (num_clicked
>= 0 && objclass
->GetSpec(num_clicked
)->IsAvailable()) this->SelectOtherObject(num_clicked
);
394 case WID_BO_OBJECT_SPRITE
:
395 if (_selected_object_index
!= -1) {
396 _selected_object_view
= GB(widget
, 16, 16);
397 this->GetWidget
<NWidgetMatrix
>(WID_BO_OBJECT_MATRIX
)->SetClicked(_selected_object_view
);
398 this->UpdateSelectSize();
406 * Select the first available object.
407 * @param change_class If true, change the class if no object in the current
408 * class is available.
410 void SelectFirstAvailableObject(bool change_class
)
412 /* First try to select an object in the selected class. */
413 ObjectClass
*sel_objclass
= ObjectClass::Get(_selected_object_class
);
414 for (uint i
= 0; i
< sel_objclass
->GetSpecCount(); i
++) {
415 const ObjectSpec
*spec
= sel_objclass
->GetSpec(i
);
416 if (spec
->IsAvailable()) {
417 this->SelectOtherObject(i
);
422 /* If that fails, select the first available object
423 * from a random class. */
424 for (ObjectClassID j
= OBJECT_CLASS_BEGIN
; j
< OBJECT_CLASS_MAX
; j
++) {
425 ObjectClass
*objclass
= ObjectClass::Get(j
);
426 for (uint i
= 0; i
< objclass
->GetSpecCount(); i
++) {
427 const ObjectSpec
*spec
= objclass
->GetSpec(i
);
428 if (spec
->IsAvailable()) {
429 _selected_object_class
= j
;
430 this->SelectOtherObject(i
);
436 /* If all objects are unavailable, select nothing... */
437 if (ObjectClass::Get(_selected_object_class
)->GetUISpecCount() == 0) {
438 /* ... but make sure that the class is not empty. */
439 for (ObjectClassID j
= OBJECT_CLASS_BEGIN
; j
< OBJECT_CLASS_MAX
; j
++) {
440 if (ObjectClass::Get(j
)->GetUISpecCount() > 0) {
441 _selected_object_class
= j
;
446 this->SelectOtherObject(-1);
450 static const NWidgetPart _nested_build_object_widgets
[] = {
451 NWidget(NWID_HORIZONTAL
),
452 NWidget(WWT_CLOSEBOX
, COLOUR_DARK_GREEN
),
453 NWidget(WWT_CAPTION
, COLOUR_DARK_GREEN
), SetDataTip(STR_OBJECT_BUILD_CAPTION
, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS
),
455 NWidget(WWT_PANEL
, COLOUR_DARK_GREEN
),
456 NWidget(NWID_HORIZONTAL
), SetPadding(2, 0, 0, 0),
457 NWidget(NWID_VERTICAL
),
458 NWidget(NWID_HORIZONTAL
), SetPadding(0, 5, 2, 5),
459 NWidget(WWT_MATRIX
, COLOUR_GREY
, WID_BO_CLASS_LIST
), SetFill(1, 0), SetDataTip(0x501, STR_OBJECT_BUILD_CLASS_TOOLTIP
), SetScrollbar(WID_BO_SCROLLBAR
),
460 NWidget(NWID_VSCROLLBAR
, COLOUR_GREY
, WID_BO_SCROLLBAR
),
462 NWidget(NWID_HORIZONTAL
), SetPadding(0, 5, 0, 5),
463 NWidget(NWID_MATRIX
, COLOUR_DARK_GREEN
, WID_BO_OBJECT_MATRIX
), SetPIP(0, 2, 0),
464 NWidget(WWT_PANEL
, COLOUR_GREY
, WID_BO_OBJECT_SPRITE
), SetDataTip(0x0, STR_OBJECT_BUILD_PREVIEW_TOOLTIP
), EndContainer(),
467 NWidget(WWT_TEXT
, COLOUR_DARK_GREEN
, WID_BO_OBJECT_NAME
), SetDataTip(STR_ORANGE_STRING
, STR_NULL
), SetPadding(2, 5, 2, 5),
468 NWidget(WWT_TEXT
, COLOUR_DARK_GREEN
, WID_BO_OBJECT_SIZE
), SetDataTip(STR_OBJECT_BUILD_SIZE
, STR_NULL
), SetPadding(2, 5, 2, 5),
470 NWidget(WWT_PANEL
, COLOUR_DARK_GREEN
), SetScrollbar(WID_BO_SELECT_SCROLL
),
471 NWidget(NWID_HORIZONTAL
),
472 NWidget(NWID_MATRIX
, COLOUR_DARK_GREEN
, WID_BO_SELECT_MATRIX
), SetFill(0, 1), SetPIP(0, 2, 0),
473 NWidget(WWT_PANEL
, COLOUR_DARK_GREEN
, WID_BO_SELECT_IMAGE
), SetMinimalSize(66, 60), SetDataTip(0x0, STR_OBJECT_BUILD_TOOLTIP
),
474 SetFill(0, 0), SetResize(0, 0), SetScrollbar(WID_BO_SELECT_SCROLL
),
477 NWidget(NWID_VSCROLLBAR
, COLOUR_DARK_GREEN
, WID_BO_SELECT_SCROLL
),
481 NWidget(NWID_HORIZONTAL
),
482 NWidget(WWT_EMPTY
, INVALID_COLOUR
, WID_BO_INFO
), SetPadding(2, 5, 0, 5), SetFill(1, 0), SetResize(1, 0),
483 NWidget(NWID_VERTICAL
),
484 NWidget(WWT_PANEL
, COLOUR_DARK_GREEN
), SetFill(0, 1), EndContainer(),
485 NWidget(WWT_RESIZEBOX
, COLOUR_DARK_GREEN
),
491 static WindowDesc
_build_object_desc(
493 WC_BUILD_OBJECT
, WC_BUILD_TOOLBAR
,
495 _nested_build_object_widgets
, lengthof(_nested_build_object_widgets
)
499 * Show our object picker.
500 * @param w The toolbar window we're associated with.
502 void ShowBuildObjectPicker(Window
*w
)
504 new BuildObjectWindow(&_build_object_desc
, w
);
507 /** Reset all data of the object GUI. */
508 void InitializeObjectGui()
510 _selected_object_class
= (ObjectClassID
)0;
514 * PlaceProc function, called when someone pressed the button if the
515 * object-tool is selected
516 * @param tile on which to place the object
518 void PlaceProc_Object(TileIndex tile
)
520 DoCommandP(tile
, ObjectClass::Get(_selected_object_class
)->GetSpec(_selected_object_index
)->Index(), _selected_object_view
, CMD_BUILD_OBJECT
| CMD_MSG(STR_ERROR_CAN_T_BUILD_OBJECT
), CcTerraform
);