projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- updated TODO
[supertux.git]
/
src
/
menu.cpp
diff --git
a/src/menu.cpp
b/src/menu.cpp
index
e79cd2c
..
9932ed6
100644
(file)
--- a/
src/menu.cpp
+++ b/
src/menu.cpp
@@
-40,6
+40,7
@@
#include "leveleditor.h"
#include "timer.h"
#include "high_scores.h"
#include "leveleditor.h"
#include "timer.h"
#include "high_scores.h"
+#include "gettext.h"
#define FLICK_CURSOR_TIME 500
#define FLICK_CURSOR_TIME 500
@@
-65,21
+66,21
@@
std::vector<Menu*> Menu::last_menus;
Menu* Menu::current_ = 0;
/* just displays a Yes/No text that can be used to confirm stuff */
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);
//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);
dialog->additem(MN_HL,"",0,0);
Menu::set_current(dialog);
+ DrawingContext context;
+
while(true)
{
SDL_Event event;
while(true)
{
SDL_Event event;
@@
-89,9
+90,12
@@
bool confirm_dialog(std::string text)
dialog->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())
dialog->action();
switch (dialog->check())
@@
-112,11
+116,11
@@
bool confirm_dialog(std::string text)
break;
}
break;
}
- mouse_cursor->draw();
-
flipscreen
();
+ mouse_cursor->draw(
context
);
+
context.do_drawing
();
SDL_Delay(25);
}
SDL_Delay(25);
}
-#endif
+
return false;
}
return false;
}
@@
-249,40
+253,40
@@
void Menu::get_controlfield_key_into_input(MenuItem *item)
switch(*item->int_p)
{
case SDLK_UP:
switch(*item->int_p)
{
case SDLK_UP:
- item->change_input(
"Up cursor"
);
+ item->change_input(
_("Up cursor")
);
break;
case SDLK_DOWN:
break;
case SDLK_DOWN:
- item->change_input(
"Down cursor"
);
+ item->change_input(
_("Down cursor")
);
break;
case SDLK_LEFT:
break;
case SDLK_LEFT:
- item->change_input(
"Left cursor"
);
+ item->change_input(
_("Left cursor")
);
break;
case SDLK_RIGHT:
break;
case SDLK_RIGHT:
- item->change_input(
"Right cursor"
);
+ item->change_input(
_("Right cursor")
);
break;
case SDLK_RETURN:
break;
case SDLK_RETURN:
- item->change_input(
"Return"
);
+ item->change_input(
_("Return")
);
break;
case SDLK_SPACE:
break;
case SDLK_SPACE:
- item->change_input(
"Space"
);
+ item->change_input(
_("Space")
);
break;
case SDLK_RSHIFT:
break;
case SDLK_RSHIFT:
- item->change_input(
"Right Shift"
);
+ item->change_input(
_("Right Shift")
);
break;
case SDLK_LSHIFT:
break;
case SDLK_LSHIFT:
- item->change_input(
"Left Shift"
);
+ item->change_input(
_("Left Shift")
);
break;
case SDLK_RCTRL:
break;
case SDLK_RCTRL:
- item->change_input(
"Right Control"
);
+ item->change_input(
_("Right Control")
);
break;
case SDLK_LCTRL:
break;
case SDLK_LCTRL:
- item->change_input(
"Left Control"
);
+ item->change_input(
_("Left Control")
);
break;
case SDLK_RALT:
break;
case SDLK_RALT:
- item->change_input(
"Right Alt"
);
+ item->change_input(
_("Right Alt")
);
break;
case SDLK_LALT:
break;
case SDLK_LALT:
- item->change_input(
"Left Alt"
);
+ item->change_input(
_("Left Alt")
);
break;
default:
{
break;
default:
{