28#include "land_outfits.h"
38#include "player_fleet.h"
39#include "pilot_outfit.h"
42#include "tk/toolkit_priv.h"
48#define EQUIPMENT_SHIPS "iarAvailShips"
49#define EQUIPMENT_OUTFIT_TAB "tabOutfits"
50#define EQUIPMENT_OUTFITS "iarAvailOutfits"
51#define EQUIPMENT_FILTER "inpFilterOutfits"
55#define BUTTON_WIDTH 200
56#define BUTTON_HEIGHT 40
68static nlua_env autoequip_env = LUA_NOREF;
76 int *sw,
int *sh,
int *ow,
int *oh,
78 int *cw,
int *ch,
int *bw,
int *bh );
84static void equipment_toggleDeploy(
unsigned int wid,
const char *wgt );
97 double x,
double y,
double w,
double h,
double rx,
double ry,
void *data );
99static char eq_qCol(
double cur,
double base,
int inv );
111static void equipment_outfitPopdown(
unsigned int wid,
const char* str );
125 int id, active, minimal, n, nfits;
130 active = window_tabWinGetActive( wid, EQUIPMENT_OUTFIT_TAB );
131 id = toolkit_getImageArrayPos( wid, EQUIPMENT_OUTFITS );
143 case OUTFIT_SLOT_STRUCTURE:
146 case OUTFIT_SLOT_UTILITY:
149 case OUTFIT_SLOT_WEAPON:
160 for (
int i=0; i<n; i++) {
166 if (o->
slot.
size == OUTFIT_SLOT_SIZE_NA)
177 if (slots[minimal].outfit != NULL)
187 if (o->
limit != NULL) {
189 for (
int i=0; i<n; i++) {
195 if (o->
slot.
size == OUTFIT_SLOT_SIZE_NA)
199 if ((slots[i].outfit == NULL) || (slots[i].outfit->limit == NULL))
203 if (strcmp(slots[i].outfit->limit,o->
limit)!=0)
221 size = OUTFIT_SLOT_SIZE_NA;
223 for (
int i=0; i<n; i++) {
225 if (slots[i].outfit != NULL)
233 if (o->
slot.
size == OUTFIT_SLOT_SIZE_NA)
237 if ((size == OUTFIT_SLOT_SIZE_NA) || (slots[i].sslot->slot.size < size)){
256 int *sw,
int *sh,
int *ow,
int *oh,
258 int *cw,
int *ch,
int *bw,
int *bh )
265 ssw = 550 + (*w - LAND_WIDTH);
290 *bw = (*w - 20 - (sw!=NULL?*sw:0) - 40 - 20 - 60) / 5;
300 int w,h, sw,sh, ow,oh, bw,bh, ew,eh, cw,ch, x,y;
306 land_tabGenerate(LAND_WINDOW_EQUIPMENT);
313 &ew, &eh, &cw, &ch, &bw, &bh );
318 window_addButtonKey( wid, x, y,
319 bw, bh,
"btnCloseEquipment",
322 window_addButtonKey( wid, x, y,
323 bw, bh,
"btnSellShip",
326 window_addButtonKey( wid, x, y,
327 bw, bh,
"btnChangeShip",
330 window_addButtonKey( wid, x, y,
331 bw, bh,
"btnUnequipShip",
334 window_addButtonKey( wid, x, y,
335 bw, bh,
"btnAutoequipShip",
340 iar_data = calloc( OUTFIT_TABS,
sizeof(iar_data_t) );
342 memset(
iar_data, 0,
sizeof(iar_data_t) * OUTFIT_TABS );
346 for (
int i=0; i<OUTFIT_TABS; i++)
361 window_addText( wid, x, y,
362 130, y-20+h-bh, 0,
"txtSDesc", &
gl_defFont, &cFontGrey, NULL );
363 window_addText( wid, x, y,
364 w-x-128-30, y-20+h-bh, 0,
"txtAcquired", &
gl_defFont, NULL, NULL );
366 window_addText( wid, x, y,
367 w-x-20-128-20, y-20+h-bh, 0,
"txtDDesc", &
gl_defFont, NULL, NULL );
370 window_addText( wid, 30, -20,
372 window_addText( wid, 30, -40-sh-20,
381 window_addCheckbox( wid, x, y, cw, 30,
"chkDeploy", _(
"Deployed"), equipment_toggleDeploy, 0 );
385 window_addButtonKey( wid, x, y, 128+8, bh,
"btnRenameShip",
388 window_addButtonKey( wid, x, y, 128+8, bh,
"btnShipMode",
403 window_addCust( wid, -20-(128-cw)/2, -20-150, cw, ch,
"cstMisc", 0,
408 window_addRect( wid, -20+4, -40+4, 128+8, 128+8,
"rctShip", &cBlack, 1 );
409 window_addCust( wid, -20, -40, 128, 128,
"cstShip", 0,
428 double x,
double y,
double w,
double h,
435 window_addCust( wid, x, y, w, h,
"cstEquipment", 0,
437 window_custSetClipping( wid,
"cstEquipment", 0 );
448 const glColour *
c, *dc, *rc;
456 if ((o != NULL) && (lst[0].sslot->slot.type == o->
slot.
type))
461 x-15., y+h+10.,
c, -1., txt );
492 if (lst[i].outfit != NULL) {
497 else if ((o != NULL) &&
498 (lst[i].sslot->slot.type == o->
slot.
type)) {
501 glUseProgram( shaders.status.program );
502 glUniform1f( shaders.status.paramf, ok );
509 if (lst[i].sslot->locked)
511 else if (lst[i].sslot->required)
513 else if (lst[i].sslot->exclusive)
515 else if (lst[i].sslot->slot.spid != 0)
540 double *w,
double *h,
int *n,
int *m )
547 th = bh / (double)tm;
549 s =
MIN( th, tw ) - 20.;
585 selected = wgt->
slot;
593 y = by + bh - (h+20) + (h+20-h)/2;
595 p->outfit_weapon, _(
"Weapon"),
596 selected, wgt->
outfit, p, wgt );
601 y = by + bh - (h+20) + (h+20-h)/2;
603 p->outfit_utility, _(
"Utility"),
604 selected, wgt->
outfit, p, wgt );
609 y = by + bh - (h+20) + (h+20-h)/2;
611 p->outfit_structure, _(
"Structure"),
612 selected, wgt->
outfit, p, wgt );
641 y = by + bh - 30 - h;
649 toolkit_drawRect( x + w * percent, y - 2, w * (1.-percent), h + 4, &cBlack, NULL );
660 percent = (p->cpu_max > 0) ?
CLAMP(0., 1., (
double)p->cpu / (double)p->cpu_max) : 0.;
662 toolkit_drawRect( x + w * percent, y - 2, w * (1.-percent), h + 4, &cRed, NULL );
671 percent = (p->stats.engine_limit > 0) ?
CLAMP(0., 1.,
672 (p->stats.engine_limit - p->solid->mass) / p->stats.engine_limit) : 0.;
674 toolkit_drawRect( x + w * percent, y - 2, w * (1.-percent), h + 4, &cOrange, NULL );
677 &cFontWhite,
"%.0f / %.0f", p->stats.engine_limit - p->solid->mass, p->stats.engine_limit );
680 if (p->stats.engine_limit > 0. && p->solid->mass > p->stats.engine_limit) {
682 x, y, &cFontRed, _(
"!! %.0f%% Slower !!"),
683 (1. - p->speed / p->speed_base) * 100);
702 int text_width, yoff;
709 if (lst[i].outfit != NULL) {
717 if ((i==mover) || subtitle) {
720 if (lst[i].sslot->locked) {
721 display = _(
"Locked");
724 else if (lst[i].outfit != NULL) {
730 display = _(
"Right click to remove");
734 else if ((wgt->
outfit != NULL) &&
741 display = _(
"Right click to add");
746 else if (lst[i].outfit != NULL) {
750 if (display != NULL) {
813 y = by + bh - (h+20) + (h+20-h)/2;
815 p->outfit_weapon, mover, wgt );
818 y = by + bh - (h+20) + (h+20-h)/2;
820 p->outfit_utility, mover, wgt );
823 y = by + bh - (h+20) + (h+20-h)/2;
825 p->outfit_structure, mover, wgt );
833 slot = &p->outfit_weapon[wgt->
mouseover];
837 slot = &p->outfit_structure[ wgt->
mouseover -
851 pos +=
scnprintf( &alt[pos],
sizeof(alt)-pos, _(
"#%c%s #%c%s #0slot" ),
855 pos +=
scnprintf( &alt[pos],
sizeof(alt)-pos,
857 if (slot->
sslot->
locked && (pos < (
int)
sizeof(alt)))
858 pos +=
scnprintf( &alt[pos],
sizeof(alt)-pos,
859 "#r%s#0", _(
" [locked]") );
871 if (slot->
lua_mem != LUA_NOREF) {
890 double bw,
double bh,
void *data )
907 tick = SDL_GetTicks();
916 if (p->ship->gfx_space->sw > bw) {
921 pw = p->ship->gfx_space->sw;
922 ph = p->ship->gfx_space->sh;
930 if (debug_isFlag(DEBUG_MARK_EMITTER)) {
932 double dircos, dirsin;
936 for (i=0; i<
array_size(p->ship->trail_emitters); i++) {
937 v.x = p->ship->trail_emitters[i].x_engine * dircos -
938 p->ship->trail_emitters[i].y_engine * dirsin;
939 v.y = p->ship->trail_emitters[i].x_engine * dirsin +
940 p->ship->trail_emitters[i].y_engine * dircos +
941 p->ship->trail_emitters[i].h_engine;
942 v.x *= pw / p->ship->gfx_space->sw;
943 v.y *= ph / p->ship->gfx_space->sh;
944 if (p->ship->trail_emitters[i].trail_spec->nebula)
945 gl_renderCross(px + pw/2. + v.x, py + ph/2. + v.y*M_SQRT1_2, 2., &cFontBlue);
947 gl_renderCross(px + pw/2. + v.x, py + ph/2. + v.y*M_SQRT1_2, 4., &cInert);
958 v.x *= pw / p->ship->gfx_space->sw;
959 v.y *= ph / p->ship->gfx_space->sh;
962 glUseProgram(shaders.crosshairs.program);
963 glUniform1f(shaders.crosshairs.paramf, 2.);
964 gl_renderShader( px+v.x, py+v.y, 7., 7., 0., &shaders.crosshairs, &cRadar_player, 1 );
978 for (
int i=0; i<n; i++) {
979 if ((my > y) && (my < y+h+20.))
1008 if (event->type == SDL_MOUSEBUTTONDOWN) {
1011 if (event->button.button == SDL_BUTTON_LEFT)
1012 wgt->
slot = selected + ret;
1013 else if ((event->button.button == SDL_BUTTON_RIGHT) &&
1024 if (event->button.button == SDL_BUTTON_LEFT)
1026 else if (event->button.button == SDL_BUTTON_RIGHT)
1081 double mx,
double my,
double bw,
double bh,
1082 double rx,
double ry,
void *data )
1102 if ((event->type != SDL_MOUSEBUTTONDOWN) &&
1103 (
event->type != SDL_MOUSEMOTION))
1114 tw = bw / (double)n;
1119 y = bh - (h+20) + (h+20-h)/2 - 10;
1120 if ((mx > x-10) && (mx < x+w+10)) {
1122 p->outfit_weapon, p, selected, wgt );
1124 return !!(
event->type == SDL_MOUSEBUTTONDOWN);
1128 if ((mx > x-10) && (mx < x+w+10)) {
1130 p->outfit_utility, p, selected, wgt );
1132 return !!(
event->type == SDL_MOUSEBUTTONDOWN);
1136 if ((mx > x-10) && (mx < x+w+10)) {
1138 p->outfit_structure, p, selected, wgt );
1140 return !!(
event->type == SDL_MOUSEBUTTONDOWN);
1158 if (slot->
outfit != NULL) {
1238 double offship, offoutfit;
1256 noutfit = toolkit_getImageArrayPos( wid, EQUIPMENT_OUTFITS );
1257 offoutfit = toolkit_getImageArrayOffset( wid, EQUIPMENT_OUTFITS );
1261 nship = toolkit_getImageArrayPos( wid, EQUIPMENT_SHIPS );
1262 offship = toolkit_getImageArrayOffset( wid, EQUIPMENT_SHIPS );
1263 s = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
1264 selship = strdup( s );
1273 toolkit_setImageArrayPos( wid, EQUIPMENT_OUTFITS, noutfit );
1274 toolkit_setImageArrayOffset( wid, EQUIPMENT_OUTFITS, offoutfit );
1278 toolkit_setImageArrayPos( wid, EQUIPMENT_SHIPS, nship );
1279 toolkit_setImageArrayOffset( wid, EQUIPMENT_SHIPS, offship );
1281 s = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
1282 if ((s != NULL) && (strcmp(s,selship)!=0)) {
1283 int ret = toolkit_setImageArray( wid, EQUIPMENT_SHIPS, selship );
1285 toolkit_setImageArrayPos( wid, EQUIPMENT_SHIPS, nship );
1345 _(
"%.2f DPS [%.2f EPS]"), dps, eps );
1355 int state = window_checkboxState( wid, wgt );
1356 const char *shipname = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
1369static void equipment_toggleDeploy(
unsigned int wid,
const char *wgt )
1371 int state = window_checkboxState( wid, wgt );
1372 const char *shipname = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
1381 if (state && ship_isFlag( ps->
p->
ship, SHIP_NOESCORT )) {
1382 dialogue_msg( _(
"Invalid Escort"), _(
"You can not set your ship '%s' as an escort!"), ps->
p->
name );
1390 window_checkboxSet( wid, wgt, 1 );
1421 ImageArrayCell *cships;
1433 NULL, NULL, NULL, NULL, NULL, NULL );
1439 if (spob_hasService(
land_spob, SPOB_SERVICE_SHIPYARD))
1443 cships = calloc( nships,
sizeof(ImageArrayCell) );
1448 t =
gl_newImage( OVERLAY_GFX_PATH
"active.webp", 0 );
1449 cships[0].layers =
gl_addTexArray( cships[0].layers, &cships[0].nlayers, t );
1451 t =
gl_newImage( OVERLAY_GFX_PATH
"favourite.webp", 0 );
1452 cships[0].layers =
gl_addTexArray( cships[0].layers, &cships[0].nlayers, t );
1455 snprintf( r,
sizeof(r), OVERLAY_GFX_PATH
"rarity_%d.webp",
player.
p->
ship->
rarity );
1457 cships[0].layers =
gl_addTexArray( cships[0].layers, &cships[0].nlayers, t );
1459 if (spob_hasService(
land_spob, SPOB_SERVICE_SHIPYARD)) {
1463 cships[i].image =
gl_dupTexture( ps[i-1].p->ship->gfx_store );
1464 cships[i].caption = strdup( ps[i-1].p->name );
1465 cships[i].layers =
gl_copyTexArray( ps[i-1].p->ship->gfx_overlays, &cships[i].nlayers );
1466 if (ps[i-1].favourite) {
1467 t =
gl_newImage( OVERLAY_GFX_PATH
"favourite.webp", 0 );
1468 cships[i].layers =
gl_addTexArray( cships[i].layers, &cships[i].nlayers, t );
1470 if (ps[i-1].deployed) {
1471 t =
gl_newImage( OVERLAY_GFX_PATH
"fleet.webp", 0 );
1472 cships[i].layers =
gl_addTexArray( cships[i].layers, &cships[i].nlayers, t );
1474 if (ps[i-1].p->ship->rarity > 0) {
1475 snprintf( r,
sizeof(r), OVERLAY_GFX_PATH
"rarity_%d.webp", ps[i-1].p->ship->rarity );
1477 cships[i].layers =
gl_addTexArray( cships[i].layers, &cships[i].nlayers, t );
1482 for (
int i=0; i<nships; i++) {
1484 cships[i].alt = malloc( STRMAX_SHORT );
1485 l = snprintf( &cships[i].alt[0], STRMAX_SHORT, _(
"Ship Stats\n") );
1488 free( cships[i].alt );
1489 cships[i].alt = NULL;
1496 if (toolkit_simImageArrayVisibleElements(sw,sh,iconsize,iconsize) < nships)
1498 if (toolkit_simImageArrayVisibleElements(sw,sh,iconsize,iconsize) < nships)
1501 window_addImageArray( wid, 20, -40,
1502 sw, sh, EQUIPMENT_SHIPS, iconsize, iconsize,
1507static int equipment_filter(
const Outfit *o ) {
1519 for (
int i=0; i <
array_size(p->outfits); i++) {
1532 for (
int i=0; i <
array_size(p->outfits); i++) {
1539 return (o->
slot.
size==OUTFIT_SLOT_SIZE_LIGHT);
1541 return (o->
slot.
size==OUTFIT_SLOT_SIZE_MEDIUM);
1543 return (o->
slot.
size==OUTFIT_SLOT_SIZE_HEAVY);
1547static int equipment_filterWeapon(
const Outfit *o ) {
1548 return equipment_filter(o) && outfit_filterWeapon(o);
1550static int equipment_filterUtility(
const Outfit *o ) {
1551 return equipment_filter(o) && outfit_filterUtility(o);
1553static int equipment_filterStructure(
const Outfit *o ) {
1554 return equipment_filter(o) && outfit_filterStructure(o);
1556static int equipment_filterCore(
const Outfit *o ) {
1557 return equipment_filter(o) && outfit_filterCore(o);
1566 int x, y, w, h, ow, oh;
1567 int ix, iy, iw, ih, barw;
1568 const char *filtertext;
1569 int (*tabfilters[])(
const Outfit *o ) = {
1571 equipment_filterWeapon,
1572 equipment_filterUtility,
1573 equipment_filterStructure,
1574 equipment_filterCore,
1576 const char *tabnames[] = {
1577 _(
"All"), _(OUTFIT_LABEL_WEAPON), _(OUTFIT_LABEL_UTILITY), _(OUTFIT_LABEL_STRUCTURE), _(OUTFIT_LABEL_CORE)
1579 int noutfits, active;
1580 ImageArrayCell *coutfits;
1586 NULL, NULL, NULL, NULL, NULL, NULL );
1597 window_addTabbedWindow( wid, x, y + oh - 30, ow, 30,
1598 EQUIPMENT_OUTFIT_TAB, OUTFIT_TABS, tabnames, 1 );
1600 barw = window_tabWinGetBarWidth( wid, EQUIPMENT_OUTFIT_TAB );
1602 iw =
CLAMP(0, 150, ow - barw - 30);
1606 iy = y + oh - 25 - 1;
1610 WARN(_(
"Very little space on equipment outfit tabs!"));
1614 window_addButton( wid, ix+iw-30, iy, 30, 30,
"btnOutfitFilter", NULL, equipment_outfitPopdown );
1615 window_buttonCustomRender( wid,
"btnOutfitFilter", window_buttonCustomRenderGear );
1619 window_addInput( wid, ix, iy, iw, ih, EQUIPMENT_FILTER, 32, 1, NULL );
1620 inp_setEmptyText( wid, EQUIPMENT_FILTER, _(
"Filter…") );
1625 active = window_tabWinGetActive(
equipment_wid, EQUIPMENT_OUTFIT_TAB );
1638 filtertext = window_getInput(
equipment_wid, EQUIPMENT_FILTER );
1639 if (strlen(filtertext) == 0)
1652 if (toolkit_simImageArrayVisibleElements(iw,ih,iconsize,iconsize) < noutfits)
1654 if (toolkit_simImageArrayVisibleElements(iw,ih,iconsize,iconsize) < noutfits)
1657 window_addImageArray( wid, x + 4, y + 3, iw, ih,
1658 EQUIPMENT_OUTFITS, iconsize, iconsize,
1670static char eq_qCol(
double cur,
double base,
int inv )
1673 return (inv) ?
'r' :
'g';
1674 else if (cur < 0.8*base)
1675 return (inv) ?
'g' :
'r';
1682static const char*
eq_qSym(
double cur,
double base,
int inv )
1685 return (inv) ?
"!! " :
"";
1686 else if (cur < 0.8*base)
1687 return (inv) ?
"" :
"!! ";
1691#define EQ_COMP( cur, base, inv ) \
1692eq_qCol( cur, base, inv ), eq_qSym( cur, base, inv ), cur
1701 char buf[STRMAX], buf_price[ECON_CRED_STRLEN];
1702 char errorReport[STRMAX_SHORT], tbuf[64];
1703 const char *shipname, *acquired;
1704 char sdet[NUM2STRLEN], seva[NUM2STRLEN], sste[NUM2STRLEN];
1705 char smass[NUM2STRLEN], sfuel[NUM2STRLEN];
1709 int onboard, cargo, jumps, favourite, deployed, x, h, spaceworthy;
1710 int ww, wh, sw, sh, hacquired, hname;
1714 equipment_getDim( wid, &ww, &wh, &sw, &sh, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL );
1722 shipname = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
1749 x = 20+sw+20+180+10;
1750 acquired = (ps->
acquired) ? ps->
acquired : _(
"You do not remember how you acquired this ship.");
1763 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"%s", _(
"Name:") );
1764 for (
int i=0; i<hname-1; i++)
1765 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n" );
1766 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Model:") );
1767 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Class:") );
1768 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Acquired Date:") );
1769 for (
int i=0; i<hacquired+1; i++)
1770 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n" );
1772 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Value:") );
1774 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Fleet Capacity:") );
1775 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Crew:") );
1776 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Mass:") );
1777 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Jump Time:") );
1778 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Thrust:") );
1779 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Speed:") );
1780 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Turn:") );
1781 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Time Constant:") );
1782 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Detected at:") );
1783 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Evasion:") );
1784 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Stealth:") );
1785 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n" );
1786 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Absorption:") );
1787 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Shield:") );
1788 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Armour:") );
1789 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Energy:") );
1790 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Cargo Space:") );
1791 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Fuel:") );
1792 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n" );
1793 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Ship Status:") );
1796 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Time Flown:") );
1797 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Jumped Times:") );
1798 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Landed Times:") );
1799 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Damage Done:") );
1800 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Damage Taken:") );
1801 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"Ships Destroyed:") );
1802 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n\n%s", _(
"Intrinsic Outfits:") );
1804 window_modifyText( wid,
"txtSDesc", buf );
1813 snprintf( tbuf,
sizeof(tbuf), _(
"Unknown") );
1816 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", tbuf );
1820 window_modifyText( wid,
"txtAcquired", acquired );
1822 for (
int i=0; i<hacquired+1; i++)
1823 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1826 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", buf_price );
1829 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n#%c%s%.0f#0", EQ_COMP( ship->
crew, ship->
ship->
crew, 0 ) );
1830 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s#0 %s", smass, n_(
"tonne",
"tonnes", ship->
solid->
mass ) );
1831 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1832 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"%s average"), nt );
1833 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1834 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"#%c%s%.0f#0 kN/tonne"),
1836 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"\n#%c%s%.0f#0 m/s (max #%c%s%.0f#0 m/s)"),
1839 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"\n#%c%s%.0f#0 deg/s"),
1840 EQ_COMP( ship->
turn*180./M_PI, ship->
ship->
turn*180./M_PI, 0 ) );
1842 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s\n", sdet );
1844 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s\n", sste );
1845 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1848 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"#%c%s%.0f#0 MJ (#%c%s%.1f#0 MW)"),
1850 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1851 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"#%c%s%.0f#0 MJ (#%c%s%.1f#0 MW)"),
1853 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1854 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"#%c%s%.0f#0 MJ (#%c%s%.1f#0 MW)"),
1856 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1858 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"%d / #%c%s%d#0 %s"),
1860 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1861 l +=
scnprintf( &buf[l],
sizeof(buf)-l, _(
"%s %s (%d %s)"),
1862 sfuel, n_(
"unit",
"units", ship->
fuel_max ), jumps, n_(
"jump",
"jumps", jumps ) );
1863 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1864 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n#%c%s#0", spaceworthy ?
'0' :
'r', errorReport );
1868 for (
int i=0; i<SHIP_CLASS_TOTAL; i++)
1870 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1874 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1876 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s",
"" );
1879 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n" );
1883 window_modifyText( wid,
"txtDDesc", buf );
1889 window_checkboxSet( wid,
"chkFav", favourite );
1891 window_checkboxSet( wid,
"chkDeploy", deployed );
1895 window_disableButton( wid,
"btnSellShip" );
1896 window_disableButton( wid,
"btnChangeShip" );
1899 window_enableButton( wid,
"btnChangeShip" );
1900 window_enableButton( wid,
"btnSellShip" );
1919 active = window_tabWinGetActive( wid, EQUIPMENT_OUTFIT_TAB );
1920 i = toolkit_getImageArrayPos( wid, EQUIPMENT_OUTFITS );
1946 int m = toolkit_getListPos( wid, str );
1955static void equipment_outfitPopdownActivate(
unsigned int wid,
const char *str )
1961static void equipment_outfitPopdown(
unsigned int wid,
const char* str )
1963 const char *name =
"lstOutfitPopdown";
1964 const char *modes[] = {
1965 N_(
"Show all outfits"),
1966 N_(
"Show only outfits equipable on any of your ships"),
1967 N_(
"Show only outfits equipable on current ship"),
1968 N_(
"Show only light outfits"),
1969 N_(
"Show only medium outfits"),
1970 N_(
"Show only heavy outfits"),
1973 const size_t n =
sizeof(modes) /
sizeof(
const char*);
1981 modelist = malloc(
sizeof(modes));
1982 for (
size_t i=0; i<n; i++)
1983 modelist[i] = strdup( _(modes[i]) );
1987 window_addList( wid, x+w, y-120+h, 350, 120, name, modelist, n,
equipment_outfitMode,
equipment_outfitPopdownSelect, equipment_outfitPopdownActivate );
2006 toolkit_saveImageArrayData( wid, EQUIPMENT_OUTFITS, &
iar_data[old] );
2014 window_setInput(wid, EQUIPMENT_FILTER, NULL);
2021 toolkit_setImageArrayPos( wid, EQUIPMENT_OUTFITS, pos );
2022 toolkit_setImageArrayOffset( wid, EQUIPMENT_OUTFITS, offset );
2033 const char *shipname = toolkit_getImageArray( wid, str );
2048 if (!ps->
deployed && ship_isFlag( ps->
p->
ship, SHIP_NOESCORT )) {
2049 dialogue_msg( _(
"Invalid Escort"), _(
"You can not set your ship '%s' as an escort!"), ps->
p->
name );
2058 window_checkboxSet( wid,
"chkDeploy", ps->
deployed );
2085 const char *shipname, *filtertext;
2089 shipname = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
2100 i = window_tabWinGetActive( wid, EQUIPMENT_OUTFIT_TAB );
2101 toolkit_saveImageArrayData( wid, EQUIPMENT_OUTFITS, &
iar_data[i] );
2103 filtertext = window_getInput(
equipment_wid, EQUIPMENT_FILTER );
2118 window_tabWinSetActive( wid, EQUIPMENT_OUTFIT_TAB, i );
2119 toolkit_setImageArrayPos( wid, EQUIPMENT_OUTFITS,
iar_data[i].pos );
2120 toolkit_setImageArrayOffset( wid, EQUIPMENT_OUTFITS,
iar_data[i].offset );
2122 window_setInput(wid, EQUIPMENT_FILTER, filtertext);
2128 toolkit_setImageArrayPos( wid, EQUIPMENT_SHIPS, 0 );
2129 toolkit_setImageArrayOffset( wid, EQUIPMENT_SHIPS, 0. );
2150 dialogue_alert( _(
"You can't unequip your ship when you have more cargo than it can hold without modifications!") );
2154 _(
"Are you sure you want to remove all equipment from your ship?"))==0)
2157 if (!
dialogue_YesNo(_(
"Recall Fighters"), _(
"This action will recall your deployed fighters. Is that OK?")))
2216 const char *curship;
2217 const char *file = AUTOEQUIP_PATH;
2229 if (autoequip_env == LUA_NOREF) {
2234 WARN( _(
"File '%s' not found!"), file );
2238 autoequip_env = nlua_newEnv();
2241 if (nlua_dobufenv(autoequip_env, buf, bufsize, file) != 0) {
2242 WARN(_(
"Failed to run '%s': %s"), file, lua_tostring(naevL,-1));
2245 goto autoequip_cleanup;
2252 nlua_getenv( naevL, autoequip_env,
"autoequip" );
2253 if (!lua_isfunction(naevL,-1)) {
2254 WARN(_(
"'%s' doesn't have valid required 'autoequip' function!"), file);
2256 goto autoequip_cleanup;
2259 if (nlua_pcall( autoequip_env, 1, 0 )) {
2260 WARN(_(
"'%s' failed to run required 'autoequip' function: %s"), file, lua_tostring(naevL,-1));
2262 goto autoequip_cleanup;
2284 char buf[ECON_CRED_STRLEN], *name;
2289 const char *shipname = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
2296 credits2str( buf, price, 2 );
2300 _(
"Are you sure you want to sell your ship %s for %s?"),
2309 name = strdup(shipname);
2318 _(
"You have sold your ship %s for %s."), name, buf );
2321 hparam[0].
type = HOOK_PARAM_STRING;
2323 hparam[1].
type = HOOK_PARAM_STRING;
2324 hparam[1].
u.
str = name;
2325 hparam[2].
type = HOOK_PARAM_SENTINEL;
2327 land_needsTakeoff( 1 );
2340 const char *shipname = toolkit_getImageArray( wid, EQUIPMENT_SHIPS );
2343 _(
"Please enter a new name for your %s:"), _(ship->
ship->
name) );
2346 if (newname == NULL)
2352 _(
"Please do not give the ship the same name as another of your ships."));
2358 ship->
name = newname;
2388 if (outfit_isProp(o,OUTFIT_PROP_UNIQUE))
2402 for (
int i=0; i<OUTFIT_TABS; i++)
Provides macros to work with dynamic arrays.
static ALWAYS_INLINE int array_size(const void *array)
Returns number of elements in the array.
void dialogue_alert(const char *fmt,...)
Displays an alert popup with only an ok button and a message.
char * dialogue_input(const char *title, int min, int max, const char *fmt,...)
Creates a dialogue that allows the player to write a message.
void dialogue_msg(const char *caption, const char *fmt,...)
Opens a dialogue window with an ok button and a message.
int dialogue_YesNo(const char *caption, const char *fmt,...)
Runs a dialogue with both yes and no options.
void equipment_slotDeselect(CstSlotWidget *wgt)
Deselects equipment stuff.
static const char * eq_qSym(double cur, double base, int inv)
Gets the symbol for comparing a current value vs a ship base value.
static void equipment_rightClickShips(unsigned int wid, const char *str)
Toggles deployed status.
static double equipment_dir
static void equipment_renderColumn(double x, double y, double w, double h, PilotOutfitSlot *lst, const char *txt, int selected, Outfit *o, Pilot *p, CstSlotWidget *wgt)
Renders an outfit column.
static Outfit *** iar_outfits
static CstSlotWidget eq_wgt
static int equipment_playerAddOutfit(const Outfit *o, int quantity)
Wrapper to only add unique outfits.
static void equipment_shipMode(unsigned int wid, const char *str)
Toggles the ship visualization mode.
static void equipment_changeTab(unsigned int wid, const char *wgt, int old, int tab)
Ensures the tab's selected item is reflected in the ship slot list.
static void equipment_sellShip(unsigned int wid, const char *str)
Player tries to sell a ship.
static int equipment_playerRmOutfit(const Outfit *o, int quantity)
Wrapper to only remove unique outfits.
static void equipment_getDim(unsigned int wid, int *w, int *h, int *sw, int *sh, int *ow, int *oh, int *ew, int *eh, int *cw, int *ch, int *bw, int *bh)
Gets the window dimensions.
static void equipment_outfitPopdownSelect(unsigned int wid, const char *str)
void equipment_regenLists(unsigned int wid, int outfits, int ships)
Regenerates the equipment window lists.
static void equipment_renameShip(unsigned int wid, const char *str)
Renames the selected ship.
static void equipment_renderOverlayColumn(double x, double y, double h, PilotOutfitSlot *lst, int mover, CstSlotWidget *wgt)
Renders an outfit column.
void equipment_cleanup(void)
Cleans up after the equipment stuff.
static void equipment_filterOutfits(unsigned int wid, const char *str)
Handles text input in the filter input widget.
static int equipment_outfitMode
static void equipment_genLists(unsigned int wid)
Generates a new ship/outfit lists if needed.
static void equipment_rightClickOutfits(unsigned int wid, const char *str)
Handles right-click on unequipped outfit.
void equipment_updateOutfits(unsigned int wid, const char *str)
Updates the player's outfit list.
static iar_data_t * iar_data
static void equipment_transChangeShip(unsigned int wid, const char *str)
Changes ship.
static void equipment_genOutfitList(unsigned int wid)
Generates the outfit list.
static void equipment_toggleFav(unsigned int wid, const char *wgt)
Handles toggling of the favourite checkbox.
static void equipment_autoequipShip(unsigned int wid, const char *str)
Does the autoequip magic on the player's ship.
void equipment_slotWidget(unsigned int wid, double x, double y, double w, double h, CstSlotWidget *data)
Creates the slot widget and initializes it.
void equipment_updateShips(unsigned int wid, const char *str)
Updates the player's ship window.
static void equipment_renderShip(double bx, double by, double bw, double bh, void *data)
Renders the ship in the equipment window.
static void equipment_calculateSlots(const Pilot *p, double bw, double bh, double *w, double *h, int *n, int *m)
Calculates the size the slots need to be for a given window.
static int equipment_mouseSlots(unsigned int wid, SDL_Event *event, double x, double y, double w, double h, double rx, double ry, void *data)
Does mouse input for the custom equipment widget.
static int equipment_mouseInColumn(double y, double h, int n, double my)
Handles a mouse press in column.
static void equipment_renderMisc(double bx, double by, double bw, double bh, void *data)
Renders the custom equipment widget.
int equipment_shipStats(char *buf, int max_len, const Pilot *s, int dpseps, int name)
Creates and allocates a string containing the ship stats.
void equipment_addAmmo(void)
Adds all the ammo it can to the player.
static int equipment_swapSlot(unsigned int wid, Pilot *p, PilotOutfitSlot *slot)
Swaps an equipment slot.
static char eq_qCol(double cur, double base, int inv)
Gets the colour for comparing a current value vs a ship base value.
static void equipment_changeShip(unsigned int wid)
Player attempts to change ship.
static void equipment_unequipShip(unsigned int wid, const char *str)
Unequips the player's ship.
static int equipment_mouseColumn(unsigned int wid, SDL_Event *event, double mx, double my, double y, double h, PilotOutfitSlot *os, Pilot *p, int selected, CstSlotWidget *wgt)
Handles a mouse press in a column.
static unsigned int equipment_wid
void equipment_open(unsigned int wid)
Opens the player's equipment window.
static void equipment_renderSlots(double bx, double by, double bw, double bh, void *data)
Renders the equipment slots.
static void equipment_genShipList(unsigned int wid)
Generates the ship list.
static unsigned int equipment_lastick
static void equipment_renderOverlaySlots(double bx, double by, double bw, double bh, void *data)
Renders the equipment overlay.
int escort_clearDeployed(Pilot *p)
Clears deployed escorts of a pilot.
int gl_printHeightRaw(const glFont *ft_font, const int width, const char *text)
Gets the height of a non-formatted string.
int gl_printWidthRaw(const glFont *ft_font, const char *text)
Gets the width that it would take to print some text.
int gl_printMidRaw(const glFont *ft_font, int width, double x, double y, const glColour *c, double outlineR, const char *text)
Displays text centered in position and width.
int gl_printLinesRaw(const glFont *ft_font, const int width, const char *text)
Gets the number of lines of a non-formatted string.
int gl_printMaxRaw(const glFont *ft_font, const int max, double x, double y, const glColour *c, double outlineR, const char *text)
Behaves like gl_printRaw but stops displaying text after a certain distance.
int gl_printMid(const glFont *ft_font, const int width, double x, double y, const glColour *c, const char *fmt,...)
Displays text centered in position and width.
void gui_setShip(void)
Player just upgraded their ship or modified it.
int hooks_runParam(const char *stack, const HookParam *param)
Runs all the hooks of stack.
int hooks_run(const char *stack)
Runs all the hooks of stack.
void info_update(void)
Updates the info windows.
int land_errDialogue(const char *name, const char *type)
Generates error dialogues used by several landing tabs.
void land_buttonTakeoff(unsigned int wid, const char *unused)
Wrapper for takeoff mission button.
void land_refuel(void)
Refuels the player's current ship, if possible.
int outfit_altText(char *buf, int n, const Outfit *o, const Pilot *plt)
Computes the alt text for an outfit.
ImageArrayCell * outfits_imageArrayCells(const Outfit **outfits, int *noutfits, const Pilot *p)
Generates image array cells corresponding to outfits.
void outfits_updateEquipmentOutfits(void)
Updates the outfitter and equipment outfit image arrays.
Header file with generic functions and naev-specifics.
void * ndata_read(const char *path, size_t *filesize)
Reads a file from the ndata (will be NUL terminated).
int nlua_loadStandard(nlua_env env)
Loads the standard Naev Lua API.
LuaPilot * lua_pushpilot(lua_State *L, LuaPilot pilot)
Pushes a pilot on the stack.
int nlua_loadTk(nlua_env env)
Loads the Toolkit Lua library.
int num2str(char dest[NUM2STRLEN], double n, int decimals)
Converts an electronic warfare value to a string.
int scnprintf(char *text, size_t maxlen, const char *fmt,...)
Like snprintf(), but returns the number of characters ACTUALLY "printed" into the buffer....
const char * num2strU(double n, int decimals)
Unsafe version of num2str that uses an internal buffer. Every call overwrites the return value.
char * ntime_pretty(ntime_t t, int d)
Gets the time in a pretty human readable format.
void ntime_prettyBuf(char *str, int max, ntime_t t, int d)
Gets the time in a pretty human readable format filling a preset buffer.
void gl_renderShader(double x, double y, double w, double h, double r, const SimpleShader *shd, const glColour *c, int center)
Renders a simple shader.
void gl_renderScale(const glTexture *texture, double bx, double by, double bw, double bh, const glColour *c)
Blits a texture scaling it.
void gl_renderScaleSprite(const glTexture *sprite, double bx, double by, int sx, int sy, double bw, double bh, const glColour *c)
Blits a scaled sprite, position is in absolute screen coordinates.
void gl_renderCross(double x, double y, double r, const glColour *c)
Renders a cross at a given position.
glTexture * gl_dupTexture(const glTexture *texture)
Duplicates a texture.
glTexture ** gl_copyTexArray(glTexture **tex, int *n)
Copy a texture array.
glTexture ** gl_addTexArray(glTexture **tex, int *n, glTexture *t)
Adds an element to a texture array.
glTexture * gl_newImage(const char *path, const unsigned int flags)
Loads an image as a texture.
void gl_getSpriteFromDir(int *x, int *y, const glTexture *t, const double dir)
Sets x and y to be the appropriate sprite for glTexture using dir.
int outfit_isLauncher(const Outfit *o)
Checks if outfit is a weapon launcher.
char outfit_slotTypeColourFont(const OutfitSlot *os)
Gets a font colour character that roughly matches an outfit slot type colour.
int outfit_fitsSlot(const Outfit *o, const OutfitSlot *s)
Checks to see if an outfit fits a slot.
int outfit_isFighterBay(const Outfit *o)
Checks if outfit is a fighter bay.
char outfit_slotSizeColourFont(const OutfitSlot *os)
Gets a font colour character that roughly matches an outfit slot size colour.
int outfit_amount(const Outfit *o)
Gets the amount an outfit can hold.
const char * slotName(const OutfitSlotType type)
const char * slotSize(const OutfitSlotSize o)
Gets the slot size as a string.
const glColour * outfit_slotSizeColour(const OutfitSlot *os)
Gets the slot size colour for an outfit slot.
ntime_t pilot_hyperspaceDelay(Pilot *p)
Calculates the hyperspace delay for a pilot.
void pilot_dpseps(const Pilot *p, double *pdps, double *peps)
Calculates the dps and eps of a pilot.
int pilot_cargoFree(const Pilot *p)
Gets the pilot's free cargo space.
int pilot_cargoUsed(const Pilot *p)
Gets how much cargo ship has on board.
double pilot_ewScanTime(const Pilot *p)
Gets the time it takes to scan a pilot.
int pilot_getMount(const Pilot *p, const PilotOutfitSlot *w, vec2 *v)
Gets the mount position of a pilot.
int pilot_rmOutfit(Pilot *pilot, PilotOutfitSlot *s)
Removes an outfit from the pilot.
int pilot_hasDeployed(Pilot *p)
Checks to see if the pilot has deployed ships.
void pilot_healLanded(Pilot *pilot)
Cures the pilot as if he was landed.
int pilot_maxAmmoO(const Pilot *p, const Outfit *o)
Gets the maximum available ammo for a pilot for a specific outfit.
int pilot_slotIsToggleable(const PilotOutfitSlot *o)
Checks to see if a slot has an active outfit that can be toggleable.
void pilot_calcStats(Pilot *pilot)
Recalculates the pilot's stats based on his outfits.
void pilot_fillAmmo(Pilot *pilot)
Fills pilot's ammo completely.
int pilot_rmOutfitRaw(Pilot *pilot, PilotOutfitSlot *s)
Removes an outfit from the pilot without doing any checks.
int pilot_reportSpaceworthy(const Pilot *p, char *buf, int bufSize)
Pilot safety report - makes sure stats are safe.
int pilot_rmAmmo(Pilot *pilot, PilotOutfitSlot *s, int quantity)
Removes some ammo from the pilot stock.
const char * pilot_canEquip(const Pilot *p, const PilotOutfitSlot *s, const Outfit *o)
Checks to see if can equip/remove an outfit from a slot.
int pilot_addOutfitRaw(Pilot *pilot, const Outfit *outfit, PilotOutfitSlot *s)
Adds an outfit to the pilot, ignoring CPU or other limits.
int pilot_weapSetTypeCheck(Pilot *p, int id)
Checks the current weapon set type.
void pilot_weaponSafe(Pilot *p)
Sets the weapon set as safe.
void ws_copy(PilotWeaponSet dest[PILOT_WEAPON_SETS], const PilotWeaponSet src[PILOT_WEAPON_SETS])
Copies a weapon set over.
void pilot_weapSetAdd(Pilot *p, int id, PilotOutfitSlot *o, int level)
Adds an outfit to a weapon set.
int pilot_weapSetCheck(Pilot *p, int id, PilotOutfitSlot *o)
Checks to see if a slot is in a weapon set.
void pilot_weapSetRmSlot(Pilot *p, int id, OutfitSlotType type)
Removes slots by type from the weapon set.
void pilot_weapSetType(Pilot *p, int id, int type)
Changes the weapon sets mode.
void pilot_weaponAuto(Pilot *p)
Tries to automatically set and create the pilot's weapon set.
void pilot_weapSetRm(Pilot *p, int id, PilotOutfitSlot *o)
Removes a slot from a weapon set.
int player_nships(void)
Gets the amount of ships player has in storage.
int player_rmOutfit(const Outfit *o, int quantity)
Remove an outfit from the player's outfit stack.
void player_swapShip(const char *shipname, int move_cargo)
Swaps player's current ship with their ship named shipname.
int player_addOutfit(const Outfit *o, int quantity)
Adds an outfit to the player outfit stack.
credits_t player_shipPrice(const char *shipname)
Calculates the price of one of the player's ships.
int player_numOutfits(void)
Gets the amount of different outfits in the player outfit stack.
const PlayerShip_t * player_getShipStack(void)
Gets the array (array.h) of the player's ships.
void player_rmShip(const char *shipname)
Removes one of the player's ships.
PlayerShip_t * player_getPlayerShip(const char *shipname)
Gets a specific ship.
int player_getOutfitsFiltered(const Outfit **outfits, int(*filter)(const Outfit *o), const char *name)
Prepares two arrays for displaying in an image array.
credits_t player_modCredits(credits_t amount)
Modifies the amount of credits the player has.
int player_hasShip(const char *shipname)
Sees if player has a ship of a name.
void player_shipsSort(void)
Sorts the players ships.
int player_outfitOwned(const Outfit *o)
Gets how many of the outfit the player owns.
Pilot * player_getShip(const char *shipname)
Gets a specific ship.
int pfleet_toggleDeploy(PlayerShip_t *ps, int deploy)
Toggles a player ship as deployed.
void pfleet_update(void)
Updates the used fleet capacity of the player.
const char * ship_classDisplay(const Ship *s)
Gets the ship's display class in human readable form.
int ss_statsDesc(const ShipStats *s, char *buf, int len, int newline)
Writes the ship statistics description.
const char * sp_description(unsigned int spid)
Gets the description of a slot property (in English).
const char * sp_display(unsigned int spid)
Gets the display name of a slot property (in English).
The actual hook parameter.
A ship outfit, depends radically on the type.
Stores an outfit the pilot has.
The representation of an in-game pilot.
PilotWeaponSet weapon_sets[PILOT_WEAPON_SETS]
PilotOutfitSlot * outfit_structure
PilotOutfitSlot ** outfits
PilotOutfitSlot * outfit_utility
PilotOutfitSlot * outfit_intrinsic
PilotOutfitSlot * outfit_weapon
unsigned int landed_times
unsigned int ships_destroyed[SHIP_CLASS_TOTAL]
unsigned int jumped_times
PilotWeaponSet weapon_sets[PILOT_WEAPON_SETS]
glTexture ** gfx_overlays
Abstraction for rendering sprite sheets.