Add use_gui flag in application, don't use theme functions when not using gui

This commit is contained in:
ChrisTerBeke 2018-01-12 17:38:47 +01:00
parent 1a05fd5989
commit bd1bf2caaf
2 changed files with 19 additions and 2 deletions

View file

@ -24,7 +24,10 @@ class ConvexHullNode(SceneNode):
self._original_parent = parent
# Color of the drawn convex hull
self._color = Color(*Application.getInstance().getTheme().getColor("convex_hull").getRgb())
if Application.getInstance().hasGui():
self._color = Color(*Application.getInstance().getTheme().getColor("convex_hull").getRgb())
else:
self._color = Color(0, 0, 0)
# The y-coordinate of the convex hull mesh. Must not be 0, to prevent z-fighting.
self._mesh_height = 0.1