#include "control/controller.hpp"
#include "gui/menu_manager.hpp"
+#include "gui/menu.hpp"
#include "gui/mousecursor.hpp"
#include "supertux/resources.hpp"
+#include "supertux/colorscheme.hpp"
#include "video/drawing_context.hpp"
#include "video/renderer.hpp"
#include "video/video_system.hpp"
ctx.draw_text(Resources::normal_font, m_buttons[i].text,
Vector(pos.x, pos.y - int(Resources::normal_font->get_height()/2)),
- ALIGN_CENTER, LAYER_GUI);
+ ALIGN_CENTER, LAYER_GUI,
+ i == m_selected_button ? ColorScheme::Menu::active_color : ColorScheme::Menu::default_color);
}
}
#include "gui/menu_item.hpp"
#include "gui/menu_manager.hpp"
#include "gui/mousecursor.hpp"
+#include "supertux/colorscheme.hpp"
#include "supertux/globals.hpp"
#include "supertux/resources.hpp"
#include "supertux/screen_manager.hpp"
MenuItem& pitem = *(items[index]);
- Color text_color = default_color;
+ Color text_color = ColorScheme::Menu::default_color;
float x_pos = pos.x;
float y_pos = pos.y + 24*index - menu_height/2 + 12;
int text_width = int(Resources::normal_font->get_text_width(pitem.text));
if(index == active_item)
{
- text_color = active_color;
+ text_color = ColorScheme::Menu::active_color;
}
if(active_item == index)
{
context.draw_text(Resources::normal_font, pitem.text,
Vector(pos.x, y_pos - int(Resources::normal_font->get_height()/2)),
- ALIGN_CENTER, LAYER_GUI, inactive_color);
+ ALIGN_CENTER, LAYER_GUI, ColorScheme::Menu::inactive_color);
break;
}
{
context.draw_text(Resources::big_font, pitem.text,
Vector(pos.x, y_pos - int(Resources::big_font->get_height()/2)),
- ALIGN_CENTER, LAYER_GUI, label_color);
+ ALIGN_CENTER, LAYER_GUI, ColorScheme::Menu::label_color);
break;
}
case MN_TEXTFIELD:
context.draw_text(Resources::normal_font,
pitem.get_input_with_symbol(true),
Vector(right, y_pos - int(Resources::normal_font->get_height()/2)),
- ALIGN_RIGHT, LAYER_GUI, field_color);
+ ALIGN_RIGHT, LAYER_GUI, ColorScheme::Menu::field_color);
else
context.draw_text(Resources::normal_font,
pitem.get_input_with_symbol(false),
Vector(right, y_pos - int(Resources::normal_font->get_height()/2)),
- ALIGN_RIGHT, LAYER_GUI, field_color);
+ ALIGN_RIGHT, LAYER_GUI, ColorScheme::Menu::field_color);
}
else
context.draw_text(Resources::normal_font, pitem.input,
Vector(right, y_pos - int(Resources::normal_font->get_height()/2)),
- ALIGN_RIGHT, LAYER_GUI, field_color);
+ ALIGN_RIGHT, LAYER_GUI, ColorScheme::Menu::field_color);
context.draw_text(Resources::normal_font, pitem.text,
Vector(left, y_pos - int(Resources::normal_font->get_height()/2)),
class Menu
{
- static Color default_color;
- static Color active_color;
- static Color inactive_color;
- static Color label_color;
- static Color field_color;
-
private:
/* Action done on the menu */
enum MenuAction {
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
+#include "supertux/colorscheme.hpp"
+
#include "gui/menu.hpp"
#include "object/floating_text.hpp"
#include "object/level_time.hpp"
Color Statistics::header_color(1.0,1.0,1.0);
Color Statistics::text_color(1.0,1.0,0.6);
-Color Menu::default_color(1.0,1.0,1.0);
-Color Menu::active_color(0.2,0.5,1.0);
-Color Menu::inactive_color(0.5,0.5,0.5);
-Color Menu::label_color(0.0,1.0,1.0);
-Color Menu::field_color(1.0,1.0,0.6);
+Color ColorScheme::Menu::default_color(1.0,1.0,1.0);
+Color ColorScheme::Menu::active_color(0.2,0.5,1.0);
+Color ColorScheme::Menu::inactive_color(0.5,0.5,0.5);
+Color ColorScheme::Menu::label_color(0.0,1.0,1.0);
+Color ColorScheme::Menu::field_color(1.0,1.0,0.6);
Color PlayerStatus::text_color(1.0,1.0,0.6);
--- /dev/null
+// SuperTux
+// Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef HEADER_SUPERTUX_SUPERTUX_COLORSCHEME_HPP
+#define HEADER_SUPERTUX_SUPERTUX_COLORSCHEME_HPP
+
+#include "video/color.hpp"
+
+class ColorScheme
+{
+public:
+ class Menu
+ {
+ public:
+ static Color default_color;
+ static Color active_color;
+ static Color inactive_color;
+ static Color label_color;
+ static Color field_color;
+ };
+};
+
+#endif
+
+/* EOF */