![]() |
naev 0.12.6
|
Handles all the landing menus and actions. More...
#include "land_outfits.h"#include "array.h"#include "cond.h"#include "dialogue.h"#include "equipment.h"#include "hook.h"#include "land.h"#include "log.h"#include "map.h"#include "naevpedia.h"#include "nlua.h"#include "nstring.h"#include "outfit.h"#include "pilot_outfit.h"#include "player.h"#include "player_gui.h"#include "slots.h"#include "space.h"#include "toolkit.h"#include "utf8.h"
Go to the source code of this file.
Data Structures | |
| struct | LandOutfitData |
| Data for handling the widget. More... | |
Macros | |
| #define | OUTFITS_IAR "iarOutfits" |
| #define | OUTFITS_TAB "tabOutfits" |
| #define | OUTFITS_FILTER "inpFilterOutfits" |
| #define | OUTFITS_NTABS 7 |
Functions | |
| 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. | |
| static void | outfits_buy (unsigned int wid, const char *str) |
| Attempts to buy the outfit that is selected. | |
| 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. | |
| static void | outfits_rmouse (unsigned int wid, const char *widget_name) |
| Player right-clicks on an outfit. | |
| static void | outfits_naevpedia (unsigned int wid, const char *str) |
| Starts the map find with outfit search selected. | |
| static const char * | outfit_getPrice (const Outfit *outfit, credits_t *price, int *canbuy, int *cansell, char **player_has) |
| Returns the price of an outfit (subject to quantity modifier) | |
| static void | outfit_Popdown (unsigned int wid, const char *str) |
| static void | outfits_genList (unsigned int wid) |
| Generates the outfit list. | |
| 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. | |
| static void | outfits_onClose (unsigned int wid, const char *str) |
| For when the widget closes. | |
| static void | outfit_modifiers (unsigned int wid) |
| 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. | |
| void | outfits_regenList (unsigned int wid, const char *str) |
| Regenerates the outfit list. | |
| static int | outfitLand_filter (const Outfit *o) |
| static int | outfitLand_filterWeapon (const Outfit *o) |
| static int | outfitLand_filterUtility (const Outfit *o) |
| static int | outfitLand_filterStructure (const Outfit *o) |
| static int | outfitLand_filterCore (const Outfit *o) |
| void | outfits_update (unsigned int wid, const char *str) |
| Updates the outfits in the outfit window. | |
| void | outfits_updateEquipmentOutfits (void) |
| Updates the outfitter and equipment outfit image arrays. | |
| 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. | |
| 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, int store) |
| Generates image array cells corresponding to outfits. | |
| static void | outfit_PopdownSelect (unsigned int wid, const char *str) |
| static void | outfit_PopdownActivate (unsigned int wid, const char *str) |
| static int | outfit_isSold (const Outfit *outfit, int wid) |
| int | outfit_canBuy (const Outfit *outfit, int wid) |
| Checks to see if the player can buy the outfit. | |
| int | outfit_canSell (const Outfit *outfit) |
| Checks to see if the player can sell the selected outfit. | |
| void | outfits_cleanup (void) |
| Cleans up outfit globals. | |
Variables | |
| static iar_data_t | iar_data [OUTFITS_NTABS] |
| static Outfit ** | iar_outfits [OUTFITS_NTABS] |
| static int | outfit_Mode = 0 |
| static PlayerOutfit_t * | outfits_sold |
| static int | outfits_mod = 1 |
Handles all the landing menus and actions.
Definition in file land_outfits.c.
| #define OUTFITS_FILTER "inpFilterOutfits" |
Definition at line 41 of file land_outfits.c.
| #define OUTFITS_IAR "iarOutfits" |
Definition at line 39 of file land_outfits.c.
| #define OUTFITS_NTABS 7 |
Definition at line 42 of file land_outfits.c.
| #define OUTFITS_TAB "tabOutfits" |
Definition at line 40 of file land_outfits.c.
Computes the alt text for an outfit.
Definition at line 775 of file land_outfits.c.
| int outfit_canBuy | ( | const Outfit * | outfit, |
| int | wid ) |
Checks to see if the player can buy the outfit.
| outfit | Outfit to buy. |
| wid | Window ID of the outfitter (or -1 to ignore). |
Definition at line 936 of file land_outfits.c.
| int outfit_canSell | ( | const Outfit * | outfit | ) |
Checks to see if the player can sell the selected outfit.
| outfit | Outfit to try to sell. |
Definition at line 1139 of file land_outfits.c.
|
static |
Used to force rerenders.
Definition at line 134 of file land_outfits.c.
|
static |
Returns the price of an outfit (subject to quantity modifier)
Definition at line 721 of file land_outfits.c.
|
static |
Definition at line 914 of file land_outfits.c.
|
static |
Definition at line 111 of file land_outfits.c.
|
static |
Definition at line 883 of file land_outfits.c.
|
static |
Definition at line 877 of file land_outfits.c.
|
static |
Functions for the popdown menu (filter outfits by size)
Definition at line 867 of file land_outfits.c.
|
static |
Ad-hoc filter functions.
Definition at line 290 of file land_outfits.c.
|
static |
Definition at line 341 of file land_outfits.c.
|
static |
Definition at line 337 of file land_outfits.c.
|
static |
Definition at line 333 of file land_outfits.c.
|
static |
Definition at line 329 of file land_outfits.c.
|
static |
Attempts to buy the outfit that is selected.
| wid | Window buying outfit from. |
| str | Unused. |
Definition at line 1047 of file land_outfits.c.
|
static |
Ensures the tab's selected item is reflected in the ship slot list.
| wid | Unused. |
| wgt | Unused. |
| old | Tab changed from. |
| tab | Tab changed to. |
Definition at line 646 of file land_outfits.c.
| void outfits_cleanup | ( | void | ) |
Cleans up outfit globals.
Definition at line 1287 of file land_outfits.c.
| 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.
| outfits | Array of outfits to filter. |
| n | Number of outfits in the array. |
| filter | Filter function to run on each outfit. |
| name | Name fragment that each outfit name must contain. |
Definition at line 681 of file land_outfits.c.
|
static |
Generates the outfit list.
| wid | Window to generate the list on. |
Definition at line 351 of file land_outfits.c.
|
static |
Gets the current modifier status.
Definition at line 1273 of file land_outfits.c.
|
static |
Gets the size of the outfits window.
Definition at line 87 of file land_outfits.c.
| ImageArrayCell * outfits_imageArrayCells | ( | const Outfit ** | outfits, |
| int * | noutfits, | ||
| const Pilot * | p, | ||
| int | store ) |
Generates image array cells corresponding to outfits.
Definition at line 794 of file land_outfits.c.
|
static |
Starts the map find with outfit search selected.
| wid | Window buying outfit from. |
| str | Unused. |
Definition at line 711 of file land_outfits.c.
|
static |
For when the widget closes.
Definition at line 145 of file land_outfits.c.
| void outfits_open | ( | unsigned int | wid, |
| const Outfit ** | outfits, | ||
| int | blackmarket ) |
Opens the outfit exchange center window.
| wid | Window ID to open at. |
| outfits | Array (array.h): Outfits to sell. Will be freed. Set to NULL if this is the landed player store. |
| blackmarket | Whether or not the outfit seller is a black market. |
Definition at line 163 of file land_outfits.c.
| void outfits_regenList | ( | unsigned int | wid, |
| const char * | str ) |
Regenerates the outfit list.
| wid | Window to generate the list on. |
| str | Unused. |
Definition at line 252 of file land_outfits.c.
|
static |
Player right-clicks on an outfit.
| wid | Window player is buying ship from. |
| widget_name | Name of the window. (unused) |
Definition at line 1037 of file land_outfits.c.
|
static |
Attempts to sell the selected outfit the player has.
| wid | Window selling outfits from. |
| str | Unused. |
Definition at line 1187 of file land_outfits.c.
| void outfits_update | ( | unsigned int | wid, |
| const char * | str ) |
Updates the outfits in the outfit window.
| wid | Window to update the outfits in. |
| str | Unused. |
Definition at line 484 of file land_outfits.c.
| void outfits_updateEquipmentOutfits | ( | void | ) |
Updates the outfitter and equipment outfit image arrays.
Definition at line 623 of file land_outfits.c.
|
static |
Stored image array positions.
Definition at line 52 of file land_outfits.c.
|
static |
C-array of Arrays: Outfits associated with the image array cells.
Definition at line 54 of file land_outfits.c.
|
static |
Outfit mode for filtering.
Definition at line 56 of file land_outfits.c.
|
static |
Definition at line 61 of file land_outfits.c.
|
static |
List of the outfits the player sold so they can buy them back.
Definition at line 57 of file land_outfits.c.