def DrawProgressBar(self, DISPLAY): self.LoadingBarPos = (DISPLAY.get_width() / 2 - 250 / 2, DISPLAY.get_height() / 2 + 10 / 2, 250, 10) self.LoadingBarProgress = (self.LoadingBarPos[0], self.LoadingBarPos[1], max( 10, UTILS.Get_Percentage( self.Progress, self.LoadingBarPos[2], self.ProgressMax)), 10) Shape.Shape_Rectangle(DISPLAY, (20, 20, 58), self.LoadingBarPos, 0, self.LoadingBarPos[3]) Shape.Shape_Rectangle(DISPLAY, (94, 114, 219), self.LoadingBarProgress, 0, self.LoadingBarPos[3])
def Render(self, DISPLAY): if not self.IsVisible: return if self.Progress >= self.ProgressMax: self.Progress = self.ProgressMax if self.LastProgress != self.Progress: self.LastProgress = self.Progress UI.SystemResources.PlaySound("/progress.wav", UI.SystemSoundsVolume) self.ProgressRect = (self.Rectangle[0], self.Rectangle[1], max( 10, UTILS.Get_Percentage(self.Progress, self.Rectangle[2], self.ProgressMax)), 10) Shape.Shape_Rectangle(DISPLAY, (20, 20, 58), self.Rectangle, 0, self.Rectangle[3]) Shape.Shape_Rectangle(DISPLAY, (94, 114, 219), self.ProgressRect, 0, self.ProgressRect[3])