merge(stored, settings);
}
const ui = game.ui.root.querySelector('.ui-page.options');
- game.ui.hud.style.display = settings['enablehud'] ? 'flex' : 'none';
if(settings['controls']) {
ui.querySelector('.controls input[value="' + settings['controls'] + '"]').checked = true;
ui.querySelector('.controls .leftside input').checked = settings['virtualinputleft'];
ui.querySelectorAll('.controls p span:not(.' + settings['controls'] + ')').forEach(span => span.style.display = 'none');
ui.querySelector('.controls span.' + settings['controls']).style.display = 'block';
}
+ ui.querySelector('.hud input[name="upInTheAirGame-hud"]').checked = settings['enablehud'];
+ game.ui.hud.style.display = settings['enablehud'] ? 'flex' : 'none';
ui.querySelector('.graphics input[value="' + settings['graphics'] + '"]').checked = true;
for(let audioCategory of ['music', 'sounds']) {
let newValue = Math.max(0, Math.min(100, Math.round(100 * settings['audio'][audioCategory])));
game.view.camera.updateProjectionMatrix();
game.view.renderer.setSize(game.view.canvas.width, game.view.canvas.height);
}
+ game.settings['enablehud'] = ui.querySelector('.hud input[name="upInTheAirGame-hud"]').checked;
for(let audioCategory of ['music', 'sounds']) {
game.settings['audio'][audioCategory] = parseInt(ui.querySelector('.audio input[type=range].' + audioCategory).value, 10) / 100;
}
game['fn'].start = () => {
game.ui = {
root: document.querySelector('.upInTheAirGame .ui-container'),
- hud: document.querySelector('.upInTheAirGame .hud'),
+ hud: document.querySelector('.upInTheAirGame .gameplay .hud'),
gamepads: [],
};
game.settings = {};
});
});
- game.ui.root.querySelectorAll('.options .controls input, .options .graphics input, .options .feather input, .options .accessibility input, .options .accessibility select').forEach((elem) => {
+ game.ui.root.querySelectorAll('.options .controls input, .options .graphics input, .options .hud input, .options .feather input, .options .accessibility input, .options .accessibility select').forEach((elem) => {
elem.addEventListener('change', () => {
game['fn'].applySettings();
if(elem.name == 'upInTheAirGame-controls') {