diff options
author | dominik <dominik@openttd.org> | 2005-01-22 23:13:20 +0000 |
---|---|---|
committer | dominik <dominik@openttd.org> | 2005-01-22 23:13:20 +0000 |
commit | 6027e777c85c94f009e8ecd27ed1cce525359c61 (patch) | |
tree | 7ba9c7c70f6eb7397517ffa76f15d0a421ede17a /strings.c | |
parent | 8313879b3cd923c5458a5ae3cb827c6e6b4e9a6c (diff) | |
download | openttd-6027e777c85c94f009e8ecd27ed1cce525359c61.tar.xz |
(svn r1598) Feature: Message history now is stickyable and resizeable
The news messages are now precisely cropped according to pixel width to fit optimal into the window.
Introduced a new date format: DATE_TINY, which is ISOish.
Diffstat (limited to 'strings.c')
-rw-r--r-- | strings.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -259,6 +259,17 @@ static byte *FormatMonthAndYear(byte *buff, uint16 number) return FormatNoCommaNumber(buff, ymd.year + MAX_YEAR_BEGIN_REAL); } +static byte *FormatTinyDate(byte *buff, uint16 number) +{ + const char *src; + YearMonthDay ymd; + + ConvertDayToYMD(&ymd, number); + buff += sprintf(buff, " %02i-%02i-%04i", ymd.day, ymd.month + 1, ymd.year + MAX_YEAR_BEGIN_REAL); + + return buff; +} + uint GetCurrentCurrencyRate(void) { return (&_currency_specs[_opt.currency])->rate; @@ -478,6 +489,12 @@ static byte *DecodeString(byte *buff, const byte *str) buff = GetString(buff, str); } break; + + case 0x9E: { // {DATE_TINY} + buff = FormatTinyDate(buff, GetParamUint16()); + break; + } + // case 0x88..0x98: // {COLORS} // case 0xE: // {TINYFONT} // case 0xF: // {BIGFONT} |