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

Method GetNewVehicleMessageString

src/news_gui.cpp:675–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673 }
674
675 std::string GetNewVehicleMessageString(WidgetID widget) const
676 {
677 assert(std::holds_alternative<EngineID>(ni->ref1));
678 EngineID engine = std::get<EngineID>(this->ni->ref1);
679
680 switch (widget) {
681 case WID_N_VEH_TITLE:
682 return GetString(STR_NEWS_NEW_VEHICLE_NOW_AVAILABLE, GetEngineCategoryName(engine));
683
684 case WID_N_VEH_NAME:
685 return GetString(STR_NEWS_NEW_VEHICLE_TYPE, PackEngineNameDParam(engine, EngineNameContext::PreviewNews));
686
687 default:
688 NOT_REACHED();
689 }
690 }
691};
692
693/* static */ int NewsWindow::duration = 0; // Instance creation.

Callers 2

UpdateWidgetSizeMethod · 0.95
DrawWidgetMethod · 0.95

Calls 4

GetEngineCategoryNameFunction · 0.85
PackEngineNameDParamFunction · 0.85
NOT_REACHEDFunction · 0.85
GetStringFunction · 0.70

Tested by

no test coverage detected