2 // Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #include "supertux/menu/addon_menu.hpp"
21 #include "addon/addon.hpp"
22 #include "util/gettext.hpp"
24 AddonMenu::AddonMenu(const std::vector<Addon*>& addons)
26 add_label(_("Add-ons"));
29 // FIXME: don't use macro, use AddonManager::online_available() or so
31 add_entry(0, std::string(_("Check Online")));
33 add_inactive(0, std::string(_("Check Online (disabled)")));
38 for (unsigned int i = 0; i < addons.size(); i++)
40 const Addon& addon = *addons[i];
41 std::string text = "";
43 if (!addon.kind.empty())
45 text += addon.kind + " ";
47 text += std::string("\"") + addon.title + "\"";
49 if (!addon.author.empty())
51 text += " by \"" + addon.author + "\"";
53 add_toggle(ADDON_LIST_START_ID + i, text, addon.loaded);