Merge pull request #10514 from pchote/blink-install-button
Blink install map button.
This commit is contained in:
@@ -16,6 +16,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
{
|
||||
public class LobbyMapPreviewLogic : ChromeLogic
|
||||
{
|
||||
readonly int blinkTickLength = 10;
|
||||
bool installHighlighted;
|
||||
int blinkTick;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
internal LobbyMapPreviewLogic(Widget widget, OrderManager orderManager, LobbyLogic lobby)
|
||||
{
|
||||
@@ -93,7 +97,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var install = download.GetOrNull<ButtonWidget>("MAP_INSTALL");
|
||||
if (install != null)
|
||||
{
|
||||
install.OnClick = () => lobby.Map.Install();
|
||||
install.IsHighlighted = () => installHighlighted;
|
||||
}
|
||||
}
|
||||
|
||||
var progress = widget.GetOrNull("MAP_PROGRESS");
|
||||
@@ -169,5 +176,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Tick()
|
||||
{
|
||||
if (++blinkTick >= blinkTickLength)
|
||||
{
|
||||
installHighlighted ^= true;
|
||||
blinkTick = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user