From cc18095cded14f5e7e3f049e47fca2224134b647 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 19 Sep 2010 19:44:13 +0000 Subject: text rendering cleanups, inventory capacity & cargo volume --- src/ui/inputbox.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ui/inputbox.cc') 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) -- cgit v1.2.3