diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-04-02 13:10:41 -0400 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-04-02 13:10:41 -0400 |
commit | c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f (patch) | |
tree | 3f8a1b0daf0e34b6e072d0f7e669fb5d3ba92b56 /io.c | |
parent | Added more special actions (diff) | |
download | 7w-c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f.tar.gz 7w-c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f.tar.bz2 7w-c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f.zip |
Halicarnassus bug fixes
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 38 |
1 files changed, 25 insertions, 13 deletions
@@ -189,24 +189,36 @@ int io_printcard(int x, int y, int era, int card, int player) return y; } -int io_printhand(int x, int y, int player, int cursor) +int* data_getdiscards(); +int print_cards(int x, int y, int *cards, int cursor); + +int io_printhand(int x, int y, int player, int cursor, int mode) //mode 0 is normal, 1 is discard search { - int *hand = data_gethand(player); + int *hand; + if(mode) hand = data_getdiscards(); + else hand = data_gethand(player); int i; io_printborder(x, y++, 28); - y = io_printtext(x, y, 28, " Hand"); - for(i = 0; hand[i] != -1 && i < 7; i++) { - io_printname(x, y++, data_getera(), hand[i]); - if(i == cursor) { - mvprintw(y-1, x+25, "*"); + if(mode) { + y = io_printtext(x, y, 28, " Discards"); + y = print_cards(x, y, hand, cursor); + y = io_printcard(x, y, hand[cursor*2], hand[cursor*2+1], player); + } + else { + y = io_printtext(x, y, 28, " Hand"); + for(i = 0; hand[i] != -1 && i < 7; i++) { + io_printname(x, y++, data_getera(), hand[i]); + if(i == cursor) { + mvprintw(y-1, x+25, "*"); + } } + y = io_printtext(x, y, 28, " Trade..."); + if(i == cursor) + mvprintw(y-1, x+25, "*"); + else if(cursor >= 0 && cursor < 7 && hand[cursor] != -1) + y = io_printcard(x, y, data_getera(), hand[cursor], player); + else io_printborder(x, y++, 28); } - y = io_printtext(x, y, 28, " Trade..."); - if(i == cursor) - mvprintw(y-1, x+25, "*"); - else if(cursor >= 0 && cursor < 7 && hand[cursor] != -1) - y = io_printcard(x, y, data_getera(), hand[cursor], player); - else io_printborder(x, y++, 28); return y; } |