Moved back button to an old dir.
[supertux.git] / src / menu.cpp
index 34dd8b8..9d9cb32 100644 (file)
@@ -196,7 +196,7 @@ MenuItem::change_input(const  char *text_)
     }
 }
 
-char* MenuItem::get_input_with_symbol(bool active_item)
+std::string MenuItem::get_input_with_symbol(bool active_item)
 {
 if(!active_item)
   input_flickering = true;
@@ -214,11 +214,13 @@ else
 
 char str[1024];
 if(input_flickering)
-  sprintf(str,"%s-",input);
+  sprintf(str,"%s_",input);
 else
   sprintf(str,"%s ",input);
 
-return (char*)str;
+std::string string = str;
+
+return string;
 }
 
 /* Set ControlField a key */
@@ -389,11 +391,14 @@ Menu::action()
                 break;
 
               case MN_ACTION:
-              case MN_TEXTFIELD:
-              case MN_NUMFIELD:
                 Menu::set_current(0); 
                 item[active_item].toggled = true;
                 break;
+              case MN_TEXTFIELD:
+              case MN_NUMFIELD:
+                menuaction = MENU_ACTION_DOWN;
+                action();
+                break;
 
               case MN_BACK:
                 Menu::pop_current();
@@ -555,9 +560,9 @@ Menu::draw_item(int index, // Position of the current item in the menu
         if(pitem.kind == MN_TEXTFIELD || pitem.kind == MN_NUMFIELD)
           {
           if(active_item == index)
-            gold_text->draw_align(pitem.get_input_with_symbol(true), x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2);
+            gold_text->draw_align((pitem.get_input_with_symbol(true)).c_str(), x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2);
           else
-            gold_text->draw_align(pitem.get_input_with_symbol(false), x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2);
+            gold_text->draw_align((pitem.get_input_with_symbol(false)).c_str(), x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2);
           }
         else
           gold_text->draw_align(pitem.input,