Moved audio sink toggle to unit control panel

This commit is contained in:
Pax1601
2024-10-08 13:59:07 +02:00
parent 84a1375663
commit 804743c051
6 changed files with 71 additions and 31 deletions

View File

@@ -849,20 +849,7 @@ export abstract class Unit extends CustomMarker {
if (targetPosition) getApp().getUnitsManager().addDestination(targetPosition, false, 0, units);
}
);
contextActionSet.addContextAction(
this,
"speaker",
"Make audio source",
"Make this unit an audio source (loudspeakers)",
faVolumeHigh,
null,
(units: Unit[], _1, _2) => {
units.forEach((unit) => getApp().getAudioManager().addUnitSink(unit));
},
{ executeImmediately: true }
);
contextActionSet.addDefaultContextAction(this, "default", "Set destination", "", faRoute, null, (units: Unit[], targetUnit, targetPosition) => {
if (targetPosition) {
getApp().getUnitsManager().clearDestinations(units);