naev 0.10.4
land.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "conf.h"
7#include "nstring.h"
8#include "space.h"
9
10/*
11 * The window interfaces.
12 */
13enum {
14 LAND_WINDOW_MAIN,
15 LAND_WINDOW_BAR,
16 LAND_WINDOW_MISSION,
17 LAND_WINDOW_OUTFITS,
18 LAND_WINDOW_SHIPYARD,
19 LAND_WINDOW_EQUIPMENT,
20 LAND_WINDOW_COMMODITY,
21 LAND_NUMWINDOWS
22};
23
24/* global/main window */
25#define LAND_WIDTH RESOLUTION_W_MIN
26#define LAND_HEIGHT RESOLUTION_H_MIN
27#define PORTRAIT_WIDTH 200
28#define PORTRAIT_HEIGHT 150
29
30/*
31 * Default button sizes.
32 */
33#define LAND_BUTTON_WIDTH 200
34#define LAND_BUTTON_HEIGHT 40
36/*
37 * Minor hack, for 'buy map' button.
38 */
39#define LOCAL_MAP_NAME "Local System Map"
40
41/*
42 * Landed at.
43 */
44extern int landed;
45extern Spob* land_spob;
46
47/* Tracking for which tabs have been generated. */
48#define land_tabGenerate(w) (land_generated |= (1 << w))
49#define land_tabGenerated(w) (land_generated & (1 << w))
50extern unsigned int land_generated;
51
52/*
53 * Main interface.
54 */
55void land_queueTakeoff (void);
56void land_needsTakeoff( int delay );
57int land_canSave (void);
58int land_doneLoading (void);
59void land( Spob* p, int load );
60void land_genWindows( int load, int changetab );
61void takeoff( int delay, int nosave );
62void land_cleanup (void);
63void land_exit (void);
64int land_setWindow( int window );
65
66/*
67 * Internal usage.
68 */
69void land_refuel (void);
70void land_updateMainTab (void);
71void land_buttonTakeoff( unsigned int wid, const char *unused );
72unsigned int land_getWid( int window );
73void bar_regen (void);
74
75/*
76 * Error dialogue generation and associated checks.
77 */
78int can_swap( const char *shipname );
79int can_swapEquipment( const char *shipname );
80int can_sell( const char *shipname );
81int land_errDialogue( const char *name, const char *type );
82PRINTF_FORMAT( 1, 2 ) void land_errDialogueBuild( const char *fmt, ... );
void bar_regen(void)
Regenerates the bar list.
Definition: land.c:452
void land_queueTakeoff(void)
Queue a takeoff.
Definition: land.c:143
void takeoff(int delay, int nosave)
Makes the player take off if landed.
Definition: land.c:1461
int can_swapEquipment(const char *shipname)
Makes sure it's valid to change ships in the equipment view.
Definition: land.c:200
void land_genWindows(int load, int changetab)
Recreates the land windows.
Definition: land.c:1032
int land_setWindow(int window)
Sets the land window tab.
Definition: land.c:1186
unsigned int land_getWid(int window)
Gets the WID of a window by type.
Definition: land.c:963
void land_cleanup(void)
Cleans up some land-related variables.
Definition: land.c:1672
int landed
Definition: land.c:74
int land_doneLoading(void)
Check to see if finished loading.
Definition: land.c:189
void land(Spob *p, int load)
Opens up all the land dialogue stuff.
Definition: land.c:1201
void land_errDialogueBuild(const char *fmt,...)
Generates error dialogues used by several landing tabs.
Definition: land.c:288
int land_errDialogue(const char *name, const char *type)
Generates error dialogues used by several landing tabs.
Definition: land.c:256
void land_exit(void)
Exits all the landing stuff.
Definition: land.c:1718
void land_updateMainTab(void)
Adds the "Buy Local Map" button if needed and updates info.
Definition: land.c:864
Spob * land_spob
Definition: land.c:82
int land_canSave(void)
Whether or not the player can save.
Definition: land.c:166
void land_buttonTakeoff(unsigned int wid, const char *unused)
Wrapper for takeoff mission button.
Definition: land.c:925
void land_refuel(void)
Refuels the player's current ship, if possible.
Definition: land.c:807
int can_sell(const char *shipname)
Makes sure it's valid to sell a ship.
int can_swap(const char *shipname)
Makes sure it's valid to change ships.
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...
Definition: space.h:88