Mercurial > hg > openttd
comparison src/console_gui.cpp @ 11483:f45b22901ffa draft
(svn r15844) -Codechange: allow text alignment to be forced so the console and ai debug output don't get swapped (those are untranslateable anyways)
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 25 Mar 2009 01:10:24 +0000 |
parents | caf4456fbbf3 |
children | 80379bc12cb3 |
comparison
equal
deleted
inserted
replaced
11482:684bb10eddfc | 11483:f45b22901ffa |
---|---|
161 } | 161 } |
162 | 162 |
163 virtual void OnPaint() | 163 virtual void OnPaint() |
164 { | 164 { |
165 const int max = (this->height / ICON_LINE_HEIGHT) - 1; | 165 const int max = (this->height / ICON_LINE_HEIGHT) - 1; |
166 const int right = this->width - 1; | 166 const int right = this->width - 5; |
167 | 167 |
168 const IConsoleLine *print = IConsoleLine::Get(IConsoleWindow::scroll); | 168 const IConsoleLine *print = IConsoleLine::Get(IConsoleWindow::scroll); |
169 GfxFillRect(this->left, this->top, this->width, this->height - 1, 0); | 169 GfxFillRect(this->left, this->top, this->width, this->height - 1, 0); |
170 for (int i = 0; i < max && print != NULL; i++, print = print->previous) { | 170 for (int i = 0; i < max && print != NULL; i++, print = print->previous) { |
171 DrawString(5, right, this->height - (2 + i) * ICON_LINE_HEIGHT, print->buffer, print->colour); | 171 DrawString(5, right, this->height - (2 + i) * ICON_LINE_HEIGHT, print->buffer, print->colour, SA_LEFT | SA_FORCE); |
172 } | 172 } |
173 /* If the text is longer than the window, don't show the starting ']' */ | 173 /* If the text is longer than the window, don't show the starting ']' */ |
174 int delta = this->width - 10 - _iconsole_cmdline.width - ICON_RIGHT_BORDERWIDTH; | 174 int delta = this->width - 10 - _iconsole_cmdline.width - ICON_RIGHT_BORDERWIDTH; |
175 if (delta > 0) { | 175 if (delta > 0) { |
176 DrawString(5, right, this->height - ICON_LINE_HEIGHT, "]", (TextColour)CC_COMMAND); | 176 DrawString(5, right, this->height - ICON_LINE_HEIGHT, "]", (TextColour)CC_COMMAND, SA_LEFT | SA_FORCE); |
177 delta = 0; | 177 delta = 0; |
178 } | 178 } |
179 | 179 |
180 DrawString(10 + delta, right, this->height - ICON_LINE_HEIGHT, _iconsole_cmdline.buf, (TextColour)CC_COMMAND); | 180 DrawString(10 + delta, right, this->height - ICON_LINE_HEIGHT, _iconsole_cmdline.buf, (TextColour)CC_COMMAND, SA_LEFT | SA_FORCE); |
181 | 181 |
182 if (_focused_window == this && _iconsole_cmdline.caret) { | 182 if (_focused_window == this && _iconsole_cmdline.caret) { |
183 DrawString(10 + delta + _iconsole_cmdline.caretxoffs, right, this->height - ICON_LINE_HEIGHT, "_", TC_WHITE); | 183 DrawString(10 + delta + _iconsole_cmdline.caretxoffs, right, this->height - ICON_LINE_HEIGHT, "_", TC_WHITE, SA_LEFT | SA_FORCE); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 virtual void OnHundredthTick() | 187 virtual void OnHundredthTick() |
188 { | 188 { |