OpenTTD: src/object_gui.cpp File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Functions | Variables
object_gui.cpp File Reference

The GUI for objects. More...

`#include "stdafx.h"`
`#include "command_func.h"`
`#include "newgrf.h"`
`#include "newgrf_object.h"`
`#include "newgrf_text.h"`
`#include "strings_func.h"`
`#include "viewport_func.h"`
`#include "window_gui.h"`
`#include "window_func.h"`
`#include "zoom_func.h"`
`#include "widgets/object_widget.h"`
`#include "table/strings.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Data Structures
class | BuildObjectWindow
| The window used for building objects. More...

## Functions
void | ShowBuildObjectPicker (Window *w)
| Show our object picker.
void | InitializeObjectGui ()
| Reset all data of the object GUI.
void | PlaceProc_Object (TileIndex tile)
| PlaceProc function, called when someone pressed the button if the object-tool is selected.

## Variables
static ObjectClassID | _selected_object_class
| the currently visible object class
static int | _selected_object_index
| the index of the selected object in the current class or -1
static uint8 | _selected_object_view
| the view of the selected object
static const NWidgetPart | _nested_build_object_widgets []
static WindowDesc | _build_object_desc (WDP_AUTO,"build_object", 0, 0, WC_BUILD_OBJECT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, _nested_build_object_widgets, lengthof(_nested_build_object_widgets))

## Detailed Description

The GUI for objects.

Definition in file object_gui.cpp.

## Function Documentation

void InitializeObjectGui | ( |  | ) |

Reset all data of the object GUI.

Definition at line 497 of file object_gui.cpp.

References _selected_object_class.

void PlaceProc_Object | ( | TileIndex | tile | ) |

PlaceProc function, called when someone pressed the button if the object-tool is selected.

Parameters

  tile | on which to place the object

Definition at line 507 of file object_gui.cpp.

References _selected_object_class, _selected_object_index, _selected_object_view, CMD_BUILD_OBJECT, CMD_MSG, DoCommandP(), and NewGRFClass< Tspec, Tid, Tmax >::Get().

Referenced by TerraformToolbarWindow::OnPlaceObject(), and ScenarioEditorLandscapeGenerationWindow::OnPlaceObject().

void ShowBuildObjectPicker | ( | Window * | w | ) |

Show our object picker.

Parameters

  w | The toolbar window we're associated with.

Definition at line 491 of file object_gui.cpp.

Referenced by TerraformToolbarWindow::OnClick(), and ScenarioEditorLandscapeGenerationWindow::OnClick().