File tree Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 11## 0.10.2
22
3+ - Fix setting defaults and v12 issues
4+
5+ ## 0.10.2
6+
37- Fix application templates not being included in module package
48
59## 0.10.1
Original file line number Diff line number Diff line change 11{
22 "id" : " fvtt-perf-optim" ,
33 "title" : " Prime Performance" ,
4- "version" : " 0.10.2 " ,
4+ "version" : " 0.10.3 " ,
55 "description" : " Provides a collection of unofficial performance optimizations and hacks for foundry vtt." ,
66 "esmodules" : [" dist/fvtt-perf-optim.js" ],
77 "languages" : [
Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ export class CustomRenderScaleConfig extends foundry.applications.api.Handlebars
147147 const FormDataExtendedConstructor =
148148 FOUNDRY_API . generation >= 13 ? foundry . applications . ux . FormDataExtended : FormDataExtended ;
149149
150- const formData = new FormDataExtendedConstructor ( this . form ) ;
150+ const dataElement = FOUNDRY_API . generation >= 13 ? this . form : this . element ;
151+ const formData = new FormDataExtendedConstructor ( dataElement ) ;
151152
152153 this . #setting = foundry . utils . expandObject ( formData . object ) as typeof RENDER_SCALE_DEFAULTS ;
153154 configureEffectsResolution ( this . #setting) ;
Original file line number Diff line number Diff line change 1- import type { RENDER_SCALE_DEFAULTS } from 'src/settings /constants.ts' ;
2- import { SETTINGS } from 'src/settings/constants.ts' ;
1+ import { NAMESPACE } from 'src/constants.ts' ;
2+ import { RENDER_SCALE_DEFAULTS , SETTINGS } from 'src/settings/constants.ts' ;
33import { getSetting } from 'src/settings/settings.ts' ;
44import { FOUNDRY_API } from 'src/utils/foundryShim.ts' ;
55
@@ -24,7 +24,15 @@ async function enableReducedLightingResolution() {
2424 if ( ! getSetting < boolean > ( SETTINGS . ReduceLightingResolution ) ) {
2525 return ;
2626 }
27- const customRenderScale = getSetting < typeof RENDER_SCALE_DEFAULTS > ( SETTINGS . CustomRenderScale ) ;
27+ let customRenderScale = getSetting < typeof RENDER_SCALE_DEFAULTS > ( SETTINGS . CustomRenderScale ) ;
28+
29+ // TODO: remove in some future version, this is a workaround for settings being initialized as an array
30+ // because I set the wrong default value in the settings file
31+ if ( Array . isArray ( customRenderScale ) ) {
32+ game . settings . set ( NAMESPACE , SETTINGS . CustomRenderScale , RENDER_SCALE_DEFAULTS ) ;
33+ customRenderScale = RENDER_SCALE_DEFAULTS ;
34+ }
35+
2836 configureEffectsResolution ( customRenderScale ) ;
2937 } ) ;
3038}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { NAMESPACE } from 'src/constants.ts';
33import { toggleDisableAppBackgroundBlur } from 'src/hacks/disableAppBackgroundBlur.ts' ;
44import { configureEffectsResolution } from 'src/hacks/reduceLightingResolution.ts' ;
55import { CustomSpritesheetConfig } from '../apps/CustomSpritesheetConfig.ts' ;
6- import { type RENDER_SCALE_DEFAULTS , SETTINGS } from './constants.ts' ;
6+ import { RENDER_SCALE_DEFAULTS , SETTINGS } from './constants.ts' ;
77
88export function getSetting < T = unknown > ( settings : SETTINGS ) : T {
99 return game . settings . get < T > ( NAMESPACE , settings ) ;
@@ -104,7 +104,7 @@ Hooks.on('init', () => {
104104 config : false ,
105105 scope : 'client' ,
106106 type : Object ,
107- default : [ ] ,
107+ default : RENDER_SCALE_DEFAULTS ,
108108 } ) ;
109109 game . settings . registerMenu ( NAMESPACE , SETTINGS . CustomRenderScale , {
110110 name : `${ NAMESPACE } .settings.${ SETTINGS . CustomRenderScale } .name` ,
You can’t perform that action at this time.
0 commit comments