#include "leveleditor.h"
#include "timer.h"
#include "high_scores.h"
+#include "gettext.h"
#define FLICK_CURSOR_TIME 500
Menu* Menu::current_ = 0;
/* just displays a Yes/No text that can be used to confirm stuff */
-bool confirm_dialog(std::string text)
+bool confirm_dialog(Surface *background, std::string text)
{
- // TODO
-#if 0
//Surface* cap_screen = Surface::CaptureScreen();
Menu* dialog = new Menu;
dialog->additem(MN_DEACTIVE, text,0,0);
dialog->additem(MN_HL,"",0,0);
- dialog->additem(MN_ACTION,"Yes",0,0,true);
- dialog->additem(MN_ACTION,"No",0,0,false);
+ dialog->additem(MN_ACTION,_("Yes"),0,0,true);
+ dialog->additem(MN_ACTION,_("No"),0,0,false);
dialog->additem(MN_HL,"",0,0);
Menu::set_current(dialog);
+ DrawingContext context;
+
while(true)
{
SDL_Event event;
dialog->event(event);
}
- //cap_screen->draw(0,0);
+ if(background == NULL)
+ context.draw_gradient(Color(200, 100, 200), Color(100, 200, 100), LAYER_BACKGROUND0);
+ else
+ context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0);
- dialog->draw();
+ dialog->draw(context);
dialog->action();
switch (dialog->check())
break;
}
- mouse_cursor->draw();
- flipscreen();
+ mouse_cursor->draw(context);
+ context.do_drawing();
SDL_Delay(25);
}
-#endif
+
return false;
}
switch(*item->int_p)
{
case SDLK_UP:
- item->change_input("Up cursor");
+ item->change_input(_("Up cursor"));
break;
case SDLK_DOWN:
- item->change_input("Down cursor");
+ item->change_input(_("Down cursor"));
break;
case SDLK_LEFT:
- item->change_input("Left cursor");
+ item->change_input(_("Left cursor"));
break;
case SDLK_RIGHT:
- item->change_input("Right cursor");
+ item->change_input(_("Right cursor"));
break;
case SDLK_RETURN:
- item->change_input("Return");
+ item->change_input(_("Return"));
break;
case SDLK_SPACE:
- item->change_input("Space");
+ item->change_input(_("Space"));
break;
case SDLK_RSHIFT:
- item->change_input("Right Shift");
+ item->change_input(_("Right Shift"));
break;
case SDLK_LSHIFT:
- item->change_input("Left Shift");
+ item->change_input(_("Left Shift"));
break;
case SDLK_RCTRL:
- item->change_input("Right Control");
+ item->change_input(_("Right Control"));
break;
case SDLK_LCTRL:
- item->change_input("Left Control");
+ item->change_input(_("Left Control"));
break;
case SDLK_RALT:
- item->change_input("Right Alt");
+ item->change_input(_("Right Alt"));
break;
case SDLK_LALT:
- item->change_input("Left Alt");
+ item->change_input(_("Left Alt"));
break;
default:
{
int menu_height = get_height();
int menu_width = get_width();
- context.push_transform();
- context.set_translation(Vector(0, 0));
-
/* Draw a transparent background */
context.draw_filled_rect(
Vector(pos_x - menu_width/2, pos_y - 24*item.size()/2 - 10),
{
draw_item(context, i, menu_width, menu_height);
}
- context.pop_transform();
}
MenuItem&