a few tweaks
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6770 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+9
-3
@@ -1,19 +1,25 @@
|
||||
if (! (checkalias mapstartalways)) [ mapstartalways = "" ]
|
||||
if (! (strstr $mapstartalways autoSaveCheck)) [ add2alias mapstartalways [ if $autosavemap autoSaveCheck ] ]
|
||||
if (! (strstr $mapstartalways autoSaveCheck)) [ add2alias mapstartalways [ if $autosavemap autoSaveCheck; numAutoSaves = 0 ] ]
|
||||
|
||||
if (! (checkalias onNewMap)) [ onNewMap = "" ]
|
||||
if (! (strstr $onNewMap autoSaveCheck)) [ add2alias onNewMap [ if $autosavemap autoSaveCheck; numAutoSaves = 0 ] ]
|
||||
|
||||
if (! (checkalias autosavemap)) [ autosavemap = 0 ]
|
||||
if (! (checkalias timeBetAutoSaves)) [ timeBetAutoSaves = 300000 ] // Once every 5 minutes.
|
||||
if (! (checkalias numAutoSaveBackups)) [ numAutoSaveBackups = 12 ]
|
||||
|
||||
const autoSaveCheck [ sleep $timeBetAutoSaves [ doAutoSave ] ]
|
||||
|
||||
const doAutoSave [
|
||||
if (! (strstr $defaultmaps (curmap 1))) [
|
||||
if (&& (! (strstr $defaultmaps (curmap 1))) (! (strcmp (curmap 1) ""))) [
|
||||
if (|| $editing (= $gamemode 1)) [
|
||||
if $autosavemap [
|
||||
+= numAutoSaves 1
|
||||
oldmapbackups = $mapbackupsonsave
|
||||
mapbackupsonsave 0 // Temporarily turn off map backups to avoid clutter.
|
||||
if (|| (!= $numAutoSaveBackups $numAutoSaves) (= $numAutoSaveBackups 0)) [ mapbackupsonsave 0 ] [ numAutoSaves = 0 ] // Temporarily turn off map backups to avoid clutter.
|
||||
savemap (curmap 1)
|
||||
mapbackupsonsave $oldmapbackups
|
||||
echo (blue)The map was automatically saved. (white)Next auto-save in (divf $timeBetAutoSaves 60000) minutes.
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
@@ -430,4 +430,5 @@ menuitem "2 [ OK ]" [ newent sound $ambientsoundmenu $soundrad $soundsize
|
||||
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 ]
|
||||
menuitemslider "Time between auto saves (in milliseconds): " 30000 600000 "$timeBetAutoSaves" 30000 [] [ timeBetAutoSaves = $arg1 ]
|
||||
menuitemtextinput "Make a map backup (.BAK) every (# auto saves):" "$numAutoSaveBackups" [ if (testlist $arg1) [ numAutoSaveBackups = $arg1 ] ] [] 4
|
||||
Reference in New Issue
Block a user