![]() |
naev 0.11.5
|
Handles the star system editor. More...
#include "dev_sysedit.h"#include "array.h"#include "conf.h"#include "dev_spob.h"#include "dev_system.h"#include "dev_uniedit.h"#include "dialogue.h"#include "economy.h"#include "map.h"#include "ndata.h"#include "nstring.h"#include "opengl.h"#include "opengl_render.h"#include "safelanes.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 | Select_t |
| Selection generic for stuff in a system. More... | |
Macros | |
| #define | BUTTON_WIDTH 100 |
| #define | BUTTON_HEIGHT 30 |
| #define | SYSEDIT_EDIT_WIDTH 500 |
| #define | SYSEDIT_EDIT_HEIGHT 400 |
| #define | SYSEDIT_DRAG_THRESHOLD 300 |
| #define | SYSEDIT_MOVE_THRESHOLD 10 |
| #define | SYSEDIT_ZOOM_STEP 1.2 |
| #define | SYSEDIT_ZOOM_MAX 1 |
| #define | SYSEDIT_ZOOM_MIN -23 |
Enumerations | |
| enum | { SELECT_NONE , SELECT_SPOB , SELECT_JUMPPOINT , SELECT_ASTEROID , SELECT_ASTEXCLUDE } |
Functions | |
| static void | sysedit_buttonZoom (unsigned int wid, const char *str) |
| Handles the button zoom clicks. | |
| static void | sysedit_render (double bx, double by, double w, double h, void *data) |
| System editor custom widget rendering. | |
| static void | sysedit_renderAsteroidsField (double bx, double by, const AsteroidAnchor *ast, int selected) |
| Draws an asteroid field on the map. | |
| static void | sysedit_renderAsteroidExclusion (double bx, double by, const AsteroidExclusion *aexcl, int selected) |
| Draws an asteroid exclusion zone on the map. | |
| static void | sysedit_renderBG (double bx, double by, double w, double h, double x, double y) |
| Renders the custom widget background. | |
| static void | sysedit_renderSprite (glTexture *gfx, double bx, double by, double x, double y, int sx, int sy, const glColour *c, int selected, const char *caption) |
| Renders a sprite for the custom widget. | |
| static void | sysedit_focusLose (unsigned int wid, const char *wgtname) |
| Called when it's de-focused. | |
| static int | sysedit_mouseTrySelect (const Select_t *sel, double x, double y, double t, double mx, double my, SDL_Keymod mod, void(*func)(void)) |
| static int | sysedit_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 | sysedit_close (unsigned int wid, const char *wgt) |
| Closes the system editor widget. | |
| static void | sysedit_btnNewSpob (unsigned int wid_unused, const char *unused) |
| Enters the editor in new spob mode. | |
| static void | sysedit_btnNewAsteroids (unsigned int wid_unused, const char *unused) |
| Enters the editor in new spob mode. | |
| static void | sysedit_btnRename (unsigned int wid_unused, const char *unused) |
| static void | sysedit_btnRemove (unsigned int wid_unused, const char *unused) |
| Removes spobs. | |
| static void | sysedit_btnReset (unsigned int wid_unused, const char *unused) |
| Resets jump points. | |
| static void | sysedit_btnScale (unsigned int wid_unused, const char *unused) |
| Interface for scaling a system from the system view. | |
| static void | sysedit_btnGrid (unsigned int wid_unused, const char *unused) |
| Toggles the grid. | |
| static void | sysedit_btnEdit (unsigned int wid_unused, const char *unused) |
| Opens the system property editor. | |
| static void | sysedit_editPnt (void) |
| Edits a spob. | |
| static void | sysedit_editPntClose (unsigned int wid, const char *unused) |
| Closes the spob editor, saving the changes made. | |
| static void | sysedit_spobDesc (unsigned int wid, const char *unused) |
| Displays the spob landing description and bar description in a separate window. | |
| static void | sysedit_spobDescReturn (unsigned int wid, const char *unused) |
| Closes the spob description window and returns to the properties window. | |
| static void | sysedit_spobDescClose (unsigned int wid, const char *unused) |
| Closes both the spob description window and the properties window. | |
| static void | sysedit_genServicesList (unsigned int wid) |
| Generates the spob services list. | |
| static void | sysedit_btnTechEdit (unsigned int wid, const char *unused) |
| Edits a spob's tech. | |
| static void | sysedit_genTechList (unsigned int wid) |
| Generates the spob tech list. | |
| static void | sysedit_btnAddTech (unsigned int wid, const char *unused) |
| Adds a tech to a spob. | |
| static void | sysedit_btnRmTech (unsigned int wid, const char *unused) |
| Removes a tech from a spob. | |
| static void | sysedit_btnTagsEdit (unsigned int wid, const char *unused) |
| Edits a spob's tags. | |
| static void | sysedit_genTagsList (unsigned int wid) |
| Generates the spob tech list. | |
| static void | sysedit_btnAddTag (unsigned int wid, const char *unused) |
| Adds a tech to a spob. | |
| static void | sysedit_btnRmTag (unsigned int wid, const char *unused) |
| Removes a tech from a spob. | |
| static void | sysedit_btnNewTag (unsigned int wid, const char *unused) |
| Adds a tech to a spob. | |
| static void | sysedit_btnTagsClose (unsigned int wid, const char *unused) |
| static void | sysedit_btnAddService (unsigned int wid, const char *unused) |
| Adds a service to a spob. | |
| static void | sysedit_btnRmService (unsigned int wid, const char *unused) |
| Removes a service from a spob. | |
| static void | sysedit_spobGFX (unsigned int wid_unused, const char *wgt) |
| Opens the spob landing or space graphic editor. | |
| static void | sysedit_btnGFXClose (unsigned int wid, const char *wgt) |
| Closes the spob graphic editor. | |
| static void | sysedit_btnGFXApply (unsigned int wid, const char *wgt) |
| Apply new graphics. | |
| static void | sysedit_btnFaction (unsigned int wid_unused, const char *unused) |
| Edits a spob's faction. | |
| static void | sysedit_btnFactionSet (unsigned int wid, const char *unused) |
| Actually modifies the faction. | |
| static void | sysedit_editJump (void) |
| Edits a jump. | |
| static void | sysedit_editJumpClose (unsigned int wid, const char *unused) |
| Closes the jump editor, saving the changes made. | |
| static void | sysedit_editAsteroids (void) |
| Opens the asteroid editor. | |
| static void | sysedit_editAsteroidsClose (unsigned int wid, const char *unused) |
| static void | sysedit_genAsteroidsList (unsigned int wid) |
| static void | sysedit_btnAsteroidsDelete (unsigned int wid, const char *unused) |
| static void | sysedit_btnRmAsteroid (unsigned int wid, const char *unused) |
| static void | sysedit_btnAddAsteroid (unsigned int wid, const char *unused) |
| static void | sysedit_editExclusion (void) |
| static void | sysedit_editExclusionClose (unsigned int wid, const char *unused) |
| static void | sysedit_btnExclusionDelete (unsigned int wid, const char *unused) |
| static int | sysedit_keys (unsigned int wid, SDL_Keycode key, SDL_Keymod mod, int isrepeat) |
| Handles keybindings. | |
| static int | sysedit_selectCmp (const Select_t *a, const Select_t *b) |
| Compares two selections to see if they are the same. | |
| static int | sysedit_isSelected (const Select_t *sel) |
| Check to see if something is selected. | |
| static void | sysedit_checkButtons (void) |
| Checks to see which buttons should be active and the likes. | |
| static void | sysedit_deselect (void) |
| Deselects everything. | |
| static void | sysedit_selectAdd (const Select_t *sel) |
| Adds a system to the selection. | |
| static void | sysedit_selectRm (Select_t *sel) |
| Removes a system from the selection. | |
| void | sysedit_open (StarSystem *sys) |
| Opens the system editor interface. | |
| void | sysedit_sysScale (StarSystem *sys, double factor) |
| Scales a system. | |
| static void | jp_type_check_hidden_update (unsigned int wid, const char *str) |
| Updates the jump point checkboxes. | |
| static void | jp_type_check_exit_update (unsigned int wid, const char *str) |
| Updates the jump point checkboxes. | |
| static void | jp_type_check_nolanes_update (unsigned int wid, const char *str) |
| Updates the jump point checkboxes. | |
Variables | |
| static Select_t * | sysedit_select = NULL |
| static int | sysedit_nselect = 0 |
| static int | sysedit_mselect = 0 |
| static Select_t | sysedit_tsel |
| static int | sysedit_tadd = 0 |
| static char ** | sysedit_tagslist = NULL |
| static StarSystem * | sysedit_sys = NULL |
| static unsigned int | sysedit_wid = 0 |
| static unsigned int | sysedit_widEdit = 0 |
| static int | sysedit_grid = 1 |
| static double | sysedit_xpos = 0. |
| static double | sysedit_ypos = 0. |
| static double | sysedit_zoom = 1. |
| static int | sysedit_moved = 0 |
| static unsigned int | sysedit_dragTime = 0 |
| static int | sysedit_drag = 0 |
| static int | sysedit_dragSel = 0 |
| static double | sysedit_mx = 0. |
| static double | sysedit_my = 0. |
| static int | jp_hidden = 0 |
| static int | jp_exit = 0 |
Handles the star system editor.
Definition in file dev_sysedit.c.
| #define BUTTON_HEIGHT 30 |
Map button height.
Definition at line 37 of file dev_sysedit.c.
| #define BUTTON_WIDTH 100 |
Map button width.
Definition at line 36 of file dev_sysedit.c.
| #define SYSEDIT_DRAG_THRESHOLD 300 |
Drag threshold.
Definition at line 42 of file dev_sysedit.c.
| #define SYSEDIT_EDIT_HEIGHT 400 |
System editor height.
Definition at line 40 of file dev_sysedit.c.
| #define SYSEDIT_EDIT_WIDTH 500 |
System editor width.
Definition at line 39 of file dev_sysedit.c.
| #define SYSEDIT_MOVE_THRESHOLD 10 |
Movement threshold.
Definition at line 43 of file dev_sysedit.c.
| #define SYSEDIT_ZOOM_MAX 1 |
Maximum zoom level (close).
Definition at line 46 of file dev_sysedit.c.
| #define SYSEDIT_ZOOM_MIN -23 |
Minimum zoom level (far).
Definition at line 47 of file dev_sysedit.c.
| #define SYSEDIT_ZOOM_STEP 1.2 |
Factor to zoom by for each zoom level.
Definition at line 45 of file dev_sysedit.c.
| anonymous enum |
Definition at line 52 of file dev_sysedit.c.
|
static |
Updates the jump point checkboxes.
Definition at line 1547 of file dev_sysedit.c.
|
static |
Updates the jump point checkboxes.
Definition at line 1531 of file dev_sysedit.c.
|
static |
Updates the jump point checkboxes.
Definition at line 1563 of file dev_sysedit.c.
|
static |
Definition at line 1808 of file dev_sysedit.c.
|
static |
Adds a service to a spob.
Definition at line 2079 of file dev_sysedit.c.
|
static |
Adds a tech to a spob.
Definition at line 2426 of file dev_sysedit.c.
|
static |
Adds a tech to a spob.
Definition at line 2233 of file dev_sysedit.c.
|
static |
Definition at line 1819 of file dev_sysedit.c.
|
static |
Opens the system property editor.
Definition at line 2585 of file dev_sysedit.c.
|
static |
Definition at line 1888 of file dev_sysedit.c.
|
static |
Edits a spob's faction.
Definition at line 2500 of file dev_sysedit.c.
|
static |
Actually modifies the faction.
Definition at line 2556 of file dev_sysedit.c.
|
static |
Apply new graphics.
Definition at line 2682 of file dev_sysedit.c.
|
static |
Closes the spob graphic editor.
Definition at line 2674 of file dev_sysedit.c.
|
static |
Toggles the grid.
Definition at line 683 of file dev_sysedit.c.
|
static |
Enters the editor in new spob mode.
Definition at line 447 of file dev_sysedit.c.
|
static |
Enters the editor in new spob mode.
Definition at line 382 of file dev_sysedit.c.
|
static |
Adds a tech to a spob.
Definition at line 2476 of file dev_sysedit.c.
|
static |
Removes spobs.
Definition at line 553 of file dev_sysedit.c.
|
static |
Definition at line 496 of file dev_sysedit.c.
|
static |
Resets jump points.
Definition at line 594 of file dev_sysedit.c.
|
static |
Definition at line 1796 of file dev_sysedit.c.
|
static |
Removes a service from a spob.
Definition at line 2100 of file dev_sysedit.c.
|
static |
Removes a tech from a spob.
Definition at line 2448 of file dev_sysedit.c.
|
static |
Removes a tech from a spob.
Definition at line 2255 of file dev_sysedit.c.
|
static |
Interface for scaling a system from the system view.
Definition at line 611 of file dev_sysedit.c.
|
static |
Definition at line 2338 of file dev_sysedit.c.
|
static |
Edits a spob's tags.
Definition at line 2282 of file dev_sysedit.c.
|
static |
Edits a spob's tech.
Definition at line 2124 of file dev_sysedit.c.
|
static |
Handles the button zoom clicks.
| wid | Unused. |
| str | Name of the button creating the event. |
Definition at line 1228 of file dev_sysedit.c.
|
static |
Checks to see which buttons should be active and the likes.
Definition at line 1269 of file dev_sysedit.c.
|
static |
Closes the system editor widget.
Definition at line 294 of file dev_sysedit.c.
|
static |
Deselects everything.
Definition at line 1254 of file dev_sysedit.c.
|
static |
Opens the asteroid editor.
Definition at line 1665 of file dev_sysedit.c.
|
static |
Definition at line 1836 of file dev_sysedit.c.
|
static |
Definition at line 1854 of file dev_sysedit.c.
|
static |
Definition at line 1904 of file dev_sysedit.c.
|
static |
Edits a jump.
Definition at line 1576 of file dev_sysedit.c.
|
static |
Closes the jump editor, saving the changes made.
Definition at line 1641 of file dev_sysedit.c.
|
static |
Edits a spob.
Definition at line 1383 of file dev_sysedit.c.
|
static |
Closes the spob editor, saving the changes made.
Definition at line 332 of file dev_sysedit.c.
|
static |
Called when it's de-focused.
Definition at line 956 of file dev_sysedit.c.
|
static |
Definition at line 1741 of file dev_sysedit.c.
|
static |
Generates the spob services list.
Definition at line 2010 of file dev_sysedit.c.
|
static |
Generates the spob tech list.
Definition at line 2353 of file dev_sysedit.c.
|
static |
Generates the spob tech list.
Definition at line 2155 of file dev_sysedit.c.
|
static |
Check to see if something is selected.
Definition at line 1372 of file dev_sysedit.c.
|
static |
Handles keybindings.
Definition at line 278 of file dev_sysedit.c.
|
static |
System editor custom widget mouse handling.
Definition at line 1017 of file dev_sysedit.c.
|
static |
Definition at line 963 of file dev_sysedit.c.
| void sysedit_open | ( | StarSystem * | sys | ) |
Opens the system editor interface.
Definition at line 176 of file dev_sysedit.c.
|
static |
System editor custom widget rendering.
Definition at line 694 of file dev_sysedit.c.
|
static |
Draws an asteroid exclusion zone on the map.
Definition at line 846 of file dev_sysedit.c.
|
static |
Draws an asteroid field on the map.
Definition at line 820 of file dev_sysedit.c.
|
static |
Renders the custom widget background.
Definition at line 875 of file dev_sysedit.c.
|
static |
Renders a sprite for the custom widget.
Definition at line 921 of file dev_sysedit.c.
|
static |
Adds a system to the selection.
Definition at line 1322 of file dev_sysedit.c.
Compares two selections to see if they are the same.
Definition at line 1364 of file dev_sysedit.c.
|
static |
Removes a system from the selection.
Definition at line 1344 of file dev_sysedit.c.
|
static |
Displays the spob landing description and bar description in a separate window.
Definition at line 1919 of file dev_sysedit.c.
|
static |
Closes both the spob description window and the properties window.
Definition at line 2001 of file dev_sysedit.c.
|
static |
Closes the spob description window and returns to the properties window.
Definition at line 1975 of file dev_sysedit.c.
|
static |
Opens the spob landing or space graphic editor.
Definition at line 2603 of file dev_sysedit.c.
| void sysedit_sysScale | ( | StarSystem * | sys, |
| double | factor ) |
Scales a system.
Definition at line 642 of file dev_sysedit.c.
|
static |
Jump point exit only checkbox value.
Definition at line 98 of file dev_sysedit.c.
|
static |
Jump point hidden checkbox value.
Definition at line 97 of file dev_sysedit.c.
|
static |
Dragging viewport around.
Definition at line 91 of file dev_sysedit.c.
|
static |
Dragging system around.
Definition at line 92 of file dev_sysedit.c.
|
static |
Tick last started to drag.
Definition at line 90 of file dev_sysedit.c.
|
static |
Grid is visible.
Definition at line 85 of file dev_sysedit.c.
|
static |
Space moved since mouse down.
Definition at line 89 of file dev_sysedit.c.
|
static |
Memory allocated for selections.
Definition at line 74 of file dev_sysedit.c.
|
static |
Cursor X position.
Definition at line 93 of file dev_sysedit.c.
|
static |
Cursor Y position.
Definition at line 94 of file dev_sysedit.c.
|
static |
Number of selections in current system.
Definition at line 73 of file dev_sysedit.c.
|
static |
Current system selection.
Definition at line 72 of file dev_sysedit.c.
|
static |
Currently opened system.
Definition at line 82 of file dev_sysedit.c.
|
static |
Add to selection.
Definition at line 76 of file dev_sysedit.c.
|
static |
List of existing tags.
Definition at line 77 of file dev_sysedit.c.
|
static |
Temporary selection.
Definition at line 75 of file dev_sysedit.c.
|
static |
Sysedit wid.
Definition at line 83 of file dev_sysedit.c.
|
static |
Spob editor wid.
Definition at line 84 of file dev_sysedit.c.
|
static |
Viewport X position.
Definition at line 86 of file dev_sysedit.c.
|
static |
Viewport Y position.
Definition at line 87 of file dev_sysedit.c.
|
static |
Viewport zoom level.
Definition at line 88 of file dev_sysedit.c.