diff options
author | Robert Göffringmann | 2003-07-04 20:31:41 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-04 20:31:41 +0000 |
commit | 67ba28170f26080fed61ce97b4ae6bb5d81a9d03 (patch) | |
tree | 93c4f6460ee333d0012ad6d9bf937ba48ae89ea0 | |
parent | f24ca1fcdc649e78dba89192ed994a9b06a29fb8 (diff) | |
download | scummvm-rg350-67ba28170f26080fed61ce97b4ae6bb5d81a9d03.tar.gz scummvm-rg350-67ba28170f26080fed61ce97b4ae6bb5d81a9d03.tar.bz2 scummvm-rg350-67ba28170f26080fed61ce97b4ae6bb5d81a9d03.zip |
don't let user enter too long save names
svn-id: r8749
-rw-r--r-- | sky/control.cpp | 7 | ||||
-rw-r--r-- | sky/control.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sky/control.cpp b/sky/control.cpp index f9f069db31..ff9878a5eb 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -739,6 +739,8 @@ void SkyControl::handleKeyPress(uint8 key, uint8 *textBuf) { textBuf++; textBuf[0] = 0; } else { + if (_enteredTextWidth >= PAN_LINE_WIDTH - 10) + return; if (((key >= 'A') && (key <= 'Z')) || ((key >= 'a') && (key <= 'z')) || ((key >= '0') && (key <= '9')) || checkKeyList(key)) { uint8 strLen = 0; @@ -771,9 +773,10 @@ void SkyControl::setUpGameSprites(uint8 *nameBuf, dataFileHeader **nameSprites, } nameBuf += MAX_TEXT_LEN; nameSprites[cnt] = (dataFileHeader*)textSpr.textData; - if (firstNum + cnt == selectedGame) + if (firstNum + cnt == selectedGame) { nameSprites[cnt]->flag = 1; - else + _enteredTextWidth = (uint16)textSpr.textWidth; + } else nameSprites[cnt]->flag = 0; } } diff --git a/sky/control.h b/sky/control.h index f96bafcf64..fe2da43111 100644 --- a/sky/control.h +++ b/sky/control.h @@ -229,6 +229,7 @@ private: uint32 _curButtonText; uint16 _firstText; uint16 _savedMouse; + uint16 _enteredTextWidth; SkyConResource *createResource(void *pSpData, uint32 pNSprites, uint32 pCurSprite, int16 pX, int16 pY, uint32 pText, uint8 pOnClick, uint8 panelType); |