[Add] Show free cargo space in commodity window.

This commit is contained in:
Allanis 2013-03-21 23:02:40 +00:00
parent e256a1a4d0
commit 1ae475fcdf
2 changed files with 25 additions and 19 deletions

View File

@ -89,15 +89,17 @@ static void commodity_exchange(void) {
(BUTTON_WIDTH-20)/2, BUTTON_HEIGHT, "btnCommoditySell",
"Sell", commodity_sell);
window_addText(secondary_wid, -20, -40, BUTTON_WIDTH, 20, 0,
window_addText(secondary_wid, -20, -40, BUTTON_WIDTH, 60, 0,
"txtSInfo", &gl_smallFont, &cDConsole,
"You have:\n"
"Market price:\n");
"Market price:\n"
"\n"
"Free Space:\n");
window_addText(secondary_wid, -20, -40, BUTTON_WIDTH/2, 20, 0,
window_addText(secondary_wid, -20, -40, BUTTON_WIDTH/2, 60, 0,
"txtDInfo", &gl_smallFont, &cBlack, NULL);
window_addText(secondary_wid, -40, -80, BUTTON_WIDTH-20,
window_addText(secondary_wid, -40, -100, BUTTON_WIDTH-20,
BUTTON_WIDTH, 0, "txtDesc", &gl_smallFont, &cBlack, NULL);
goods = malloc(sizeof(char*)*planet->ncommodities);
@ -126,10 +128,13 @@ static void commodity_update(char* str) {
com = commodity_get(comname);
snprintf(buf, 128,
"%d\n"
"%d Screds/ton\n",
"%d tons\n"
"%d Scred\n"
"\n"
"%d tons\n",
player_cargoOwned(comname),
com->medium);
com->medium,
player->cargo_free);
window_modifyText(secondary_wid, "txtDInfo", buf);
window_modifyText(secondary_wid, "txtDesc", com->description);
@ -201,7 +206,8 @@ static void outfits(void) {
window_addImage(secondary_wid, -20-128, -50-128, "imgOutfit", NULL);
window_addCust(secondary_wid, -40-BUTTON_WIDTH, 60+2*BUTTON_HEIGHT,
BUTTON_WIDTH, BUTTON_HEIGHT, "cstMod", 0, outfits_renderMod, NULL);
BUTTON_WIDTH, BUTTON_HEIGHT,
"cstMod", 0, outfits_renderMod, NULL);
window_addText(secondary_wid, 40+200+20, -60,
80, 96, 0, "txtSDesc", &gl_smallFont, &cDConsole,