save commander string editor fixes
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@109 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
c51ae31537
commit
f33bf945d0
@ -148,14 +148,11 @@
|
||||
{
|
||||
[self handleGUIUpDownArrowKeys: gui :gameView];
|
||||
commanderNameString=[gameView typedString];
|
||||
if([commanderNameString length])
|
||||
{
|
||||
[gui setText:
|
||||
[gui setText:
|
||||
[NSString stringWithFormat:@"Commander name: %@", commanderNameString]
|
||||
forRow: INPUTROW];
|
||||
}
|
||||
|
||||
if([gameView isDown: 13])
|
||||
if([gameView isDown: 13] && [commanderNameString length])
|
||||
{
|
||||
[self nativeSavePlayer: commanderNameString];
|
||||
}
|
||||
|
@ -878,7 +878,10 @@ Your fair use and other rights are in no way affected by the above.
|
||||
}
|
||||
|
||||
// keys 0-9, Space
|
||||
if((key >= '0' && key <= '9') || key == ' ')
|
||||
// TODO: Investigation.
|
||||
// there seems to be some problem with '0' and '2' randomly popping
|
||||
// up. Possible SDL fault? Not a big loss not to have them though.
|
||||
if(/*(key >= '0' && key <= '9') || */key == ' ')
|
||||
{
|
||||
[typedString appendFormat:@"%c", key];
|
||||
}
|
||||
@ -886,7 +889,7 @@ Your fair use and other rights are in no way affected by the above.
|
||||
// Del, Backspace
|
||||
if(key == SDLK_BACKSPACE || key == SDLK_DELETE)
|
||||
{
|
||||
if([typedString length] > 1)
|
||||
if([typedString length] >= 1)
|
||||
{
|
||||
[typedString deleteCharactersInRange:
|
||||
NSMakeRange([typedString length]-1, 1)];
|
||||
|
Loading…
x
Reference in New Issue
Block a user