Browse Source

fire trace only if debug

Bastien Sevajol 7 years ago
parent
commit
bc67ccaaee
2 changed files with 9 additions and 6 deletions
  1. 2 1
      config.yaml
  2. 7 5
      opencombat/gui/base.py

+ 2 - 1
config.yaml View File

28
       sounds:
28
       sounds:
29
         - "medias/sounds"
29
         - "medias/sounds"
30
     logging_level: ERROR
30
     logging_level: ERROR
31
-    debug: true
31
+    debug: false
32
+    debug_gui: false

+ 7 - 5
opencombat/gui/base.py View File

200
         self.graphic_path_manager = PathManager(self.config.resolve(
200
         self.graphic_path_manager = PathManager(self.config.resolve(
201
             'global.include_path.graphics',
201
             'global.include_path.graphics',
202
         ))
202
         ))
203
+        self.debug_gui = self.config.resolve('global.debug_gui', False)
203
 
204
 
204
         self.terminal.register_event_handler(
205
         self.terminal.register_event_handler(
205
             FinishMoveEvent,
206
             FinishMoveEvent,
367
         # base on time base instead cycle base. Remove it to ensure.
368
         # base on time base instead cycle base. Remove it to ensure.
368
         delay = random.uniform(0.0, 0.6)
369
         delay = random.uniform(0.0, 0.6)
369
 
370
 
370
-        self.layer_manager.edit_layer.append_callback(
371
-            gunshot_trace,
372
-            duration=0.1,
373
-            delay=delay,
374
-        )
371
+        if self.debug_gui:
372
+            self.layer_manager.edit_layer.append_callback(
373
+                gunshot_trace,
374
+                duration=0.1,
375
+                delay=delay,
376
+            )
375
         self.layer_manager.edit_layer.append_callback(
377
         self.layer_manager.edit_layer.append_callback(
376
             gunshot_sound,
378
             gunshot_sound,
377
             duration=0.0,
379
             duration=0.0,