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);
|
.Any(a => a.Owner == world.LocalPlayer);
|
||||||
|
|
||||||
if (radarEnabled != cachedRadarEnabled)
|
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;
|
cachedRadarEnabled = radarEnabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
Sprite shroudSprite;
|
Sprite shroudSprite;
|
||||||
Shroud renderShroud;
|
Shroud renderShroud;
|
||||||
|
|
||||||
|
public string SoundUp { get; private set; }
|
||||||
|
public string SoundDown { get; private set; }
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public RadarWidget(World world, WorldRenderer worldRenderer)
|
public RadarWidget(World world, WorldRenderer worldRenderer)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -618,6 +618,8 @@ Container@PLAYER_WIDGETS:
|
|||||||
Width: PARENT_RIGHT - 2
|
Width: PARENT_RIGHT - 2
|
||||||
Height: PARENT_BOTTOM - 2
|
Height: PARENT_BOTTOM - 2
|
||||||
WorldInteractionController: INTERACTION_CONTROLLER
|
WorldInteractionController: INTERACTION_CONTROLLER
|
||||||
|
SoundUp: RadarUp
|
||||||
|
SoundDown: RadarDown
|
||||||
Children:
|
Children:
|
||||||
LogicTicker@RADAR_TICKER:
|
LogicTicker@RADAR_TICKER:
|
||||||
VqaPlayer@PLAYER:
|
VqaPlayer@PLAYER:
|
||||||
|
|||||||
@@ -376,6 +376,8 @@ Container@PLAYER_WIDGETS:
|
|||||||
Y: 34
|
Y: 34
|
||||||
Width: 202
|
Width: 202
|
||||||
Height: 202
|
Height: 202
|
||||||
|
SoundUp: RadarUp
|
||||||
|
SoundDown: RadarDown
|
||||||
Children:
|
Children:
|
||||||
VqaPlayer@PLAYER:
|
VqaPlayer@PLAYER:
|
||||||
X: 12
|
X: 12
|
||||||
|
|||||||
@@ -398,6 +398,8 @@ Container@PLAYER_WIDGETS:
|
|||||||
Y: 41
|
Y: 41
|
||||||
Width: 220
|
Width: 220
|
||||||
Height: 220
|
Height: 220
|
||||||
|
SoundUp: RadarUp
|
||||||
|
SoundDown: RadarDown
|
||||||
Children:
|
Children:
|
||||||
VqaPlayer@PLAYER:
|
VqaPlayer@PLAYER:
|
||||||
X: 8
|
X: 8
|
||||||
|
|||||||
@@ -400,6 +400,8 @@ Container@PLAYER_WIDGETS:
|
|||||||
Y: 64
|
Y: 64
|
||||||
Width: 206
|
Width: 206
|
||||||
Height: 161
|
Height: 161
|
||||||
|
SoundUp: RadarUp
|
||||||
|
SoundDown: RadarDown
|
||||||
VqaPlayer@PLAYER:
|
VqaPlayer@PLAYER:
|
||||||
X: 16
|
X: 16
|
||||||
Y: 64
|
Y: 64
|
||||||
|
|||||||
Reference in New Issue
Block a user