progress_cont.py (1177B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\theatersOfWar\campaigns\panels\progress_cont.py 2 from carbonui import Align, uiconst 3 from carbonui.primitives.container import Container 4 from carbonui.primitives.fill import Fill 5 from carbonui.primitives.gridcontainer import GridContainer 6 7 class ProgressCont(Container): 8 default_align = Align.TOTOP 9 default_height = 8 10 11 def ApplyAttributes(self, attributes): 12 super(ProgressCont, self).ApplyAttributes(attributes) 13 self.progress_grid_boxes = [] 14 self.progress_grid = GridContainer(name='progress_grid', parent=self, align=Align.TOTOP, height=self.height, contentSpacing=(4, 4)) 15 16 def load_progress(self, current_progress, progress_goal, progress_color): 17 self.progress_grid_boxes = [] 18 self.progress_grid.Flush() 19 self.progress_grid.columns = progress_goal 20 for i in xrange(progress_goal): 21 if i < current_progress: 22 color = progress_color 23 else: 24 color = (0.5, 0.5, 0.5, 0.5) 25 Fill(parent=self.progress_grid, color=color, state=uiconst.UI_NORMAL)