Readded camera plugin, hotgroups, fixed smoke spawning

This commit is contained in:
Pax1601
2024-11-10 12:27:01 +01:00
parent 95e18f6503
commit 62af0f74e7
15 changed files with 368 additions and 234 deletions

View File

@@ -29,6 +29,7 @@ import { ContextActionSet } from "./contextactionset";
import {
CommandModeOptionsChangedEvent,
ContactsUpdatedEvent,
HotgroupsChangedEvent,
InfoPopupEvent,
SelectedUnitsChangedEvent,
SelectionClearedEvent,
@@ -1057,7 +1058,22 @@ export class UnitsManager {
if (units === null) units = this.getSelectedUnits();
units.forEach((unit: Unit) => unit.setHotgroup(hotgroup));
this.#showActionMessage(units, `added to hotgroup ${hotgroup}`);
//(getApp().getPanelsManager().get("hotgroup") as HotgroupPanel).refreshHotgroups();
let hotgroups: {[key: number]: number} = {};
for (let ID in this.#units) {
const unit = this.#units[ID]
if (unit.getAlive() && !unit.getHuman()) {
const hotgroup = unit.getHotgroup()
if (hotgroup) {
if (!(hotgroup in hotgroups)) {
hotgroups[hotgroup] = 1;
}
else
hotgroups[hotgroup] += 1;
}
}
}
HotgroupsChangedEvent.dispatch(hotgroups)
}
/** Delete the selected units