diff options
Diffstat (limited to 'src/client/entitymenu.cc')
-rw-r--r-- | src/client/entitymenu.cc | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/client/entitymenu.cc b/src/client/entitymenu.cc index 59c922c..d0fccef 100644 --- a/src/client/entitymenu.cc +++ b/src/client/entitymenu.cc @@ -15,7 +15,7 @@ namespace client EntityMenu::EntityMenu(ui::Widget *parent, const char * label) : ui::Window(parent) { set_border(false); - set_background(false); + set_background(false); if (label) set_label(label); else @@ -58,9 +58,9 @@ void EntityMenu::generate(core::Entity *entity, const char *menulabel) menu_generated_menu.assign(menulabel); if (!menu_generated_menu.size()) return; - + //con_debug << "generating menu " << entity->label() << " " << menulabel << std::endl; - + clear(); menu_container = new Container(this); @@ -70,7 +70,7 @@ void EntityMenu::generate(core::Entity *entity, const char *menulabel) menudescr = (*it); } } - + if (!menudescr) { menu_container->event_resize(); resize(); @@ -100,36 +100,36 @@ void EntityMenu::generate(core::Entity *entity, const char *menulabel) if (c == '"') { quote = !quote; result += c; - + } else if (c == ';') { if (quote) { current += c; - + } else if (current.size()) { if (buttondescr->command_type() == core::ButtonDescription::CommandGame) { if (result.size()) { result += ';'; } - + result.append("remote "); result.append(current); - + } else if (buttondescr->command_type() == core::ButtonDescription::CommandMenu) { if (result.size()) { result += ';'; } - + result.append("view "); result.append(current); } current.clear(); } - + } else { current += c; } - + i++; } @@ -174,21 +174,21 @@ void EntityMenu::generate(core::Entity *entity, const char *menulabel) bool EntityMenu::on_keypress(const int key, const unsigned int modifier) { - switch( key ) { - - case SDLK_ESCAPE: - if (visible()) { - if (menu_generated_menu.compare("main") != 0) { - generate(menu_generated_entity, "main"); - } else { - this->hide(); - ui::root()->show_menu("game"); + switch (key) { + + case SDLK_ESCAPE: + if (visible()) { + if (menu_generated_menu.compare("main") != 0) { + generate(menu_generated_entity, "main"); + } else { + this->hide(); + ui::root()->show_menu("game"); + } + return true; } - return true; - } - break; - default: - break; + break; + default: + break; } return Window::on_keypress(key, modifier); |