Move hardcoded static asset browser hotkeys to yaml.
This commit is contained in:
@@ -149,7 +149,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var playButton = panel.GetOrNull<ButtonWidget>("BUTTON_PLAY");
|
var playButton = panel.GetOrNull<ButtonWidget>("BUTTON_PLAY");
|
||||||
if (playButton != null)
|
if (playButton != null)
|
||||||
{
|
{
|
||||||
playButton.Key = new Hotkey(Keycode.SPACE, Modifiers.None);
|
|
||||||
playButton.OnClick = () =>
|
playButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
if (isVideoLoaded)
|
if (isVideoLoaded)
|
||||||
@@ -164,7 +163,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var pauseButton = panel.GetOrNull<ButtonWidget>("BUTTON_PAUSE");
|
var pauseButton = panel.GetOrNull<ButtonWidget>("BUTTON_PAUSE");
|
||||||
if (pauseButton != null)
|
if (pauseButton != null)
|
||||||
{
|
{
|
||||||
pauseButton.Key = new Hotkey(Keycode.SPACE, Modifiers.None);
|
|
||||||
pauseButton.OnClick = () =>
|
pauseButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
if (isVideoLoaded)
|
if (isVideoLoaded)
|
||||||
@@ -179,7 +177,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var stopButton = panel.GetOrNull<ButtonWidget>("BUTTON_STOP");
|
var stopButton = panel.GetOrNull<ButtonWidget>("BUTTON_STOP");
|
||||||
if (stopButton != null)
|
if (stopButton != null)
|
||||||
{
|
{
|
||||||
stopButton.Key = new Hotkey(Keycode.RETURN, Modifiers.None);
|
|
||||||
stopButton.OnClick = () =>
|
stopButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
if (isVideoLoaded)
|
if (isVideoLoaded)
|
||||||
@@ -196,7 +193,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var nextButton = panel.GetOrNull<ButtonWidget>("BUTTON_NEXT");
|
var nextButton = panel.GetOrNull<ButtonWidget>("BUTTON_NEXT");
|
||||||
if (nextButton != null)
|
if (nextButton != null)
|
||||||
{
|
{
|
||||||
nextButton.Key = new Hotkey(Keycode.RIGHT, Modifiers.None);
|
|
||||||
nextButton.OnClick = () =>
|
nextButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
if (!isVideoLoaded)
|
if (!isVideoLoaded)
|
||||||
@@ -209,7 +205,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var prevButton = panel.GetOrNull<ButtonWidget>("BUTTON_PREV");
|
var prevButton = panel.GetOrNull<ButtonWidget>("BUTTON_PREV");
|
||||||
if (prevButton != null)
|
if (prevButton != null)
|
||||||
{
|
{
|
||||||
prevButton.Key = new Hotkey(Keycode.LEFT, Modifiers.None);
|
|
||||||
prevButton.OnClick = () =>
|
prevButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
if (!isVideoLoaded)
|
if (!isVideoLoaded)
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ Container@ASSETBROWSER_PANEL:
|
|||||||
Button@BUTTON_PREV:
|
Button@BUTTON_PREV:
|
||||||
Width: 26
|
Width: 26
|
||||||
Height: 26
|
Height: 26
|
||||||
|
Key: LEFT
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_PREV:
|
Image@IMAGE_PREV:
|
||||||
X: 5
|
X: 5
|
||||||
@@ -131,6 +132,7 @@ Container@ASSETBROWSER_PANEL:
|
|||||||
X: 35
|
X: 35
|
||||||
Width: 26
|
Width: 26
|
||||||
Height: 26
|
Height: 26
|
||||||
|
Key: SPACE
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_PLAY:
|
Image@IMAGE_PLAY:
|
||||||
X: 5
|
X: 5
|
||||||
@@ -144,6 +146,7 @@ Container@ASSETBROWSER_PANEL:
|
|||||||
X: 35
|
X: 35
|
||||||
Width: 26
|
Width: 26
|
||||||
Height: 26
|
Height: 26
|
||||||
|
Key: SPACE
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_PAUSE:
|
Image@IMAGE_PAUSE:
|
||||||
X: 5
|
X: 5
|
||||||
@@ -156,6 +159,7 @@ Container@ASSETBROWSER_PANEL:
|
|||||||
X: 70
|
X: 70
|
||||||
Width: 26
|
Width: 26
|
||||||
Height: 26
|
Height: 26
|
||||||
|
Key: RETURN
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_STOP:
|
Image@IMAGE_STOP:
|
||||||
X: 5
|
X: 5
|
||||||
@@ -168,6 +172,7 @@ Container@ASSETBROWSER_PANEL:
|
|||||||
X: 105
|
X: 105
|
||||||
Width: 26
|
Width: 26
|
||||||
Height: 26
|
Height: 26
|
||||||
|
Key: RIGHT
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_NEXT:
|
Image@IMAGE_NEXT:
|
||||||
X: 5
|
X: 5
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ Background@ASSETBROWSER_PANEL:
|
|||||||
Y: 0
|
Y: 0
|
||||||
Width: 25
|
Width: 25
|
||||||
Height: 25
|
Height: 25
|
||||||
|
Key: LEFT
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_PREV:
|
Image@IMAGE_PREV:
|
||||||
X: 0
|
X: 0
|
||||||
@@ -129,6 +130,7 @@ Background@ASSETBROWSER_PANEL:
|
|||||||
Y: 0
|
Y: 0
|
||||||
Width: 25
|
Width: 25
|
||||||
Height: 25
|
Height: 25
|
||||||
|
Key: SPACE
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_PLAY:
|
Image@IMAGE_PLAY:
|
||||||
X: 0
|
X: 0
|
||||||
@@ -143,6 +145,7 @@ Background@ASSETBROWSER_PANEL:
|
|||||||
Y: 0
|
Y: 0
|
||||||
Width: 25
|
Width: 25
|
||||||
Height: 25
|
Height: 25
|
||||||
|
Key: SPACE
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_PAUSE:
|
Image@IMAGE_PAUSE:
|
||||||
X: 0
|
X: 0
|
||||||
@@ -156,6 +159,7 @@ Background@ASSETBROWSER_PANEL:
|
|||||||
Y: 0
|
Y: 0
|
||||||
Width: 25
|
Width: 25
|
||||||
Height: 25
|
Height: 25
|
||||||
|
Key: RETURN
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_STOP:
|
Image@IMAGE_STOP:
|
||||||
X: 0
|
X: 0
|
||||||
@@ -169,6 +173,7 @@ Background@ASSETBROWSER_PANEL:
|
|||||||
Y: 0
|
Y: 0
|
||||||
Width: 25
|
Width: 25
|
||||||
Height: 25
|
Height: 25
|
||||||
|
Key: RIGHT
|
||||||
Children:
|
Children:
|
||||||
Image@IMAGE_NEXT:
|
Image@IMAGE_NEXT:
|
||||||
X: 0
|
X: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user