aboutsummaryrefslogtreecommitdiff
path: root/trade.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-28 00:18:29 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-28 00:18:29 -0500
commit68d09777d9f188b2ac69c98ccfdcc315037224fd (patch)
tree76d41617e8ec05be2afe50a8f1b3dd6660f32332 /trade.c
parentAdded battles (diff)
download7w-68d09777d9f188b2ac69c98ccfdcc315037224fd.tar.gz
7w-68d09777d9f188b2ac69c98ccfdcc315037224fd.tar.bz2
7w-68d09777d9f188b2ac69c98ccfdcc315037224fd.zip
added science to vp count; color to trades
Diffstat (limited to 'trade.c')
-rw-r--r--trade.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/trade.c b/trade.c
index be3d339..8e474bd 100644
--- a/trade.c
+++ b/trade.c
@@ -14,8 +14,10 @@ int io_getkey();
void io_printborder(int x, int y, int width);
int io_printtext(int xorigin, int y, int width, char* text);
void io_printplain(int x, int y, char *s);
+void io_printcolor(int x, int y, int color, char *s);
char* getname(int res);
int view_refresh(int focus, int cursor, int player);
+char* itoa(int i);
static int tradebuffer[3][GOLD+1];
@@ -96,6 +98,10 @@ void trade_print(int x, int y, int player, int cursorx, int cursory)
for(i = 0; i < GOLD+1; i++) {
sprintf(s, "%-7s %d %c| %-7s %d %c", getname(i), west[i], (cursorx == 1 && cursory == i)? '*' : ' ', getname(i), east[i], (cursorx == 0 && cursory == i)? '*' : ' ');
y = io_printtext(x, y, width, s);
+ if(tradebuffer[1][i])
+ io_printcolor(x+10, y-1, 31, itoa(west[i]));
+ if(tradebuffer[0][i])
+ io_printcolor(x+23, y-1, 31, itoa(east[i]));
}
sprintf(s, "Your gold: %d", data_getgold(player));
y = io_printtext(x, y, width, s);
bgstack15