diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/console.cc | 12 | ||||
-rw-r--r-- | src/ui/palette.cc | 6 | ||||
-rw-r--r-- | src/ui/ui.cc | 10 |
3 files changed, 18 insertions, 10 deletions
diff --git a/src/ui/console.cc b/src/ui/console.cc index 60eecef..66ddf4e 100644 --- a/src/ui/console.cc +++ b/src/ui/console.cc @@ -188,17 +188,15 @@ void Console::draw() console_input->set_location(4, height() - font()->height() -4); console_input->set_size(s.x, font()->height()); - std::string version(core::name()); - version += ' '; - version.append(core::version()); - - gl::color(0.0f, 1.0f, 0.0f, 0.5f); - + math::Color fancy(palette()->fancy()); + fancy.a = 0.5f; + paint::color(fancy); + std::string version(core::name() + ' ' + core::version()); s.assign(version.size() * font()->width(), font()->height()); math::Vector2f l(global_location()); l.x += width() - s.width() -4; l.y += height() - s.height() -4; - ui::paint::text(l, s, font(), version); + paint::text(l, s, font(), version); } void Console::save_history() diff --git a/src/ui/palette.cc b/src/ui/palette.cc index f8d16c1..2ee67f3 100644 --- a/src/ui/palette.cc +++ b/src/ui/palette.cc @@ -19,7 +19,11 @@ Palette::Palette() : palette_pointer(0.0f, 0.75f, 0.0f), palette_active(0.0f, 1.0f, 0.0f), palette_debug(0.50f, 0.75f), - palette_mission(1.0f, 0.5f, 1.0f) + palette_mission(1.0f, 0.5f, 1.0f), + palette_bold(1.0f), + palette_fancy(0.0f, 1.0f, 0.0f), + palette_warning(1.0f, 1.0f, 0.0f), + palette_error(1.0f, 0.0f, 0.0f) { } diff --git a/src/ui/ui.cc b/src/ui/ui.cc index b06e29b..de32db4 100644 --- a/src/ui/ui.cc +++ b/src/ui/ui.cc @@ -94,6 +94,7 @@ void func_ui(std::string const &args) global_ui->list(); } else if (command.compare("restart") == 0) { global_ui->load(); + global_ui->apply_render_options(); } else { help(); } @@ -370,15 +371,19 @@ void UI::load() } } else if (ini.in_section("text")) { - } else if (ini.got_key_color("bold", color)) { + + if (ini.got_key_color("bold", color)) { ui_palette->set_bold(color); + } else if (ini.got_key_color("fancy", color)) { ui_palette->set_fancy(color); + } else if (ini.got_key_color("warning", color)) { ui_palette->set_warning(color); + } else if (ini.got_key_color("error", color)) { ui_palette->set_error(color); - continue; + } } } } @@ -416,6 +421,7 @@ void UI::load() void UI::apply_render_options() { + con_debug << " initializing text colors" << std::endl; // apply palette colors paint::assign_color('N', palette()->text()); paint::assign_color('D', palette()->debug()); |