public MovieElement (UIScreen screen, BinElement el, byte[] palette, string resource) : base (screen, el, palette) { Sensitive = false; Player = new SmackerPlayer ((Stream)Mpq.GetResource (resource), 1); }
public MovieElement (UIScreen screen, BinElement el, byte[] palette, SmackerPlayer player) : base (screen, el, palette) { Sensitive = false; Player = player; }
public MovieElement(UIScreen screen, BinElement el, byte[] palette, SmackerPlayer player) : base(screen, el, palette) { Sensitive = false; Player = player; }
public MovieElement(UIScreen screen, BinElement el, byte[] palette, string resource) : base(screen, el, palette) { Sensitive = false; Player = new SmackerPlayer((Stream)Mpq.GetResource(resource), 1); }
public override void RemoveFromPainter () { base.RemoveFromPainter (); player.Stop (); player = null; Painter.Remove (Layer.Background, VideoPainter); }
public override void RemoveFromPainter() { base.RemoveFromPainter(); player.Stop(); player = null; Painter.Remove(Layer.Background, VideoPainter); }
protected override void FirstPaint (object sender, EventArgs args) { base.FirstPaint (sender, args); player = new SmackerPlayer ((Stream)mpq.GetResource (resourcePath)); player.Finished += PlayerFinished; player.FrameReady += PlayerFrameReady; player.Play (); }
protected override void FirstPaint(object sender, EventArgs args) { base.FirstPaint(sender, args); player = new SmackerPlayer((Stream)mpq.GetResource(resourcePath)); player.Finished += PlayerFinished; player.FrameReady += PlayerFrameReady; player.Play(); }
void AddMovieElements(int elementIndex, int campaign, int off_x, int off_y) { MovieElement normalElement, onElement, diskElement; if (diskPlayer == null) { diskPlayer = new SmackerPlayer((Stream)Mpq.GetResource(Game.Instance.PlayingBroodWar ? "glue\\Expcampaign\\disk.smk" : "glue\\campaign\\disk.smk"), 1); } diskElement = new MovieElement(this, Elements[elementIndex].BinElement, Elements[elementIndex].Palette, diskPlayer); diskElement.X1 = (ushort)(Elements[elementIndex].X1 + ((Elements[elementIndex].Width - diskElement.MovieSize.Width) / 2)); diskElement.Y1 = (ushort)(((ButtonElement)Elements[elementIndex]).TextPosition.Y - diskElement.MovieSize.Height); normalElement = new MovieElement(this, Elements[elementIndex].BinElement, Elements[elementIndex].Palette, (Game.Instance.PlayingBroodWar ? BroodwarCampaigns : StarcraftCampaigns)[campaign].normalMovie); normalElement.X1 = (ushort)(Elements[elementIndex].X1 + ((Elements[elementIndex].Width - normalElement.MovieSize.Width) / 2) + off_x); normalElement.Y1 = (ushort)(((ButtonElement)Elements[elementIndex]).TextPosition.Y - normalElement.MovieSize.Height + off_y); onElement = new MovieElement(this, Elements[elementIndex].BinElement, Elements[elementIndex].Palette, (Game.Instance.PlayingBroodWar ? BroodwarCampaigns : StarcraftCampaigns)[campaign].onMovie); onElement.X1 = (ushort)(Elements[elementIndex].X1 + ((Elements[elementIndex].Width - onElement.MovieSize.Width) / 2)); onElement.Y1 = (ushort)(((ButtonElement)Elements[elementIndex]).TextPosition.Y - onElement.MovieSize.Height); smkElements.Add(diskElement); smkElements.Add(normalElement); smkElements.Add(onElement); onElement.Visible = false; normalElement.Dim(100); Elements[elementIndex].MouseEnterEvent += delegate() { normalElement.Dim(0); onElement.Visible = true; }; Elements[elementIndex].MouseLeaveEvent += delegate() { normalElement.Dim(100); onElement.Visible = false; }; }
void AddMovieElements (int elementIndex, int campaign, int off_x, int off_y) { MovieElement normalElement, onElement, diskElement; if (diskPlayer == null) diskPlayer = new SmackerPlayer ((Stream)Mpq.GetResource (Game.Instance.PlayingBroodWar ? "glue\\Expcampaign\\disk.smk" : "glue\\campaign\\disk.smk"), 1); diskElement = new MovieElement (this, Elements[elementIndex].BinElement, Elements[elementIndex].Palette, diskPlayer); diskElement.X1 = (ushort)(Elements[elementIndex].X1 + ((Elements[elementIndex].Width - diskElement.MovieSize.Width) / 2)); diskElement.Y1 = (ushort)(((ButtonElement)Elements[elementIndex]).TextPosition.Y - diskElement.MovieSize.Height); normalElement = new MovieElement (this, Elements[elementIndex].BinElement, Elements[elementIndex].Palette, (Game.Instance.PlayingBroodWar ? BroodwarCampaigns : StarcraftCampaigns)[campaign].normalMovie); normalElement.X1 = (ushort)(Elements[elementIndex].X1 + ((Elements[elementIndex].Width - normalElement.MovieSize.Width) / 2) + off_x); normalElement.Y1 = (ushort)(((ButtonElement)Elements[elementIndex]).TextPosition.Y - normalElement.MovieSize.Height + off_y); onElement = new MovieElement (this, Elements[elementIndex].BinElement, Elements[elementIndex].Palette, (Game.Instance.PlayingBroodWar ? BroodwarCampaigns : StarcraftCampaigns)[campaign].onMovie); onElement.X1 = (ushort)(Elements[elementIndex].X1 + ((Elements[elementIndex].Width - onElement.MovieSize.Width) / 2)); onElement.Y1 = (ushort)(((ButtonElement)Elements[elementIndex]).TextPosition.Y - onElement.MovieSize.Height); smkElements.Add (diskElement); smkElements.Add (normalElement); smkElements.Add (onElement); onElement.Visible = false; normalElement.Dim (100); Elements[elementIndex].MouseEnterEvent += delegate () { normalElement.Dim (0); onElement.Visible = true; }; Elements[elementIndex].MouseLeaveEvent += delegate () { normalElement.Dim (100); onElement.Visible = false; }; }
public override void RemoveFromPainter() { base.RemoveFromPainter (); foreach (MovieElement el in smkElements) el.Stop (); Painter.Remove (Layer.Background, smkPainter.Paint); diskPlayer = null; }