diff --git a/dat/outfit.xml b/dat/outfit.xml index e9bdb5a..b1782de 100644 --- a/dat/outfit.xml +++ b/dat/outfit.xml @@ -7,6 +7,7 @@ 5 5000 Your basic laser. + laser lasergreen @@ -30,6 +31,7 @@ 20 25000 Two laser cannons added on a rotating turret, allowing for 360 degrees of firepower! + laser_turret lasergreen @@ -53,6 +55,7 @@ 10 25000 Base for launching dumb missiles. + missile Missile @@ -66,6 +69,7 @@ 1 800 The cheapest missile on the market, what it lacks in a decent tracking system it makes up for in affordability and firepower. + missile missile @@ -89,6 +93,7 @@ 12 40000 The Headhunter Launcher is one of the most used missile launcher by the security companies. Much more reliable then the regular missiles, Headhunters feature more sensors and an advanced tracking system making them much better at hitting their targets. + missile Headhunter @@ -102,6 +107,7 @@ 1 2000 Headhunters first gained fame in the crush of the Vroen, a fearsome battle against a pirate stronghold where the Empire crushed the pirates thanks to the advanced guidance system on the Headhunter. Now used by mercenaries and bounty hunters all over. + missile headhunter @@ -125,6 +131,7 @@ 8 25000 Neutron Disruptor. + neutron neutron @@ -148,6 +155,7 @@ 2 22500 A heavy battery that will increase your ships energy allowing you to pack more firepower. + capacitator 75 @@ -160,6 +168,7 @@ 3 55000 A big panel that will generate energy based off solar energy. This will allow ships to regenerate it's enrgy supplies faster. + solar 125 @@ -172,6 +181,7 @@ 3 75000 An enhancement for the shield power system, allowing it to resist much heavier fire. + capacitator 30 @@ -184,6 +194,7 @@ 5 145000 A shield generator that feeds off the ship's main energy line. It will allow you to generate your shield faster and give you a small maximum shield boost at the expense of draining some of the ships energy. + shield 15 @@ -198,6 +209,7 @@ 1 125000 This enhancement routes energy from the ship's energy supplies to the engine, giving the ship an increased thrust. It does not increase the ship's max speed nor turn abilities. + reroute 60 @@ -211,6 +223,7 @@ 1 135000 By improving your ship's stabilization systems drastically, this modification will allow you to reach higher speeds while still keeping the ship stable. + stabilizer 50 @@ -225,6 +238,7 @@ 1 130000 + thruster 25 diff --git a/src/land.c b/src/land.c index 2669af9..0d08cc3 100644 --- a/src/land.c +++ b/src/land.c @@ -196,6 +196,10 @@ static void outfits(void) { BUTTON_WIDTH, BUTTON_HEIGHT, "btnSellOutfit", "Sell", outfits_sell); + // Fancy 128x128 image. + window_addRect(secondary_wid, -20, -50, 128, 128, "rctImage", &cBlack, 0); + 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); @@ -242,6 +246,8 @@ static void outfits_update(char* str) { outfitname = toolkit_getList(secondary_wid, "lstOutfits"); outfit = outfit_get(outfitname); + window_modifyImage(secondary_wid, "imgOutfit", outfit->gfx_store); + window_modifyText(secondary_wid, "txtDescription", outfit->description); credits2str(buf2, outfit->price, 2); credits2str(buf3, player_credits, 2); diff --git a/src/outfit.c b/src/outfit.c index 766277c..f5f5a2e 100644 --- a/src/outfit.c +++ b/src/outfit.c @@ -329,6 +329,7 @@ static Outfit* outfit_parse(const xmlNodePtr parent) { Outfit* tmp = CALLOC_L(Outfit); xmlNodePtr cur, node; char* prop; + char str[PATH_MAX] = "\0"; tmp->name = xml_nodeProp(parent, "name"); // Already malloced. if(tmp->name == NULL) WARN("Outfit in "OUTFIT_DATA" has invalid or no name"); @@ -345,6 +346,11 @@ static Outfit* outfit_parse(const xmlNodePtr parent) { else if(xml_isNode(cur, "price")) tmp->price = xml_getInt(cur); else if(xml_isNode(cur, "description")) tmp->description = strdup(xml_get(cur)); + else if(xml_isNode(cur, "gfx_store")) { + snprintf(str, strlen(xml_get(cur))+sizeof(OUTFIT_GFX)+10, + OUTFIT_GFX"store/%s.png", xml_get(cur)); + tmp->gfx_store = gl_newImage(str); + } } while((cur = cur->next)); } else if(xml_isNode(node, "specific")) { @@ -381,6 +387,7 @@ static Outfit* outfit_parse(const xmlNodePtr parent) { MELEMENT(tmp->name==NULL, "name"); MELEMENT(tmp->max==0, "max"); MELEMENT(tmp->tech==0, "tech"); + MELEMENT(tmp->gfx_store==NULL, "gfx_store"); //MELEMENT(tmp->mass==0, "mass"); MELEMENT(tmp->type==0, "type"); MELEMENT(tmp->price==0, "price"); @@ -445,6 +452,9 @@ void outfit_free(void) { if(outfit_stack[i].description) free(outfit_stack[i].description); + if(outfit_stack[i].gfx_store) + gl_freeTexture(outfit_stack[i].gfx_store); + free(outfit_stack[i].name); } free(outfit_stack);