Added support for quitting without ^C, and outputting to file
This commit is contained in:
parent
6d879da5fa
commit
d0c257b310
5 changed files with 68 additions and 23 deletions
11
ui_ncurses.c
11
ui_ncurses.c
|
|
@ -207,7 +207,7 @@ void updateBoard(
|
|||
);
|
||||
}
|
||||
|
||||
int askColumn(
|
||||
columnsint_t askColumn(
|
||||
const board_t board
|
||||
){
|
||||
columnsint_t column = 0;
|
||||
|
|
@ -228,7 +228,8 @@ int askColumn(
|
|||
column += ( column < board.columns - 1 );
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
column -= ( column > 0 );
|
||||
if( column == 0 ) return QUITCOLUMN;
|
||||
column --;
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
return column;
|
||||
|
|
@ -239,7 +240,7 @@ int askColumn(
|
|||
else column++;
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
if( column == 0 ) ch = KEY_RIGHT;
|
||||
if( column == 0 ) return QUITCOLUMN;
|
||||
else column--;
|
||||
break;
|
||||
}
|
||||
|
|
@ -272,6 +273,10 @@ int askColumn(
|
|||
#endif /* ! ARROWS */
|
||||
}
|
||||
|
||||
void exit_ui(void){
|
||||
endwin();
|
||||
}
|
||||
|
||||
#undef INPUT_X
|
||||
#undef INPUT_Y
|
||||
#undef SCOREBOARD_X
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue