Add a custom DocumentSheetConfig that supports tab-based configuration for my system-specific stuff
This commit is contained in:
parent
c7c0deaec7
commit
6081b8f9e8
7 changed files with 289 additions and 1 deletions
32
module/utils/getSizing.mjs
Normal file
32
module/utils/getSizing.mjs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { PlayerSheet } from "../apps/PlayerSheet.mjs";
|
||||
|
||||
/**
|
||||
* @typedef SheetSizing
|
||||
* @property {number} width The initial width of the application
|
||||
* @property {number} height The initial height of the application
|
||||
* @property {boolean} resizable Whether or not the application
|
||||
* is able to be resized with a drag handle.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Retrieves the computed default sizing data based on world settings
|
||||
* and the sheet class' DEFAULT_OPTIONS
|
||||
* @returns {SheetSizing}
|
||||
*/
|
||||
export function getDefaultSizing() {
|
||||
/** @type {SheetSizing} */
|
||||
const sizing = {
|
||||
width: undefined,
|
||||
height: undefined,
|
||||
resizable: undefined,
|
||||
};
|
||||
|
||||
// TODO: defaults from world settings
|
||||
|
||||
// Defaults from the sheet class itself
|
||||
sizing.height ||= PlayerSheet.DEFAULT_OPTIONS.position.height;
|
||||
sizing.width ||= PlayerSheet.DEFAULT_OPTIONS.position.width;
|
||||
sizing.resizable ||= PlayerSheet.DEFAULT_OPTIONS.window.resizable;
|
||||
|
||||
return sizing;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue