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

Method GetGroupNameString

src/group_gui.cpp:310–315  ·  view source on GitHub ↗

* Get the string to draw for the given group. * @param g_id Group to get string for. * @return Formatted string to draw. */

Source from the content-addressed store, hash-verified

308 * @return Formatted string to draw.
309 */
310 std::string GetGroupNameString(GroupID g_id) const
311 {
312 if (IsAllGroupID(g_id)) return GetString(STR_GROUP_ALL_TRAINS + this->vli.vtype);
313 if (IsDefaultGroupID(g_id)) return GetString(STR_GROUP_DEFAULT_TRAINS + this->vli.vtype);
314 return GetString(STR_GROUP_NAME, g_id);
315 }
316
317 /**
318 * Get the profit sprite ID to draw for the given group.

Callers 1

DrawGroupInfoMethod · 0.95

Calls 3

IsAllGroupIDFunction · 0.85
IsDefaultGroupIDFunction · 0.85
GetStringFunction · 0.70

Tested by

no test coverage detected