PIXI Controls: Fix startup in first time

This commit is contained in:
OleSTEEP 2024-02-08 16:14:28 +03:00
parent c39ec970f1
commit bdd4aa7762

View file

@ -514,30 +514,34 @@ ConfigManager.makeData = function () {
var _ConfigManager_applyData = ConfigManager.applyData;
ConfigManager.applyData = function (config) {
_ConfigManager_applyData.apply(this, arguments);
this.ONSConfig = config.ONSConfig;
this.ONSConfig.controlsOffsetX = config.ONSConfig.controlsOffsetX;
this.ONSConfig.controlsOffsetY = config.ONSConfig.controlsOffsetY;
this.ONSConfig.buttonsScale = config.ONSConfig.buttonsScale;
this.ONSConfig.buttonsOpacity = config.ONSConfig.buttonsOpacity;
this.ONSConfig.additionalOffset = config.ONSConfig.additionalOffset;
this.ONSConfig.buttonsSize = config.ONSConfig.buttonsSize;
this.ONSConfig.buttonsX = config.ONSConfig.buttonsX;
this.ONSConfig.buttonsY = config.ONSConfig.buttonsY;
this.ONSConfig.dPadSize = config.ONSConfig.dPadSize;
this.ONSConfig.dPadX = config.ONSConfig.dPadX;
this.ONSConfig.dPadY = config.ONSConfig.dPadY;
this.ONSConfig.bumpersWidth = config.ONSConfig.bumpersWidth;
this.ONSConfig.bumpersHeight = config.ONSConfig.bumpersHeight;
this.ONSConfig.bumpersOffsetX = config.ONSConfig.bumpersOffsetX;
this.ONSConfig.bumpersOffsetY = config.ONSConfig.bumpersOffsetY;
this.ONSConfig.LBX = config.ONSConfig.LBX;
this.ONSConfig.LBY = config.ONSConfig.LBY;
this.ONSConfig.RBX = config.ONSConfig.RBX;
this.ONSConfig.RBY = config.ONSConfig.RBY;
this.ONSConfig.additionalOffset = config.ONSConfig.additionalOffset;
this.ONSConfig.additonalSize = config.ONSConfig.additonalSize;
this.ONSConfig.showX = config.ONSConfig.showX;
this.ONSConfig.showY = config.ONSConfig.showY;
try {
this.ONSConfig = config.ONSConfig;
this.ONSConfig.controlsOffsetX = config.ONSConfig.controlsOffsetX;
this.ONSConfig.controlsOffsetY = config.ONSConfig.controlsOffsetY;
this.ONSConfig.buttonsScale = config.ONSConfig.buttonsScale;
this.ONSConfig.buttonsOpacity = config.ONSConfig.buttonsOpacity;
this.ONSConfig.additionalOffset = config.ONSConfig.additionalOffset;
this.ONSConfig.buttonsSize = config.ONSConfig.buttonsSize;
this.ONSConfig.buttonsX = config.ONSConfig.buttonsX;
this.ONSConfig.buttonsY = config.ONSConfig.buttonsY;
this.ONSConfig.dPadSize = config.ONSConfig.dPadSize;
this.ONSConfig.dPadX = config.ONSConfig.dPadX;
this.ONSConfig.dPadY = config.ONSConfig.dPadY;
this.ONSConfig.bumpersWidth = config.ONSConfig.bumpersWidth;
this.ONSConfig.bumpersHeight = config.ONSConfig.bumpersHeight;
this.ONSConfig.bumpersOffsetX = config.ONSConfig.bumpersOffsetX;
this.ONSConfig.bumpersOffsetY = config.ONSConfig.bumpersOffsetY;
this.ONSConfig.LBX = config.ONSConfig.LBX;
this.ONSConfig.LBY = config.ONSConfig.LBY;
this.ONSConfig.RBX = config.ONSConfig.RBX;
this.ONSConfig.RBY = config.ONSConfig.RBY;
this.ONSConfig.additionalOffset = config.ONSConfig.additionalOffset;
this.ONSConfig.additonalSize = config.ONSConfig.additonalSize;
this.ONSConfig.showX = config.ONSConfig.showX;
this.ONSConfig.showY = config.ONSConfig.showY;
} catch {
console.log("ONSControls loaded in first time, skip config reading.");
}
}