Extracted RadarUp and RadarDown notifications to RadarWidget.
This commit is contained in:
@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
.Any(a => a.Owner == world.LocalPlayer);
|
||||
|
||||
if (radarEnabled != cachedRadarEnabled)
|
||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", radarEnabled ? "RadarUp" : "RadarDown", null);
|
||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Sounds", radarEnabled ? radar.SoundUp : radar.SoundDown, null);
|
||||
cachedRadarEnabled = radarEnabled;
|
||||
};
|
||||
|
||||
|
||||
@@ -59,6 +59,9 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
Sprite shroudSprite;
|
||||
Shroud renderShroud;
|
||||
|
||||
public string SoundUp { get; private set; }
|
||||
public string SoundDown { get; private set; }
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public RadarWidget(World world, WorldRenderer worldRenderer)
|
||||
{
|
||||
|
||||
@@ -618,6 +618,8 @@ Container@PLAYER_WIDGETS:
|
||||
Width: PARENT_RIGHT - 2
|
||||
Height: PARENT_BOTTOM - 2
|
||||
WorldInteractionController: INTERACTION_CONTROLLER
|
||||
SoundUp: RadarUp
|
||||
SoundDown: RadarDown
|
||||
Children:
|
||||
LogicTicker@RADAR_TICKER:
|
||||
VqaPlayer@PLAYER:
|
||||
|
||||
@@ -376,6 +376,8 @@ Container@PLAYER_WIDGETS:
|
||||
Y: 34
|
||||
Width: 202
|
||||
Height: 202
|
||||
SoundUp: RadarUp
|
||||
SoundDown: RadarDown
|
||||
Children:
|
||||
VqaPlayer@PLAYER:
|
||||
X: 12
|
||||
|
||||
@@ -398,6 +398,8 @@ Container@PLAYER_WIDGETS:
|
||||
Y: 41
|
||||
Width: 220
|
||||
Height: 220
|
||||
SoundUp: RadarUp
|
||||
SoundDown: RadarDown
|
||||
Children:
|
||||
VqaPlayer@PLAYER:
|
||||
X: 8
|
||||
|
||||
@@ -400,6 +400,8 @@ Container@PLAYER_WIDGETS:
|
||||
Y: 64
|
||||
Width: 206
|
||||
Height: 161
|
||||
SoundUp: RadarUp
|
||||
SoundDown: RadarDown
|
||||
VqaPlayer@PLAYER:
|
||||
X: 16
|
||||
Y: 64
|
||||
|
||||
Reference in New Issue
Block a user