Add: [NewGRF] All callbacks returning D0xx strings, have now the option to return any string id via register 0x100.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user