Fix 4/6 behavior

develop
lethosor 2014-06-09 17:00:26 -04:00
parent 055afafedc
commit aafcd6c43a
1 changed files with 20 additions and 21 deletions

@ -189,19 +189,19 @@ void viewscreen_commandpromptst::feed(std::set<df::interface_key> *events)
{
entry.insert(cursor_pos, 1, char(key - interface_key::STRING_A000));
cursor_pos++;
return;
}
}
// Prevent number keys from moving cursor
else if(events->count(interface_key::CURSOR_RIGHT))
if(events->count(interface_key::CURSOR_RIGHT))
{
cursor_pos++;
if (cursor_pos > entry.size()) cursor_pos = entry.size();
break;
}
else if(events->count(interface_key::CURSOR_LEFT))
{
cursor_pos--;
if (cursor_pos < 0) cursor_pos = 0;
break;
}
else if(events->count(interface_key::CUSTOM_CTRL_A))
{
@ -212,7 +212,6 @@ void viewscreen_commandpromptst::feed(std::set<df::interface_key> *events)
cursor_pos = entry.size();
}
}
}
DFHACK_PLUGIN("command-prompt");
command_result show_prompt(color_ostream &out, std::vector <std::string> & parameters)
{