File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -2300,8 +2300,15 @@ export class Theatre {
2300
2300
let sprite = new PIXI . Sprite ( resources [ resName ] ) ;
2301
2301
let portWidth = resources [ resName ] . width ;
2302
2302
let portHeight = resources [ resName ] . height ;
2303
- let maxHeight = game . settings . get ( CONSTANTS . MODULE_ID , "theatreImageSize" ) ;
2304
- if ( portHeight > maxHeight ) {
2303
+
2304
+ let usePercent = game . settings . get ( CONSTANTS . MODULE_ID , "theatreImageUsePercent" ) ;
2305
+ let maxHeightPixel = game . settings . get ( CONSTANTS . MODULE_ID , "theatreImageSize" ) ;
2306
+ let maxHeightPercent = window . innerHeight * game . settings . get ( CONSTANTS . MODULE_ID , "theatreImageSizePercent" ) ;
2307
+ let useUniform = game . settings . get ( CONSTANTS . MODULE_ID , "theatreImageSizeUniform" ) ;
2308
+
2309
+ let maxHeight = usePercent ? maxHeightPercent : maxHeightPixel ;
2310
+
2311
+ if ( portHeight > maxHeight || useUniform ) {
2305
2312
portWidth *= maxHeight / portHeight ;
2306
2313
portHeight = maxHeight ;
2307
2314
}
Original file line number Diff line number Diff line change @@ -52,6 +52,33 @@ export const registerSettings = function () {
52
52
type : Number ,
53
53
} ) ;
54
54
55
+
56
+ game . settings . register ( CONSTANTS . MODULE_ID , "theatreImageUsePercent" , {
57
+ name : "Use screen height as maximum image height" ,
58
+ scope : "world" ,
59
+ config : true ,
60
+ default : false ,
61
+ type : Boolean ,
62
+ } ) ;
63
+
64
+ game . settings . register ( CONSTANTS . MODULE_ID , "theatreImageSizePercent" , {
65
+ name : "Maximum image height (percent)" ,
66
+ hint : "Set max image height as a percentage of the device screen height. Used only if the 'Use screen height as maximum image height' is enabled" ,
67
+ scope : "client" ,
68
+ config : true ,
69
+ default : 0.7 ,
70
+ type : Number
71
+ } ) ;
72
+
73
+ game . settings . register ( CONSTANTS . MODULE_ID , "theatreImageSizeUniform" , {
74
+ name : "Uniform image height" ,
75
+ hint : "Set all images size to the maximum height" ,
76
+ scope : "world" ,
77
+ config : true ,
78
+ default : false ,
79
+ type : Boolean ,
80
+ } ) ;
81
+
55
82
game . settings . register ( CONSTANTS . MODULE_ID , "theatreNarratorHeight" , {
56
83
name : "Theatre.UI.Settings.narrHeight" ,
57
84
hint : "Theatre.UI.Settings.narrHeightHint" ,
You can’t perform that action at this time.
0 commit comments