/* viDOOM - level editor for DOOM Copyright (C) 2000 Ian Cowburn (ianc@noddybox.demon.co.uk) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------- Editor global varaiable definitions Note that the lindefs, vertices, etc here are copied from the WadMap loaded prior to editting. They are then reconverted back to the WadMap for saving. */ static const char rcs_id[]="$Id$"; #include "config.h" #include "globals.h" #include "editvar.h" /* ---------------------------------------- EDIT TYPES */ char *edit_str[]={"Sector","Linedef","Vertex","Thing","Multimode"}; /* ---------------------------------------- EDIT VARS */ void HandleMoveKey(GFXKey k,int check_mouse); int edit_mode=SECTOR_MODE; Map vertex=NULL; Map linedef=NULL; Map sidedef=NULL; Map sector=NULL; Map thing=NULL; Map multimap=NULL; char *mapinfo=NULL; int hexen_mode=FALSE; char *behavior=NULL; int behavior_size=0; char *scripts=NULL; int scripts_size=0; int SCRW; int SCRH; int FH; int scale=5; int ox; int oy; GFXMouse ms; int quit; int agrid; int current=-1; List selected=NULL; /* This variable should be set to try by any actions in the generic object routines that have generated a new selection list. */ int new_selection=FALSE; /* Hardcoded values!!! Remove sometime */ Thing ed_thing={0,0,0,1,0x07,0,0,0,{0,0,0,0,0}}; /* This variable stops the DrawObjectInfo() routine being called on redraws */ int draw_current_info=TRUE; /* ---------------------------------------- USED AS GENERIC FUNCTIONS AND VALUES */ /* Data in all these functions is the Object.data pointer */ int (*PositionOnObject)(int x, int y, void *data); void (*SelectBox)(int x1, int y1, int x2, int y2); void (*SelectByType)(void); void (*DrawObject)(void *data, int selmode); void (*DrawObjectInfo)(void); void (*DrawObjectHeader)(void); void (*MoveObject)(void); void (*RotateObject)(double angle); void (*ScaleObject)(double scale); void (*SetTagObject)(int tag); void (*LocateObject)(void *obj); void (*ObjectMenu)(void); void (*ObjectInsert)(void); void (*ObjectDelete)(void); void (*ObjectKey)(GFXKey k); int (*ObjectHasTag)(void *obj, int tag); void (*SetSelect)(int i, int mode); ObjDesc *(*ObjectOverlaid)(int x,int y,int *no); char *typename; Map map; /* ---------------------------------------- MENUS AND DIALOGS */ PLAT_MENU thing_popup[]={ {"Change type",TM_TYPE,NULL}, {"Set type to value",TM_VAL,NULL}, {"Change flags",TM_FLAGS,NULL}, {"Change angle",TM_ANGLE,NULL}, {"Snap selected things",TM_SNAP,NULL}, {"Move",TM_MOVE,NULL}, {"Delete",TM_DELETE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU thing_popup_hexen[]={ {"Change type",TM_TYPE,NULL}, {"Set type to value",TM_VAL,NULL}, {"Change special action",TM_SPECIAL,NULL}, {"Set special action to value", TM_SPECIAL_VAL,NULL}, {"Change special action args",TM_ARGS,NULL}, {"Clear special action args to zero", TM_ZERO,NULL}, {"Set ranged special args",TM_ARGS_RANGE,NULL}, {"Change flags",TM_FLAGS,NULL}, {"Change angle",TM_ANGLE,NULL}, {"Change angle to value",TM_ANGLE_VAL,NULL}, {"Set Z postion",TM_Z_POS,NULL}, {"Set thing ID",TM_THING_ID,NULL}, {"Snap",TM_SNAP,NULL}, {"Move",TM_MOVE,NULL}, {"Delete",TM_DELETE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU vertex_popup[]={ {"Chain selected vertices",TM_CHAIN,NULL}, {"Chain selected vertices " "into a sector",TM_CHAIN_SECTOR,NULL}, {"Merge selected vertices",TM_MERGE,NULL}, {"Snap",TM_SNAP,NULL}, {"Move",TM_MOVE,NULL}, {"Delete",TM_DELETE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU right_popup[]= { {"Change upper texture",TM_UPPER_T_R,NULL}, {"Change middle texture",TM_MIDDLE_T_R,NULL}, {"Change lower texture",TM_LOWER_T_R,NULL}, {"Change textures to any value",TM_TEXTURES_R}, {"Change texture offset",TM_OFFSET_R,NULL}, {"Adjust texture offset",TM_ADJUST_R,NULL}, {"Change sector",TM_SECTOR_R,NULL}, {"Align textures",TM_ALIGN_R,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU left_popup[]= { {"Change upper texture",TM_UPPER_T_L,NULL}, {"Change middle texture",TM_MIDDLE_T_L,NULL}, {"Change lower texture",TM_LOWER_T_L,NULL}, {"Change textures to any value",TM_TEXTURES_L}, {"Change texture offset",TM_OFFSET_L,NULL}, {"Adjust texture offset",TM_ADJUST_L,NULL}, {"Change sector",TM_SECTOR_L,NULL}, {"Align textures",TM_ALIGN_L,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU linedef_popup[]= { {"Change linedef type",TM_TYPE,NULL}, {"Set generalised linedef type",TM_GEN_TYPE,NULL}, {"Set type to value",TM_VAL,NULL}, {"Change linedef flags",TM_FLAGS,NULL}, {"Swap sides",TM_SWAP_SIDES,NULL}, {"Split line",TM_SPLIT_LINE,NULL}, {"Select trail from this linedef",TM_TRACK_LINE,NULL}, {"Join linedefs with steps",TM_STEPS,NULL}, {"Right sidedef",0,right_popup}, {"Left sidedef",0,left_popup}, {"Change tag",TM_TAG,NULL}, {"Move",TM_MOVE,NULL}, {"Delete",TM_DELETE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU linedef_popup_hexen[]= { {"Change special action",TM_SPECIAL,NULL}, {"Set special action to value",TM_VAL,NULL}, {"Change special action args",TM_ARGS,NULL}, {"Clear special action args to zero",TM_ZERO,NULL}, {"Set ranged special args",TM_ARGS_RANGE,NULL}, {"Change linedef flags",TM_FLAGS,NULL}, {"Swap sides",TM_SWAP_SIDES,NULL}, {"Split line",TM_SPLIT_LINE,NULL}, {"Select trail from this linedef",TM_TRACK_LINE,NULL}, {"Join linedefs with steps",TM_STEPS,NULL}, {"Right sidedef",0,right_popup}, {"Left sidedef",0,left_popup}, {"Move",TM_MOVE,NULL}, {"Delete",TM_DELETE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU sector_popup[]= { {"Change type",TM_TYPE,NULL}, {"Change generalised type",TM_GEN_TYPE,NULL}, {"Set type to value",TM_VAL,NULL}, {"Change floor height",TM_FLOOR,NULL}, {"Change ceiling height",TM_CEILING,NULL}, {"Change light level",TM_LIGHT,NULL}, {"Change tag",TM_TAG,NULL}, {"Change floor",TM_FLOOR_T,NULL}, {"Change ceiling",TM_CEILING_T,NULL}, {"Paint sector in style",TM_STYLE,NULL}, {"Move",TM_MOVE,NULL}, {"Delete",TM_DELETE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_MENU multi_popup[]= { {"Snap",TM_SNAP,NULL}, {"Rotate",TM_ROTATE,NULL}, {"Scale",TM_SCALE,NULL}, {"Move",TM_MOVE,NULL}, {NULL,GUI_CANCEL,NULL} }; PLAT_RADIO thing_angle[]={ {"N",90}, {"NE",45}, {"E",0}, {"SE",315}, {"S",270}, {"SW",225}, {"W",180}, {"NW",135}, {NULL,GUI_CANCEL} }; PLAT_DIALOG offset_dialog[D_OFFSET_NO]= { {"X-offset",PLAT_DIAL_INTEGER,{0}}, {"Y-offset",PLAT_DIAL_INTEGER,{0}} }; PLAT_DIALOG sectorn_dialog[D_OFFSET_NO]= { {"Sector no",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG coord_dialog[D_COORD_NO]= { {"X",PLAT_DIAL_INTEGER,{0}}, {"Y",PLAT_DIAL_INTEGER,{0}} }; PLAT_DIALOG vertex_dialog[D_VERTEX_NO]= { {"Vertex from",PLAT_DIAL_INTEGER,{0}}, {"Vertex to",PLAT_DIAL_INTEGER,{0}} }; PLAT_DIALOG sector_fl_dialog[D_SECTOR_FL_NO]= { {"Floor height",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG sector_ce_dialog[D_SECTOR_CE_NO]= { {"Ceiling height",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG sector_li_dialog[D_SECTOR_LI_NO]= { {"Light level",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG sector_val_dialog[D_SECTOR_VAL_NO]= { {"Light level",PLAT_DIAL_INTEGER,{0}}, {"Floor height",PLAT_DIAL_INTEGER,{0}}, {"Ceiling height",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG tag_dialog[D_TAG_NO]= { {"Tag",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG scale_dialog[D_SCALE_NO]= { {"Scale",PLAT_DIAL_DOUBLE,{0}}, }; PLAT_DIALOG rotate_dialog[D_ROTATE_NO]= { {"Angle",PLAT_DIAL_DOUBLE,{0}}, }; PLAT_DIALOG objno_dialog[D_OBJNO_NO]= { {"Object number",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG nosides_dialog[D_NOSIDES_NO]= { {"Number of sides",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG zcoord_dialog[D_COORD_NO]= { {"Z co-ord",PLAT_DIAL_INTEGER,{0}}, }; PLAT_DIALOG l_range_dialog[D_L_RANGE_NO]= { {"Starting light level", PLAT_DIAL_INTEGER,{0}}, {"Minimum light level", PLAT_DIAL_INTEGER,{0}}, {"Maximum light level", PLAT_DIAL_INTEGER,{0}}, {"Lighting adjustment", PLAT_DIAL_INTEGER,{0}}, {"Pulse",PLAT_DIAL_PICKLIST,{0}}, }; PLAT_DIALOG textures_dialog[D_TEXTURES_NO]= { {"Upper",PLAT_DIAL_STRING,{0}}, {"Middle",PLAT_DIAL_STRING,{0}}, {"Lower",PLAT_DIAL_STRING,{0}}, }; /* Generic yes/no dialog picklist array */ char *edit_dial_picklist_yes_no[2]={"No","Yes"}; /* ---------------------------------------- DRAWING TABLES */ Point t_arrow[8]={{1,0}, {1,1}, {0,1}, {-1,1}, {-1,0}, {-1,-1}, {0,-1}, {1,-1}}; char *angle_str[8]={"E","NE","N","NW","W","SW","S","SE"}; /* ---------------------------------------- HELP PAGES */ char *general_help_keys[]= { "F1 - general help |" "F2 - edit mode help |" "Escape - finish editting |" "Cursor keys - move |" "Shift + Cursor keys - move quickly |" "Ctrl + Cursor keys - move by one scale position |" "Page down/up - zoom in/out |" "Q/W - decrease/increase grid scale |" "G - grid lines on/off |" "X - grid snap on/off |" "Tab/Shift + Tab - next/previous edit mode |" "V - VERTEX edit mode |" "L - LINEDEF edit mode |" "S - SECTOR edit mode |" "T - THING edit mode |" "C - MULTI edit mode |" "F9 - deselect all |" "Shift + F9 - invert selection |" "F10 - select all |" "Shift + F10 - select by type (if applicable) |" "Ctrl + F10 - select one from a number of |" " overlaid objects |" "Alt + F10 - additionally select one |" " overlaid object |" "F11/Shift + F11 - locate next/previous selection ", "Insert - insert new object |" "Delete - delete selected objects |" "Home - LUMP menu (ZDoom only) |" "F3 - merge a PWAD map |" "F4 - move selected objects |" "F5 - rotate selected objects |" "[ - rotate 5 degrees left |" "] - rotate 5 degrees right |" "F6 - scale selected objects |" "{ - scale by 90% |" "} - scale by 110% |" "F7 - set tag (if applicable) |" "Shift + F7 - select objects with tag |" "F8 - locate by object number |" "Shift + F8 - locate and select object number|" "R - redraw [useful if selected |" " sectors look unselected] |" " |" "Note: Grid lock not honoured on rotate or scale ", NULL }; char *general_help_mouse= "Left button - select object |" "Ctrl + Left button - additionally select object |" "Shift + Left button - select objects in box |" "Ctrl + Shift + Left button - additionally select objects in box|" "Right button - pop-up object menu |" "Middle button - move selected objects "; char *mode_help[]= { /* SECTOR */ "M - change sector move mode |" "H - toggle SECTOR tag highligting|" ", - decrease sector floor by 8 |" ". - increase sector floor by 8 |" "< - decrease sector ceiling by 8 |" "> - increase sector ceiling by 8 |" "- - decrease lighting level by 16|" "+ - increase lighting level by 16", /* LINEDEF */ "H - toggle LINEDEF tag highligting |" "F12 - perform checks for LINEDEF textures", /* VERTEX */ "F12 - remove vertices to bound to linedefs", /* THING */ ", - rotate THINGs angle anti-clockwise |" ". - rotate THINGs angle clockwise |" "< - decrement THING Z co-ord (Hexen only) |" "> - increment THING Z co-ord (Hexen only) ", /* MULTI */ "No additional key functions" }; /* END OF FILE */