[Add] Show free cargo space in commodity window.
This commit is contained in:
parent
e256a1a4d0
commit
1ae475fcdf
22
src/land.c
22
src/land.c
@ -89,15 +89,17 @@ static void commodity_exchange(void) {
|
|||||||
(BUTTON_WIDTH-20)/2, BUTTON_HEIGHT, "btnCommoditySell",
|
(BUTTON_WIDTH-20)/2, BUTTON_HEIGHT, "btnCommoditySell",
|
||||||
"Sell", commodity_sell);
|
"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,
|
"txtSInfo", &gl_smallFont, &cDConsole,
|
||||||
"You have:\n"
|
"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);
|
"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);
|
BUTTON_WIDTH, 0, "txtDesc", &gl_smallFont, &cBlack, NULL);
|
||||||
|
|
||||||
goods = malloc(sizeof(char*)*planet->ncommodities);
|
goods = malloc(sizeof(char*)*planet->ncommodities);
|
||||||
@ -126,10 +128,13 @@ static void commodity_update(char* str) {
|
|||||||
com = commodity_get(comname);
|
com = commodity_get(comname);
|
||||||
|
|
||||||
snprintf(buf, 128,
|
snprintf(buf, 128,
|
||||||
"%d\n"
|
"%d tons\n"
|
||||||
"%d Screds/ton\n",
|
"%d Scred\n"
|
||||||
|
"\n"
|
||||||
|
"%d tons\n",
|
||||||
player_cargoOwned(comname),
|
player_cargoOwned(comname),
|
||||||
com->medium);
|
com->medium,
|
||||||
|
player->cargo_free);
|
||||||
|
|
||||||
window_modifyText(secondary_wid, "txtDInfo", buf);
|
window_modifyText(secondary_wid, "txtDInfo", buf);
|
||||||
window_modifyText(secondary_wid, "txtDesc", com->description);
|
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_addImage(secondary_wid, -20-128, -50-128, "imgOutfit", NULL);
|
||||||
|
|
||||||
window_addCust(secondary_wid, -40-BUTTON_WIDTH, 60+2*BUTTON_HEIGHT,
|
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,
|
window_addText(secondary_wid, 40+200+20, -60,
|
||||||
80, 96, 0, "txtSDesc", &gl_smallFont, &cDConsole,
|
80, 96, 0, "txtSDesc", &gl_smallFont, &cDConsole,
|
||||||
|
Loading…
Reference in New Issue
Block a user