- import smartpaging
- import helper
- from System.Threading.Tasks import Task
- from System.IO import Path, File
- highlightStart = 0.0
- highlightSubtract = 0.184
- def __onStart(graphicOnAirItem, momentExecution, workFlowtype, graphicOnAirItems):
- Scheduler.ClearScheduler()
- extradata = graphicOnAirItem.ExtraData
- graphicOnAir = IntelliflowController.GetGraphicOnAirItems(graphicOnAirItem.Graphic, OutputManager.ActiveChannelOutput)
- if not graphicOnAir:
- list = []
- for player in Game.HomeTeam.InPlayByKeeperAndShirt:
- list.append(player)
- list.append(Game.HomeTeam.Coach)
- results = list #Game.HomeTeam.InPlayByKeeperAndShirt
- counter = len(results) + 1
- if counter == 0 or counter == 1:
- momentExecution.Message = "HOME LINEUP: No players In play!"
- momentExecution.Cancel = True
- return
- extradata["index"] = 0
- extradata["pageIndex"] = 0
- extradata["pages"] = smartpaging.NonUniformPaging(counter, 1 if counter > 2 else 2)
- extradata["players"] = results
- extradata["highlightStart"] = highlightStart
- else:
- if not "pageIndex" in extradata:
- momentExecution.Cancel = True
- return
- def __getData(graphicOnAirItem, viewBag, momentExecution):
- extradata = graphicOnAirItem.ExtraData
- viewBag.SetString("tCaptainInfo", "C")
- viewBag.SetString("tPlayerInfo", "GK")
- viewBag.SetFloat("vHighlightType", 1)
- ### TEAM INFORMATION
- logosPath = Path.Combine(graphicOnAirItem.GraphicsEngine.Options.RootPath, graphicOnAirItem.Scene.Path, "Images", "Badges")
- team_path = Path.Combine(logosPath, "%s.png"%(Game.HomeTeam.RefName))
- if File.Exists(team_path):
- viewBag.SetImage("lgTeamBadge", "Images\Badges\%s.png" % Game.HomeTeam.RefName)
- else:
- viewBag.SetImage("lgTeamBadge", "Images\\vaz.png")
- viewBag.SetString("tTeamName", Game.HomeTeam.ShortName.upper())
- ### COACH INFORMATION
- viewBag.SetTranslatedText("tCoachFunction", "{{%s}}.{{CoachLineUp}}|filter:ToUpper " % Game.HomeTeam.Coach.Function)
- viewBag.SetString("tCoachFirstName", Game.HomeTeam.Coach.FirstName)
- viewBag.SetString("tCoachLastName", Game.HomeTeam.Coach.LastName)
- viewBag.SetVisibility("vCoachAtRiskVisibility", Game.HomeTeam.Coach.AtRisk)
- for enum,player in enumerate(Game.HomeTeam.InPlayByKeeperAndShirt):
- viewBag.SetVisibility("vAtRiskVisibility%02d" % (enum+1), player.AtRisk)
- viewBag.SetVisibility("vPlayerInfo%02dVisibility" % (enum+1), player.IsGoalKeeper)
- viewBag.SetString("tNumber%02d" % (enum+1), player.Number)
- if player.IsCaptain:
- viewBag.SetFloat("vTypeCaptain", enum+1)
- if player.OtherNames:
- viewBag.SetString("tLastName%02d" % (enum+1), player.OtherNames.upper())
- else:
- viewBag.SetString("tName%02d" % (enum+1), player.FirstName.upper())
- viewBag.SetString("tLastName%02d" % (enum+1), player.LastName.upper())
- playerPath = Path.Combine(graphicOnAirItem.GraphicsEngine.Options.RootPath, graphicOnAirItem.Scene.Path, "Images", "Photos", Game.HomeTeam.RefName.ToString(), "%s.png" % Game.HomeTeam.InPlayByKeeperAndShirt[0].RefName.ToString())
- if File.Exists(playerPath):
- viewBag.SetImage("lgPhoto", "Images\Photos\%s\%s.png" % (Game.HomeTeam.RefName.ToString(), Game.HomeTeam.InPlayByKeeperAndShirt[0].RefName.ToString()))
- else:
- viewBag.SetImage("lgPhoto", "Images\Photos\\vaz.png")
- viewBag.SetFloat("vHighlightStart", 0)
- viewBag.SetFloat("vHighlightEnd", 0)
- def __continueGraphic(args):
- graphicOnAirItem, momentExecution, graphicOnAirItems = args
- extradata = graphicOnAirItem.ExtraData
- pages = extradata["pages"]
- total = extradata["total"]
- index = extradata["index"]
- players = extradata["players"]
- viewBag = IntelliflowController.CreateViewBag()
- if int(index) == 0:
- for g in graphicOnAirItems:
- g.Scene.Show("BadgeToPhoto")
- g.Scene.Wait("BadgeToPhoto")
- g.Scene.Show("Highlight_In")
- g.Scene.Show("Highlight_Scroll")
- else:
- if index == 11:
- viewBag.SetFloat("vHighlightType", 2)
- playerPath = Path.Combine(graphicOnAirItem.GraphicsEngine.Options.RootPath, graphicOnAirItem.Scene.Path, "Images", "Photos", Game.HomeTeam.RefName.ToString(), "%s.png" % players[int(index)].RefName.ToString())
- if File.Exists(playerPath):
- viewBag.SetImage("lgPhoto", "Images\Photos\%s\%s.png" % (Game.HomeTeam.RefName.ToString(), players[int(index)].RefName.ToString()))
- else:
- viewBag.SetImage("lgPhoto", "Images\Photos\\vaz.png")
- viewBag.SetFloat("vHighlightStart", extradata["highlightStart"] + 0.184)
- viewBag.SetFloat("vHighlightEnd", extradata["highlightStart"])
- for render in graphicOnAirItems:
- render.Scene.FillTags(viewBag)
- for g in graphicOnAirItems:
- g.Scene.Show("PhotoChange_In")
- g.Scene.Show("Highlight_Scroll")
- helper.SetExtraData(extradata, "highlightStart", extradata["highlightStart"] - highlightSubtract)
- delay = int(Project.ProjectSettings["LineUpTactical Timer (ms)"]) / extradata["pages"].Count
- if index < 11:
- extradata["index"] = extradata["index"] + 1
- args = [graphicOnAirItem, momentExecution, graphicOnAirItems]
- Scheduler.Add(Script.RefName, "__continueGraphic", Project.Name, args, delay)
- else:
- Scheduler.Add(Script.RefName, "__takeOut", Project.Name, graphicOnAirItem, delay)
- def __afterProgram(graphicOnAirItem, momentExecution, graphicOnAirItems):
- extradata = graphicOnAirItem.ExtraData
- pages = extradata["pages"]
- index = extradata["index"]
- delay = int(Project.ProjectSettings["LineUpTactical Timer (ms)"]) / extradata["pages"].Count
- if index < pages:
- args = [graphicOnAirItem, momentExecution, graphicOnAirItems]
- Scheduler.Add(Script.RefName, "__continueGraphic", Project.Name, args, delay)
- def __takeOut(graphicOnAirItem):
- IntelliflowController.TakeOut(graphicOnAirItem.Graphic, OutputManager.ActiveChannelOutput)
- def __beforeProgramOut(graphicOnAirItem, momentExecution):
- Scheduler.ClearScheduler()
- def __afterPanic(graphicOnAirItem, momentExecution):
- Scheduler.ClearScheduler()
Ho
From Colorant Camel, 1 Week ago, written in Plain Text, viewed 2 times.
This paste will perish in 2 Weeks.
URL https://paste.afonso.co/view/13b5a6d2
Embed
Download Paste or View Raw
— Expand Paste to full width of browser