* Replace BxEvent.TITLE_INFO_READY with Event Bus

* Migrate more events

* Migrate stream events to event bus

* Migrate preset events

* Migrate more

* Fix dispatching "input" event twice in Number Stepper
This commit is contained in:
redphx
2024-12-08 17:55:44 +07:00
committed by GitHub
parent 160044c958
commit 79ebb1a817
22 changed files with 282 additions and 191 deletions

View File

@@ -1,6 +1,7 @@
import { AppInterface, STATES } from "@utils/global";
import { BxEvent } from "@utils/bx-event";
import { StreamSettings } from "@/utils/stream-settings";
import { EventBus } from "@/utils/event-bus";
const VIBRATION_DATA_MAP = {
gamepadIndex: 8,
@@ -47,9 +48,7 @@ export class DeviceVibrationManager {
}
});
window.addEventListener(BxEvent.DEVICE_VIBRATION_CHANGED, e => {
this.setupDataChannel();
});
EventBus.Script.on('deviceVibrationUpdated', () => this.setupDataChannel());
}
private setupDataChannel() {