Allow entry of space and some letters such as 'r' and 'p' as parts of

save names.

svn-id: r18305
This commit is contained in:
Eugene Sandulenko 2005-05-31 23:41:27 +00:00
parent 6d0082d29d
commit f8f9ed18a8
3 changed files with 10 additions and 2 deletions

View file

@ -47,6 +47,11 @@ int SagaEngine::processInput() {
if (event.kbd.keycode == 'd') if (event.kbd.keycode == 'd')
_console->attach(); _console->attach();
} }
if (_interface->_textInput) {
_interface->processAscii(event.kbd.ascii);
return SUCCESS;
}
switch (event.kbd.keycode) { switch (event.kbd.keycode) {
case '#': case '#':
case '`': case '`':

View file

@ -858,7 +858,8 @@ void Interface::processTextInput(uint16 ascii) {
default: default:
if (((ascii >= 'a') && (ascii <='z')) || if (((ascii >= 'a') && (ascii <='z')) ||
((ascii >= '0') && (ascii <='9')) || ((ascii >= '0') && (ascii <='9')) ||
((ascii >= 'A') && (ascii <='Z'))) { ((ascii >= 'A') && (ascii <='Z')) ||
(ascii == ' ')) {
if (_textInputStringLength < SAVE_TITLE_SIZE - 1) { if (_textInputStringLength < SAVE_TITLE_SIZE - 1) {
ch[0] = ascii; ch[0] = ascii;
tempWidth = _vm->_font->getStringWidth(SMALL_FONT_ID, ch, 0, 0); tempWidth = _vm->_font->getStringWidth(SMALL_FONT_ID, ch, 0, 0);

View file

@ -212,6 +212,8 @@ public:
bool processAscii(uint16 ascii); bool processAscii(uint16 ascii);
void processKeyUp(uint16 ascii); void processKeyUp(uint16 ascii);
bool _textInput;
private: private:
static void textInputRepeatCallback(void *refCon); static void textInputRepeatCallback(void *refCon);
@ -245,6 +247,7 @@ public:
} }
void saveState(Common::OutSaveFile *out); void saveState(Common::OutSaveFile *out);
void loadState(Common::InSaveFile *in); void loadState(Common::InSaveFile *in);
private: private:
void handleMainUpdate(const Point& mousePoint); // main panel update void handleMainUpdate(const Point& mousePoint); // main panel update
void handleMainClick(const Point& mousePoint); // main panel click void handleMainClick(const Point& mousePoint); // main panel click
@ -395,7 +398,6 @@ private:
Rect _optionSaveRectSlider; Rect _optionSaveRectSlider;
Rect _optionSaveRectBottom; Rect _optionSaveRectBottom;
bool _textInput;
char _textInputString[SAVE_TITLE_SIZE]; char _textInputString[SAVE_TITLE_SIZE];
uint _textInputStringLength; uint _textInputStringLength;
uint _textInputPos; uint _textInputPos;