}
}
-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;
}
}
-static char str[1024];
+char str[1024];
if(input_flickering)
sprintf(str,"%s-",input);
else
sprintf(str,"%s ",input);
-return (char*)str;
+std::string string = str;
+
+return str;
}
/* Set ControlField a key */
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,
static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu, int id, int* int_p);
- char* get_input_with_symbol(bool active_item); // returns the text with an input symbol
+ std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol
private:
bool input_flickering;
Timer input_flickering_timer;