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:
@@ -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
|
||||
]
|
||||
@@ -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 ]
|
||||
@@ -405,6 +405,7 @@ customclaimadminscript = [
|
||||
run on_quit
|
||||
run dyngamma
|
||||
run survival
|
||||
run autosave
|
||||
run tutorial
|
||||
|
||||
persistidents 1
|
||||
|
||||
Reference in New Issue
Block a user