[Add] Spaceport bar. (no missions or hirelings or alchol available yet).
This commit is contained in:
parent
2c388ea1b0
commit
4384adec98
@ -8,6 +8,7 @@
|
||||
<general>
|
||||
<class>A</class>
|
||||
<description>The surface of the planet is predominantly covered with water and the planetary climate is characterised by abundant precipitation and strong winds, yet tolerable enough to make special and expensive weather control measurements unnecessary. Habitable land is characterised by soft meadows, swamps and dense forests. The resource base of KonoSphere consits mainly of agriculture and biomass, with the locally bred and grown kono rice being its main export, and fishing a traditional source of sustenance for its people. Other traditional products include wine, and various livestock, most prominently cattle. Cuisine on KonoSphere is rather refined, with most dishes containing meat.</description>
|
||||
<bar>The bar is just off the starport with a fantastic view of the harbour. You could watch the fishermen run frantically about attending their duties for hours.</bar>
|
||||
<faction>Independent</faction>
|
||||
<services>7</services>
|
||||
<tech>0</tech>
|
||||
@ -26,6 +27,7 @@
|
||||
<general>
|
||||
<class>A</class>
|
||||
<description>SaraCraft is a desert planet with no natural precipitation.</description>
|
||||
<bar>The SaraCraft canteen is a shady place. Many scoundrels and lowlifes make this thier home to avoid notice from the universal police.</bar>
|
||||
<faction>Independent</faction>
|
||||
<services>3</services>
|
||||
<tech>0</tech>
|
||||
|
23
src/land.c
23
src/land.c
@ -12,6 +12,10 @@
|
||||
#define NEWS_WIDTH 400
|
||||
#define NEWS_HEIGHT 400
|
||||
|
||||
// Bar window.
|
||||
#define BAR_WIDTH 600
|
||||
#define BAR_HEIGHT 400
|
||||
|
||||
int landed = 0;
|
||||
|
||||
static int land_wid = 0; // Primary land window.
|
||||
@ -22,6 +26,7 @@ static void commodity_exchange(coid);
|
||||
static void outfits(void);
|
||||
static void shipyard(void);
|
||||
static void spaceport_bar(void);
|
||||
static void spaceport_bar_close(char* str);
|
||||
static void news(void);
|
||||
static void news_close(char* str);
|
||||
|
||||
@ -37,10 +42,28 @@ static void shipyard(void) {
|
||||
|
||||
}
|
||||
|
||||
// Spaceport bar.
|
||||
static void spaceport_bar(void) {
|
||||
secondary_wid = window_create(-1, -1, BAR_WIDTH, BAR_HEIGHT);
|
||||
|
||||
// Window title.
|
||||
window_addText(secondary_wid, 0, -20, BAR_WIDTH, 0, 1,
|
||||
"txtTitle", NULL, &cBlack, "Spaceport Bar");
|
||||
|
||||
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_addButton(secondary_wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
|
||||
"btnCloseBar", "Close", spaceport_bar_close);
|
||||
|
||||
}
|
||||
static void spaceport_bar_close(char* str) {
|
||||
if(strcmp(str, "btnCloseBar")==0)
|
||||
window_destroy(secondary_wid);
|
||||
}
|
||||
|
||||
// Planet news reports.
|
||||
static void news(void) {
|
||||
secondary_wid = window_create(-1, -1, NEWS_WIDTH, NEWS_HEIGHT);
|
||||
|
||||
|
@ -291,6 +291,8 @@ static Planet* planet_get(const char* name) {
|
||||
tmp->faction = faction_get(xml_get(cur));
|
||||
else if(xml_isNode(cur, "description"))
|
||||
tmp->description = strdup(xml_get(cur));
|
||||
else if(xml_isNode(cur, "bar"))
|
||||
tmp->bar_description = strdup(xml_get(cur));
|
||||
else if(xml_isNode(cur, "services"))
|
||||
tmp->services = xml_getInt(cur);
|
||||
} while((cur = cur->next));
|
||||
|
@ -46,9 +46,11 @@ typedef struct {
|
||||
Vec2 pos; // Position in star system.
|
||||
|
||||
PlanetClass class; // Planet type.
|
||||
char* description; // Planet description.
|
||||
int services; // Offered services.
|
||||
Faction* faction; // Planet faction.
|
||||
|
||||
char* description; // Planet description.
|
||||
char* bar_description; // Spaceport bar description.
|
||||
int services; // Offered services.
|
||||
glTexture* gfx_space; // Graphics in space.
|
||||
glTexture* gfx_exterior; // Graphics in the exterior.
|
||||
} Planet;
|
||||
|
Loading…
Reference in New Issue
Block a user