Skip to content

Commit

Permalink
🚑 Add back mobile client check for hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaRogue committed Sep 17, 2023
1 parent 89dfd35 commit 4830af3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Make the PF2e Player Character sheet work on mobile

After installing the module, for using this module, I recommend you use Chrome and install foundry as a progressive web app by using "add to home screen".

For the best experience, disable the canvas on mobile clients (you may need to put your device into landscape to be able to use the settings menu, this will be fixed in a later version)

## Development

### Prerequisites
Expand Down
7 changes: 3 additions & 4 deletions src/module/pf2e-mobile-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function getDebug() {
// Initialize module
Hooks.once('init', async () => {
log(true, 'pf2e-mobile-sheet | Initializing pf2e-mobile-sheet');
game.settings.set('core', 'noCanvas', true);
// Assign custom classes and constants here

// Register custom module settings
Expand All @@ -39,13 +38,13 @@ Hooks.once('init', async () => {
// Register custom sheets (if any)
});

//const isMobile = navigator.userAgentData.mobile;
const isMobile = navigator.userAgentData.mobile;
Hooks.once('init', async function () {
// if (!isMobile) return;
});

Hooks.once('ready', async function () {
// if (!isMobile && !getDebug()) return;
if (!isMobile && !getDebug()) return;
const body = $('body');
body.addClass('mobile-pf2e');
if (game.modules.get('pathfinder-ui')?.active) body.addClass('pf2e-ui');
Expand All @@ -65,7 +64,7 @@ Hooks.on('renderChatLog', async function () {
});

Hooks.on('renderCharacterSheetPF2e', (_, html) => {
// if (!isMobile && !getDebug()) return;
if (!isMobile && !getDebug()) return;
html.css('width', '100%');
html.css('height', '100%');
html.css('top', 0);
Expand Down

0 comments on commit 4830af3

Please sign in to comment.