![]() |
naev 0.10.4
|
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 "log.h"#include "map.h"#include "map_find.h"#include "nstring.h"#include "nlua.h"#include "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 |
Macros | |
| #define | OUTFITS_IAR "iarOutfits" |
| #define | OUTFITS_TAB "tabOutfits" |
| #define | OUTFITS_FILTER "inpFilterOutfits" |
| #define | OUTFITS_NTABS 6 |
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. More... | |
| static void | outfits_buy (unsigned int wid, const char *str) |
| Attempts to buy the outfit that is selected. More... | |
| static void | outfits_sell (unsigned int wid, const char *str) |
| Attempts to sell the selected outfit the player has. More... | |
| static int | outfits_getMod (void) |
| Gets the current modifier status. More... | |
| static void | outfits_renderMod (double bx, double by, double w, double h, void *data) |
| Renders the outfit buying modifier. More... | |
| static void | outfits_rmouse (unsigned int wid, const char *widget_name) |
| Player right-clicks on an outfit. More... | |
| static void | outfits_find (unsigned int wid, const char *str) |
| Starts the map find with outfit search selected. More... | |
| 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) More... | |
| static void | outfit_Popdown (unsigned int wid, const char *str) |
| static void | outfits_genList (unsigned int wid) |
| Generates the outfit list. More... | |
| 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. More... | |
| static void | outfits_onClose (unsigned int wid, const char *str) |
| For when the widget closes. More... | |
| void | outfits_open (unsigned int wid, const Outfit **outfits) |
| Opens the outfit exchange center window. More... | |
| void | outfits_regenList (unsigned int wid, const char *str) |
| Regenerates the outfit list. More... | |
| 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. More... | |
| void | outfits_updateEquipmentOutfits (void) |
| Updates the outfitter and equipment outfit image arrays. More... | |
| int | outfits_filter (const Outfit **outfits, int n, int(*filter)(const Outfit *o), const char *name) |
| Applies a filter function and string to a list of outfits. More... | |
| int | outfit_altText (char *buf, int n, const Outfit *o, const Pilot *plt) |
| Computes the alt text for an outfit. More... | |
| ImageArrayCell * | outfits_imageArrayCells (const Outfit **outfits, int *noutfits, const Pilot *p) |
| Generates image array cells corresponding to outfits. More... | |
| static void | outfit_PopdownSelect (unsigned int wid, const char *str) |
| static void | outfit_PopdownActivate (unsigned int wid, const char *str) |
| int | outfit_canBuy (const char *name, const Spob *spob) |
| Checks to see if the player can buy the outfit. More... | |
| int | outfit_canSell (const char *name) |
| Checks to see if the player can sell the selected outfit. More... | |
| void | outfits_cleanup (void) |
| Cleans up outfit globals. More... | |
Variables | |
| static iar_data_t * | iar_data = NULL |
| static Outfit *** | iar_outfits = NULL |
| static int | outfit_Mode = 0 |
| 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 39 of file land_outfits.c.
| #define OUTFITS_IAR "iarOutfits" |
Definition at line 37 of file land_outfits.c.
| #define OUTFITS_NTABS 6 |
Definition at line 40 of file land_outfits.c.
| #define OUTFITS_TAB "tabOutfits" |
Definition at line 38 of file land_outfits.c.
Computes the alt text for an outfit.
Definition at line 655 of file land_outfits.c.
| int outfit_canBuy | ( | const char * | name, |
| const Spob * | spob | ||
| ) |
Checks to see if the player can buy the outfit.
| name | Outfit to buy. |
| spob | Where the player is shopping. |
Definition at line 794 of file land_outfits.c.
| int outfit_canSell | ( | const char * | name | ) |
Checks to see if the player can sell the selected outfit.
| name | Outfit to try to sell. |
Definition at line 935 of file land_outfits.c.
|
static |
Returns the price of an outfit (subject to quantity modifier)
Definition at line 618 of file land_outfits.c.
|
static |
Definition at line 759 of file land_outfits.c.
|
static |
Definition at line 753 of file land_outfits.c.
|
static |
Functions for the popdown menu (filter outfits by size)
Definition at line 743 of file land_outfits.c.
|
static |
Ad-hoc filter functions.
Definition at line 255 of file land_outfits.c.
|
static |
Definition at line 302 of file land_outfits.c.
|
static |
Definition at line 299 of file land_outfits.c.
|
static |
Definition at line 296 of file land_outfits.c.
|
static |
Definition at line 293 of file land_outfits.c.
|
static |
Attempts to buy the outfit that is selected.
| wid | Window buying outfit from. |
| str | Unused. |
Definition at line 869 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 547 of file land_outfits.c.
| void outfits_cleanup | ( | void | ) |
Cleans up outfit globals.
Definition at line 1082 of file land_outfits.c.
| int outfits_filter | ( | const Outfit ** | outfits, |
| int | n, | ||
| int(*)(const Outfit *o) | filter, | ||
| 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 585 of file land_outfits.c.
|
static |
Starts the map find with outfit search selected.
| wid | Window buying outfit from. |
| str | Unused. |
Definition at line 609 of file land_outfits.c.
|
static |
Generates the outfit list.
| wid | Window to generate the list on. |
Definition at line 311 of file land_outfits.c.
|
static |
Gets the current modifier status.
Definition at line 1042 of file land_outfits.c.
|
static |
Gets the size of the outfits window.
Definition at line 73 of file land_outfits.c.
| ImageArrayCell * outfits_imageArrayCells | ( | const Outfit ** | outfits, |
| int * | noutfits, | ||
| const Pilot * | p | ||
| ) |
Generates image array cells corresponding to outfits.
Definition at line 687 of file land_outfits.c.
|
static |
For when the widget closes.
Definition at line 100 of file land_outfits.c.
| void outfits_open | ( | unsigned int | wid, |
| const Outfit ** | outfits | ||
| ) |
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. |
Definition at line 117 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 217 of file land_outfits.c.
|
static |
Renders the outfit buying modifier.
| bx | Base X position to render at. |
| by | Base Y position to render at. |
| w | Width to render at. |
| h | Height to render at. |
| data | Unused. |
Definition at line 1061 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 859 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 982 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 405 of file land_outfits.c.
| void outfits_updateEquipmentOutfits | ( | void | ) |
Updates the outfitter and equipment outfit image arrays.
Definition at line 523 of file land_outfits.c.
|
static |
Stored image array positions.
Definition at line 46 of file land_outfits.c.
|
static |
C-array of Arrays: Outfits associated with the image array cells.
Definition at line 47 of file land_outfits.c.
|
static |
Outfit mode for filtering.
Definition at line 48 of file land_outfits.c.
|
static |
Definition at line 51 of file land_outfits.c.