[Add] Outfit graphics for store.

This commit is contained in:
Allanis 2013-03-19 00:13:03 +00:00
parent ee8512c5ef
commit 4abe914310
3 changed files with 30 additions and 0 deletions

View File

@ -7,6 +7,7 @@
<mass>5</mass>
<price>5000</price>
<description>Your basic laser.</description>
<gfx_store>laser</gfx_store>
</general>
<specific type="1">
<gfx>lasergreen</gfx>
@ -30,6 +31,7 @@
<mass>20</mass>
<price>25000</price>
<description>Two laser cannons added on a rotating turret, allowing for 360 degrees of firepower!</description>
<gfx_store>laser_turret</gfx_store>
</general>
<specific type="13">
<gfx>lasergreen</gfx>
@ -53,6 +55,7 @@
<mass>10</mass>
<price>25000</price>
<description>Base for launching dumb missiles.</description>
<gfx_store>missile</gfx_store>
</general>
<specific type="5" secondary="1">
<ammo>Missile</ammo>
@ -66,6 +69,7 @@
<mass>1</mass>
<price>800</price>
<description>The cheapest missile on the market, what it lacks in a decent tracking system it makes up for in affordability and firepower.</description>
<gfx_store>missile</gfx_store>
</general>
<specific type="6">
<gfx>missile</gfx>
@ -89,6 +93,7 @@
<mass>12</mass>
<price>40000</price>
<description>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.</description>
<gfx_store>missile</gfx_store>
</general>
<specific type="5" secondary="1">
<ammo>Headhunter</ammo>
@ -102,6 +107,7 @@
<mass>1</mass>
<price>2000</price>
<description>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.</description>
<gfx_store>missile</gfx_store>
</general>
<specific type="6">
<gfx>headhunter</gfx>
@ -125,6 +131,7 @@
<mass>8</mass>
<price>25000</price>
<description>Neutron Disruptor.</description>
<gfx_store>neutron</gfx_store>
</general>
<specific type="1">
<gfx>neutron</gfx>
@ -148,6 +155,7 @@
<mass>2</mass>
<price>22500</price>
<description>A heavy battery that will increase your ships energy allowing you to pack more firepower.</description>
<gfx_store>capacitator</gfx_store>
</general>
<specific type="15">
<energy>75</energy>
@ -160,6 +168,7 @@
<mass>3</mass>
<price>55000</price>
<description>A big panel that will generate energy based off solar energy. This will allow ships to regenerate it's enrgy supplies faster.</description>
<gfx_store>solar</gfx_store>
</general>
<specific type="15">
<energy_regen>125</energy_regen>
@ -172,6 +181,7 @@
<mass>3</mass>
<price>75000</price>
<description>An enhancement for the shield power system, allowing it to resist much heavier fire.</description>
<gfx_store>capacitator</gfx_store>
</general>
<specific type="15">
<shield>30</shield>
@ -184,6 +194,7 @@
<mass>5</mass>
<price>145000</price>
<description>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.</description>
<gfx_store>shield</gfx_store>
</general>
<specific type="15">
<shield>15</shield>
@ -198,6 +209,7 @@
<mass>1</mass>
<price>125000</price>
<description>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.</description>
<gfx_store>reroute</gfx_store>
</general>
<specific type="15">
<thrust>60</thrust>
@ -211,6 +223,7 @@
<mass>1</mass>
<price>135000</price>
<description>By improving your ship's stabilization systems drastically, this modification will allow you to reach higher speeds while still keeping the ship stable.</description>
<gfx_store>stabilizer</gfx_store>
</general>
<specific type="15">
<speed>50</speed>
@ -225,6 +238,7 @@
<mass>1</mass>
<price>130000</price>
<description> </description>
<gfx_store>thruster</gfx_store>
</general>
<specific type="15">
<turn>25</turn>

View File

@ -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);

View File

@ -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);