From fdb683e4062981e6d688419f90bbfed94e4b71eb Mon Sep 17 00:00:00 2001 From: ac-stef Date: Sat, 26 Mar 2016 00:36:16 +0100 Subject: [PATCH] add command and keybind for tag clips edittagclip type Sets tag clip type of all selected cubes. type can be numeric 0, 64 or 128 or keyword "none", "clip", or "plclip" DOCREF edittagclip --- config/menus_edit.cfg | 7 ++++++- config/resetbinds.cfg | 6 ++++++ config/scripts.cfg | 1 + source/src/editing.cpp | 11 +++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index 3eaabb24..26786997 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -573,10 +573,15 @@ menuitemeditkeyinput [Redo: ] redo menuitem "" -1 menuitemeditkeyinput [Pin/unpin closest entity: ] toggleclosestentpin menuitemeditkeyinput [Delete entity: ] editkey_delete_entity -menuitemeditkeyinput [Show tag clip volume: ] showtagclipfocus menuitemeditkeyinput [Copy entity: ] copyent menuitemeditkeyinput [Paste entity: ] pasteent menuitemeditkeyinput [Edit entity: ] editent +menuitem "" -1 +menuitem "\f2Tag clips:" -1 +menuitemeditkeyinput [Show tag clip volume: ] showtagclipfocus +menuitemeditkeyinput [Remove tag clip: ] editkey_tagclip_none +menuitemeditkeyinput [Create tag 'playerclip': ] editkey_tagclip_plclip +menuitemeditkeyinput [Create tag 'clip': ] editkey_tagclip_clip // deleted entities newmenu "deleted entities" diff --git a/config/resetbinds.cfg b/config/resetbinds.cfg index 1f76f032..47fb5d1d 100644 --- a/config/resetbinds.cfg +++ b/config/resetbinds.cfg @@ -60,6 +60,9 @@ alias editkey_ceiltex_up [ edittex 2 1 ] alias editkey_ceiltex_dn [ edittex 2 -1 ] alias editkey_uppertex_up [ edittex 3 1 ] alias editkey_uppertex_dn [ edittex 3 -1 ] +alias editkey_tagclip_none [ edittagclip none ] +alias editkey_tagclip_plclip [ edittagclip plclip ] +alias editkey_tagclip_clip [ edittagclip clip ] _defaultbinds 1 // do not save the following binds to saved.cfg @@ -181,8 +184,11 @@ bind DELETE [] editbind DELETE editkey_floortex_dn bind KP0 [] bind KP1 [] +editbind KP1 editkey_tagclip_none bind KP2 [] +editbind KP2 editkey_tagclip_plclip bind KP3 [] +editbind KP3 editkey_tagclip_clip bind KP4 [] editbind KP4 editkey_uppertex_dn bind KP5 [] diff --git a/config/scripts.cfg b/config/scripts.cfg index 0ee82a31..90b318d6 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -85,6 +85,7 @@ looplist [ edittexturestack texturestacktypes ] [ cmd options ] [ listcomplete $cmd (listoptions $options) ] +listcomplete edittagclip "none plclip clip" listcomplete getvarrange "min max default" listcomplete mapareacheck "vdelta steepest total pprest pp" listcomplete authsetup "pre priv pub ppass pass passd needpass genpre genpriv genpub newppass newpass unarmed" diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 5935e3e2..591ef8e9 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -976,6 +976,17 @@ void edittag(int *tag) } COMMAND(edittag, "i"); +void edittagclip(char *tag) +{ + int nt = ((int) strtol(tag, NULL, 0)) & TAGANYCLIP; + if(tolower(*tag) == 'n') nt = 0; // "none", "nil, "nop" + else if(!strncasecmp(tag, "pl", 2)) nt = TAGPLCLIP; // "playerclip", "plclip", "pl" + else if(isalpha(*tag)) nt = TAGCLIP; // "clip", "all", "full", "hippo" + EDITSELMP; + loopselsxy(s->tag = (s->tag & TAGTRIGGERMASK) | nt); +} +COMMAND(edittagclip, "s"); + void newent(char *what, float *a1, float *a2, float *a3, float *a4) { EDITSEL;