diff options
Diffstat (limited to 'src/client/view.cc')
-rw-r--r-- | src/client/view.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/client/view.cc b/src/client/view.cc index 391da35..862e394 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -32,6 +32,7 @@ namespace client core::Cvar *draw_ui = 0; core::Cvar *draw_stats = 0; core::Cvar *draw_location = 0; +core::Cvar *draw_keypress = 0; core::Cvar *ui_pointercolor = 0; core::Cvar *ui_pointerhovercolor =0; @@ -58,6 +59,9 @@ void init() draw_ui = core::Cvar::get("draw_ui", "1", core::Cvar::Archive); draw_ui->set_info("[bool] draw the user interface"); + draw_keypress = core::Cvar::get("draw_keypress", "0", core::Cvar::Archive); + draw_keypress->set_info("[bool] draw keypress key names"); + ui_pointercolor = core::Cvar::get("ui_pointercolor", "0 .5 0", core::Cvar::Archive); ui_pointercolor->set_info("[r g b] mouse pointer color"); @@ -177,14 +181,11 @@ void draw_status() Text::draw(4, video::height - Text::fontheight()*2 -4, location); } - if (core::localplayer()->zone()) { - Text::draw(video::width - 4-Text::fontwidth()*24, video::height - Text::fontheight()*3 -4, core::localplayer()->zone()->name()); - } - + float y = 1.0f; core::Entity *entity = targets::current(); if (entity) { std::stringstream target; - target << "^B" << entity->name() << "\n"; + target << "^B" << entity->name() << "\n"; target << "^Ndist ^B"; math::Vector3f v = entity->state()->location() - core::localcontrol()->state()->location(); @@ -194,10 +195,17 @@ void draw_status() else target << " --"; - Text::draw(video::width - 4-Text::fontwidth()*24, video::height - Text::fontheight()*2 -4, target); + Text::draw(video::width - 4-Text::fontwidth()*32, video::height - Text::fontheight()*2 -4, target); + y = 3.0f; } + + Text::draw(video::width-4-Text::fontwidth()*32, video::height-Text::fontheight()*y-4, core::localcontrol()->zone()->name()); } + if (draw_keypress->value() && input::last_key_pressed()) { + Text::setcolor('F'); //set fancy color + Text::draw(video::width-4-Text::fontwidth()*6, video::height-Text::fontheight()-4, input::last_key_pressed()->name()); + } } void draw_cursor() @@ -415,7 +423,8 @@ void frame(float seconds) // draw text elements if (draw_ui->value()) { - Text::setfont("bitmaps/fonts/gui", 16, 24); + //Text::setfont("bitmaps/fonts/gui", 16, 24); + Text::setfont("bitmaps/fonts/gui", 12, 18); // draw the player status draw_status(); |