diff -r 9b1552d0fd9b -r f8eb3e208514 src/main_gui.cpp --- a/src/main_gui.cpp Thu Feb 21 22:34:54 2008 +0000 +++ b/src/main_gui.cpp Fri Feb 22 00:25:54 2008 +0000 @@ -977,8 +977,8 @@ if (HasBit(_display_opt, DO_WAYPOINTS)) SetBit(x, 9); if (HasBit(_display_opt, DO_FULL_ANIMATION)) SetBit(x, 10); if (HasBit(_display_opt, DO_FULL_DETAIL)) SetBit(x, 11); - if (IsTransparencySet(TO_HOUSES) && IsTransparencySet(TO_TREES)) SetBit(x, 12); - if (IsTransparencySet(TO_SIGNS)) SetBit(x, 13); + if (IsTransparencySet(TO_HOUSES)) SetBit(x, 12); + if (IsTransparencySet(TO_SIGNS)) SetBit(x, 13); WP(w, menu_d).checked_items = x; } @@ -1668,7 +1668,7 @@ { char buf[512]; StringID str; - const char *s; + const char *s, *last; char *d; DrawPixelInfo tmp_dpi, *old_dpi; int x; @@ -1685,19 +1685,22 @@ s = buf; d = buffer; + last = lastof(buffer); for (;;) { WChar c = Utf8Consume(&s); if (c == 0) { - *d = '\0'; break; - } else if (*s == 0x0D) { + } else if (c == 0x0D) { + if (d + 4 >= last) break; d[0] = d[1] = d[2] = d[3] = ' '; d += 4; } else if (IsPrintable(c)) { + if (d + Utf8CharLen(c) >= last) break; d += Utf8Encode(d, c); } } + *d = '\0'; if (!FillDrawPixelInfo(&tmp_dpi, 141, 1, width, 11)) return true; @@ -1914,6 +1917,7 @@ case '6' | WKC_CTRL: case '7' | WKC_CTRL: case '8' | WKC_CTRL: + case '9' | WKC_CTRL: /* Transparency toggle hot keys */ ToggleTransparency((TransparencyOption)(e->we.keypress.keycode - ('1' | WKC_CTRL))); MarkWholeScreenDirty();