OpenTTD Source 20241224-master-gf74b0cf984
|
Helper class to wrap some functionality/queries in. More...
Public Member Functions | |
virtual | ~NIHelper ()=default |
Silence a warning. | |
virtual bool | IsInspectable (uint index) const =0 |
Is the item with the given index inspectable? | |
virtual uint | GetParent (uint index) const =0 |
Get the parent "window_number" of a given instance. | |
virtual const void * | GetInstance (uint index) const =0 |
Get the instance given an index. | |
virtual const void * | GetSpec (uint index) const =0 |
Get (NewGRF) specs given an index. | |
virtual void | SetStringParameters (uint index) const =0 |
Set the string parameters to write the right data for a STRINGn. | |
virtual uint32_t | GetGRFID (uint index) const =0 |
Get the GRFID of the file that includes this item. | |
virtual uint | Resolve (uint index, uint var, uint param, bool &avail) const =0 |
Resolve (action2) variable for a given index. | |
virtual bool | PSAWithParameter () const |
Used to decide if the PSA needs a parameter or not. | |
virtual const std::span< int32_t > | GetPSA (uint index, uint32_t grfid) const |
Gets the span containing the persistent storage. | |
Protected Member Functions | |
void | SetSimpleStringParameters (StringID string, uint32_t index) const |
Helper to make setting the strings easier. | |
void | SetObjectAtStringParameters (StringID string, uint32_t index, TileIndex tile) const |
Helper to make setting the strings easier for objects at a specific tile. | |
Helper class to wrap some functionality/queries in.
Definition at line 118 of file newgrf_debug_gui.cpp.
|
pure virtual |
Get the GRFID of the file that includes this item.
index | index to check. |
Implemented in NIHVehicle, NIHStation, NIHHouse, NIHIndustryTile, NIHIndustry, NIHObject, NIHAirportTile, NIHAirport, NIHRoadStop, NIHRailType, NIHTown, and NIHRoadType.
|
pure virtual |
Get the instance given an index.
index | the index to get the instance for. |
Implemented in NIHVehicle, NIHIndustry, NIHObject, NIHAirport, NIHTown, NIHStation, NIHHouse, NIHIndustryTile, NIHRailType, NIHAirportTile, NIHRoadType, and NIHRoadStop.
Referenced by NewGRFInspectWindow::DrawMainPanelWidget().
|
pure virtual |
Get the parent "window_number" of a given instance.
index | the instance to get the parent for. |
Implemented in NIHVehicle, NIHStation, NIHHouse, NIHIndustryTile, NIHIndustry, NIHObject, NIHAirportTile, NIHAirport, NIHRoadStop, NIHRailType, NIHTown, and NIHRoadType.
|
inlinevirtual |
Gets the span containing the persistent storage.
index | Index of the item. |
grfid | Parameter for the PSA. Only required for items with parameters. |
Reimplemented in NIHTown, NIHIndustry, and NIHAirport.
Definition at line 189 of file newgrf_debug_gui.cpp.
|
pure virtual |
Get (NewGRF) specs given an index.
index | the index to get the specs for for. |
Implemented in NIHVehicle, NIHStation, NIHHouse, NIHIndustryTile, NIHIndustry, NIHObject, NIHAirportTile, NIHAirport, NIHRoadStop, NIHRailType, NIHTown, and NIHRoadType.
|
pure virtual |
Is the item with the given index inspectable?
index | the index to check. |
Implemented in NIHVehicle, NIHStation, NIHHouse, NIHIndustryTile, NIHIndustry, NIHObject, NIHAirportTile, NIHAirport, NIHTown, NIHRoadStop, NIHRailType, and NIHRoadType.
Referenced by IsNewGRFInspectable().
|
inlinevirtual |
Used to decide if the PSA needs a parameter or not.
Reimplemented in NIHTown.
Definition at line 178 of file newgrf_debug_gui.cpp.
|
pure virtual |
Resolve (action2) variable for a given index.
index | The (instance) index to resolve the variable for. |
var | The variable to actually resolve. |
param | The varaction2 0x60+x parameter to pass. |
avail | Return whether the variable is available. |
Implemented in NIHVehicle, NIHStation, NIHHouse, NIHIndustryTile, NIHIndustry, NIHObject, NIHRailType, NIHAirportTile, NIHAirport, NIHTown, and NIHRoadType.
|
inlineprotected |
Helper to make setting the strings easier for objects at a specific tile.
string | the string to draw the object's name |
index | the (instance) index for the string. |
tile | the tile the object is at |
Definition at line 213 of file newgrf_debug_gui.cpp.
References SetDParam().
Referenced by NIHStation::SetStringParameters(), NIHHouse::SetStringParameters(), NIHIndustryTile::SetStringParameters(), NIHObject::SetStringParameters(), NIHRailType::SetStringParameters(), NIHAirportTile::SetStringParameters(), NIHAirport::SetStringParameters(), NIHRoadType::SetStringParameters(), and NIHRoadStop::SetStringParameters().
|
inlineprotected |
Helper to make setting the strings easier.
string | the string to actually draw. |
index | the (instance) index for the string. |
Definition at line 200 of file newgrf_debug_gui.cpp.
References SetDParam().
Referenced by NIHVehicle::SetStringParameters(), NIHIndustry::SetStringParameters(), and NIHTown::SetStringParameters().
|
pure virtual |
Set the string parameters to write the right data for a STRINGn.
index | the index to get the string parameters for. |
Implemented in NIHVehicle, NIHStation, NIHHouse, NIHIndustryTile, NIHIndustry, NIHObject, NIHRailType, NIHAirportTile, NIHAirport, NIHTown, NIHRoadType, and NIHRoadStop.
Referenced by NewGRFInspectWindow::SetStringParameters().