Add: [NewGRF] All callbacks returning D0xx strings, have now the option to return any string id via register 0x100.

This commit is contained in:
frosch
2025-05-06 17:28:51 +02:00
committed by frosch
parent 84bc78fd8f
commit c6fa5022cb
11 changed files with 114 additions and 54 deletions
+3
View File
@@ -801,6 +801,9 @@ static std::optional<std::string> GetNewGRFAdditionalText(EngineID engine)
if (callback == CALLBACK_FAILED || callback == 0x400) return std::nullopt;
const GRFFile *grffile = Engine::Get(engine)->GetGRF();
assert(grffile != nullptr);
if (callback == 0x40F) {
return GetGRFStringWithTextStack(grffile, static_cast<GRFStringID>(regs100[0]), std::span{regs100}.subspan(1));
}
if (callback > 0x400) {
ErrorUnknownCallbackResult(grffile->grfid, CBID_VEHICLE_ADDITIONAL_TEXT, callback);
return std::nullopt;