![]() |
naev 0.12.6
|
Handles the star system editor. More...
#include "dev_mapedit.h"#include "array.h"#include "commodity.h"#include "conf.h"#include "dev_spob.h"#include "dev_sysedit.h"#include "dev_system.h"#include "dev_uniedit.h"#include "dialogue.h"#include "load.h"#include "map.h"#include "mapData.h"#include "ndata.h"#include "nfile.h"#include "nstring.h"#include "opengl.h"#include "outfit.h"#include "pause.h"#include "space.h"#include "tk/toolkit_priv.h"#include "toolkit.h"#include "unidiff.h"
Go to the source code of this file.
Data Structures | |
| struct | mapOutfitsList_t |
Macros | |
| #define | BUTTON_WIDTH 80 |
| #define | BUTTON_HEIGHT 30 |
| #define | MAPEDIT_EDIT_WIDTH 400 |
| #define | MAPEDIT_EDIT_HEIGHT 450 |
| #define | MAPEDIT_DRAG_THRESHOLD 300 |
| #define | MAPEDIT_MOVE_THRESHOLD 10 |
| #define | MAPEDIT_ZOOM_STEP 1.2 |
| #define | MAPEDIT_ZOOM_MAX 5 |
| #define | MAPEDIT_ZOOM_MIN -5 |
| #define | MAPEDIT_OPEN_WIDTH 800 |
| #define | MAPEDIT_OPEN_HEIGHT 500 |
| #define | MAPEDIT_OPEN_TXT_WIDTH 300 |
| #define | MAPEDIT_SAVE_WIDTH 800 |
| #define | MAPEDIT_SAVE_HEIGHT 500 |
| #define | MAPEDIT_SAVE_TXT_WIDTH 300 |
Functions | |
| static void | mapedit_deselect (void) |
| Deselects selected targets. | |
| static void | mapedit_selectAdd (StarSystem *sys) |
| Adds a system to the selection. | |
| static void | mapedit_selectRm (StarSystem *sys) |
| Removes a system from the selection. | |
| static void | mapedit_buttonZoom (unsigned int wid, const char *str) |
| Handles the button zoom clicks. | |
| static void | mapedit_render (double bx, double by, double w, double h, void *data) |
| System editor custom widget rendering. | |
| static void | mapedit_focusLose (unsigned int wid, const char *wgtname) |
| Called when it's de-focused. | |
| static int | mapedit_mouse (unsigned int wid, const SDL_Event *event, double mx, double my, double w, double h, double xr, double yr, void *data) |
| System editor custom widget mouse handling. | |
| static void | mapedit_close (unsigned int wid, const char *wgt) |
| Closes the system editor widget. | |
| static void | mapedit_btnOpen (unsigned int wid_unused, const char *unused) |
| Opens up a map file. | |
| static void | mapedit_btnSaveMapAs (unsigned int wdw, const char *unused) |
| Save the current Map to selected file. | |
| static void | mapedit_clear (unsigned int wid, const char *unused) |
| Closes the system editor widget. | |
| static void | mapedit_chkSpob (unsigned int wid, const char *wgtname) |
| static void | mapedit_chkHidden (unsigned int wid, const char *wgtname) |
| static int | mapedit_keys (unsigned int wid, SDL_Keycode key, SDL_Keymod mod, int isrepeat) |
| Handles keybindings. | |
| static void | mapedit_loadMapMenu_open (void) |
| Opens the load map outfit menu. | |
| static void | mapedit_loadMapMenu_close (unsigned int wdw, const char *str) |
| Closes the load map outfit menu. | |
| static void | mapedit_loadMapMenu_update (unsigned int wdw, const char *str) |
| Updates the load menu. | |
| static void | mapedit_loadMapMenu_load (unsigned int wdw, const char *str) |
| Load the selected Map. | |
| static int | mapedit_saveMap (StarSystem **uniedit_sys, mapOutfitsList_t *ns) |
| Saves selected systems as a map outfit file. | |
| void | mapedit_setGlobalLoadedInfos (mapOutfitsList_t *ns) |
| Set and display the global variables describing last loaded/saved file. | |
| static int | mapedit_mapsList_refresh (void) |
| Gets the list of all the maps names. from outfit_mapParse() | |
| static void | mapsList_free (void) |
| Frees the loaded map. | |
| void | mapedit_open (unsigned int wid_unused, const char *unused) |
| Opens the system editor interface. | |
| void | mapedit_selectText (void) |
| Sets the selected system text. | |
Variables | |
| StarSystem * | systems_stack |
| static mapOutfitsList_t * | mapList |
| static unsigned int | mapedit_wid = 0 |
| static double | mapedit_xpos = 0. |
| static double | mapedit_ypos = 0. |
| static double | mapedit_zoom = 1. |
| static int | mapedit_moved = 0 |
| static unsigned int | mapedit_dragTime = 0 |
| static int | mapedit_drag = 0 |
| static StarSystem ** | mapedit_sys = NULL |
| static int | mapedit_iLastClickedSystem |
| static int | mapedit_tadd = 0 |
| static int | mapedit_nsys = 0 |
| static int | mapedit_msys = 0 |
| static double | mapedit_mx = 0. |
| static double | mapedit_my = 0. |
| static unsigned int | mapedit_widLoad = 0 |
| static char * | mapedit_sLoadMapName = NULL |
| static int | mapedit_nospob = 0 |
| static int | mapedit_hidden = 0 |
Handles the star system editor.
Definition in file dev_mapedit.c.
| #define BUTTON_HEIGHT 30 |
Map button height.
Definition at line 44 of file dev_mapedit.c.
| #define BUTTON_WIDTH 80 |
Map button width.
Definition at line 43 of file dev_mapedit.c.
| #define MAPEDIT_DRAG_THRESHOLD 300 |
Drag threshold.
Definition at line 49 of file dev_mapedit.c.
| #define MAPEDIT_EDIT_HEIGHT 450 |
System editor height.
Definition at line 47 of file dev_mapedit.c.
| #define MAPEDIT_EDIT_WIDTH 400 |
System editor width.
Definition at line 46 of file dev_mapedit.c.
| #define MAPEDIT_MOVE_THRESHOLD 10 |
Movement threshold.
Definition at line 50 of file dev_mapedit.c.
| #define MAPEDIT_OPEN_HEIGHT 500 |
Open window height.
Definition at line 57 of file dev_mapedit.c.
| #define MAPEDIT_OPEN_TXT_WIDTH 300 |
Text width.
Definition at line 58 of file dev_mapedit.c.
| #define MAPEDIT_OPEN_WIDTH 800 |
Open window width.
Definition at line 56 of file dev_mapedit.c.
| #define MAPEDIT_SAVE_HEIGHT 500 |
Open window height.
Definition at line 61 of file dev_mapedit.c.
| #define MAPEDIT_SAVE_TXT_WIDTH 300 |
Text width.
Definition at line 62 of file dev_mapedit.c.
| #define MAPEDIT_SAVE_WIDTH 800 |
Open window width.
Definition at line 60 of file dev_mapedit.c.
| #define MAPEDIT_ZOOM_MAX 5 |
Maximum mapedit zoom level (close).
Definition at line 53 of file dev_mapedit.c.
| #define MAPEDIT_ZOOM_MIN -5 |
Minimum mapedit zoom level (far).
Definition at line 54 of file dev_mapedit.c.
| #define MAPEDIT_ZOOM_STEP 1.2 |
Factor to zoom by for each zoom level.
Definition at line 52 of file dev_mapedit.c.
|
static |
Opens up a map file.
Definition at line 392 of file dev_mapedit.c.
|
static |
Save the current Map to selected file.
Definition at line 901 of file dev_mapedit.c.
|
static |
Handles the button zoom clicks.
| wid | Unused. |
| str | Name of the button creating the event. |
Definition at line 656 of file dev_mapedit.c.
|
static |
Definition at line 384 of file dev_mapedit.c.
|
static |
Definition at line 379 of file dev_mapedit.c.
|
static |
Closes the system editor widget.
Definition at line 370 of file dev_mapedit.c.
|
static |
Closes the system editor widget.
Definition at line 351 of file dev_mapedit.c.
|
static |
Deselects selected targets.
Definition at line 555 of file dev_mapedit.c.
|
static |
Called when it's de-focused.
Definition at line 439 of file dev_mapedit.c.
|
static |
Handles keybindings.
Definition at line 331 of file dev_mapedit.c.
|
static |
Closes the load map outfit menu.
| wdw | Window triggering function. |
| str | Unused. |
Definition at line 778 of file dev_mapedit.c.
|
static |
Load the selected Map.
Definition at line 787 of file dev_mapedit.c.
|
static |
Opens the load map outfit menu.
Definition at line 682 of file dev_mapedit.c.
|
static |
Updates the load menu.
| wdw | Window triggering function. |
| str | Unused. |
Definition at line 741 of file dev_mapedit.c.
|
static |
Gets the list of all the maps names. from outfit_mapParse()
Definition at line 952 of file dev_mapedit.c.
|
static |
System editor custom widget mouse handling.
Definition at line 449 of file dev_mapedit.c.
| void mapedit_open | ( | unsigned int | wid_unused, |
| const char * | unused ) |
Opens the system editor interface.
Definition at line 138 of file dev_mapedit.c.
|
static |
System editor custom widget rendering.
Definition at line 403 of file dev_mapedit.c.
|
static |
Saves selected systems as a map outfit file.
Definition at line 1098 of file dev_mapedit.c.
|
static |
Adds a system to the selection.
Definition at line 571 of file dev_mapedit.c.
|
static |
Removes a system from the selection.
Definition at line 597 of file dev_mapedit.c.
| void mapedit_selectText | ( | void | ) |
Sets the selected system text.
Definition at line 613 of file dev_mapedit.c.
| void mapedit_setGlobalLoadedInfos | ( | mapOutfitsList_t * | ns | ) |
Set and display the global variables describing last loaded/saved file.
Definition at line 926 of file dev_mapedit.c.
|
static |
Frees the loaded map.
Definition at line 1077 of file dev_mapedit.c.
|
static |
Dragging viewport around.
Definition at line 83 of file dev_mapedit.c.
|
static |
Tick last started to drag.
Definition at line 82 of file dev_mapedit.c.
|
static |
Mark hidden jump lanes too.
Definition at line 95 of file dev_mapedit.c.
|
static |
Last clicked system (use with system_getIndex).
Definition at line 85 of file dev_mapedit.c.
|
static |
Space moved since mouse down.
Definition at line 81 of file dev_mapedit.c.
|
static |
Memory allocated for selected systems.
Definition at line 89 of file dev_mapedit.c.
|
static |
X mouse position.
Definition at line 90 of file dev_mapedit.c.
|
static |
Y mouse position.
Definition at line 91 of file dev_mapedit.c.
|
static |
Don't save spobs.
Definition at line 94 of file dev_mapedit.c.
|
static |
Number of selected systems.
Definition at line 88 of file dev_mapedit.c.
|
static |
Loaded Map Outfit.
Definition at line 93 of file dev_mapedit.c.
|
static |
Selected systems.
Definition at line 84 of file dev_mapedit.c.
|
static |
Temporarily clicked system should be added.
Definition at line 87 of file dev_mapedit.c.
|
static |
Sysedit wid.
Definition at line 77 of file dev_mapedit.c.
|
static |
Load Map Outfit wid.
Definition at line 92 of file dev_mapedit.c.
|
static |
Viewport X position.
Definition at line 78 of file dev_mapedit.c.
|
static |
Viewport Y position.
Definition at line 79 of file dev_mapedit.c.
|
static |
Viewport zoom level.
Definition at line 80 of file dev_mapedit.c.
|
static |
Definition at line 74 of file dev_mapedit.c.