From f7fe817623211e846a4f858eadc4aa9d625cf9af Mon Sep 17 00:00:00 2001 From: wertiop Date: Thu, 25 Jul 2024 19:32:34 +0100 Subject: [PATCH] fixup! feat: add horizontal FOV converter --- scripts/pages/settings/fov.js | 8 ++++---- scripts/pages/settings/settings.js | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/scripts/pages/settings/fov.js b/scripts/pages/settings/fov.js index dc50c32a..9d6ee571 100644 --- a/scripts/pages/settings/fov.js +++ b/scripts/pages/settings/fov.js @@ -14,13 +14,13 @@ class Fov { static aspectRatio() { const id = this.panels.aspectRatio.GetSelected().id; - switch(id) { + switch (id) { case 'aspectratio0': - return 4/3; + return 4 / 3; case 'aspectratio1': - return 16/9; + return 16 / 9; case 'aspectratio2': - return 16/10; + return 16 / 10; } return Number.NaN; } diff --git a/scripts/pages/settings/settings.js b/scripts/pages/settings/settings.js index 07a5235a..8a8b50af 100644 --- a/scripts/pages/settings/settings.js +++ b/scripts/pages/settings/settings.js @@ -313,19 +313,16 @@ class MainMenuSettings { const title = panel.GetAttributeString('infotitle', ''); // Don't set events if there's no info to show - if(!this.isSettingsPanel(panel) && message === '' && title === '' && !panel.convar && !panel.bind) return; + if (!this.isSettingsPanel(panel) && message === '' && title === '' && !panel.convar && !panel.bind) return; // Default to true if not set const hasDocs = !(panel.GetAttributeString('hasdocspage', '') === 'false'); - panel.SetPanelEvent('onmouseover', () => { // Set onmouseover events for all settings panels this.showInfo( // If a panel has a specific title use that, if not use the panel's name. Child ID names vary between panel types, blame Valve - title || - panel.FindChildTraverse('Title')?.text || - panel.FindChildTraverse('title')?.text, + title || panel.FindChildTraverse('Title')?.text || panel.FindChildTraverse('title')?.text, message, panel.convar ?? panel.bind, hasDocs,