Index: ps/trunk/binaries/data/mods/public/audio/interface/alarm/alarm_no_idle_unit.xml =================================================================== --- ps/trunk/binaries/data/mods/public/audio/interface/alarm/alarm_no_idle_unit.xml +++ ps/trunk/binaries/data/mods/public/audio/interface/alarm/alarm_no_idle_unit.xml @@ -0,0 +1,12 @@ + + + 1 + owner + 0.3 + 100 + 1 + 0 + 1 + audio/interface/alarm + alarm_no_idle_unit_01.ogg + Index: ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json +++ ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json @@ -55,6 +55,7 @@ { "name": "Cédric Houbart" }, { "nick": "Chakakhan", "name": "Kenny Long" }, { "nick": "Clockwork-Muse", "name": "Stephen A. Imhoff" }, + { "nick": "cpc", "name": "Clément Pit-Claudel" }, { "nick": "Cracker78", "name": "Chad Heim" }, { "nick": "Crynux", "name": "Stephen J. Fewer" }, { "nick": "cwprogger" }, Index: ps/trunk/binaries/data/mods/public/gui/session/input.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/input.js +++ ps/trunk/binaries/data/mods/public/gui/session/input.js @@ -1622,8 +1622,10 @@ let idleUnits = Engine.GuiInterfaceCall("FindIdleUnits", data); if (!idleUnits.length) { - // TODO: display a message or play a sound to indicate no more idle units, or something - // Reset for next cycle + // TODO: display a message to indicate no more idle units, or something + Engine.GuiInterfaceCall("PlaySoundForPlayer", { + "name": "no_idle_unit" + }); resetIdleUnit(); return; } Index: ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js +++ ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js @@ -1790,6 +1790,18 @@ return false; }; +GuiInterface.prototype.PlaySoundForPlayer = function(player, data) +{ + let playerEntityID = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetPlayerByID(player); + let cmpSound = Engine.QueryInterface(playerEntityID, IID_Sound); + if (!cmpSound) + return; + + let soundGroup = cmpSound.GetSoundGroup(data.name); + if (soundGroup) + Engine.QueryInterface(SYSTEM_ENTITY, IID_SoundManager).PlaySoundGroupForPlayer(soundGroup, player); +}; + GuiInterface.prototype.PlaySound = function(player, data) { if (!data.entity) @@ -2088,6 +2100,7 @@ "SetWallPlacementPreview": 1, "GetFoundationSnapData": 1, "PlaySound": 1, + "PlaySoundForPlayer": 1, "FindIdleUnits": 1, "HasIdleUnits": 1, "GetTradingRouteGain": 1, Index: ps/trunk/binaries/data/mods/public/simulation/templates/special/player/player.xml =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/templates/special/player/player.xml +++ ps/trunk/binaries/data/mods/public/simulation/templates/special/player/player.xml @@ -91,6 +91,7 @@ interface/alarm/alarm_defeated.xml interface/alarm/alarm_defeated_ally.xml interface/alarm/alarm_defeated_enemy.xml + interface/alarm/alarm_no_idle_unit.xml