From 299841d0127d848959f95fa7ff450625b62a8e31 Mon Sep 17 00:00:00 2001 From: Allanis Date: Sun, 17 Mar 2013 15:44:50 +0000 Subject: [PATCH] [Change] Some cosmetic changes to landing windows. --- src/land.c | 42 +++++++++++++++++++++++++++--------------- src/menu.c | 6 +++++- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/land.c b/src/land.c index 05d296b..3d3f6ee 100644 --- a/src/land.c +++ b/src/land.c @@ -27,11 +27,11 @@ // News window. #define NEWS_WIDTH 400 -#define NEWS_HEIGHT 400 +#define NEWS_HEIGHT 500 // Bar window. -#define BAR_WIDTH 600 -#define BAR_HEIGHT 400 +#define BAR_WIDTH 460 +#define BAR_HEIGHT 300 #define MUSIC_TAKEOFF "liftoff" #define MUSIC_LAND "agriculture" @@ -178,8 +178,10 @@ static void commodity_sell(char* str) { static void outfits(void) { char** outfits; int noutfits; + char buf[128]; - secondary_wid = window_create("Outfits", -1, -1, + snprintf(buf, 128, "%s - Outfits", planet->name); + secondary_wid = window_create(buf, -1, -1, OUTFITS_WIDTH, OUTFITS_HEIGHT); window_addButton(secondary_wid, -20, 20, @@ -350,8 +352,10 @@ static void outfits_renderMod(double bx, double by, double w, double h) { static void shipyard(void) { char** ships; int nships; + char buf[128]; - secondary_wid = window_create("Shipyard", + snprintf(buf, 128, "%s - Shipyard", planet->name); + secondary_wid = window_create(buf, -1, -1, SHIPYARD_WIDTH, SHIPYARD_HEIGHT); window_addButton(secondary_wid, -20, 20, @@ -458,12 +462,16 @@ static void shipyard_buy(char* str) { static void spaceport_bar(void) { secondary_wid = window_create("SpacePort Bar", -1, -1, BAR_WIDTH, BAR_HEIGHT); - window_addText(secondary_wid, 20, 20 + BUTTON_HEIGHT + 20, - BAR_WIDTH-140, BAR_HEIGHT - 40 - BUTTON_HEIGHT - 60, - 0, "txtDescription", &gl_smallFont, &cBlack, planet->bar_description); + window_addText(secondary_wid, 20, -30, + BAR_WIDTH-140, BAR_HEIGHT - 40 - BUTTON_HEIGHT, 0, + "txtDescription", &gl_smallFont, &cBlack, planet->bar_description); window_addButton(secondary_wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, "btnCloseBar", "Close", spaceport_bar_close); + + window_addButton(secondary_wid, 20, 20, + BUTTON_WIDTH, BUTTON_HEIGHT, "btnNews", + "News", (void(*)(char*))news); } static void spaceport_bar_close(char* str) { @@ -473,20 +481,23 @@ static void spaceport_bar_close(char* str) { // Planet news reports. static void news(void) { - secondary_wid = window_create("New Reports", -1, -1, NEWS_WIDTH, NEWS_HEIGHT); + unsigned int news_wid; + news_wid = window_create("News Reports", + -1, -1, NEWS_WIDTH, NEWS_HEIGHT); - window_addText(secondary_wid, 20, 20 + BUTTON_HEIGHT + 20, + window_addText(news_wid, 20, 20 + BUTTON_HEIGHT + 20, NEWS_WIDTH-40, NEWS_HEIGHT - 20 - BUTTON_HEIGHT - 20 - 20 -20, 0, "txtNews", &gl_smallFont, &cBlack, "News reporters report that they are on strike right now! D:"); - window_addButton(secondary_wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, + window_addButton(news_wid, -20, 20, + BUTTON_WIDTH, BUTTON_HEIGHT, "btnCloseNews", "Close", news_close); } static void news_close(char* str) { if(strcmp(str, "btnCloseNews")==0) - window_destroy(secondary_wid); + window_destroy(window_get("News Reports")); } // Land the player. @@ -523,13 +534,14 @@ void land(Planet* p) { BUTTON_WIDTH, BUTTON_HEIGHT, "btnOutfits", "Outfits", (void(*)(char*))outfits); - if(planet_hasService(planet, PLANET_SERVICE_BASIC)) + if(planet_hasService(planet, PLANET_SERVICE_BASIC)) { window_addButton(land_wid, 20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, "btnNews", - "News", (void(*)(char*))news); + "Mission Terminal", NULL); window_addButton(land_wid, 20, 20 + BUTTON_HEIGHT + 20, BUTTON_WIDTH, BUTTON_HEIGHT, "btnBar", - "SpaceBar", (void(*)(char*))spaceport_bar); + "Spaceport Bar", (void(*)(char*))spaceport_bar); + } landed = 1; diff --git a/src/menu.c b/src/menu.c index 1b3e3cb..23905b7 100644 --- a/src/menu.c +++ b/src/menu.c @@ -141,7 +141,7 @@ static void info_outfits_menu(char* str) { unsigned int wid; wid = window_create("Outfits", -1, -1, OUTFITS_WIDTH, OUTFITS_HEIGHT); - window_addText(wid, 20, 0, 100, OUTFITS_HEIGHT-40, + window_addText(wid, 20, -40, 100, OUTFITS_HEIGHT-40, 0, "txtLabel", &gl_smallFont, &cDConsole, "Ship Outfits:"); @@ -156,6 +156,10 @@ static void info_outfits_menu(char* str) { strcat(buf, buf2); } + window_addText(wid, 20, -45-gl_smallFont.h, + OUTFITS_WIDTH-40, OUTFITS_HEIGHT-60, + 0, "txtOutfits", &gl_smallFont, &cBlack, buf); + window_addButton(wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT, "closeOutfits", "Close", info_outfits_menu_close);