def __init__(self, width, ppsettings): self.background = Image.open(os.path.join(abspath, "res/pppp.png")) ratio = self.background.size[1] / self.background.size[0] newheight = int(width * ratio) self.background = self.background.resize((width, newheight), Image.ANTIALIAS) self.outputpath = os.path.join(abspath, "ppsample.png") settings = Settings() settings.path = os.path.dirname(osr2mp4.__file__) + "/" width, height = self.background.size playfield_scale, playfield_width, playfield_height, scale, move_right, move_down = get_screensize( width, height) settings.scale = scale settings.width = width settings.height = height settings.settings["Enable PP counter"] = True settings.ppsettings = ppsettings settings.fps = 60 settings.timeframe = 1000 self.ppcounter = PPCounter(settings) self.ppcounter.set(727.27) self.hitresultcounter = HitresultCounter(settings) self.hitresultcounter.set({100: 17, 50: 70, 0: 13}) self.settings = settings
def __init__(self, frames, settings, diff, replay_info, meta, maphash, map_time): opacity_interval, timepreempt, _ = calculate_ar(diff["ApproachRate"], settings) check = DiffCalculator(diff) rankinggap = 0 skin = settings.skin_ini hd = Mod.Hidden in replay_info.mod_combination hasfl = Mod.Flashlight in replay_info.mod_combination self.cursormiddle = Cursor(frames.cursormiddle) self.cursor = Cursor(frames.cursor) self.cursor_trail = Cursortrail(frames.cursor_trail, frames.continuous, settings) # self.lifegraph = LifeGraph(skin_path + "scorebarbg-colour") self.scoreentry = ScoreEntry(frames.scoreentry, settings) self.inputoverlayBG = InputOverlayBG(frames.inputoverlayBG, settings=settings) self.key1 = InputOverlay(frames.key, self.scoreentry, settings) self.key2 = InputOverlay(frames.key, self.scoreentry, settings) self.mouse1 = InputOverlay(frames.mouse, self.scoreentry, settings) self.mouse2 = InputOverlay(frames.mouse, self.scoreentry, settings) self.playingmodicons = PlayingModIcons(frames.modicons, replay_info, settings) self.accuracy = Accuracy(frames.accuracy, skin.fonts["ScoreOverlap"], settings) self.timepie = TimePie(self.accuracy, map_time[0], map_time[1], frames.scorebarbg, settings) self.playinggrade = PlayingGrade(frames.playinggrade, self.timepie, replay_info, settings) self.hitresult = HitResult(frames.hitresult, settings, replay_info.mod_combination) self.spinbonus = SpinBonusScore(frames.spinbonus, skin.fonts["ScoreOverlap"], settings) self.combocounter = ComboCounter(frames.combocounter, skin.fonts["ScoreOverlap"], settings) self.scorecounter = ScoreCounter(frames.scorecounter, diff, skin.fonts["ScoreOverlap"], settings) self.urbar = URBar(frames.urbar, frames.urarrow, settings) self.followpoints = FollowPointsManager(frames.fpmanager, settings) self.hitcirclenumber = Number(frames.hitcirclenumber, skin.fonts) self.circle = CircleManager(frames.circle, timepreempt, self.hitcirclenumber, settings) self.slider = SliderManager(frames.slider, diff, settings, hd) self.spinner = SpinnerManager((frames.spinner, frames.scorecounter), settings, check) self.hitobjmanager = HitObjectManager(self.circle, self.slider, self.spinner, check.scorewindow[2], settings) self.background = Background(frames.bg, map_time[0] - timepreempt, settings, hasfl) self.sections = Sections(frames.sections, settings) self.scorebarbg = ScorebarBG(frames.scorebarbg, map_time[0] - timepreempt, settings, hasfl) self.scorebar = Scorebar(frames.scorebar, settings) self.arrowwarning = ArrowWarning(frames.arrowwarning, settings) self.scoreboard = Scoreboard(frames.scoreboard, frames.scoreboardscore, frames.scoreboardeffect, replay_info, meta, maphash, settings) if frames.loadranking: self.rankingpanel = RankingPanel(frames.rankingpanel, settings) self.rankinghitresults = RankingHitresults(frames.rankinghitresults, replay_info, frames.rankingscore, rankinggap, settings) self.rankingtitle = RankingTitle(frames.rankingtitle, replay_info, meta, settings) self.rankingcombo = RankingCombo(frames.rankingcombo, replay_info, frames.rankingscore, rankinggap, settings) self.rankingaccuracy = RankingAccuracy(frames.rankingaccuracy, replay_info, frames.rankingscore, rankinggap, settings) self.rankinggrade = RankingGrade(replay_info, frames.rankinggrades, rankinggap, settings) self.menuback = Menuback(frames.menuback, settings) self.modicons = ModIcons(frames.modicons, replay_info, settings) self.rankingreplay = RankingReplay(frames.rankingreplay, settings) self.rankinggraph = RankingGraph(frames.rankinggraph, replay_info, settings) self.ppcounter = PPCounter(settings) self.hitresultcounter = HitresultCounter(settings) self.flashlight = Flashlight(frames.flashlight, settings, hasfl) self.strain_graph = StrainGraph(settings, map_time[0], map_time[1])