From f5834d33f98d93d717f19f2d9e84178c08185c3f Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Tue, 19 Feb 2013 21:46:11 +0000 Subject: [PATCH] [Add] Commodity exchange. The market is closed the minute. :P --- src/land.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/land.c b/src/land.c index ffff9a6..191412e 100644 --- a/src/land.c +++ b/src/land.c @@ -16,13 +16,18 @@ #define BAR_WIDTH 600 #define BAR_HEIGHT 400 +// Commodity window. +#define COMMODITY_WIDTH 400 +#define COMMODITY_HEIGHT 400 + int landed = 0; static int land_wid = 0; // Primary land window. static int secondary_wid = 0; // For the second opened land window (We can only have 2 max). static Planet* planet = NULL; -static void commodity_exchange(coid); +static void commodity_exchange(void); +static void commodity_exchange_close(char* str); static void outfits(void); static void shipyard(void); static void spaceport_bar(void); @@ -30,8 +35,18 @@ static void spaceport_bar_close(char* str); static void news(void); static void news_close(char* str); +// The local market. static void commodity_exchange(void) { + secondary_wid = window_create("Commodity Exchange", -1, -1, COMMODITY_WIDTH, COMMODITY_HEIGHT); + window_addButton(secondary_wid, -20, 20, + BUTTON_WIDTH, BUTTON_HEIGHT, "btnCommodityClose", + "Close", commodity_exchange_close); +} + +static void commodity_exchange_close(char* str) { + if(strcmp(str, "btnCommodityClose")==0) + window_destroy(secondary_wid); } static void outfits(void) {