Hi everyone!
I have one issue, where I need your help with. I made field, where you can write name of your character, when you making it. Everything looks fine, but I can't figure out how can I input my national (polish) letters in (ę, ó, ą, ś, ł, ż, ź, ć, ń).
Here is my code:
void Character_creation::event_character_creation_insert_name(RenderWindow* window, Event* ev, string& name_input_string, bool &char_creation_insert_name_status)
{
if (char_creation_insert_name_status == 1)
{
if (ev->type == Event::TextEntered)
{
if (ev->text.unicode == '\b' && name_input_string.size() != 0)
{
name_input_string.erase(name_input_string.size() - 1, 1);
char_creation_name_input_txt.move(+8, 0);
char_creation_name_input_txt.setString(name_input_string);
}
else if (((ev->text.unicode > 64) && (ev->text.unicode < 91)) || ((ev->text.unicode > 96) && (ev->text.unicode < 123)))
{
if (ev->text.unicode != '\b' && name_input_string.size() < 16)
{
name_input_string += ev->text.unicode;
char_creation_name_input_txt.move(-8, 0);
char_creation_name_input_txt.setString(name_input_string);
}
}
}
}
}
I tried everything, for ex. I tried to implement unicode numbers to this "else if", but only two letters works ("Ó, ó"). Another letters are replaced by another.
Can you help me with that issue?