Browse Source

fire trace only if debug

Bastien Sevajol 6 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,4 +28,5 @@ global:
28 28
       sounds:
29 29
         - "medias/sounds"
30 30
     logging_level: ERROR
31
-    debug: true
31
+    debug: false
32
+    debug_gui: false

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

@@ -200,6 +200,7 @@ class Game(TMXGui):
200 200
         self.graphic_path_manager = PathManager(self.config.resolve(
201 201
             'global.include_path.graphics',
202 202
         ))
203
+        self.debug_gui = self.config.resolve('global.debug_gui', False)
203 204
 
204 205
         self.terminal.register_event_handler(
205 206
             FinishMoveEvent,
@@ -367,11 +368,12 @@ class Game(TMXGui):
367 368
         # base on time base instead cycle base. Remove it to ensure.
368 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 377
         self.layer_manager.edit_layer.append_callback(
376 378
             gunshot_sound,
377 379
             duration=0.0,