summaryrefslogtreecommitdiff
path: root/strings.c
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2005-01-22 23:13:20 +0000
committerdominik <dominik@openttd.org>2005-01-22 23:13:20 +0000
commitbb34830bee19f5928617485705486f9ee6f8b433 (patch)
tree7ba9c7c70f6eb7397517ffa76f15d0a421ede17a /strings.c
parentafbac4c3176d06dcb4b0e785072f33bd1ea4f358 (diff)
downloadopenttd-bb34830bee19f5928617485705486f9ee6f8b433.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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/strings.c b/strings.c
index c9fa18196..db29c71f8 100644
--- a/strings.c
+++ b/strings.c
@@ -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}