- // Keep jump button pressed
- if (jumpPushTimer.started())
- controller->press(Controller::JUMP);
+ // if one of the Addons listed was chosen, take appropriate action
+ if ((index >= ADDON_LIST_START_ID) && (index < ADDON_LIST_START_ID) + addons.size()) {
+ Addon addon = addons[index - ADDON_LIST_START_ID];
+ if (!addon.isInstalled) {
+ try {
+ addon.install();
+ generate_addons_menu();
+ Menu::set_current(addons_menu.get());
+ addons_menu->set_active_item(index);
+ }
+ catch (std::runtime_error e) {
+ log_warning << "Installation of Add-on failed: " << e.what() << std::endl;
+ }
+ } else {
+ try {
+ addon.remove();
+ generate_addons_menu();
+ Menu::set_current(addons_menu.get());
+ addons_menu->set_active_item(index);
+ }
+ catch (std::runtime_error e) {
+ log_warning << "Removal of Add-on failed: " << e.what() << std::endl;
+ }
+ }
+ }
+
+}
+
+void
+TitleScreen::free_addons_menu()
+{
+}
+
+void
+TitleScreen::make_tux_jump()
+{
+ static bool jumpWasReleased = true;
+ Sector* sector = titlesession->get_current_sector();
+ Player* tux = sector->player;