17#include "land_outfits.h"
30#include "pilot_outfit.h"
32#include "player_gui.h"
38#define OUTFITS_IAR "iarOutfits"
39#define OUTFITS_TAB "tabOutfits"
40#define OUTFITS_FILTER "inpFilterOutfits"
41#define OUTFITS_NTABS 7
45typedef struct LandOutfitData_ {
56static int outfits_mod = 1;
62 int *iw,
int *ih,
int *bw,
int *bh );
63static void outfits_buy(
unsigned int wid,
const char *str );
64static void outfits_sell(
unsigned int wid,
const char *str );
66static void outfits_rmouse(
unsigned int wid,
const char* widget_name );
67static void outfits_find(
unsigned int wid,
const char *str );
68static const char *
outfit_getPrice(
const Outfit *outfit, credits_t *price,
int *canbuy,
int *cansell );
69static void outfit_Popdown(
unsigned int wid,
const char* str );
71static void outfits_changeTab(
unsigned int wid,
const char *wgt,
int old,
int tab );
73static void outfit_modifiers(
unsigned int wid );
80 int *iw,
int *ih,
int *bw,
int *bh )
89 *iw = 680 + (*w - LAND_WIDTH);
94 padding = 40 + 20 * 4;
98 *bw = (*w - (iw!=NULL?*iw:0) - padding) / 4;
100 *bh = LAND_BUTTON_HEIGHT;
103static void outfit_modifiers(
unsigned int wid )
106 if (q != outfits_mod) {
110 window_buttonCaption( wid,
"btnBuyOutfit", _(
"Buy") );
111 window_buttonCaption( wid,
"btnSellOutfit", _(
"Sell") );
114 char buf[STRMAX_SHORT];
115 snprintf( buf,
sizeof(buf), _(
"Buy (%dx)"), q );
116 window_buttonCaption( wid,
"btnBuyOutfit", buf );
117 snprintf( buf,
sizeof(buf), _(
"Sell (%dx)"), q );
118 window_buttonCaption( wid,
"btnSellOutfit", buf );
130 if ((evt->type==SDL_KEYDOWN) || (evt->type==SDL_KEYUP))
131 outfit_modifiers( wid );
158 int w, h, iw, ih, bw, bh, off;
168 data->outfits = outfits;
169 data->blackmarket = blackmarket;
175 land_tabGenerate(LAND_WINDOW_OUTFITS);
181 for (
int i=0; i<OUTFITS_NTABS; i++) {
182 toolkit_initImageArrayData( &
iar_data[i] );
196 if (data->outfits==NULL) {
197 window_addButtonKey( wid, off, 20,
198 bw, bh,
"btnCloseOutfits",
202 window_addButtonKey( wid, off, 20,
203 bw, bh,
"btnCloseOutfits",
207 window_addButtonKey( wid, off, 20,
208 bw, bh,
"btnSellOutfit",
211 window_addButtonKey( wid, off, 20,
212 bw, bh,
"btnBuyOutfit",
215 window_addButtonKey( wid, off, 20,
216 bw, bh,
"btnFindOutfits",
220 window_addRect( wid, -40+4, -40+4, 264, 264,
"rctImage", &cBlack, 1 );
221 window_addImage( wid, -40, -40, 256, 256,
"imgOutfit", NULL, 0 );
224 window_addText( wid, 20 + iw + 20, -40,
225 w - (20 + iw + 20) - 264 - 40, 160, 0,
"txtOutfitName", &
gl_defFont, NULL, NULL );
226 window_addText( wid, 20 + iw + 20, -40 -
gl_defFont.
h*2. - 30,
227 w - (20 + iw + 20) - 264 - 40, 400, 0,
"txtDescShort", &
gl_defFont, NULL, NULL );
229 window_addText( wid, 20 + iw + 20, 0,
230 90, 160, 0,
"txtSDesc", &
gl_defFont, &cFontGrey, NULL );
231 window_addText( wid, 20 + iw + 20 + 90, 0,
232 w - (20 + iw + 20 + 90), 160, 0,
"txtDDesc", &
gl_defFont, NULL, NULL );
233 window_addText( wid, 20 + iw + 20, 0,
235 0,
"txtDescription", &
gl_defFont, NULL, NULL );
261 if ((data->outfits==NULL) && (
land_getWid( LAND_WINDOW_OUTFITS ) == 0))
268 tab = window_tabWinGetActive( wid, OUTFITS_TAB );
269 toolkit_saveImageArrayData( wid, OUTFITS_IAR, &
iar_data[tab] );
275 toolkit_loadImageArrayData( wid, OUTFITS_IAR, &
iar_data[tab] );
299 for (
int i=0; i <
array_size(p->outfits); i++) {
310 for (
int i=0; i <
array_size(p->outfits); i++) {
317 return (o->
slot.
size==OUTFIT_SLOT_SIZE_LIGHT);
319 return (o->
slot.
size==OUTFIT_SLOT_SIZE_MEDIUM);
321 return (o->
slot.
size==OUTFIT_SLOT_SIZE_HEAVY);
325static int outfitLand_filterWeapon(
const Outfit *o ) {
328static int outfitLand_filterUtility(
const Outfit *o ) {
331static int outfitLand_filterStructure(
const Outfit *o ) {
334static int outfitLand_filterCore(
const Outfit *o ) {
345 int (*tabfilters[])(
const Outfit *o ) = {
347 outfitLand_filterWeapon,
348 outfitLand_filterUtility,
349 outfitLand_filterStructure,
350 outfitLand_filterCore,
356 ImageArrayCell *coutfits;
359 const char *filtertext;
368 int fx, fy, fw, fh, barw;
369 const char *tabnames[] = {
370 _(
"All"), _(OUTFIT_LABEL_WEAPON), _(OUTFIT_LABEL_UTILITY), _(OUTFIT_LABEL_STRUCTURE), _(OUTFIT_LABEL_CORE), _(
"#rOther"), _(
"Owned"),
373 window_addTabbedWindow( wid, 20, 20 + ih - 30, iw, 30,
374 OUTFITS_TAB, OUTFITS_NTABS, tabnames, 1 );
376 barw = window_tabWinGetBarWidth( wid, OUTFITS_TAB );
377 fw =
CLAMP(0, 150, iw - barw - 30);
381 fy = ih - 25 -1 + 20;
386 window_addButton( wid, fx+fw-30, fy, 30, 30,
"btnOutfitFilter", NULL, outfit_Popdown );
387 window_buttonCustomRender( wid,
"btnOutfitFilter", window_buttonCustomRenderGear );
391 window_addInput( wid, fx, fy, fw, fh, OUTFITS_FILTER, 32, 1, &
gl_defFont );
392 inp_setEmptyText( wid, OUTFITS_FILTER, _(
"Filter…") );
398 active = window_tabWinGetActive( wid, OUTFITS_TAB );
406 filtertext = window_getInput( wid, OUTFITS_FILTER );
407 if (strlen(filtertext) == 0)
426 if (po[j].o == os->
o) {
445 if (toolkit_simImageArrayVisibleElements(iw,ih-34,iconsize,iconsize) < noutfits)
447 if (toolkit_simImageArrayVisibleElements(iw,ih-34,iconsize,iconsize) < noutfits)
450 window_addImageArray( wid, 20, 20,
451 iw, ih - 34, OUTFITS_IAR, iconsize, iconsize,
468 char buf[STRMAX], lbl[STRMAX], buf_credits[ECON_CRED_STRLEN], buf_mass[ECON_MASS_STRLEN];
469 const char *buf_price;
472 int iw, ih, w, h, blackmarket, canbuy, cansell, sw, th;
481 blackmarket = data->blackmarket;
484 k +=
scnprintf( &lbl[k],
sizeof(lbl)-k,
"%s", _(
"Owned:") );
485 k +=
scnprintf( &lbl[k],
sizeof(lbl)-k,
"\n%s", _(
"Mass:") );
486 k +=
scnprintf( &lbl[k],
sizeof(lbl)-k,
"\n%s", _(
"Price:") );
487 k +=
scnprintf( &lbl[k],
sizeof(lbl)-k,
"\n%s", _(
"Money:") );
490 active = window_tabWinGetActive( wid, OUTFITS_TAB );
491 i = toolkit_getImageArrayPos( wid, OUTFITS_IAR );
493 window_modifyImage( wid,
"imgOutfit", NULL, 256, 256 );
494 window_disableButton( wid,
"btnBuyOutfit" );
495 window_disableButton( wid,
"btnSellOutfit" );
496 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"%s", _(
"N/A") );
497 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"N/A") );
498 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"N/A") );
499 scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", _(
"N/A") );
500 window_modifyText( wid,
"txtSDesc", buf );
501 window_modifyText( wid,
"txtDDesc", buf );
502 window_modifyText( wid,
"txtOutfitName", _(
"None") );
503 window_modifyText( wid,
"txtDescShort", NULL );
504 window_modifyText( wid,
"txtDescription", NULL );
517 window_modifyImage( wid,
"imgOutfit", outfit->
gfx_store, 256, 256 );
520 if (outfit->
slot.
type == OUTFIT_SLOT_INTRINSIC) {
521 scnprintf( buf,
sizeof(buf),
"%s\n\n#o%s#0",
523 _(
"This is an intrinsic outfit that will be directly equipped on the current ship and can not be moved."));
524 window_modifyText( wid,
"txtDescription", buf );
527 window_modifyText( wid,
"txtDescription", _(outfit->
desc_raw) );
533 window_enableButton( wid,
"btnSellOutfit" );
535 window_disableButtonSoft( wid,
"btnSellOutfit" );
538 window_enableButton( wid,
"btnBuyOutfit" );
541 window_disableButtonSoft( wid,
"btnBuyOutfit" );
551 window_modifyText( wid,
"txtOutfitName", buf );
556 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", buf_mass );
557 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", buf_price );
558 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s", buf_credits );
561 k +=
scnprintf( &lbl[k],
sizeof(lbl)-k,
"\n%s", _(
"License:") );
563 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s#0", _(
"Not Necessary (Blackmarket)") );
565 l +=
scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s%s#0", meets_reqs ?
"" :
"#r", _(outfit->
license) );
571 scnprintf( &lbl[k],
sizeof(lbl)-k,
"\n%s", _(
"Requires:") );
573 scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s#0", _(
"Not Necessary (Blackmarket)") );
575 scnprintf( &buf[l],
sizeof(buf)-l,
"\n%s%s#0", meets_reqs ?
"" :
"#r", _(outfit->
condstr) );
577 window_modifyText( wid,
"txtSDesc", lbl );
578 window_modifyText( wid,
"txtDDesc", buf );
580 window_modifyText( wid,
"txtDescShort", summary );
599 if (spob_hasService(
land_spob, SPOB_SERVICE_OUTFITS)) {
603 else if (!spob_hasService(
land_spob, SPOB_SERVICE_SHIPYARD))
625 toolkit_saveImageArrayData( wid, OUTFITS_IAR, &
iar_data[old] );
632 window_setInput(wid, OUTFITS_FILTER, NULL);
639 toolkit_loadImageArrayData( wid, OUTFITS_IAR, &old_data );
655 int(*filter)(
const Outfit* ),
const char *name )
658 for (
int i=0; i<n; i++) {
659 const Outfit *o = outfits[i];
662 if ((filter != NULL) && !filter(outfits[i]))
667 if ((SDL_strcasestr(_(o->
name), name)==NULL) &&
687 map_inputFindType(wid,
"outfit");
695 static char pricestr[STRMAX_SHORT];
699 *price = outfit->
price * q;
706 lua_rawgeti(naevL, LUA_REGISTRYINDEX, outfit->
lua_price);
707 lua_pushinteger(naevL, q);
708 if (nlua_pcall( outfit->
lua_env, 1, 3 )) {
709 WARN(_(
"Outfit '%s' failed to run '%s':\n%s"),outfit->
name,
"price",lua_tostring(naevL,-1));
717 str = luaL_checkstring( naevL, -3 );
718 strncpy( pricestr, str,
sizeof(pricestr)-1 );
720 *canbuy = lua_toboolean( naevL, -2 );
721 *cansell = lua_toboolean( naevL, -1 );
744 if (outfit_isProp(o, OUTFIT_PROP_UNIQUE))
745 p +=
scnprintf( &buf[p], n-p,
"#o%s#0\n", _(
"Unique") );
746 if (o->
limit != NULL)
747 p +=
scnprintf( &buf[p], n-p,
"#r%s#0\n", _(
"Only 1 of type per ship") );
749 p +=
scnprintf( &buf[p], n-p,
"#o%s#0\n",
752 if ((o->
mass > 0.) && (p < n)) {
753 char buf_mass[ECON_MASS_STRLEN];
755 scnprintf( &buf[p], n-p,
"\n%s", buf_mass );
765 ImageArrayCell *coutfits = calloc(
MAX(1,*noutfits),
sizeof(ImageArrayCell) );
767 if (*noutfits == 0) {
769 coutfits[0].image = NULL;
770 coutfits[0].caption = strdup( _(
"None") );
774 for (
int i=0; i<*noutfits; i++) {
777 const Outfit *o = outfits[i];
780 coutfits[i].caption = strdup( _(o->
name) );
781 if (!store && outfit_isProp(o, OUTFIT_PROP_UNIQUE))
782 coutfits[i].quantity = -1;
801 u8_inc(
typename, &sz );
802 coutfits[i].slottype = malloc( sz+1 );
803 memcpy( coutfits[i].slottype,
typename, sz );
804 coutfits[i].slottype[sz] =
'\0';
824 int m = toolkit_getListPos( wid, str );
832static void outfit_PopdownActivate(
unsigned int wid,
const char *str )
838static void outfit_Popdown(
unsigned int wid,
const char* str )
840 const char *name =
"lstOutfitPopdown";
841 const char *modes[] = {
842 N_(
"Show all outfits"),
843 N_(
"Show only outfits equipable on any of your ships"),
844 N_(
"Show only outfits equipable on current ship"),
845 N_(
"Show only light outfits"),
846 N_(
"Show only medium outfits"),
847 N_(
"Show only heavy outfits"),
850 const size_t n =
sizeof(modes) /
sizeof(
const char*);
858 modelist = malloc(
sizeof(modes));
859 for (
size_t i=0; i<n; i++)
860 modelist[i] = strdup( _(modes[i]) );
864 window_addList( wid, x+w, y-120+h, 350, 120, name, modelist, n,
outfit_Mode,
outfit_PopdownSelect, outfit_PopdownActivate );
868static int outfit_isSold(
const Outfit *outfit,
int wid )
873 if ((data!=NULL) && (data->outfits!=NULL)) {
874 for (
int i=0; i<
array_size(data->outfits); i++) {
875 if (data->outfits[i]==outfit)
892 int failure, canbuy, cansell;
897 int blackmarket = (data!=NULL) ? data->blackmarket : 0;
916 if (!sold && !outfit_isSold( outfit, wid )) {
929 if (outfit->
slot.
type==OUTFIT_SLOT_INTRINSIC) {
954 char buf[ECON_CRED_STRLEN];
1003 active = window_tabWinGetActive( wid, OUTFITS_TAB );
1004 i = toolkit_getImageArrayPos( wid, OUTFITS_IAR );
1011 if (outfit_isProp(outfit, OUTFIT_PROP_UNIQUE) ||
1012 (outfit->
slot.
type==OUTFIT_SLOT_INTRINSIC) ||
1033 if (outfit->
slot.
type==OUTFIT_SLOT_INTRINSIC)
1034 if (!
dialogue_YesNo( _(
"Buy Intrinsic Outfit?"), _(
"Are you sure you wish to buy '%s'? It will be automatically equipped on your current ship '%s'."), _(outfit->
name),
player.
p->
name ))
1038 if (outfit->
lua_buy != LUA_NOREF) {
1039 lua_rawgeti(naevL, LUA_REGISTRYINDEX, outfit->
lua_buy);
1040 lua_pushinteger(naevL, q);
1041 if (nlua_pcall( outfit->
lua_env, 1, 2 )) {
1042 WARN(_(
"Outfit '%s' failed to run '%s':\n%s"),outfit->
name,
"price",lua_tostring(naevL,-1));
1046 int bought = lua_toboolean(naevL,-2);
1053 q = luaL_checkinteger(naevL,-1);
1063 hparam[0].
type = HOOK_PARAM_OUTFIT;
1065 hparam[1].
type = HOOK_PARAM_NUMBER;
1066 hparam[1].
u.
num = q;
1067 hparam[2].
type = HOOK_PARAM_SENTINEL;
1069 land_needsTakeoff( 1 );
1085 int canbuy, cansell;
1092 if (outfit_isProp(outfit, OUTFIT_PROP_UNIQUE)) {
1137 active = window_tabWinGetActive( wid, OUTFITS_TAB );
1138 i = toolkit_getImageArrayPos( wid, OUTFITS_IAR );
1153 if (outfit->
lua_sell != LUA_NOREF) {
1154 lua_rawgeti(naevL, LUA_REGISTRYINDEX, outfit->
lua_sell);
1155 lua_pushinteger(naevL, q);
1156 if (nlua_pcall( outfit->
lua_env, 1, 2 )) {
1157 WARN(_(
"Outfit '%s' failed to run '%s':\n%s"),outfit->
name,
"price",lua_tostring(naevL,-1));
1161 int bought = lua_toboolean(naevL,-2);
1168 q = luaL_checkinteger(naevL,-1);
1178 hparam[0].
type = HOOK_PARAM_OUTFIT;
1180 hparam[1].
type = HOOK_PARAM_NUMBER;
1181 hparam[1].
u.
num = q;
1182 hparam[2].
type = HOOK_PARAM_SENTINEL;
1184 land_needsTakeoff( 1 );
1187 if (!outfit_isSold( outfit, wid )) {
1193 if (poi->
o == outfit ) {
1217 SDL_Keymod mods = SDL_GetModState();
1219 if (mods & (KMOD_LCTRL | KMOD_RCTRL))
1221 if (mods & (KMOD_LSHIFT | KMOD_RSHIFT))
1232 for (
int i=0; i<OUTFITS_NTABS; i++)
Provides macros to work with dynamic arrays.
#define array_free(ptr_array)
Frees memory allocated and sets array to NULL.
#define array_copy(basic_type, ptr_array)
Returns a shallow copy of the input array.
static ALWAYS_INLINE int array_size(const void *array)
Returns number of elements in the array.
#define array_push_back(ptr_array, element)
Adds a new element at the end of the array.
#define array_create(basic_type)
Creates a new dynamic array of ‘basic_type’.
void col_blend(glColour *blend, const glColour *fg, const glColour *bg, float alpha)
Blends two colours.
void credits2str(char *str, credits_t credits, int decimals)
Converts credits to a usable string for displaying.
void tonnes2str(char *str, int tonnes)
Converts tonnes to a usable string for displaying.
void price2str(char *str, credits_t price, credits_t credits, int decimals)
Given a price and on-hand credits, outputs a colourized string.
int cond_check(const char *cond)
Checks to see if a condition is true.
void dialogue_alert(const char *fmt,...)
Displays an alert popup with only 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_regenLists(unsigned int wid, int outfits, int ships)
Regenerates the equipment window lists.
void equipment_addAmmo(void)
Adds all the ammo it can to the player.
int gl_printHeightRaw(const glFont *ft_font, const int width, const char *text)
Gets the height of a non-formatted string.
int hooks_runParam(const char *stack, const HookParam *param)
Runs all the hooks of stack.
unsigned int land_getWid(int window)
Gets the WID of a window by type.
int land_doneLoading(void)
Check to see if finished loading.
void land_errDialogueBuild(const char *fmt,...)
Generates error dialogues used by several landing tabs.
void land_errClear(void)
Clear error dialogues.
void land_buttonTakeoff(unsigned int wid, const char *unused)
Wrapper for takeoff mission button.
int land_errDisplay(void)
Displays an error if applicable.
static void outfits_sell(unsigned int wid, const char *str)
Attempts to sell the selected outfit the player has.
static int outfits_getMod(void)
Gets the current modifier status.
int outfit_altText(char *buf, int n, const Outfit *o, const Pilot *plt)
Computes the alt text for an outfit.
static void outfits_onClose(unsigned int wid, const char *str)
For when the widget closes.
static void outfits_genList(unsigned int wid)
Generates the outfit list.
static int outfitLand_filter(const Outfit *o)
void outfits_regenList(unsigned int wid, const char *str)
Regenerates the outfit list.
static void outfits_find(unsigned int wid, const char *str)
Starts the map find with outfit search selected.
static void outfits_getSize(unsigned int wid, int *w, int *h, int *iw, int *ih, int *bw, int *bh)
Gets the size of the outfits window.
int outfit_canBuy(const Outfit *outfit, int wid)
Checks to see if the player can buy the outfit.
void outfits_cleanup(void)
Cleans up outfit globals.
ImageArrayCell * outfits_imageArrayCells(const Outfit **outfits, int *noutfits, const Pilot *p, int store)
Generates image array cells corresponding to outfits.
static int outfit_events(unsigned int wid, SDL_Event *evt)
void outfits_open(unsigned int wid, const Outfit **outfits, int blackmarket)
Opens the outfit exchange center window.
static iar_data_t iar_data[OUTFITS_NTABS]
static Outfit ** iar_outfits[OUTFITS_NTABS]
void outfits_updateEquipmentOutfits(void)
Updates the outfitter and equipment outfit image arrays.
static void outfits_buy(unsigned int wid, const char *str)
Attempts to buy the outfit that is selected.
void outfits_update(unsigned int wid, const char *str)
Updates the outfits in the outfit window.
static PlayerOutfit_t * outfits_sold
int outfits_filter(const Outfit **outfits, int n, int(*filter)(const Outfit *), const char *name)
Applies a filter function and string to a list of outfits.
static void outfit_PopdownSelect(unsigned int wid, const char *str)
int outfit_canSell(const Outfit *outfit)
Checks to see if the player can sell the selected outfit.
static const char * outfit_getPrice(const Outfit *outfit, credits_t *price, int *canbuy, int *cansell)
Returns the price of an outfit (subject to quantity modifier)
static void outfits_rmouse(unsigned int wid, const char *widget_name)
Player right-clicks on an outfit.
static void outfits_changeTab(unsigned int wid, const char *wgt, int old, int tab)
Ensures the tab's selected item is reflected in the ship slot list.
Header file with generic functions and naev-specifics.
int scnprintf(char *text, size_t maxlen, const char *fmt,...)
Like snprintf(), but returns the number of characters ACTUALLY "printed" into the buffer....
glTexture * gl_dupTexture(const glTexture *texture)
Duplicates a texture.
glTexture ** gl_addTexArray(glTexture **tex, glTexture *t)
Adds an element to a texture array.
glTexture ** gl_copyTexArray(glTexture **tex)
Copy a texture array.
const Outfit * outfit_get(const char *name)
Gets an outfit by name.
int outfit_isLauncher(const Outfit *o)
Checks if outfit is a weapon launcher.
int outfit_isLocalMap(const Outfit *o)
Checks if outfit is a local space map.
int outfit_compareTech(const void *outfit1, const void *outfit2)
Function meant for use with C89, C99 algorithm qsort().
size_t outfit_getNameWithClass(const Outfit *outfit, char *buf, size_t size)
Gets a brief name/class description suitable for the title section of an outfitter screen.
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.
int outfit_isMap(const Outfit *o)
Checks if outfit is a space map.
int outfit_isLicense(const Outfit *o)
Checks if outfit is a license.
int outfit_amount(const Outfit *o)
Gets the amount an outfit can hold.
const char * outfit_getType(const Outfit *o)
Gets the outfit's specific type.
int outfit_isGUI(const Outfit *o)
Checks if outfit is a GUI.
const char * outfit_slotName(const Outfit *o)
Gets the name of the slot type of an outfit.
glTexture * rarity_texture(int rarity)
const glColour * outfit_slotSizeColour(const OutfitSlot *os)
Gets the slot size colour for an outfit slot.
int pilot_hasOutfitLimit(const Pilot *p, const char *limit)
Checks to see if a pilot has an outfit with a specific outfit type.
int pilot_hasIntrinsic(const Pilot *pilot, const Outfit *outfit)
Gets how many copies of an intrinsic a pilot has.
const char * pilot_outfitSummary(const Pilot *p, const Outfit *o, int withname)
Gets the summary of an outfit for a give pilot.
int player_rmOutfit(const Outfit *o, int quantity)
Remove an outfit from the player's outfit stack.
int player_hasLicense(const char *license)
Checks to see if player has license.
int player_addOutfit(const Outfit *o, int quantity)
Adds an outfit to the player outfit stack.
const PlayerShip_t * player_getShipStack(void)
Gets the array (array.h) of the player's ships.
int player_outfitOwnedTotal(const Outfit *o)
credits_t player_modCredits(credits_t amount)
Modifies the amount of credits the player has.
int player_hasCredits(credits_t amount)
Checks to see if the player has enough credits.
int player_outfitOwned(const Outfit *o)
Gets how many of the outfit the player owns.
const PlayerOutfit_t * player_getOutfits(void)
Gets an array (array.h) of the player's outfits.
int player_guiCheck(const char *name)
Check if player has a GUI.
const glTexture * sp_icon(unsigned int spid)
Gets the icon associated with the slot.
const char * sp_display(unsigned int spid)
Gets the display name of a slot property (in English).
The actual hook parameter.
Data for handling the widget.
A ship outfit, depends radically on the type.
glTexture ** gfx_overlays
The representation of an in-game pilot.
Abstraction for rendering sprite sheets.
int tech_checkOutfit(const tech_group_t *tech, const Outfit *o)
Checks to see if there is an outfit in the tech group.
Outfit ** tech_getOutfit(const tech_group_t *tech)
Gets all of the outfits associated to a tech group.