auto save map script

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6566 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-08-08 22:14:53 +00:00
parent dff42f8ee9
commit 7fe80902bd
3 changed files with 31 additions and 1 deletions
+23
View File
@@ -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
]
+7 -1
View File
@@ -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 ]
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 ]
+1
View File
@@ -405,6 +405,7 @@ customclaimadminscript = [
run on_quit
run dyngamma
run survival
run autosave
run tutorial
persistidents 1