Skip to content

Commit

Permalink
fixup! feat: add horizontal FOV converter
Browse files Browse the repository at this point in the history
  • Loading branch information
wertiop121 committed Jul 25, 2024
1 parent 5d54f08 commit f7fe817
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions scripts/pages/settings/fov.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
7 changes: 2 additions & 5 deletions scripts/pages/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f7fe817

Please sign in to comment.