diff --git a/config/autosave.cfg b/config/autosave.cfg new file mode 100644 index 00000000..7ad7a9b3 --- /dev/null +++ b/config/autosave.cfg @@ -0,0 +1,23 @@ +if (! (checkalias mapstartalways)) [ mapstartalways = "" ] +if (! (checkalias onNewMap)) [ onNewMap = "" ] +if (! (checkalias autosavemap)) [ autosavemap = 0 ] +if (! (checkalias timeBetAutoSaves)) [ timeBetAutoSaves = 300000 ] // Once every 5 minutes. + +autoSaveCheck = [ sleep $timeBetAutoSaves [ doAutoSave ] ] + +if (! (strstr $mapstartalways autoSaveCheck)) [ add2alias mapstartalways [ if $autosavemap autoSaveCheck ] ] +if (! (strstr $onNewMap autoSaveCheck)) [ add2alias onNewMap [ if $autosavemap autoSaveCheck ] ] + +doAutoSave = [ + if (! (strstr $defaultmaps (curmap 1))) [ + if (|| $editing (= $gamemode 1)) [ + if $autosavemap [ + oldmapbackups = $mapbackupsonsave + mapbackupsonsave 0 // Temporarily turn off map backups to avoid clutter. + savemap (curmap 1) + mapbackupsonsave $oldmapbackups + ] + ] + ] + autoSaveCheck +] \ No newline at end of file diff --git a/config/menus_edit.cfg b/config/menus_edit.cfg index 73d8a6d4..de8e8b65 100644 --- a/config/menus_edit.cfg +++ b/config/menus_edit.cfg @@ -9,6 +9,7 @@ menuitem "Ambient sounds..." [ showmenu "Ambient sounds" ] menuitem "Arches and slopes..." [ showmenu Arches ] menuitem "Map operations..." [ showmenu "Map operations" ] menuitem "Bots..." [ showmenu "Creating bot waypoints" ] +menuitem "Settings..." [ showmenu "Editing settings" ] menuitem "Help?" [ echo (c 2)Please read the AssaultCube README which has a detailed guide on mapediting... ] tmp_cradius = 12 @@ -424,4 +425,9 @@ menuinit [ soundrad = 1; soundsize = 0; ambientsoundvol = 255 ] menuitemslider "Sound radius: " 1 25 "$soundrad" 1 "" [ soundrad = $arg1 ] menuitemslider "Sound size: " 0 25 "$soundsize" 1 "" [ soundsize = $arg1 ] menuitemslider "Sound volume: " 1 255 "$ambientsoundvol" 5 "" [ ambientsoundvol = $arg1 ] -menuitem " 2 [ OK ]" [ newent sound $ambientsoundmenu $soundrad $soundsize $ambientsoundvol ] \ No newline at end of file +menuitem " 2 [ OK ]" [ newent sound $ambientsoundmenu $soundrad $soundsize $ambientsoundvol ] + +newmenu "Editing settings" +menuitemslider "Fly speeds multiplier: " 1 5 "$flyspeed" 1 "" [ flyspeed $arg1 ] +menuitemcheckbox "Enable auto save map: " "$autosavemap" [ autosavemap = $arg1 ] +menuitemslider "Time between auto saves: " 30000 600000 "$timeBetAutoSaves" 30000 [] [ timeBetAutoSaves = $arg1 ] \ No newline at end of file diff --git a/config/scripts.cfg b/config/scripts.cfg index 9d073d53..f180e024 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -405,6 +405,7 @@ customclaimadminscript = [ run on_quit run dyngamma run survival +run autosave run tutorial persistidents 1