enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/data startup.lua,1.16,1.17


From: Ralf Westram <address@hidden>
Subject: [Enigma-cvs] enigma/data startup.lua,1.16,1.17
Date: Wed, 22 Oct 2003 21:47:31 +0000

Update of /cvsroot/enigma/enigma/data
In directory subversions:/tmp/cvs-serv5633/data

Modified Files:
        startup.lua 
Log Message:
- LevelStat2 sets status with revision number
- LevelStat converts old status to new format



Index: startup.lua
===================================================================
RCS file: /cvsroot/enigma/enigma/data/startup.lua,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** startup.lua 12 Sep 2003 21:40:20 -0000      1.16
--- startup.lua 22 Oct 2003 21:47:29 -0000      1.17
***************
*** 27,31 ****
--- 27,46 ----
  ------------------------------
  
+ function options.LevelStat2 (key, stat)
+     if stat[1] < 0 then stat[1] = -1 end
+     if stat[2] < 0 then stat[2] = -1 end
+     if stat[3] < 0 then stat[3] = 0 end
+ 
+     local status = LevelStatus:new(stat[1], stat[2], stat[3], stat[4] or 0)
+     gsub(key, "([^#]*)#(.+)", function (pack,lev)
+                                   options.SetLevelStatus(pack,lev, %status)
+                               end)
+     status:delete()
+ end
+ 
  function options.LevelStat (key, stat)
+     -- old level status (containing modtime of .lua file)
+     -- [keep this function here for compatibility with old config files]
+ 
      -- Enigma accidentally used to save times in the wrong numeric format.
      -- The following two lines works around this problem
***************
*** 34,38 ****
      if stat[3] < 0 then stat[3] = 0 end
  
!     local status = LevelStatus:new(stat[1], stat[2], stat[3], stat[4] or 0)
      gsub(key, "([^#]*)#(.+)", function (pack,lev)
                                    options.SetLevelStatus(pack,lev, %status)
--- 49,56 ----
      if stat[3] < 0 then stat[3] = 0 end
  
!     stat[4] = stat[4] or 0
!     if stat[4] > 0 then stat[4] = 1 end -- level status has 'solved_at' time 
-> default to revision 1
! 
!     local status = LevelStatus:new(stat[1], stat[2], stat[3], stat[4])
      gsub(key, "([^#]*)#(.+)", function (pack,lev)
                                    options.SetLevelStatus(pack,lev, %status)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]