MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetPropertyString

Method GetPropertyString

src/newgrf_debug_gui.cpp:425–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423 }
424
425 std::string GetPropertyString(const NIProperty &nip, uint value) const
426 {
427 switch (nip.type) {
428 case NIT_INT: return GetString(STR_JUST_INT, value);
429 case NIT_CARGO: return GetString(IsValidCargoType(value) ? CargoSpec::Get(value)->name : STR_QUANTITY_N_A);
430 default: NOT_REACHED();
431 }
432 }
433
434 /**
435 * Helper function to draw the main panel widget.

Callers 1

DrawMainPanelWidgetMethod · 0.95

Calls 3

IsValidCargoTypeFunction · 0.85
NOT_REACHEDFunction · 0.85
GetStringFunction · 0.70

Tested by

no test coverage detected