Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-09-19 19:44:13 +0000
committerStijn Buys <ingar@osirion.org>2010-09-19 19:44:13 +0000
commitcc18095cded14f5e7e3f049e47fca2224134b647 (patch)
tree2a057f4836925083a19988d571dc0664925c9e48 /src/ui/inputbox.cc
parentbadfb31888a6bd62e0a019b3f3dec517df4121ec (diff)
text rendering cleanups, inventory capacity & cargo volume
Diffstat (limited to 'src/ui/inputbox.cc')
-rw-r--r--src/ui/inputbox.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ui/inputbox.cc b/src/ui/inputbox.cc
index 6f493e2..5656cb9 100644
--- a/src/ui/inputbox.cc
+++ b/src/ui/inputbox.cc
@@ -71,14 +71,14 @@ void InputBox::draw()
size_t text_width = (size_t) floorf(width() / font()->width());
size_t prompt_width = aux::text_length(input_prompt);
math::Vector2f v(global_location());
- paint::color(palette()->text());
+ Paint::set_color(palette()->text());
// draw the prompt
if (prompt_width) {
- paint::text(v, size(), font(), input_prompt);
+ Paint::draw_text(v, font(), input_prompt);
v[0] += prompt_width * font()->width();
}
- paint::color(palette()->text());
+ Paint::set_color(palette()->text());
// draw the part before the cursor
std::string firstpart(input_text.substr(0, input_pos));
@@ -98,7 +98,7 @@ void InputBox::draw()
while (*c && draw_width > text_width - prompt_width - 1) {
if (aux::is_color_code(c)) {
c++;
- paint::color_code(*c);
+ Paint::set_system_color(*c);
} else {
draw_width--;
}
@@ -106,14 +106,14 @@ void InputBox::draw()
}
if (*c) {
- paint::text(v, size(), font(), std::string(c));
+ Paint::draw_text(v, font(), std::string(c));
}
// draw the part behind the cursor
v[0] += draw_width * font()->width();
if (input_pos < input_text.size()) {
if (input_pos > 1 && aux::is_color_code(input_text.c_str() + input_pos - 1)) {
- paint::color_code(input_text[input_pos]);
+ Paint::set_system_color(input_text[input_pos]);
}
// limit to width
std::string secondpart;
@@ -128,18 +128,18 @@ void InputBox::draw()
c++;
}
- paint::text(v, size(), font(), secondpart);
+ Paint::draw_text(v, font(), secondpart);
}
// draw the cursor
if (has_input_focus() && (core::application()->time() - ::floorf(core::application()->time())) < 0.5f) {
std::string cursor("^B");
cursor += (char) 11;
- paint::text(v, size(), font(), cursor);
+ Paint::draw_text(v, font(), cursor);
}
// reset color
- paint::color(palette()->foreground());
+ Paint::set_color(palette()->foreground());
}
bool InputBox::on_keypress(const int key, const unsigned int modifier)