mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r2644) - Fix: my name was mistyped ;p
- Add DoDrawStringCentered() and change the multiline strings in the about box to single-line ones
This commit is contained in:
parent
7c694f2553
commit
f0c0c03c5f
7
gfx.c
7
gfx.c
@ -365,6 +365,13 @@ int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 colo
|
|||||||
return DoDrawString(buffer, (xl + xr - w) / 2, y, color);
|
return DoDrawString(buffer, (xl + xr - w) / 2, y, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DoDrawStringCentered(int x, int y, const char *str, uint16 color)
|
||||||
|
{
|
||||||
|
int w = GetStringWidth(str);
|
||||||
|
DoDrawString(str, x - w / 2, y, color);
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color)
|
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color)
|
||||||
{
|
{
|
||||||
int w = DrawStringCentered(x, y, str, color);
|
int w = DrawStringCentered(x, y, str, color);
|
||||||
|
1
gfx.h
1
gfx.h
@ -38,6 +38,7 @@ void GfxScroll(int left, int top, int width, int height, int xo, int yo);
|
|||||||
|
|
||||||
int DrawStringCentered(int x, int y, StringID str, uint16 color);
|
int DrawStringCentered(int x, int y, StringID str, uint16 color);
|
||||||
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color);
|
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color);
|
||||||
|
int DoDrawStringCentered(int x, int y, const char *str, uint16 color);
|
||||||
|
|
||||||
int DrawString(int x, int y, StringID str, uint16 color);
|
int DrawString(int x, int y, StringID str, uint16 color);
|
||||||
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw);
|
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw);
|
||||||
|
@ -188,7 +188,7 @@ static const char *credits[] = {
|
|||||||
" Matthijs Kooijman (blathijs) - Pathfinder-god",
|
" Matthijs Kooijman (blathijs) - Pathfinder-god",
|
||||||
" Bjarni Corfitzen (Bjarni) - MacOSX port, coder",
|
" Bjarni Corfitzen (Bjarni) - MacOSX port, coder",
|
||||||
" Victor Fischer (Celestar) - Programming everywhere you need him to",
|
" Victor Fischer (Celestar) - Programming everywhere you need him to",
|
||||||
" Tamas Faragó (Darkvater) - Lead coder",
|
" Tamás Faragó (Darkvater) - Lead coder",
|
||||||
" Kerekes Miham (MiHaMiX) - Translator system, and Nightlies host",
|
" Kerekes Miham (MiHaMiX) - Translator system, and Nightlies host",
|
||||||
" Owen Rudge (orudge) - Forum- and masterserver host, OS/2 port",
|
" Owen Rudge (orudge) - Forum- and masterserver host, OS/2 port",
|
||||||
" Christoph Mallon (Tron) - Programmer, code correctness police",
|
" Christoph Mallon (Tron) - Programmer, code correctness police",
|
||||||
@ -246,7 +246,8 @@ static void AboutWindowProc(Window *w, WindowEvent *e)
|
|||||||
// If the last text has scrolled start anew from the start
|
// If the last text has scrolled start anew from the start
|
||||||
if (y < 50) WP(w, scroller_d).height = w->height - 40;
|
if (y < 50) WP(w, scroller_d).height = w->height - 40;
|
||||||
|
|
||||||
DrawStringMultiCenter(210, w->height - 15, STR_00BA_COPYRIGHT_OPENTTD, 398);
|
DoDrawStringCentered(210, w->height - 25, "Website: http://www.openttd.org", 16);
|
||||||
|
DrawStringCentered(210, w->height - 15, STR_00BA_COPYRIGHT_OPENTTD, 0);
|
||||||
} break;
|
} break;
|
||||||
case WE_MOUSELOOP: /* Timer to scroll the text and adjust the new top */
|
case WE_MOUSELOOP: /* Timer to scroll the text and adjust the new top */
|
||||||
if (WP(w, scroller_d).counter++ % 3 == 0) {
|
if (WP(w, scroller_d).counter++ % 3 == 0) {
|
||||||
|
@ -253,7 +253,7 @@ X.X) Credits:
|
|||||||
The OpenTTD team (in alphabetical order):
|
The OpenTTD team (in alphabetical order):
|
||||||
Bjarni Corfitzen (Bjarni) - Mac OS X port, coder
|
Bjarni Corfitzen (Bjarni) - Mac OS X port, coder
|
||||||
Victor Fischer (Celestar) - Programming everywhere you need him to
|
Victor Fischer (Celestar) - Programming everywhere you need him to
|
||||||
Tamas Faragó (Darkvater) - Lead programmer
|
Tamás Faragó (Darkvater) - Lead programmer
|
||||||
Kerekes Miham (MiHaMiX) - Maintainer of translator service, and host of nightlies
|
Kerekes Miham (MiHaMiX) - Maintainer of translator service, and host of nightlies
|
||||||
Owen Rudge (orudge) - Contributor, forum host, master server host, OS/2 port
|
Owen Rudge (orudge) - Contributor, forum host, master server host, OS/2 port
|
||||||
Christoph Mallon (Tron) - Programmer, code correctness police
|
Christoph Mallon (Tron) - Programmer, code correctness police
|
||||||
|
Loading…
Reference in New Issue
Block a user