diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-02-25 21:12:35 -0500 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-02-25 21:12:35 -0500 |
commit | 2a07633968f1b80fb7e602ba2c5952af3c10e35f (patch) | |
tree | 36871a529c791821e61a07bd79cfae2e1212b18d /view.c | |
parent | Can select build type (diff) | |
download | 7w-2a07633968f1b80fb7e602ba2c5952af3c10e35f.tar.gz 7w-2a07633968f1b80fb7e602ba2c5952af3c10e35f.tar.bz2 7w-2a07633968f1b80fb7e602ba2c5952af3c10e35f.zip |
Trade ui implemented
Diffstat (limited to 'view.c')
-rw-r--r-- | view.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -2,12 +2,12 @@ int print_wonder(int x, int y, int player, int cursor); int print_wondersmall(int x, int y, int player, int selected, int dir); -void io_printcard(int x, int y, int era, int card); -void io_printhand(int x, int y, int player, int cursor); +int io_printhand(int x, int y, int player, int cursor); void io_clearscreen(); int data_numplayers(); -void io_printhand(int x, int y, int player, int cursor); void printmessage(int x, int y, int width); +int data_geteast(int p); +int data_getwest(int p); void view_printwonders(int focus, int cursor, int player) { @@ -17,8 +17,8 @@ void view_printwonders(int focus, int cursor, int player) for(i = 0; i < num; i++) { p = (player+i)%num; dir = 0; - if(i == 1) dir = 1; - if(i == num-1) dir = 2; + if(p == data_geteast(player)) dir = 1; + if(p == data_getwest(player)) dir = 2; if(focus == p) print_wonder(34, 0, p, cursor); y = print_wondersmall(x, y, p, focus == p, dir); @@ -26,14 +26,16 @@ void view_printwonders(int focus, int cursor, int player) printmessage(0, y+2, 35); } -void view_refresh(int focus, int cursor, int player) +int view_refresh(int focus, int cursor, int player) { + int ret; io_clearscreen(); if(focus == data_numplayers()) { view_printwonders(player, -1, player); - io_printhand(61, 0, player, cursor); + ret = io_printhand(61, 0, player, cursor); } else { view_printwonders((focus+player)%data_numplayers(), cursor, player); - io_printhand(61, 0, player, -1); + ret = io_printhand(61, 0, player, -1); } + return ret; } |