add undelete for entities
BACKSPACE in combination with editmeta (LCTRL) now undeletes the last deleted entity. BACKSPACE in combination with editmeta2 (LSHIFT) brings up the menu "deleted entities". The edit menu now has a submenu "deleted entities" which lists all deleted entities and undeletes the selected one. undelent [<index>] If no index is specified, the last deleted entity is restored. If an index is given, the specified entity from the list of deleted entities is restored. getdeletedentities Returns a list of deleted entities. Each line contains the entity type, the position and all seven attributes. unlistdeletedentity [<which>] If <which> is a number, the specified entry from the list of deleted entities gets removed. If <which> is "all", the whole list of deleted entities gets deleted. If <which> is "last" the last deleted entity is removed from the list of deleted entities. Returns the number of entities on the list of deleted entities (even if the parameter <which> was unknown or not specified). DOCREF undelent getdeletedentities unlistdeletedentity
This commit is contained in:
@@ -13,6 +13,8 @@ menuitem (_ [Map operations...]) [ showmenu [Map operations] ]
|
||||
menuitem [Map config operations...] [ showmenu [Map config operations] ]
|
||||
menuitem (_ [Bots...]) [ showmenu [Creating bot waypoints] ]
|
||||
menuitem (_ [Settings...]) [ showmenu [Editing settings] ]
|
||||
menuitem [Deleted entities] [ showmenu "deleted entities" ]
|
||||
|
||||
menuitem (_ Help?) [ echo (yellow) (_ [Please read the AssaultCube README which has a detailed guide on mapediting...]) ]
|
||||
|
||||
tempalias tmp_cradius 12
|
||||
@@ -287,6 +289,33 @@ menuitemcheckbox (_ [Enable auto save map: ]) "$autosavemap" [ autosavemap = $ar
|
||||
menuitemslider (_ [Time between auto saves (in minutes): ]) 2 60 "(div $timeBetAutoSaves 60000)" 1 [] [ timeBetAutoSaves = (* $arg1 60000) ]
|
||||
menuitemtextinput (_ [Make a map backup (.BAK) every: ]) "$numAutoSaveBackups" [ numAutoSaveBackups = $arg1 ] [ if (! $showedBAKinfo) [ echo This setting effects the number of autosavemaps between making a map backup file. "(.BAK)"; showedBAKinfo = 1 ] ] 4
|
||||
|
||||
// deleted entities
|
||||
newmenu "deleted entities"
|
||||
menuinit __rebuilddeletedentitymenu
|
||||
|
||||
tempalias __rebuilddeletedentitymenu [
|
||||
delmenu "deleted entities"
|
||||
newmenu "deleted entities"
|
||||
if (unlistdeletedentity) [
|
||||
push i 0
|
||||
looplist (getdeletedentities) [type x y z a1 a2 a3 a4 a5 a6 a7] [
|
||||
push desc (concat $type (concatword "[" $x "|" $y "|" $z "]") (concatword "(" $a1 ", " $a2 ", " $a3 ", " $a4 ", " $a5 ", " $a6 ", " $a7 ")"))
|
||||
if (strcmp $type mapmodel) [desc = (concat $desc (mapmodelslotname $a2))]
|
||||
if (&& $editing (strcmp $type sound)) [desc = (concat $desc (at (editmapsoundslot $a1) 0))]
|
||||
if $editing [
|
||||
menuitem (pop desc) (concat gotoposition $x $y $z $a1 0 ";" undelent $i)
|
||||
][
|
||||
menuitem (pop desc) -1
|
||||
]
|
||||
+= i 1
|
||||
]
|
||||
pop i
|
||||
menuitem "\f3clear this list" "unlistdeletedentity all"
|
||||
] [
|
||||
menuitem "no deleted entities" -1
|
||||
]
|
||||
]
|
||||
|
||||
//Mapmodels
|
||||
newmenu Mapmodels
|
||||
menuinit __rebuildmapmodelmenus
|
||||
|
||||
@@ -30,7 +30,7 @@ bind MOUSE3 weapon
|
||||
bind MOUSE4 key_universaldelta_plus
|
||||
bind MOUSE5 key_universaldelta_minus
|
||||
bind BACKSPACE dropflag
|
||||
editbind BACKSPACE delent
|
||||
editbind BACKSPACE [if $editmeta2down [showmenu "deleted entities" ; menuselection "deleted entities" (- (unlistdeletedentity) 1)] [if $editmetakeydown undelent delent]]
|
||||
bind TAB key_showscores
|
||||
bind CLEAR []
|
||||
bind RETURN []
|
||||
|
||||
Reference in New Issue
Block a user