Callback: Show additional text in industry window

From GRFSpecs
Revision as of 13:30, 1 April 2012 by Frosch (talk | contribs) (use new grf templates)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Show additional text in industry window (3A)

This callback allows you to display extra information in the industry window about the state of your industry. The return value should be the number of a D0xx text to be displayed. The text must begin with a colouring special character and should not be longer than one line. For example, you can use this callback to display the current production limit of a secondary industry.

GRFv≥8 For GRF version 8 and above you can return 400 to display no text (instead of failing the callback).

Supported by OpenTTD 0.6 (r11987)0.6 Note that since r11987, OpenTTD allows resizing the window when this callback is enabled.  It allows to specify a text containing more than one line.

Supported by OpenTTD 0.60.6 Supported by TTDPatch 2.6 (r1370)2.6 Since TTDPatch 2.6 r1370, the contents of registers 100h..105h are copied onto the text reference stack. This allows you to display dynamically calculated values in the text by using the according StringCodes. Please note, though, that the text handler will see it as an array of bytes, not as an array of DWORDs, so you will have to pack two words into a register when you use codes that read words from the stack. In the case of \7D (which gets a byte), you may have to pack more into a register, but it's probably easier to use \7C instead. Please also note that you can use \80 to display textIDs calculated on the fly, but DCxx textIDs won't work correctly. When you need to choose from your own texts dynamically, you must use D0xx IDs, and add 400h to them. (That is, use D400 to refer to D000, D401 for D001 etc.)

This callback is available from Supported by TTDPatch 2.52.5 TTDPatch 2.0.1 a72 and above