Skip to content

Commit

Permalink
hide bars when no data or paused
Browse files Browse the repository at this point in the history
  • Loading branch information
jamessanford committed Jan 3, 2015
1 parent 0efe22e commit 8929976
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion deltabar/deltabar_lib/deltabar_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ def update_sector(self, new_sector):
session[sector_number] = self.lap

def clear_screen_data(self):
ac.setText(self.data.label4, "") # delta text
ac.setVisible(self.data.label4, 0) # delta text
ac.setText(self.data.label4, "")
if hasattr(self.data, 't'):
del self.data.t
if hasattr(self.data, 's'):
Expand Down Expand Up @@ -456,12 +457,20 @@ def draw_delta_bar(self, time_delta, speed_delta):
'{}{}{}.{}'.format(plus, star, ms[0:-3], ms[-3:-1]))

def onRender(self, delta_t):
if self.first_update:
return # bail out, nothing is ready

if (sim_info.info.graphics.status not in (sim_info.AC_LIVE,
sim_info.AC_PAUSE)):
ac.setVisible(self.data.bar_area, 0)
ac.setVisible(self.data.label4, 0)
self.clear_screen_data()
elif hasattr(self.data, 't') and hasattr(self.data, 's'):
ac.setVisible(self.data.bar_area, 1)
ac.setVisible(self.data.label4, 1)
self.draw_delta_bar(self.data.t, self.data.s)
else:
ac.setVisible(self.data.bar_area, 1)
self.clear_screen_data()

if self.banner_time == 0:
Expand Down

0 comments on commit 8929976

Please sign in to comment.