Implemented sound and lighting sliders

This commit is contained in:
2026-03-13 17:19:53 +01:00
parent 1ce7dfa057
commit 4e9651b08b
23 changed files with 461 additions and 34 deletions

View File

@@ -7,7 +7,35 @@ var Lighting = /** @class */ (function () {
this.exposureInput = document.querySelector('.ntsh_lightingsettings-exposure');
this.whiteBalanceInput = document.querySelector('.ntsh_lightingsettings-whitebalance');
this._Main = Main;
this.registerListeners();
}
Lighting.prototype.update = function (state) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
if (((_a = state === null || state === void 0 ? void 0 : state.parameters) === null || _a === void 0 ? void 0 : _a.dataAdvancedSliders) == null)
return;
var gainSliderIndex = (_b = state.parameters) === null || _b === void 0 ? void 0 : _b.dataAdvancedSliders.findIndex(function (slider) { return slider.sliderName === 'Gain'; });
var gainSlider = (_c = state.parameters) === null || _c === void 0 ? void 0 : _c.dataAdvancedSliders[gainSliderIndex !== null && gainSliderIndex !== void 0 ? gainSliderIndex : -1];
var exposureSliderIndex = (_d = state.parameters) === null || _d === void 0 ? void 0 : _d.dataAdvancedSliders.findIndex(function (slider) { return slider.sliderName === 'Exposure'; });
var exposureSlider = (_e = state.parameters) === null || _e === void 0 ? void 0 : _e.dataAdvancedSliders[exposureSliderIndex !== null && exposureSliderIndex !== void 0 ? exposureSliderIndex : -1];
var whiteBalanceSliderIndex = (_f = state.parameters) === null || _f === void 0 ? void 0 : _f.dataAdvancedSliders.findIndex(function (slider) { return slider.sliderName === 'WhiteBalance'; });
var whiteBalanceSlider = (_g = state.parameters) === null || _g === void 0 ? void 0 : _g.dataAdvancedSliders[whiteBalanceSliderIndex !== null && whiteBalanceSliderIndex !== void 0 ? whiteBalanceSliderIndex : -1];
this.gainInput.valueAsNumber =
(_h = gainSlider === null || gainSlider === void 0 ? void 0 : gainSlider.outputValue) !== null && _h !== void 0 ? _h : this.gainInput.valueAsNumber;
this.exposureInput.valueAsNumber =
(_j = exposureSlider === null || exposureSlider === void 0 ? void 0 : exposureSlider.outputValue) !== null && _j !== void 0 ? _j : this.exposureInput.valueAsNumber;
this.whiteBalanceInput.valueAsNumber =
(_k = whiteBalanceSlider === null || whiteBalanceSlider === void 0 ? void 0 : whiteBalanceSlider.outputValue) !== null && _k !== void 0 ? _k : this.whiteBalanceInput.valueAsNumber;
this.gainInput.setAttribute('index', (_l = gainSliderIndex === null || gainSliderIndex === void 0 ? void 0 : gainSliderIndex.toString()) !== null && _l !== void 0 ? _l : '-1');
this.exposureInput.setAttribute('index', (_m = exposureSliderIndex === null || exposureSliderIndex === void 0 ? void 0 : exposureSliderIndex.toString()) !== null && _m !== void 0 ? _m : '-1');
this.whiteBalanceInput.setAttribute('index', (_o = whiteBalanceSliderIndex === null || whiteBalanceSliderIndex === void 0 ? void 0 : whiteBalanceSliderIndex.toString()) !== null && _o !== void 0 ? _o : '-1');
};
Lighting.prototype.registerListeners = function () {
var _this = this;
this.gainInput.onchange = function () {
var _a;
_this._Main.socket.emit('unityWebSocket', 'dataAdvancedParameterValue', parseInt((_a = _this.gainInput.getAttribute('index')) !== null && _a !== void 0 ? _a : '-1'), _this.gainInput.valueAsNumber);
};
};
return Lighting;
}());
exports.Lighting = Lighting;