Remove unused video player from ra
This commit is contained in:
@@ -320,7 +320,6 @@
|
||||
<Compile Include="Widgets\Delegates\PerfDebugDelegate.cs" />
|
||||
<Compile Include="Widgets\Delegates\ServerBrowserDelegate.cs" />
|
||||
<Compile Include="Widgets\Delegates\SettingsMenuDelegate.cs" />
|
||||
<Compile Include="Widgets\Delegates\VideoPlayerDelegate.cs" />
|
||||
<Compile Include="TargetableSubmarine.cs" />
|
||||
<Compile Include="Effects\RallyPoint.cs" />
|
||||
<Compile Include="AttackMedic.cs" />
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
namespace OpenRA.Mods.RA.Widgets.Delegates
|
||||
{
|
||||
public class VideoPlayerDelegate : IWidgetDelegate
|
||||
{
|
||||
string Selected;
|
||||
|
||||
public VideoPlayerDelegate()
|
||||
{
|
||||
var bg = Widget.RootWidget.GetWidget("VIDEOPLAYER_MENU");
|
||||
var player = bg.GetWidget<VqaPlayerWidget>("VIDEOPLAYER");
|
||||
|
||||
var pp = bg.GetWidget("BUTTON_PLAYPAUSE");
|
||||
pp.OnMouseUp = mi =>
|
||||
{
|
||||
if (player.Paused)
|
||||
player.Play();
|
||||
else
|
||||
player.Pause();
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
pp.GetWidget("PLAY").IsVisible = () => player.Paused;
|
||||
pp.GetWidget("PAUSE").IsVisible = () => !player.Paused;
|
||||
|
||||
bg.GetWidget("BUTTON_STOP").OnMouseUp = mi =>
|
||||
{
|
||||
player.Stop();
|
||||
return true;
|
||||
};
|
||||
|
||||
bg.GetWidget("BUTTON_CLOSE").OnMouseUp = mi => {
|
||||
player.Stop();
|
||||
Widget.CloseWindow();
|
||||
return true;
|
||||
};
|
||||
|
||||
// Menu Buttons
|
||||
Widget.RootWidget.GetWidget("MAINMENU_BUTTON_VIDEOPLAYER").OnMouseUp = mi => {
|
||||
Widget.OpenWindow("VIDEOPLAYER_MENU");
|
||||
return true;
|
||||
};
|
||||
|
||||
var vl = bg.GetWidget<ScrollPanelWidget>("VIDEO_LIST");
|
||||
var itemTemplate = vl.GetWidget<LabelWidget>("VIDEO_TEMPLATE");
|
||||
|
||||
foreach (var kv in Rules.Movies)
|
||||
{
|
||||
var video = kv.Key;
|
||||
var title = kv.Value;
|
||||
if (!FileSystem.Exists(video))
|
||||
continue;
|
||||
|
||||
if (Selected == null)
|
||||
player.Load(Selected = video);
|
||||
|
||||
var template = itemTemplate.Clone() as LabelWidget;
|
||||
template.Id = "VIDEO_{0}".F(video);
|
||||
template.GetText = () => " " + title;
|
||||
template.GetBackground = () => ((video == Selected) ? "dialog2" : null);
|
||||
template.OnMouseDown = mi =>
|
||||
{
|
||||
if (mi.Button != MouseButton.Left) return false;
|
||||
Selected = video;
|
||||
player.Load(video);
|
||||
return true;
|
||||
};
|
||||
template.IsVisible = () => true;
|
||||
vl.AddChild(template);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user