Log some info on level calls
authorNeil <neil@dip.sun.ac.za>
Fri, 19 Apr 2013 15:19:04 +0000 (17:19 +0200)
committerNeil <neil@dip.sun.ac.za>
Fri, 19 Apr 2013 15:19:04 +0000 (17:19 +0200)
erdslangetjie/editor/editor.py
erdslangetjie/level.py

index 3a6b4eca49991c198f52a92b2dd090aa22a643b4..3cf3d6d9ca6de4da6adb28f52a9af7b924006d70 100644 (file)
@@ -49,7 +49,7 @@ class EditorWindow(FloatLayout):
                 self.level = level
             else:
                 self.level = 'levels/' + level
-        self.level_obj = Level(level_data)
+        self.level_obj = Level(level_data, self.level)
         level_data.close()
         self.level_obj.load_tiles()
 
index 2246b1f2acd6910aa2e3bc17ca0b5f10354d41ea..9ebb6f4912525a3f0f34c7589badbb80cf3525af 100644 (file)
@@ -3,6 +3,9 @@
 import os
 from data import load_image, load, filepath
 
+
+from kivy.logger import Logger
+
 WALL = '.'
 FLOOR = ' '
 ENTRY = 'E'
@@ -13,7 +16,7 @@ BUTTON = 'B'
 
 class Level(object):
 
-    def __init__(self, levelfile):
+    def __init__(self, levelfile, name):
         self._data = []
         self.exit_pos = []
         self.enter_pos = None
@@ -21,6 +24,7 @@ class Level(object):
         self._changed = []
         self._gates = {}
         self._buttons = {}
+        self._name = name
         # Because of how kivy's coordinate system works,
         # we reverse the lines so things match up between
         # the file and the display (top of file == top of display)
@@ -29,6 +33,7 @@ class Level(object):
 
     def load_tiles(self):
         """Load the list of tiles for the level"""
+        Logger.info('%s: load tiles' % self._name)
         self._tiles = []
         self._gates = {}
         self._buttons = {}
@@ -296,7 +301,7 @@ class LevelList(object):
             line = line.strip()
             if os.path.exists(filepath(line)):
                 level_file = load(line)
-                level = Level(level_file)
+                level = Level(level_file, line)
                 level_file.close()
                 try:
                     level.validate()