├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── get-version.js │ └── main.yml ├── .gitignore ├── Changelog.MD ├── LICENSE ├── README.MD ├── example1.png ├── example2.png ├── lang ├── de.json └── en.json ├── module.json ├── scripts ├── actorStorage.js ├── actorsList.js ├── addControlButtons.js ├── api.js ├── canvasHider.js ├── chat.js ├── compatibility.js ├── defaultZoom.js ├── dialogs.js ├── drag.js ├── firefoxZoom.js ├── fullscreen.js ├── main.js ├── settings.js ├── system-specific │ └── dnd5e │ │ └── dnd5e.js └── utils.js ├── setup.png ├── styles ├── dnd5e.css ├── dnd5e_media.css ├── main.css ├── main_media.css └── tidy5e_media.css └── templates ├── buttons-small-display.html ├── buttons.html └── controller.html /.gitattributes: -------------------------------------------------------------------------------- 1 | packs/** binary 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | --- 8 | 9 | ## Before raising an issue 10 | - Update the game system and all modules to the current version 11 | - Disable all other modules and see if the issue goes away 12 | - If this is the case, please use [Find The Culprit]() to narrow down the suspects 13 | - Disable Sheet-Only, log into Foundry with your desired device and open a character sheet manually. If this does not work without issues then your device might not be compatible with FoundryVTT 14 | - If the issue persists, please go ahead and fill out the issue template 15 | 16 | #### Issue description 17 | Describe the issue. 18 | 19 | #### Expected behavior 20 | What did you expect to (not) happen? 21 | 22 | #### System & versions 23 | What's the system and version you encountered the issue? 24 | 25 | Module-Version: ... 26 | Game-System & -version: ... 27 | 28 | #### Steps to reproduce the issue 29 | Please give me a short step-by-step instruction to reproduce the issue 30 | 31 | 1. ... 32 | 2. ... 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "[IMPROVEMENT]" 5 | labels: improvement 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Is your feature request related to a problem? Please describe. 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | ### Describe the solution you'd like 14 | A clear and concise description of what you want to happen. 15 | 16 | ### Describe alternatives you've considered 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | ### Additional context 20 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/workflows/get-version.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | console.log(JSON.parse(fs.readFileSync('module.json', 'utf8')).version); -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Release Creation 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v2 12 | 13 | # Substitute the Manifest and Download URLs in the `module.json`. 14 | - name: Substitute Manifest and Download Links For Versioned Ones 15 | id: sub_manifest_link_version 16 | uses: microsoft/variable-substitution@v1 17 | with: 18 | files: 'module.json' 19 | env: 20 | version: ${{github.event.release.tag_name}} 21 | url: https://github.com/${{github.repository}} 22 | manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json 23 | download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip 24 | 25 | # Create a zip file with all files required by the module to add to the release AND to the latest 26 | - run: zip -r ./module.zip module.json scripts/ packs/ styles/ templates/ lang/ 27 | 28 | - name: Update release with files 29 | id: create_version_release 30 | uses: ncipollo/release-action@v1 31 | with: 32 | allowUpdates: true # Set this to false if you want to prevent updating existing releases 33 | name: ${{ github.event.release.name }} 34 | draft: ${{ github.event.release.unpublished }} 35 | prerelease: ${{ github.event.release.prerelease }} 36 | token: ${{ secrets.GITHUB_TOKEN }} 37 | artifacts: './module.json,./module.zip' 38 | tag: ${{ github.event.release.tag_name }} 39 | body: ${{ github.event.release.body }} 40 | 41 | - name: Create Latest Release 42 | id: create_latest_release 43 | uses: ncipollo/release-action@v1 44 | with: 45 | allowUpdates: true 46 | name: Latest 47 | draft: false 48 | prerelease: false 49 | token: ${{ secrets.GITHUB_TOKEN }} 50 | artifacts: './module.json,./module.zip' 51 | tag: latest 52 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | replay_pid* 25 | 26 | .idea 27 | /packs/maps/LOCK 28 | /packs/maps/LOG 29 | /packs/maps/LOG.old 30 | -------------------------------------------------------------------------------- /Changelog.MD: -------------------------------------------------------------------------------- 1 | # 2.0.1 2 | - v13 compatibility 3 | - Unfortunately, the morph feature is gone 4 | - It is too system-specific and honestly, it is just too much work to implement it again. I might do an addon for this sometime in the future 5 | 6 | # 1.8.2 7 | - Sets the maximum foundry version to 12.343 8 | 9 | # 1.8.1 10 | 11 | - [DND5e] fixes issue with the sheet not receiving updates and not be able to edit 12 | 13 | # 1.8.0 14 | - Removes 'black bar' behind ability scores (dnd5e) 15 | - Adds setting to disable bottom button bar for small displays 16 | 17 | # 1.7.2 18 | - Fixes missing button to roll for HP on short rest in dnd5e 19 | 20 | # 1.7.1 21 | - Fixes a bug where the chat was not well visible 22 | - Fixes a bug where the settings window was hidden behind the bottom button bar 23 | - On smaller screens the settings window now has two rows instead of two columns, making it more usable 24 | 25 | # 1.7.0 26 | - Fixes a bug where the journal could not be re-opened 27 | - Improves dragging behaviour 28 | - The time it takes before the drag functionality kicks in can now be set in the settings 29 | 30 | # 1.6.3 31 | - [DND5e] Fixes a bug where the control bar did not respond if the GM disabled the morph feature 32 | 33 | # 1.6.2 34 | - Fixes a bug where the new dnd5e-morph-button conflicts with non-dnd5e systems 35 | 36 | # 1.6.1 37 | - [DND5e] Only shows Morph-Button if all requirements are met (FoundryVTT is at least v12, socketlib and 38 | either Quick Insert or Spotlight Omnisearch is installed) 39 | 40 | # 1.6.0 (The Fehr-Update) 41 | Thanks to [TheFehr](https://github.com/TheFehr) for this awesome contribution. It contains the following changes: 42 | 43 | - [DND5e] Adds a morph-button to the controls, which lets the player polymorph/wildshape their characters 44 | - [DND5e] Adds some styling for Tidy5e-Sheet. Thanks to []() for that incredible contribituion 45 | 46 | # 1.5.2 47 | - [DND3.5] Fixes bug where character sheet closes automatically when changing values on the sheet. Thanks to [DavidAremaCarretero](https://github.com/DavidAremaCarretero) 48 | 49 | # 1.5.1 50 | - Fixes issue with the manual roll window hidden behind chat 51 | 52 | # 1.5.0 (The Eddie-Update) 53 | 54 | Thanks to [Eddie](https://github.com/eddiecooro) for this contribution containing the following changes: 55 | - Improved handling for smaller displays 56 | - Dnd5e: Opens the chat window when using item or spell 57 | - Renders dialogs on top of the chat window 58 | - Disables drag & drop for the chat window if the chat is set to fullscreen 59 | - Moves the main buttons to the bottom for smaller displays (width < 800px) 60 | - The sheet might still look squished on such a small resolution 61 | - For Dnd5e use the legacy sheet for best results 62 | 63 | # 1.4.4 64 | - Adds a settings option to display chat window fullscreen 65 | - Fixes minor incompatibilities with sheet-only-plus 66 | 67 | # 1.4.3 68 | - Fixes bug introduced with new dragging method 69 | 70 | # 1.4.2 71 | - Changes drag and drop functionality 72 | - Now, you need to press and hold to activate the drag and drop 73 | - Applies drag and drop to the chat window 74 | 75 | # 1.4.1 76 | - Adds token movement 77 | 78 | # 1.3.1 79 | - Changes Real-Dice option to a client setting 80 | - Prompts users when they are not 'sheet-only' but have disabled canvas 81 | 82 | # 1.3.0 83 | - Adds volume settings 84 | 85 | # 1.2.0 86 | - v12 compatibility 87 | 88 | # 1.1.15 89 | - Fixes bug with fullscreen 90 | 91 | # 1.1.14 92 | - Fixes minor issues 93 | - Rollout new build. The last might be corrupt 94 | 95 | # 1.1.13 96 | - Fixes bug with sheet popping up when any actor gets deleted 97 | 98 | # 1.1.12 99 | - Adds german translation. Thanks to [Niclasp1501](https://github.com/Niclasp1501) 100 | 101 | # 1.1.11 102 | - Fixed a bug where dialogs popped up twice 103 | - Dnd5e: Using the new character sheet, clicking on a spell/item additionally opens the tooltip 104 | 105 | # 1.1.10 106 | - Fixes bug that closes virtual keyboard when trying to enter something 107 | - Modifies the height of the sheet to fit better on screen 108 | - Changes styling of actor list. The last actor should now be fully visible 109 | - Moves the edit slider for dnd5e's new character sheet from the header to the sheet itself so that the character sheet can now be edited 110 | 111 | # 1.1.9 112 | - Fixes bug that closes virtual keyboard when trying to enter something 113 | - Adds compatibility with sheet-only-plus journals 114 | 115 | # 1.1.8 116 | - Better responsiveness of the sheet when tilting the device 117 | 118 | # 1.1.7 119 | - Fixed a minor bug when checking for sheet-only-plus 120 | 121 | # 1.1.6 122 | - Changes canvas behaviour. Canvas is disabled by default and needs to be manually enabled for targeting 123 | - Adds button to enable fullscreen 124 | - Buttons can now be re-positioned by dragging (it always starts at the top left corner) 125 | 126 | # 1.1.5 127 | - Disables playlist-, ambience- and interface sounds for Sheet-Only clients 128 | 129 | # 1.1.4 130 | - Pops up character sheet after initial choice of character 131 | - Closes actor list when selecting new character 132 | - Hides canvas instead of disabling it 133 | - Adds settings button for player 134 | 135 | # 1.1.3 136 | - Internal code to improve targeting in sheet-only-plus 137 | 138 | # 1.1.2 139 | - Fixes bug where the backpack (dnd5e) was not usable 140 | 141 | # 1.1.1 142 | - Enables support for [Real-Dice](https://foundryvtt.com/packages/real-dice) 143 | 144 | # 1.1.0 145 | - Adds support for Sheet-Only-Plus 146 | 147 | # 1.0.15 148 | - Removes dice tray and chat controls 149 | 150 | # 1.0.14 151 | - Fixes bug where chat input was always disabled, not matter if sheet-only was enabled or not 152 | 153 | # 1.0.13 154 | - Hotfix: Fixes bug preventing interactions with the sheet 155 | - 156 | # 1.0.12 157 | - Adds a button to toggle chat 158 | 159 | # 1.0.11 160 | - Fixes bug with activation by screen size not working 161 | - Adds a bit more styling to the nav bar at the top right of the sheet 162 | 163 | # 1.0.10 164 | - Fixes bug with auto-closing item entry on legacy sheet 165 | 166 | # 1.0.9 167 | - Adds D&D 5e v 3.0.0 support (Thanks to [ZeroXNoxus](https://github.com/ZeroXNoxus)) 168 | - Adds the option to set a screen width as a trigger. If the screen width is above the entered value, sheet-only gets not activated. This idea was brought to you by [ZeroXNoxus](https://github.com/ZeroXNoxus) 169 | 170 | # 1.0.8 171 | - Adds dynamic actor list (Thanks to [ZeroXNoxus](https://github.com/ZeroXNoxus)) 172 | 173 | # 1.0.7 174 | - Improved zooming (does not work for Firefox) 175 | 176 | # 1.0.6 177 | - Adds buttons to resize UI. !!! This only works for sheets that uses relative font size values (rem) e.g. the default sheet of the 'Level Up: Advanced 5th Edition' system !!! 178 | 179 | # 1.0.5 180 | - Compatibility with 'Level Up! Advanced 5th Edition' 181 | - Added higher system compatibility in general 182 | 183 | # 1.0.4 184 | - Added a setting to enable/disable notifications for all clients. 185 | - Added a setting to enable/disable canvas rendering. In some systems the canvas is needed in combination with some modules (e.g. The Dark Eye 5e + Dice So Nice) 186 | 187 | # 1.0.3 188 | - Adds support for multiple characters (like familiars or wild shapes) 189 | 190 | # 1.0.2 191 | - Disabling Canvas instead of hiding it (Thanks to [jsavko](https://github.com/jsavko)) 192 | - Therefor sheetonly map is not needed anymore 193 | 194 | # 1.0.1 195 | - Refactorings 196 | 197 | # 1.0.0 198 | - Initial version 199 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | ![](https://img.shields.io/badge/Foundry-v12-informational) 2 | ![GitHub All Releases](https://img.shields.io/github/downloads/Syrious/foundryvtt-sheet-only/total?label=Downloads+Total) 3 | ![GitHub Downloads (all assets, latest release)](https://img.shields.io/github/downloads/Syrious/foundryvtt-sheet-only/latest/total?label=Downloads+Latest) 4 | [![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3DSyriousWorkshop%26type%3Dpatrons&style=flat)](https://patreon.com/SyriousWorkshop) 5 | 6 | [Discord](https://discord.gg/VMqndcyUGS) 7 | 8 | # FoundryVTT Sheet-Only 9 | Designed for in-person sessions. Players can connect with their **tablets** to foundry and will see their character sheet and only their character sheet. 10 | They can interact with the sheet, see all the relevant information, and the sheet gets updated if the GM makes any changes such as inventory, HP and so on. 11 | 12 | I built this simple module for my own in-person sessions, where I have a large display to show foundry (using [Monk's Common Display](https://github.com/ironmonk88/monks-common-display)) 13 | 14 | *(Looking for something to work on smartphones? Check out [Mobile-Companion](https://github.com/Syrious/foundryvtt-mobile-companion))* 15 | 16 | ### Installation and setup 17 | * Go to Settings -> Sheet-Only and select the players which should only see their character sheets 18 | * There you can also set a screen-width so that this module only activates if the screen width it below a certain value 19 | * Let's say you want to use it only if you are logging in with your mobile. Set it to 800 (or whatever your mobile screen maximum width is) and you will see your sheet only if you are logged in with your mobile device 20 | * There are also settings to change the default behavior regarding notifications and the canvas 21 | 22 | setup.png 23 | 24 | ### Usage 25 | * If sheet-only users log in, they will only see their sheets 26 | * If they have multiple characters, a sidebar is shown and the users are able to switch between characters 27 | * Works for companions and wild shapes (as long as the user has owner permission) 28 | * You can drag the button bar if it is in your way. It starts always in the top left corner after login 29 | 30 | #### Zooming 31 | * In the bottom right corner, there are buttons to resize the UI. Depending on the browser you are using, it works differently 32 | * Firefox: If you are using firefox, only the font size gets adjusted (like you would in the core setting) and therefore does only work with sheets that uses relative font-size units (rem instead of px). A working example is the default sheet of [Level Up: Advanced 5th Edition (Official)](https://foundryvtt.com/packages/a5e) 33 | * Non-Firefox: Taking advantage of the 'zoom'-property, this should zoom in and out quite nicely regardless of the font size units 34 | 35 | example1.png 36 | 37 | #### Actor List 38 | * If you own more than one actor, a button at the bottom right can be used to toggle a list of all your actors 39 | * If you don't have more than one actor, this button does nothing 40 | 41 | example2.png 42 | 43 | #### Dragging 44 | If the control buttons are in your way, press and hold the button bar for about half a second, 45 | then drag and drop it elsewhere. 46 | The same works for the chat window 47 | 48 | #### Polymorph/Wildshape (v12+ and DND5e only) 49 | To be able to polymorph or wildshape from client-side you need 50 | to have [SocketLib](https://foundryvtt.com/packages/socketlib) installed and active as well as one of 51 | either [Quick Insert](https://foundryvtt.com/packages/quick-insert) 52 | or [Spotlight Omnisearch](https://foundryvtt.com/packages/spotlight-omnisearch) 53 | 54 | The GM can then enable that feature in the Sheet-Only settings, allowing users to polymorph or wildshape. 55 | **A GM has to be logged in for that feature to work!** 56 | 57 | ### Sheet-Only-Plus 58 | These features are [Patreon-Only](https://www.patreon.com/SyriousWorkshop). 59 | For a tiny fee, you gain access to the additional features. 60 | Your support helps immensely to keep developing foundry modules, 61 | but I understand if you don't like to continuously support the project. 62 | In this case, you can cancel your subscription anytime and continue to use the module. 63 | You only need to re-subscribe if you want newer features or upgrade to a compatible version. 64 | 65 | The current features in the Plus-Version are: 66 | * Targeting 67 | * Journal 68 | * Movement 69 | 70 | ### Compatibility 71 | * [Real-Dice](https://foundryvtt.com/packages/real-dice) If installed, you can enable manual rolling in sheet-only settings. 72 | 73 | ### Tested with 74 | - [Alien RPG](https://foundryvtt.com/packages/alienrpg) 75 | - [Cyberpunk RED](https://foundryvtt.com/packages/cyberpunk-red-core) (Little wonky though) 76 | - [Das Schwarze Auge / The Dark Eye (5th Edition)](https://foundryvtt.com/packages/dsa5) 77 | - [DnD5e](https://foundryvtt.com/packages/dnd5e) 78 | - [Level Up: Advanced 5th Edition (Official)](https://foundryvtt.com/packages/a5e) 79 | 80 | ### Issues 81 | * The UI is not very reactive. If you go from portrait to landscape or vice versa, you probably need to reload 82 | * Changing the permission on an actor does not get synced with connected users 83 | * On some systems (e.g., TDE5e, Cyberpunk Red) Dice So Nice! doesn't show roll if the canvas is disabled. To make it work again, uncheck "Disable Canvas for users" in Sheet-Only settings 84 | 85 | ### Support 86 | If you like to support my work, find me on [Patreon](https://www.patreon.com/SyriousWorkshop). 87 | -------------------------------------------------------------------------------- /example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syrious/foundryvtt-sheet-only/aaacd5815056ee1fc628db269ff94434b9b3ca05/example1.png -------------------------------------------------------------------------------- /example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syrious/foundryvtt-sheet-only/aaacd5815056ee1fc628db269ff94434b9b3ca05/example2.png -------------------------------------------------------------------------------- /lang/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "Sheet-Only.display-notifications.name": "Benachrichtigungen anzeigen", 3 | "Sheet-Only.display-notifications.wait-init": "Sheet-Only: Warte auf die Initialisierung des Akteurs...", 4 | "Sheet-Only.notifications.ownedActorFound": "Sheet-Only: Mindestens ein eigener Akteur gefunden", 5 | "Sheet-Only.notifications.actorInitError": "Akteur konnte nicht initialisiert werden.", 6 | "Sheet-Only.display-notifications.hint": "(Standard: Nicht aktiviert) Benachrichtigungen für Benutzer aktivieren?", 7 | "Sheet-Only.activation-screen.width": "Aktivieren ab Bildschirmbreite", 8 | "Sheet-Only.settingsMenu.name": "Benutzer", 9 | "Sheet-Only.settingsMenu.label": "Auswählen", 10 | "Sheet-Only.settingsMenu.hint": "Wähle Benutzer, die ausschließlich Zugang zu ihren Charakterinformationen haben", 11 | "Sheet-Only.players": "Spieler", 12 | "Sheet-Only.name": "Sheet-Only", 13 | "Sheet-Only.hint": "Benutzer auswählen", 14 | "Sheet-Only.button.save": "Speichern", 15 | "Sheet-Only.mobile-only.name": "Nur auf Mobilgeräten anzeigen", 16 | "Sheet-Only.mobile-only.hint": "(Standard: Aktiviert) Ob das Blatt nur als 'Sheet-Only' auf Mobilgeräten angezeigt werden soll. Deaktivieren, um es für ausgewählte Benutzer auf jedem Gerät anzuzeigen.", 17 | "Sheet-Only.canvas-option.name": "Canvas-Steuerungen", 18 | "Sheet-Only.canvas-option.hint": "Diese Option ermöglicht es dir, zu spezifizieren, ob Sheet-Only das Figuren-Spielfeld deaktivieren (Standard), verstecken oder keine Änderungen daran vornehmen soll. Das Deaktivieren ist am leistungsstärksten, aber einige Module funktionieren möglicherweise nicht.", 19 | "Sheet-Only.real-dice.name": "Real Dice: Manuelles Würfeln aktivieren", 20 | "Sheet-Only.real-dice.hint": "(Standard: Nicht aktiviert) Du hast Real Dice installiert. Soll das manuelle Würfeln für alle Spieler aktiviert werden?", 21 | "Sheet-Only.volume.playlist.name": "Lautstärke Musik", 22 | "Sheet-Only.volume.ambience.name": "Lautstärke Umgebungsgeräusche", 23 | "Sheet-Only.volume.interface.name": "Lautstärke Benutzeroberfläche", 24 | "Sheet-Only.chat-full-width.name": "Chat als Vollbild", 25 | "Sheet-Only.chat-full-width.hint": "Maximiere Chat-Fenster", 26 | "Sheet-Only.open-chat-on-item-use.name": "Chat bei Verwendung eines Gegenstands öffnen", 27 | "Sheet-Only.open-chat-on-item-use.hint": "Chat automatisch öffnen und nach unten scrollen, wenn Gegenstände oder Zauber verwendet werden (nur DnD5e)", 28 | "Sheet-Only.morph-on-mobile.name": "Polymorph aktivieren", 29 | "Sheet-Only.morph-on-mobile.hint": "(Standard: Nicht aktiviert) Du hast Spotlight Omnisearch oder Quick Insert installiert. Dürfen die Spieler die Option haben, nach einem Monster zu suchen, um sie für Tiergestalt/Verwandlung/... zu verwenden? Hinweis: Die Transformierung der Token funktioniert nur, wenn mindestens ein Spielleiter eingeloggt ist.", 30 | "Sheet-Only.drag.name": "Dauer der Drag-Aktivierung", 31 | "Sheet-Only.drag.hint": "Die Zeit in Millisekunden, die du drücken und halten musst, um Drag zu aktivieren. Trage 0 ein, um die Funktion zu deaktivieren Standard: 500", 32 | "Sheet-Only.show-bottom-bar.name": "Button Leiste für kleine Bildschirme", 33 | "Sheet-Only.show-bottom-bar.hint": "Blendet die Button Leiste am unteren Rand des Bildschirms ein. (Für kleine Bildschirme mit einer Breite kleiner als 800px)" 34 | 35 | } -------------------------------------------------------------------------------- /lang/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Sheet-Only.display-notifications.name": "Display Notifications", 3 | "Sheet-Only.display-notifications.wait-init": "Sheet-Only: Waiting for actor to be initialized...", 4 | "Sheet-Only.notifications.ownedActorFound": "Sheet-Only: Found at least one owned actor", 5 | "Sheet-Only.notifications.actorInitError": "Could not initialize actor.", 6 | "Sheet-Only.display-notifications.hint": "(Default: Unchecked) Whether or not to display ui notifications for clients", 7 | "Sheet-Only.activation-screen.width": "Activation screen width", 8 | "Sheet-Only.settingsMenu.name": "User", 9 | "Sheet-Only.settingsMenu.label": "Select", 10 | "Sheet-Only.settingsMenu.hint": "Choose users who only have access to their sheet", 11 | "Sheet-Only.players": "Players", 12 | "Sheet-Only.name": "Sheet-Only", 13 | "Sheet-Only.hint": "Select Users", 14 | "Sheet-Only.button.save": "Save", 15 | "Sheet-Only.mobile-only.name": "Only display on mobile", 16 | "Sheet-Only.mobile-only.hint": "(Default: Checked) Whether the sheet should only be displayed as an 'Only Sheet' on mobile devices. Disable to display for the selected users on any device.", 17 | "Sheet-Only.canvas-option.name": "Canvas Controls", 18 | "Sheet-Only.canvas-option.hint": "This option allows you to specify whether Sheet-Only should deactivate the canvas (default), hide it or not make any changes at all. Disabling it is the most performant but some modules might not work.", 19 | "Sheet-Only.real-dice.name": "Real Dice: Enable manual rolls", 20 | "Sheet-Only.real-dice.hint": "(Default: Unchecked) You have Real Dice installed. Should manual rolling be enabled for all players?", 21 | "Sheet-Only.volume.playlist.name": "Playlist Volume", 22 | "Sheet-Only.volume.ambience.name": "Ambience Volume", 23 | "Sheet-Only.volume.interface.name": "Interface Volume", 24 | "Sheet-Only.chat-full-width.name": "Chat as fullscreen window", 25 | "Sheet-Only.chat-full-width.hint": "Displays chat as fullscreen", 26 | "Sheet-Only.open-chat-on-item-use.name": "Open chat on item use", 27 | "Sheet-Only.open-chat-on-item-use.hint": "Automatically open chat and scroll to bottom when item or spells are used (dnd5e only)", 28 | "Sheet-Only.morph-on-mobile.name": "Show polymorph button", 29 | "Sheet-Only.morph-on-mobile.hint": "(Default: Unchecked) You have Spotlight Omnisearch or Quick Insert installed. Should the players have the option to search for an actor to polymorph/wild shape/... into? Note: Token transformation only works if a GM account is logged on as well.", 30 | "Sheet-Only.drag.name": "Drag Activation", 31 | "Sheet-Only.drag.hint": "Time in milliseconds you need to hold to enable dragging. To disable this feature, set to 0. Default: 500", 32 | "Sheet-Only.show-bottom-bar.name": "Small Screen Button Bar", 33 | "Sheet-Only.show-bottom-bar.hint": "If enabled, it shows the button bar at the bottom of the screen for better access on small displays (width < 800px)" 34 | } 35 | 36 | -------------------------------------------------------------------------------- /module.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "sheet-only", 3 | "title": "Sheet Only", 4 | "description": "Provides a fullscreen character sheet to use on tablets", 5 | "version": "2.0.0", 6 | "compatibility": { 7 | "minimum": "13", 8 | "verified": "13.342" 9 | }, 10 | "authors": [ 11 | { 12 | "name": "Syrious", 13 | "discord": "syrious_", 14 | "flags": { 15 | "patreon": "SyriousWorkshop", 16 | "github": "Syrious", 17 | "ko-fi": "syrious" 18 | } 19 | } 20 | ], 21 | "languages": [ 22 | { 23 | "lang": "en", 24 | "name": "English", 25 | "path": "lang/en.json", 26 | "flags": {} 27 | }, 28 | { 29 | "lang": "de", 30 | "name": "Deutsch", 31 | "path": "lang/de.json", 32 | "flags": {} 33 | } 34 | ], 35 | "esmodules": [ 36 | "/scripts/main.js", 37 | "/scripts/settings.js", 38 | "/scripts/api.js" 39 | ], 40 | "styles": [ 41 | "styles/main.css", 42 | "styles/dnd5e.css" 43 | ], 44 | "url": "https://github.com/Syrious/foundryvtt-sheet-only", 45 | "manifest": "https://github.com/Syrious/foundryvtt-sheet-only/releases/latest/download/module.json", 46 | "download": "https://github.com/Syrious/foundryvtt-sheet-only/releases/download/1.6.3/module.zip", 47 | "socket": true 48 | } -------------------------------------------------------------------------------- /scripts/actorStorage.js: -------------------------------------------------------------------------------- 1 | export const actorStorage = { 2 | current: null, 3 | } // The currently selected actor 4 | 5 | export function saveLastActorId(actorId) { 6 | game.settings.set("sheet-only", "lastActorId", actorId); 7 | } 8 | 9 | export function getLastActorId() { 10 | return game.settings.get("sheet-only", "lastActorId"); 11 | } -------------------------------------------------------------------------------- /scripts/actorsList.js: -------------------------------------------------------------------------------- 1 | import { actorStorage, saveLastActorId } from "./actorStorage.js"; 2 | 3 | 4 | export function rebuildActorList() { 5 | let actorList = $('.sheet-only-actor-list'); 6 | 7 | displayActorListButton(); 8 | 9 | actorList.empty(); 10 | let actorElements = getActorElements(); 11 | 12 | actorList.show(); 13 | actorElements.forEach(elem => actorList.append(elem)); 14 | } 15 | 16 | export function displayActorListButton() { 17 | const actorsListButton = $("#so-collapse-actor-select") 18 | const ownedActors = getOwnedActors(); 19 | 20 | if(ownedActors.length > 1) { 21 | actorsListButton.show(); 22 | } else { 23 | actorsListButton.hide(); 24 | } 25 | } 26 | 27 | export function getOwnedActors() { 28 | return game.actors.filter(actor => isActorOwnedByUser(actor)); 29 | } 30 | 31 | export function isActorOwnedByUser(actor) { 32 | return actor.ownership[game.user.id] === 3; 33 | } 34 | 35 | export function getActorElements() { 36 | let actors = getOwnedActors(); 37 | return actors.map(actor => { 38 | return $('
') 39 | //.text(actor.name) 40 | .append($('').attr('src', actor.img)) 41 | .click(async () => { 42 | await switchToActor(actor); 43 | toggleActorList(); 44 | }); 45 | } 46 | ); 47 | } 48 | 49 | /** 50 | * @param {Actor} actor 51 | */ 52 | export async function switchToActor(actor, render = true) { 53 | actorStorage.current = actor; 54 | if (render) await actor.sheet.render(true); 55 | 56 | setCurrentActorTokenAsControlled(); 57 | saveLastActorId(actorStorage.current.id); 58 | } 59 | 60 | // Take control of the token of this actor (for targeting) 61 | function setCurrentActorTokenAsControlled() { 62 | const activeTokens = actorStorage.current.getActiveTokens(); 63 | if (activeTokens.length > 0) { 64 | activeTokens[0].control({releaseOthers: true}) 65 | } 66 | } 67 | 68 | export function toggleActorList() { 69 | $('.sheet-only-actor-list').toggleClass('collapse'); 70 | if ($('.sheet-only-actor-list.collapse')) { 71 | localStorage.setItem("collapsed-actor-select", "true"); 72 | } else { 73 | localStorage.setItem("collapsed-actor-select", "false"); 74 | } 75 | } -------------------------------------------------------------------------------- /scripts/addControlButtons.js: -------------------------------------------------------------------------------- 1 | import {showPatreonDialog} from "./dialogs.js" 2 | import {initDragListener, wasDragged} from "./drag.js"; 3 | import {toggleFullscreen} from "./fullscreen.js"; 4 | import {sheetOnlyPlusActive} from "./compatibility.js"; 5 | import {toggleChat} from "./chat.js"; 6 | import {displayActorListButton, toggleActorList} from "./actorsList.js"; 7 | 8 | export function useSmallScreenSettings() { 9 | const maxWithForSmallDisplays = 800; 10 | const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 11 | 12 | const showBottomBar = game.settings.get("sheet-only", "show-bottom-bar"); 13 | const isSmallScreen = screenWidth < maxWithForSmallDisplays; 14 | 15 | return isSmallScreen && showBottomBar; 16 | } 17 | 18 | function checkAndSetupSmallScreen() { 19 | if (useSmallScreenSettings()) { 20 | $('#so-main-buttons').addClass("small-display"); 21 | $('.sheet-only-container').addClass("small-display"); 22 | 23 | // Observe the DOM until sheet-only-sheet has been added 24 | const observer = new MutationObserver(() => { 25 | if ($(".sheet-only-sheet").length > 0) { 26 | $('.sheet-only-sheet').addClass("small-display"); 27 | 28 | observer.disconnect(); // Stop watching 29 | } 30 | }); 31 | 32 | observer.observe(document.body, {childList: true, subtree: true}); 33 | } 34 | } 35 | 36 | export function addControlButtons(sheetContainer, increaseZoom, decreaseZoom, resetZoom) { 37 | const buttonContainer = $(`
`); 38 | 39 | buttonContainer.load("modules/sheet-only/templates/buttons.html", () => { 40 | setupDefaultButtons(buttonContainer, increaseZoom, decreaseZoom, resetZoom); 41 | setupMenuButtons(buttonContainer); 42 | 43 | checkAndSetupSmallScreen(); 44 | }); 45 | 46 | sheetContainer.append(buttonContainer); 47 | 48 | setupDefaults(); 49 | initDragListener(); 50 | } 51 | 52 | function setupMenuButtons(buttonContainer) { 53 | const menuButton = buttonContainer.find("#so-menu"); 54 | 55 | menuButton.on("click", function () { 56 | if (wasDragged()) return; 57 | 58 | $('#so-main-buttons').toggle(); 59 | $('#so-settings-buttons').toggle(); 60 | }); 61 | } 62 | 63 | function setupDefaultButtons(buttonContainer, increaseZoom, decreaseZoom, resetZoom) { 64 | const collapseButton = buttonContainer.find("#so-collapse-actor-select") 65 | const chatButton = buttonContainer.find("#so-toggle-chat") 66 | const increaseButton = buttonContainer.find("#so-increase-font"); 67 | const decreaseButton = buttonContainer.find("#so-decrease-font"); 68 | const resetButton = buttonContainer.find("#so-reset-font"); 69 | const logoutButton = buttonContainer.find("#so-log-out"); 70 | const targetingButton = buttonContainer.find("#so-targeting"); 71 | const journalButton = buttonContainer.find("#so-journal"); 72 | const controllingButton = buttonContainer.find("#so-controlling"); 73 | const settingsButton = buttonContainer.find("#so-fvtt-settings"); 74 | const fullscreen = buttonContainer.find("#so-fullscreen"); 75 | 76 | collapseButton.on("click", function () { 77 | if (wasDragged()) return; 78 | 79 | toggleActorList(); 80 | }); 81 | 82 | chatButton.on("click", function () { 83 | if (wasDragged()) return; 84 | toggleChat(); 85 | }); 86 | 87 | increaseButton.on("click", function () { 88 | if (wasDragged()) return; 89 | increaseZoom(); 90 | }); 91 | 92 | decreaseButton.on("click", function () { 93 | if (wasDragged()) return; 94 | decreaseZoom(); 95 | }); 96 | 97 | resetButton.on("click", function () { 98 | if (wasDragged()) return; 99 | resetZoom() 100 | }); 101 | 102 | logoutButton.on("click", function () { 103 | if (wasDragged()) return; 104 | ui.menu.items.logout.onClick(); 105 | }); 106 | 107 | settingsButton.on("click", function () { 108 | if (wasDragged()) return; 109 | game.settings.sheet.render(true); 110 | }) 111 | 112 | targetingButton.on("click", function () { 113 | if (wasDragged()) return; 114 | if (sheetOnlyPlusActive()) { 115 | game.modules.get('sheet-only-plus').api.openTargeting(); 116 | } else { 117 | showPatreonDialog("Targeting"); 118 | } 119 | }); 120 | 121 | journalButton.on("click", function () { 122 | if (wasDragged()) return; 123 | if (sheetOnlyPlusActive()) { 124 | game.modules.get('sheet-only-plus').api.openJournal(); 125 | } else { 126 | showPatreonDialog("Journal"); 127 | } 128 | }); 129 | 130 | controllingButton.on("click", function () { 131 | if (wasDragged()) return; 132 | 133 | if (sheetOnlyPlusActive()) { 134 | game.modules.get('sheet-only-plus').api.openControls(); 135 | } else { 136 | showPatreonDialog("Movement"); 137 | } 138 | }); 139 | 140 | fullscreen.on("click", function () { 141 | if (wasDragged()) return; 142 | toggleFullscreen(); 143 | }); 144 | 145 | displayActorListButton(); 146 | } 147 | 148 | function setupDefaults() { 149 | $('#collapse-actor-select i').addClass('hidden'); 150 | $('.sheet-only-actor-list').addClass('collapse'); 151 | } 152 | 153 | 154 | -------------------------------------------------------------------------------- /scripts/api.js: -------------------------------------------------------------------------------- 1 | import { actorStorage } from "./actorStorage.js"; 2 | import {isSheetOnly} from "./main.js"; 3 | /* global game, Hooks*/ 4 | 5 | 6 | Hooks.once('setup', async () => { 7 | setupApi(); 8 | }); 9 | 10 | function setupApi() { 11 | game.modules.get('sheet-only').api = { 12 | // This sheet-only version is compatible with the following sheet-only-plus version 13 | plusCompatibility: "1.0.0", 14 | 15 | getCurrentActor: function () { 16 | return actorStorage.current; 17 | }, 18 | 19 | isSheetOnly: function () { 20 | return isSheetOnly(); 21 | } 22 | 23 | // ExampleClass: class { 24 | // constructor(name) { 25 | // this.name = name; 26 | // } 27 | // 28 | // myMethod() { 29 | // //...the actual logic 30 | // } 31 | // } 32 | } 33 | } -------------------------------------------------------------------------------- /scripts/canvasHider.js: -------------------------------------------------------------------------------- 1 | export function hideCanvas(){ 2 | checkDnd5e() 3 | } 4 | 5 | function checkDnd5e() { 6 | if (game.system === 'dnd5e' || document.getElementById('board')) { 7 | // Hide the canvas 8 | document.body.classList.add("hidden-canvas"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /scripts/chat.js: -------------------------------------------------------------------------------- 1 | import {moduleId} from "./settings.js"; 2 | import {isSheetOnly} from "./main.js"; 3 | 4 | let chatPopout; 5 | 6 | function popoutChat() { 7 | // Retrieve the chat tab element 8 | const chatTabElement = document.querySelector('#chat'); 9 | 10 | // Ensure the element is found and the associated tab app can be accessed 11 | if (chatTabElement && window.ui) { 12 | const tabApp = window.ui[chatTabElement.dataset.tab]; 13 | 14 | if (tabApp && typeof tabApp.renderPopout === 'function') { 15 | // Call renderPopout on the tabApp 16 | tabApp.renderPopout().then(popout => { 17 | chatPopout = popout; 18 | chatPopout.classList.add("so-draggable"); 19 | 20 | const chatFullscreen = game.settings.get(moduleId, "chat-fullscreen"); 21 | updateChatFullscreen(chatFullscreen, chatPopout) 22 | }); 23 | 24 | } else { 25 | console.error("The popout or renderPopout function is not available."); 26 | } 27 | } else { 28 | console.error("Chat tab element or ui object not found."); 29 | } 30 | } 31 | 32 | export function openChat() { 33 | if(!chatPopout){ 34 | popoutChat(); 35 | } 36 | } 37 | 38 | export function closeChat() { 39 | if (chatPopout) { 40 | chatPopout.close(); 41 | chatPopout = undefined; 42 | } 43 | } 44 | 45 | export function toggleChat() { 46 | if (chatPopout) { 47 | closeChat(); 48 | }else{ 49 | popoutChat(); 50 | } 51 | } 52 | 53 | export function updateChatFullscreen(fullscreen, chatPopout) { 54 | if(!isSheetOnly()) return; 55 | 56 | chatPopout.element.style.zIndex = 9999; 57 | 58 | if (fullscreen) { 59 | // To reset the chat to correct place even after moved around with draggable 60 | chatPopout.setPosition({ 61 | left: 0, 62 | top: 0, 63 | width: window.innerWidth, 64 | height: window.innerHeight 65 | }); 66 | 67 | chatPopout.classList.remove('so-draggable') 68 | 69 | } else { 70 | chatPopout.setPosition({ 71 | left: window.innerWidth, 72 | top: 0 73 | }); 74 | 75 | chatPopout.classList.add('so-draggable'); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /scripts/compatibility.js: -------------------------------------------------------------------------------- 1 | export function sheetOnlyPlusActive() { 2 | let moduleName = "sheet-only-plus"; 3 | return game.modules.has(moduleName) && game.modules.get(moduleName).active; 4 | } 5 | 6 | 7 | -------------------------------------------------------------------------------- /scripts/defaultZoom.js: -------------------------------------------------------------------------------- 1 | export function increaseZoom() { 2 | let sheet = $('.sheet-only-sheet'); 3 | let scaleFactor = parseFloat(sheet.css('zoom')); 4 | 5 | scaleFactor += 0.1; 6 | 7 | sheet.css({ zoom: scaleFactor }); 8 | } 9 | 10 | export function decreaseZoom() { 11 | let sheet = $('.sheet-only-sheet'); 12 | let scaleFactor = parseFloat(sheet.css('zoom')); 13 | 14 | scaleFactor = Math.max(scaleFactor - 0.1, 0.1); 15 | 16 | sheet.css({ zoom: scaleFactor }); 17 | } 18 | 19 | export function resetZoom() { 20 | let sheet = $('.sheet-only-sheet'); 21 | 22 | sheet.css({ zoom: 1 }); 23 | } -------------------------------------------------------------------------------- /scripts/dialogs.js: -------------------------------------------------------------------------------- 1 | import {moduleId} from "./settings.js"; 2 | export function showPatreonDialog(titleSuffix) { 3 | let dialogContent = `

This is a Sheet-only-PLUS feature.

4 |

Please visit: Syrious' Workshop on Patreon

`; 5 | 6 | new Dialog({ 7 | title: "Patreon Only Feature - " + titleSuffix, 8 | content: dialogContent, 9 | buttons: { 10 | ok: { 11 | icon: "", 12 | label: 'Ok' 13 | } 14 | } 15 | }).render(true); 16 | } 17 | 18 | export function wipDialog(titleSuffix, text) { 19 | let dialogContent = `

This feature is in the making

20 |

${text}

`; 21 | 22 | new Dialog({ 23 | title: "Work in progess - " + titleSuffix, 24 | content: dialogContent, 25 | buttons: { 26 | ok: { 27 | icon: "", 28 | label: 'Ok' 29 | } 30 | } 31 | }).render(true); 32 | } 33 | 34 | export function enableCanvasDialog() { 35 | let dialogContent = `

Sheet-Only is not active for you but your canvas is disabled.

36 |

Should the canvas be activated for you?

`; 37 | 38 | new Dialog({ 39 | title: "Enable canvas?", 40 | content: dialogContent, 41 | buttons: { 42 | yes: { 43 | icon: "", 44 | label: 'Yes', 45 | callback: () => { 46 | game.settings.set("core", "noCanvas", false); 47 | foundry.utils.debouncedReload(); 48 | } 49 | }, 50 | no: { 51 | icon: "", 52 | label: 'No' 53 | }, 54 | no_never: { 55 | icon: "", 56 | label: 'No, don\'t ask again!', 57 | callback: () => { 58 | game.settings.set(moduleId, "neverAskCanvas", true); 59 | } 60 | } 61 | }, 62 | default: "yes", 63 | }).render(true, {width: 500}) 64 | } -------------------------------------------------------------------------------- /scripts/drag.js: -------------------------------------------------------------------------------- 1 | let selectedElement = null; 2 | let xOffset = 0; 3 | let yOffset = 0; 4 | let hasMoved = false; 5 | 6 | let pressTimer; 7 | let longPressDuration; 8 | 9 | const scaleUpTo = 1.08; 10 | 11 | export function initDragListener() { 12 | document.addEventListener('mousedown', handleStart, false); 13 | document.addEventListener('touchstart', handleStart, false); 14 | 15 | document.addEventListener('mousemove', dragMove, false); 16 | document.addEventListener('touchmove', dragMove, false); 17 | 18 | document.addEventListener('mouseup', dragEnd, false); 19 | document.addEventListener('touchend', dragEnd, false); 20 | 21 | longPressDuration = getDuration(); 22 | } 23 | 24 | function getDuration() { 25 | return game.settings.get("sheet-only", "dragDuration"); 26 | } 27 | 28 | function handleStart(event) { 29 | if (longPressDuration <= 0) return; 30 | 31 | hasMoved = false; 32 | 33 | let container = findAncestor(event.target, '.so-draggable'); 34 | if (container) { 35 | // Initiate the press timer. 36 | pressTimer = window.setTimeout(() => dragStart(event, container), longPressDuration); 37 | } 38 | } 39 | 40 | function findAncestor(el, sel) { 41 | while ((el = el.parentElement) && !(el.matches || el.matchesSelector).call(el, sel)); 42 | return el; 43 | } 44 | 45 | export function wasDragged() { 46 | return hasMoved; 47 | } 48 | 49 | function dragStart(event, container) { 50 | event.preventDefault(); 51 | event.stopPropagation(); 52 | 53 | selectedElement = container; 54 | selectedElement.classList.add('dragged'); 55 | hasMoved = true; 56 | 57 | let { x, y } = getPosition(); 58 | 59 | xOffset = (event.clientX || event.touches[0].clientX) - x; 60 | yOffset = (event.clientY || event.touches[0].clientY) - y; 61 | 62 | selectedElement.style.transform = `translate(${x}px, ${y}px) scale(${scaleUpTo})`; 63 | 64 | } 65 | 66 | function dragMove(event) { 67 | if (selectedElement) { 68 | event.stopPropagation(); 69 | 70 | let xPosition = (event.clientX || event.touches[0].clientX) - xOffset; 71 | let yPosition = (event.clientY || event.touches[0].clientY) - yOffset; 72 | 73 | // Apply transform using translate for positional adjustments and keep the scale constant 74 | selectedElement.style.transform = `translate(${xPosition}px, ${yPosition}px) scale(${scaleUpTo})`; 75 | } 76 | } 77 | 78 | function dragEnd(event) { 79 | clearTimeout(pressTimer); 80 | 81 | if (selectedElement) { 82 | event.stopPropagation(); 83 | 84 | let { x, y } = getPosition(); 85 | 86 | // Reset the scale to 1.0 and maintain the final position using translate 87 | selectedElement.style.transform = `translate(${x}px, ${y}px) scale(1)`; 88 | 89 | selectedElement.classList.remove('dragged'); 90 | 91 | applyTransformation(selectedElement); 92 | 93 | selectedElement = null; 94 | } 95 | } 96 | 97 | function getPosition() { 98 | const elementStyle = window.getComputedStyle(selectedElement); 99 | const transform = elementStyle.transform; 100 | let xPosition = 0; 101 | let yPosition = 0; 102 | 103 | if (transform && transform !== 'none') { 104 | const matrix = new WebKitCSSMatrix(transform); 105 | xPosition = matrix.m41; 106 | yPosition = matrix.m42; 107 | } 108 | 109 | return { x: xPosition, y: yPosition }; 110 | } 111 | 112 | /** 113 | * Applies the transformation to left and top so that if foundry triggers a new render, the window won't jump 114 | * to its original position 115 | * @param element The dragged element 116 | */ 117 | function applyTransformation(element) { 118 | const computedStyle = getComputedStyle(element); 119 | 120 | // Extract transformation values 121 | const transform = computedStyle.transform; 122 | 123 | if (transform !== 'none') { 124 | // Parse the transform matrix 125 | const matrix = transform.match(/matrix\(([^)]+)\)/)[1].split(', ').map(parseFloat); 126 | 127 | // Translate values from the matrix 128 | const translateX = matrix[4]; 129 | const translateY = matrix[5]; 130 | 131 | // Calculate the new top and left positions 132 | const translatedLeft = parseFloat(computedStyle.left) + translateX; 133 | const translatedTop = parseFloat(computedStyle.top) + translateY; 134 | 135 | // Apply the calculated position and reset transformation 136 | element.style.transform = 'none'; 137 | element.style.left = `${translatedLeft}px`; 138 | element.style.top = `${translatedTop}px`; 139 | } 140 | } -------------------------------------------------------------------------------- /scripts/firefoxZoom.js: -------------------------------------------------------------------------------- 1 | export function increaseZoom() { 2 | const max = game.settings.settings.get('core.fontSize').range.max; 3 | const currentFontSize = game.settings.get("core", "fontSize"); 4 | 5 | let newFontSize = currentFontSize + 1; 6 | 7 | if (newFontSize > max) { 8 | newFontSize = max; 9 | } 10 | 11 | game.settings.set("core", "fontSize", newFontSize) 12 | } 13 | 14 | export function decreaseZoom() { 15 | const min = game.settings.settings.get('core.fontSize').range.min; 16 | const currentFontSize = game.settings.get("core", "fontSize"); 17 | 18 | let newFontSize = currentFontSize - 1; 19 | 20 | if (newFontSize < min) { 21 | newFontSize = min; 22 | } 23 | 24 | game.settings.set("core", "fontSize", newFontSize) 25 | } 26 | 27 | export function resetZoom() { 28 | const defaultFontSize = game.settings.settings.get('core.fontSize').default; 29 | 30 | game.settings.set("core", "fontSize", defaultFontSize) 31 | } -------------------------------------------------------------------------------- /scripts/fullscreen.js: -------------------------------------------------------------------------------- 1 | function enable() { 2 | const element = document.body; 3 | const requestMethod = element.requestFullscreen || element.webkitRequestFullscreen || element.mozRequestFullScreen || element.msRequestFullscreen; 4 | 5 | if (requestMethod) { // Native full screen. 6 | requestMethod.call(element); 7 | } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. 8 | const wscript = new ActiveXObject("WScript.Shell"); 9 | if (wscript !== null) { 10 | wscript.SendKeys("{F11}"); 11 | } 12 | } 13 | } 14 | 15 | function disable() { 16 | const element = document; 17 | 18 | const exitMethod = element.exitFullscreen || element.webkitExitFullscreen || element.mozCancelFullScreen || element.msExitFullscreen; 19 | 20 | if (exitMethod) { 21 | exitMethod.call(document); 22 | } else if (typeof window.ActiveXObject !== "undefined") { // Older IE. 23 | const wscript = new ActiveXObject("WScript.Shell"); 24 | if (wscript !== null) { 25 | wscript.SendKeys("{F11}"); 26 | } 27 | } 28 | } 29 | 30 | export function toggleFullscreen() { 31 | const isInFullScreen = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement; 32 | 33 | if (isInFullScreen) { 34 | disable() 35 | } else { 36 | enable(); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /scripts/main.js: -------------------------------------------------------------------------------- 1 | import {addControlButtons} from "./addControlButtons.js"; 2 | import * as FirefoxZoom from "./firefoxZoom.js"; 3 | import * as DefaultZoom from "./defaultZoom.js"; 4 | import {hideCanvas} from "./canvasHider.js"; 5 | import {dnd5eReadyHook} from "./system-specific/dnd5e/dnd5e.js"; 6 | import {actorStorage, getLastActorId} from "./actorStorage.js"; 7 | import {i18n} from "./utils.js"; 8 | import {enableCanvasDialog} from "./dialogs.js"; 9 | import {moduleId} from "./settings.js"; 10 | import {getOwnedActors, isActorOwnedByUser, rebuildActorList, switchToActor} from "./actorsList.js"; 11 | 12 | /* global game, canvas, Hooks, CONFIG, foundry */ 13 | // CONFIG.debug.hooks = false; 14 | 15 | /** @type {FormApplication|null} */ 16 | let currentSheet = null; // Track the currently open sheet 17 | 18 | /* ************************************* */ 19 | /* *************** HOOKS *************** */ 20 | /* ************************************* */ 21 | Hooks.on('setup', async () => { 22 | if (!isSheetOnly()) { 23 | return; 24 | } 25 | 26 | await setupClient(); 27 | }); 28 | 29 | /* Wildshape, Polymorph etc */ 30 | Hooks.on('dnd5e.transformActor', async (fromActor, toActor) => { 31 | if (!isSheetOnly()) { 32 | return; 33 | } 34 | 35 | if (actorStorage.current?.id === fromActor.id) { 36 | actorStorage.current = toActor; 37 | } 38 | }); 39 | 40 | Hooks.once('ready', async function () { 41 | if (!isSheetOnly()) { 42 | const canvasDisabled = game.settings.get("core", "noCanvas"); 43 | const neverAsk = game.settings.get(moduleId, "neverAskCanvas"); 44 | 45 | if (canvasDisabled && !neverAsk) { 46 | enableCanvasDialog(); 47 | } 48 | 49 | return; 50 | } 51 | 52 | await userInitialization(); 53 | 54 | setupContainer(); 55 | rebuildActorList() 56 | await popupSheet(); 57 | hideUnusedElements(); 58 | 59 | addEventListener("resize", onResize); 60 | 61 | dnd5eReadyHook(); 62 | }); 63 | 64 | Hooks.on('renderActorSheetV2', async (app, _sheet, {actor}) => { 65 | if (currentSheet?.id === app.id || !isSheetOnly()) { 66 | return; 67 | } 68 | 69 | currentSheet?.close(); 70 | currentSheet = app; 71 | 72 | app?.setPosition({ 73 | left: 0, 74 | top: 0, 75 | width: window.innerWidth, 76 | height: window.innerHeight 77 | }); 78 | 79 | app.classList.add('sheet-only-sheet'); 80 | 81 | $(".window-resizable-handle").hide(); 82 | 83 | getTokenizerImage(); 84 | 85 | if (actor) { 86 | await switchToActor(actor, false); 87 | } 88 | } 89 | ); 90 | 91 | Hooks.on('createActor', async function (actor) { 92 | if (!isSheetOnly()) { 93 | return; 94 | } 95 | 96 | if (isActorOwnedByUser(actor)) { 97 | rebuildActorList(); 98 | await switchToActor(actor); 99 | } 100 | }); 101 | 102 | Hooks.on('deleteActor', async function (actor) { 103 | if (!isSheetOnly()) { 104 | return; 105 | } 106 | 107 | if (isActorOwnedByUser(actor)) { 108 | rebuildActorList(); 109 | 110 | if (actor === actorStorage.current) { 111 | // We need to pop up the sheet for another character the user owns 112 | await popupSheet() 113 | } 114 | } 115 | }); 116 | 117 | Hooks.on('renderContainerSheet', async (app, html) => { 118 | if (!isSheetOnly()) { 119 | return; 120 | } 121 | 122 | app.setPosition({ 123 | left: window.innerWidth, 124 | top: 0, 125 | width: 1, // It will adjust to its minimum width 126 | height: window.innerHeight // It will adjust to its minimum height 127 | }) 128 | html.css('z-index', '99999'); 129 | }); 130 | 131 | Hooks.once('closeUserConfig', async () => { 132 | if (!isSheetOnly()) { 133 | return; 134 | } 135 | // Popup sheet after user selected their character 136 | await popupSheet() 137 | }); 138 | 139 | Hooks.on('renderSettingsConfig', async (app, element, settings) => { 140 | if (!isSheetOnly()) { 141 | return; 142 | } 143 | 144 | app.setPosition({zIndex: 2000}) 145 | 146 | if (window.innerWidth < 600) { 147 | app.setPosition({ 148 | top: 0, 149 | left: 0, 150 | width: window.innerWidth, 151 | height: window.innerHeight 152 | }) 153 | 154 | const content = element.querySelector('.window-content'); 155 | 156 | if (content) { 157 | content.style.flexDirection = 'column' 158 | content.style.overflowY = 'auto'; 159 | content.style.maxHeight = '100vh'; 160 | } 161 | } 162 | }) 163 | 164 | 165 | /* ************************************* */ 166 | 167 | async function setupClient() { 168 | controlCanvas() 169 | } 170 | 171 | function controlCanvas() { 172 | const setting = game.settings.get("sheet-only", "canvas-option"); 173 | const coreIsDisabled = game.settings.get("core", "noCanvas"); 174 | 175 | if (setting === 'Disabled' && !coreIsDisabled) { 176 | game.settings.set("core", "noCanvas", true); 177 | foundry.utils.debouncedReload(); 178 | } else if (setting === 'Hidden') { 179 | hideCanvas(); 180 | 181 | if (coreIsDisabled) { 182 | game.settings.set("core", "noCanvas", false); 183 | foundry.utils.debouncedReload(); 184 | } 185 | } 186 | } 187 | 188 | function setupContainer() { 189 | const sheetContainer = $('
').addClass('sheet-only-container'); 190 | 191 | $('body').append(sheetContainer); 192 | sheetContainer.append( 193 | $('
') 194 | .css({'padding-top': '40px'}) 195 | .addClass('sheet-only-actor-list') 196 | .attr('id', 'sheet-only-actor-list') 197 | ); 198 | 199 | // Add control buttons depending on browser 200 | if (navigator.userAgent.indexOf("Firefox") !== -1) { 201 | console.log("Adding font-size buttons for firefox"); 202 | addControlButtons(sheetContainer, FirefoxZoom.increaseZoom, FirefoxZoom.decreaseZoom, FirefoxZoom.resetZoom); 203 | } else { 204 | console.log("Adding zoom buttons"); 205 | addControlButtons(sheetContainer, DefaultZoom.increaseZoom, DefaultZoom.decreaseZoom, DefaultZoom.resetZoom); 206 | } 207 | } 208 | 209 | function getTokenizerImage() { 210 | let actors = getOwnedActors(); 211 | actors.map(actor => { 212 | let actorImg = actor.img; 213 | let sheet = $('#ActorSheet5eCharacter-Actor-' + actor._id)[0]; 214 | if (sheet !== undefined) { 215 | if (actorImg.includes('tokenizer') 216 | && actorImg.includes('Avatar')) { 217 | actorImg = actorImg.replace('Avatar', 'Token'); 218 | $('.sheet-only-container .sheet-header img.profile')[0].src = actorImg; 219 | } 220 | } 221 | }); 222 | } 223 | 224 | function hideUnusedElements() { 225 | $("#interface").addClass("sheet-only-hide"); 226 | $("#pause").addClass("sheet-only-hide"); 227 | 228 | $("#tooltip").addClass("sheet-only-hide"); 229 | 230 | if (!game.settings.get("sheet-only", "display-notifications")) { 231 | $("#notifications").addClass("sheet-only-hide"); 232 | } 233 | } 234 | 235 | export function isSheetOnly() { 236 | 237 | let playerdata = game.settings.get("sheet-only", 'playerdata'); 238 | let user = game.user; 239 | let userData = playerdata[user.id]; 240 | 241 | if (userData) { 242 | const useSheetOnly = userData.display; 243 | 244 | if (useSheetOnly) { 245 | const screenWidthToIgnoreSheetOnly = userData.screenwidth; 246 | 247 | if (screenWidthToIgnoreSheetOnly <= 0) { 248 | // We ignore screen size 249 | return true; 250 | } 251 | 252 | if (screen.width < screenWidthToIgnoreSheetOnly) { 253 | // If the mobile value is set, the screen width must be smaller than the set value to get sheet-only activated 254 | return true; 255 | } 256 | } 257 | } 258 | 259 | return false; 260 | } 261 | 262 | function userInitialization() { 263 | return new Promise((resolve, reject) => { 264 | let count = 0; 265 | const checkApiInterval = setInterval(() => { 266 | if (count % 10 === 0) { 267 | ui.notifications.info(i18n("Sheet-Only.display-notifications.wait-init")); 268 | } 269 | 270 | const ownedActors = getOwnedActors(); 271 | 272 | if (ownedActors && ownedActors.length > 0) { 273 | ui.notifications.info(i18n("Sheet-Only.notifications.ownedActorFound")); 274 | clearInterval(checkApiInterval); 275 | resolve(); 276 | } else if (count >= 500) { 277 | ui.notifications.error(i18n("Sheet-Only.notifications.actorInitError")); 278 | clearInterval(checkApiInterval); 279 | reject(new Error("Could not initialize actor.")); 280 | } else { 281 | count++; 282 | } 283 | }, 500); 284 | }); 285 | } 286 | 287 | async function popupSheet() { 288 | const ownedActors = getOwnedActors(); 289 | const lastActorId = getLastActorId(); 290 | 291 | // Attempt to open the last used actor 292 | if (lastActorId) { 293 | const lastActor = game.actors.get(lastActorId); 294 | const actorIsOwned = ownedActors.some(actor => actor.id === lastActorId); 295 | 296 | if (lastActor && actorIsOwned) { 297 | await switchToActor(lastActor); 298 | return; // Exit the function if the last actor was successfully loaded 299 | } else { 300 | console.log("The saved actor could not be found, opening the first actor."); 301 | } 302 | } 303 | 304 | // Open the first actor in the list if no saved actor was found or could not be loaded 305 | if (ownedActors?.length > 0) { 306 | await switchToActor(ownedActors[0]); 307 | } else { 308 | console.error("No actor for user found."); 309 | } 310 | } 311 | 312 | function onResize(event) { 313 | 314 | currentSheet?.setPosition({ 315 | width: window.innerWidth, 316 | height: window.innerHeight 317 | }); 318 | } 319 | -------------------------------------------------------------------------------- /scripts/settings.js: -------------------------------------------------------------------------------- 1 | import {i18n} from "./utils.js"; 2 | import {updateChatFullscreen} from "./chat.js"; 3 | import {isDnd5e} from "./system-specific/dnd5e/dnd5e.js"; 4 | 5 | export const moduleId = "sheet-only"; 6 | 7 | Hooks.on('init', () => { 8 | game.settings.registerMenu(moduleId, "settingsMenu", { 9 | name: i18n("Sheet-Only.settingsMenu.name"), 10 | label: i18n("Sheet-Only.settingsMenu.label"), 11 | hint: i18n("Sheet-Only.settingsMenu.hint"), 12 | icon: "fas fa-users", 13 | type: PlayerSelectionMenu, 14 | restricted: true 15 | }); 16 | 17 | game.settings.register(moduleId, "display-notifications", { 18 | name: i18n("Sheet-Only.display-notifications.name"), 19 | hint: i18n("Sheet-Only.display-notifications.hint"), 20 | scope: "client", 21 | config: true, 22 | default: false, 23 | type: Boolean, 24 | requiresReload: true 25 | }); 26 | 27 | game.settings.register(moduleId, "chat-fullscreen", { 28 | name: i18n("Sheet-Only.chat-full-width.name"), 29 | hint: i18n("Sheet-Only.chat-full-width.hint"), 30 | scope: "client", 31 | config: true, 32 | default: false, 33 | type: Boolean, 34 | requiresReload: false, 35 | onChange: value => { 36 | updateChatFullscreen(value) 37 | } 38 | }); 39 | 40 | game.settings.register(moduleId, "open-chat-on-item-use", { 41 | name: i18n("Sheet-Only.open-chat-on-item-use.name"), 42 | hint: i18n("Sheet-Only.open-chat-on-item-use.hint"), 43 | scope: "client", 44 | config: isDnd5e(), 45 | default: true, 46 | type: Boolean, 47 | requiresReload: false 48 | }); 49 | 50 | game.settings.register(moduleId, "canvas-option", { 51 | name: i18n("Sheet-Only.canvas-option.name"), 52 | hint: i18n("Sheet-Only.canvas-option.hint"), 53 | scope: "client", 54 | config: true, 55 | type: String, 56 | choices: { 57 | "No-Control": "No Control", 58 | "Hidden": "Hide", 59 | "Disabled": "Disable" 60 | }, 61 | default: "Disabled", 62 | requiresReload: true 63 | }); 64 | 65 | game.settings.register(moduleId, "dragDuration", { 66 | name: i18n("Sheet-Only.drag.name"), 67 | hint: i18n("Sheet-Only.drag.hint"), 68 | scope: "client", 69 | config: true, 70 | type: Number, 71 | requiresReload: true, 72 | default: 500, 73 | }); 74 | 75 | game.settings.register(moduleId, "lastActorId", { 76 | scope: "client", 77 | config: false, 78 | type: String, 79 | default: "", 80 | }); 81 | 82 | game.settings.register(moduleId, "neverAskCanvas", { 83 | scope: "client", 84 | config: false, 85 | type: Boolean, 86 | default: false, 87 | }); 88 | 89 | game.settings.register(moduleId, "playerdata", { 90 | scope: "world", 91 | config: false, 92 | default: {}, 93 | type: Object, 94 | }); 95 | 96 | game.settings.register(moduleId, "show-bottom-bar", { 97 | name: i18n("Sheet-Only.show-bottom-bar.name"), 98 | hint: i18n("Sheet-Only.show-bottom-bar.hint"), 99 | scope: "client", 100 | config: true, 101 | default: true, 102 | type: Boolean, 103 | requiresReload: true 104 | }); 105 | 106 | volumeSettings(moduleId); 107 | }) 108 | 109 | function volumeSettings() { 110 | game.settings.register(moduleId, "volume_playlist", { 111 | name: i18n("Sheet-Only.volume.playlist.name"), 112 | scope: "client", 113 | config: true, 114 | range: {min: 0, max: 1.0, step: .1}, 115 | type: Number, 116 | default: 0.8, 117 | onChange: value => { 118 | game.settings.set("core", "globalPlaylistVolume", value) 119 | } 120 | }); 121 | 122 | game.settings.register(moduleId, "volume_ambience", { 123 | name: i18n("Sheet-Only.volume.ambience.name"), 124 | scope: "client", 125 | config: true, 126 | range: {min: 0, max: 1.0, step: .1}, 127 | type: Number, 128 | default: 0.8, 129 | onChange: value => { 130 | game.settings.set("core", "globalAmbientVolume", value) 131 | } 132 | }); 133 | 134 | game.settings.register(moduleId, "volume_interface", { 135 | name: i18n("Sheet-Only.volume.interface.name"), 136 | scope: "client", 137 | config: true, 138 | range: {min: 0, max: 1.0, step: .1}, 139 | type: Number, 140 | default: 0.8, 141 | onChange: value => { 142 | game.settings.set("core", "globalInterfaceVolume", value) 143 | } 144 | }); 145 | } 146 | 147 | class PlayerSelectionMenu extends FormApplication { 148 | constructor(options = {}) { 149 | super(options); 150 | } 151 | 152 | static get defaultOptions() { 153 | return foundry.utils.mergeObject(super.defaultOptions, { 154 | id: "sheet-only", 155 | title: "Sheet-Only", 156 | template: "./modules/sheet-only/templates/controller.html", 157 | width: 500, 158 | height: "auto", 159 | popOut: true 160 | }); 161 | } 162 | 163 | getData(options) { 164 | let playerdata = game.settings.get("sheet-only", 'playerdata'); 165 | 166 | let players = game.users.filter(u => !u.isGM) 167 | .map(u => { 168 | let data = playerdata[u.id] || {}; 169 | return foundry.utils.mergeObject({ 170 | id: u.id, 171 | name: u.name, 172 | img: u.avatar, 173 | display: false, 174 | mobile: false, 175 | screenwidth: 0, 176 | mirror: false, 177 | selection: false 178 | }, data); 179 | }); 180 | 181 | return { 182 | players: players 183 | }; 184 | } 185 | 186 | saveData() { 187 | let playerdata = game.settings.get("sheet-only", 'playerdata'); 188 | 189 | $('.item-list .item', this.element).each(function () { 190 | let id = this.dataset.itemId; 191 | let data = playerdata[id] || {}; 192 | 193 | data.display = $('.display', this).is(':checked'); 194 | data.mobile = $('.mobile', this).is(':checked'); 195 | data.screenwidth = $('.screenwidth', this).val() || 0; 196 | 197 | playerdata[id] = data; 198 | }); 199 | 200 | game.settings.set('sheet-only', 'playerdata', playerdata); 201 | 202 | this.close(); 203 | } 204 | 205 | activateListeners(html) { 206 | super.activateListeners(html); 207 | var that = this; 208 | 209 | $('.dialog-buttons.save', html).click($.proxy(this.saveData, this)); 210 | }; 211 | 212 | 213 | } 214 | -------------------------------------------------------------------------------- /scripts/system-specific/dnd5e/dnd5e.js: -------------------------------------------------------------------------------- 1 | import {openChat} from "../../chat.js"; 2 | import { moduleId } from "../../settings.js"; 3 | 4 | export function dnd5eReadyHook() { 5 | if (!isDnd5e()) { 6 | return 7 | } 8 | 9 | document.body.addEventListener("click", onActivate, true); 10 | 11 | Hooks.on("renderChatMessage", handleChatMessage) 12 | } 13 | 14 | export function isDnd5e() { 15 | return game.system.id === 'dnd5e'; 16 | } 17 | 18 | /** 19 | * Handle use items 20 | */ 21 | function handleChatMessage(message, _html, messageData){ 22 | const shouldOpenChat = game.settings.get(moduleId, "open-chat-on-item-use"); 23 | if(!shouldOpenChat) return; 24 | 25 | // Check if this user is the author of the message 26 | if (!messageData.author.isSelf) return; 27 | 28 | // Check if the messsage is usage of an item 29 | const useFlag = message.getFlag("dnd5e", "use") 30 | if (!useFlag) return; 31 | 32 | /** 33 | * Open chat and scroll to bottom. 34 | * It might be possible to scroll to the specific message. But from my experience, it doesn't worth the effort. 35 | * Since this message is highly likely to be the last message (Given that we're scrolling right after it is sent) 36 | */ 37 | openChat() 38 | game.messages.directory.scrollBottom(); 39 | } 40 | 41 | /** 42 | * Opens a tooltip 43 | * @param event 44 | */ 45 | function onActivate(event) { 46 | let element = event.target; 47 | 48 | while(element) { 49 | if (element.hasAttribute('data-tooltip-class')) { 50 | game.tooltip.activate(element); 51 | break; 52 | } 53 | element = element.parentElement; 54 | } 55 | } -------------------------------------------------------------------------------- /scripts/utils.js: -------------------------------------------------------------------------------- 1 | export function i18n(key) { 2 | return game.i18n.localize(key) 3 | } -------------------------------------------------------------------------------- /setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Syrious/foundryvtt-sheet-only/aaacd5815056ee1fc628db269ff94434b9b3ca05/setup.png -------------------------------------------------------------------------------- /styles/dnd5e.css: -------------------------------------------------------------------------------- 1 | /*DnD 5th Edition v1 (2.1.4 and lower)*/ 2 | .dnd5e.sheet.actor.character.sheet-only-sheet{ 3 | min-width: auto; 4 | } 5 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-header img.profile{ 6 | border: none; 7 | } 8 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-header .header-details{ 9 | border-left: 2px groove #eeede0; 10 | } 11 | 12 | @media (max-width: 800px) { 13 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-header { 14 | zoom: 0.85; 15 | } 16 | 17 | .dnd5e.sheet.actor.character.sheet-only-sheet .tab.attributes { 18 | zoom: 1.15 19 | } 20 | .dnd5e.sheet.actor.character.sheet-only-sheet .tab.inventory { 21 | zoom: 1.1 22 | } 23 | .dnd5e.sheet.actor.character.sheet-only-sheet .tab.features { 24 | zoom: 1.1 25 | } 26 | .dnd5e.sheet.actor.character.sheet-only-sheet .tab.spellbook { 27 | zoom: 1.1 28 | } 29 | } 30 | 31 | .dnd5e.sheet.actor.character.sheet-only-sheet .tab.attributes{ 32 | overflow: auto; 33 | } 34 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-navigation{ 35 | flex: 0 0 60px; 36 | flex-wrap: wrap; 37 | } 38 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-navigation .item{ 39 | flex: 1 0 25%; 40 | } 41 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-header .attributes .attribute{ 42 | flex: 1 0 33%; 43 | border:none; 44 | border-bottom: 2px groove #eeede0; 45 | border-left: 2px groove #eeede0; 46 | } 47 | .dnd5e.sheet.actor.character.sheet-only-sheet .skills-list{ 48 | flex: auto; 49 | } 50 | .dnd5e.sheet.actor.character.sheet-only-sheet .center-pane{ 51 | flex: 1 0 100%; 52 | overflow-y: visible; 53 | } 54 | 55 | @media (max-width: 800px) { 56 | /** General Responsive Changes */ 57 | .dnd5e.sheet.actor.character.sheet-only-sheet .header-details .summary { 58 | height: auto; 59 | } 60 | .dnd5e.sheet.actor.character.sheet-only-sheet .header-details .summary > li { 61 | min-width: 80px; 62 | min-width: min-content; 63 | height: auto; 64 | } 65 | .dnd5e.sheet.actor.character.sheet-only-sheet .header-details .summary > li input { 66 | min-width: 80px; 67 | } 68 | 69 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-navigation.tabs { 70 | column-gap: 24px; 71 | row-gap: 5px; 72 | padding-bottom: 10px; 73 | } 74 | 75 | .dnd5e.sheet.actor.character.sheet-only-sheet .sheet-navigation .item { 76 | margin: 0; 77 | } 78 | 79 | /** Inventory Responsive Changes */ 80 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency { 81 | margin: 0; 82 | gap: 2px; 83 | } 84 | 85 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > h3 { 86 | white-space: nowrap; 87 | } 88 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .denomination { 89 | margin-inline-start: 10px; 90 | font-size: 0; 91 | } 92 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .denomination::after { 93 | font-size: 12px; 94 | content: ""; 95 | } 96 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .pp::after { 97 | content: "P"; 98 | } 99 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .gp::after { 100 | content: "G"; 101 | } 102 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .ep::after { 103 | content: "E"; 104 | } 105 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .sp::after { 106 | content: "S"; 107 | } 108 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > .cp::after { 109 | content: "C"; 110 | } 111 | 112 | .dnd5e.sheet.actor.character.sheet-only-sheet .currency > input[type="text"] { 113 | margin-left:0px; 114 | max-inline-size: 30px; 115 | height: 30px; 116 | } 117 | 118 | /** Spellbook Responsive Changes */ 119 | .dnd5e.sheet.actor.character.sheet-only-sheet .spellbook-filters { 120 | justify-content: flex-start; 121 | 122 | } 123 | .dnd5e.sheet.actor.character.sheet-only-sheet .spellbook-filters > .filter-list { 124 | padding: 10px 0; 125 | max-width: none; 126 | flex-basis: 100%; 127 | max-width: 500px; 128 | } 129 | } 130 | 131 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list { 132 | list-style: none; 133 | margin: 0; 134 | padding: 0; 135 | overflow-y: auto; 136 | scrollbar-width: thin; 137 | color: #7a7971; 138 | } 139 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-list { 140 | list-style: none; 141 | margin: 0; 142 | padding: 0; 143 | max-height: 300px; 144 | overflow-y: auto; 145 | } 146 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-name { 147 | flex: 1; 148 | margin: 0; 149 | overflow: hidden; 150 | font-size: 13px; 151 | text-align: left; 152 | align-items: center; 153 | } 154 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-name h3, .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-name h4 { 155 | margin: 0; 156 | white-space: nowrap; 157 | overflow-x: hidden; 158 | } 159 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item { 160 | align-items: center; 161 | padding: 0 2px; 162 | border-bottom: 1px solid #c9c7b8; 163 | } 164 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item:last-child { 165 | border-bottom: none; 166 | } 167 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item .item-name { 168 | color: #191813; 169 | } 170 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item .item-name .item-image { 171 | flex: 0 0 30px; 172 | height: 30px; 173 | width: 30px; 174 | background-size: 30px; 175 | background-size: contain; 176 | background-repeat: no-repeat; 177 | background-position: center; 178 | border: none; 179 | margin-right: 5px; 180 | text-align: center; 181 | } 182 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item .item-name .item-image { 183 | flex: 0 0 48px; 184 | width: 48px; 185 | } 186 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-controls { 187 | flex: 0 0 90px; 188 | text-align: center; 189 | } 190 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-controls .item-control { 191 | flex: 0 0 25px; 192 | } 193 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .item-controls > input { 194 | margin: auto; 195 | } 196 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .items-header { 197 | height: 28px; 198 | margin: 2px 0; 199 | padding: 0; 200 | align-items: center; 201 | background: rgba(0, 0, 0, 0.05); 202 | border: 2px groove #eeede0; 203 | font-weight: bold; 204 | } 205 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .items-header .item-control { 206 | font-weight: normal; 207 | flex: 0 0 90px; 208 | font-size: 12px; 209 | text-align: center; 210 | } 211 | .sheet-only-container .dnd5e.sheet.sheet-only-sheet .items-list .items-header h3 { 212 | padding-left: 5px; 213 | font-family: "Modesto Condensed", "Palatino Linotype", serif; 214 | font-weight: 700; 215 | text-align: left; 216 | font-size: 16px; 217 | min-width: 60px; 218 | } 219 | 220 | /*DnD 5th Edition v2 (3.0.0 and higher)*/ 221 | .sheet-only-sheet.dnd5e2.sheet.actor.character { 222 | min-width: unset; 223 | min-height: unset; 224 | } 225 | .sheet-only-sheet.dnd5e2.sheet.actor.character .tab-details .tab-body { 226 | padding-top: 75px; 227 | } 228 | .sheet-only-sheet.dnd5e2.sheet.actor.character nav.tabs { 229 | flex-direction: row; 230 | gap: 0.1rem; 231 | z-index: 1; 232 | right: 20rem; 233 | left: auto; 234 | top: 104px; 235 | } 236 | .sheet-only-sheet.dnd5e2.sheet.actor.character nav.tabs > .item { 237 | justify-content: center; 238 | padding-right: 0; 239 | border-radius: 8px; 240 | } 241 | .sheet-only-sheet.dnd5e2.sheet.actor.character nav.tabs > .item.active, 242 | .sheet-only-sheet.dnd5e2.sheet.actor.character nav.tabs > .item:hover { 243 | margin-left: 0; 244 | } 245 | 246 | .sheet-only-sheet.dnd5e2.sheet.actor.character .sheet-header > .left .document-name { 247 | font-size: 2.4rem; 248 | } 249 | .sheet-only-sheet.dnd5e2.sheet.actor.character .sheet-header > .right > div:last-child { 250 | margin-top: -1rem; 251 | } 252 | .sheet-only-sheet.dnd5e2.sheet.actor.character .ability-scores .rows > .top { 253 | display: none; 254 | } 255 | .sheet-only-sheet.dnd5e2.sheet.actor.character .ability-scores .rows { 256 | padding: 10px 0; 257 | margin-top: 8.75rem; 258 | backdrop-filter: blur(2px); 259 | border-radius: 0 0 10px 10px; 260 | } 261 | 262 | .sheet-only-sheet.dnd5e2.sheet.actor.character nav.tabs > .item { 263 | justify-content: center; 264 | padding-right: 0; 265 | 266 | position: relative; 267 | border: none; 268 | border-radius: 4px; 269 | background: var(--dnd5e-color-black); 270 | color: var(--dnd5e-color-gold); 271 | width: 40px; 272 | height: 40px; 273 | margin: 0; 274 | box-shadow: 0 0 6px var(--dnd5e-shadow-45); 275 | font-size: var(--font-size-14); 276 | display: grid; 277 | place-content: center; 278 | line-height: normal; 279 | } 280 | 281 | .sheet-only-sheet.dnd5e2.sheet.actor.character nav.tabs > .item::after { 282 | content: ""; 283 | position: absolute; 284 | inset: 3px; 285 | border: 1px solid var(--dnd5e-color-gold); 286 | border-radius: 3px; 287 | } 288 | 289 | .sheet-only-sheet > header { 290 | display: flex; 291 | } 292 | 293 | .sheet-only-sheet > header a { 294 | display: none !important; 295 | } 296 | 297 | /** Quick Insert for Morph Search ** 298 | aside.tooltip -------------------------------------------------------------------------------- /styles/dnd5e_media.css: -------------------------------------------------------------------------------- 1 | @media only screen and (max-width: 500px) { 2 | .dnd5e.sheet.actor.character.sheet-only-sheet .item-detail.item-weight { 3 | display: none; 4 | } 5 | 6 | .dnd5e.sheet.actor.character.sheet-only-sheet .spell-school { 7 | display: none; 8 | } 9 | } 10 | 11 | @media only screen and (max-width: 575px) { 12 | .dnd5e.sheet.actor.character.sheet-only-sheet .item-detail.item-quantity { 13 | display: none; 14 | } 15 | 16 | .dnd5e.sheet.actor.character.sheet-only-sheet .spell-target { 17 | display: none; 18 | } 19 | } 20 | 21 | @media only screen and (max-width: 615px) { 22 | .dnd5e.sheet.actor.character.sheet-only-sheet .inventory-filters .currency h3 { 23 | display: none; 24 | } 25 | 26 | /* No images in chat log */ 27 | .sheet-only-chat ol#chat-log li img { 28 | /*display: none;*/ 29 | } 30 | 31 | } 32 | 33 | /*DnD 5th Edition v2 (3.0.0 and higher)*/ 34 | @media only screen and (max-width: 523px) { 35 | .sheet-only-sheet.dnd5e2.sheet.actor.character .ability-scores .rows > div { 36 | gap: 1rem; 37 | flex-wrap: wrap; 38 | } 39 | 40 | .sheet-only-sheet.dnd5e2.sheet.actor.character .ability-scores .ability-score { 41 | flex: 0 0 30%; 42 | } 43 | 44 | .sheet-only-sheet.dnd5e2.sheet.actor.character .tab-details .tab-body { 45 | padding-top: 160px; 46 | } 47 | 48 | .sheet-only-sheet.dnd5e2.sheet.actor.character .sheet-body .tab-body .tab.details { 49 | --skills-col-width: unset; 50 | grid-template-columns: 95vw; 51 | } 52 | } 53 | 54 | @media (max-width: 800px) { 55 | 56 | .dnd5e.sheet .sheet-navigation { 57 | gap: 10px; 58 | justify-content: space-around; 59 | } 60 | 61 | .dnd5e.sheet .sheet-navigation .item { 62 | margin: 0; 63 | } 64 | 65 | .dnd5e.polymorph section .two-column { 66 | /* grid-template-columns: 1fr; 67 | grid-auto-rows: auto; */ 68 | } 69 | 70 | .dnd5e.polymorph .two-column label.checkbox { 71 | height: fit-content; 72 | } 73 | } -------------------------------------------------------------------------------- /styles/main.css: -------------------------------------------------------------------------------- 1 | /*Sheet Only Styling*/ 2 | .sheet-only-hide, 3 | .sheet-only-sheet > header { 4 | display: none; 5 | } 6 | 7 | .sheet-only-sheet { 8 | position: relative; 9 | width: 100vw; 10 | height: 100dvh !important; 11 | transform-origin: top left; 12 | max-height: unset; 13 | 14 | } 15 | 16 | .sheet-only-container { 17 | position: absolute; 18 | display: flex; 19 | flex-direction: row; 20 | left: 0; 21 | top: 0; 22 | width: 100vw; 23 | height: 100dvh; 24 | justify-items: flex-start; 25 | overflow: hidden; 26 | } 27 | 28 | .sheet-only-container > .small-display-main-buttons { 29 | display: flex; 30 | flex-direction: row; 31 | z-index: 1000; 32 | } 33 | 34 | .sheet-only-container > .small-display-main-buttons .button { 35 | cursor: pointer; 36 | } 37 | 38 | .sheet-only-container > .small-display-main-buttons .button > i { 39 | vertical-align: middle; 40 | } 41 | 42 | 43 | .sheet-only-container > .button-container { 44 | display: flex; 45 | flex-direction: row; 46 | z-index: 1000; 47 | position: absolute; 48 | } 49 | 50 | #so-main-buttons, #so-settings-buttons, #so-menu-button { 51 | display: flex; 52 | flex-direction: row; 53 | justify-content: flex-start; 54 | align-items: center; 55 | } 56 | 57 | .sheet-only-container ~ .dialog { 58 | /* Needs important because foundry sets the dialog z-index to 105 on element.style */ 59 | z-index: 600 !important; 60 | } 61 | 62 | body.hidden-canvas canvas#board { 63 | display: none !important; 64 | } 65 | 66 | .sheet-only-actor-list { 67 | display: flex; 68 | flex-direction: column; 69 | background-color: rgb(0 0 0 / 90%); 70 | justify-items: flex-start; 71 | padding: 5px 5px 20vh; 72 | gap: 3px; 73 | flex-shrink: 0; 74 | position: absolute; 75 | z-index: 1001; 76 | height: 100dvh; 77 | width: 33vw; 78 | max-width: 200px; 79 | border-right: 10px solid rgb(68 68 68 / 90%); 80 | border-top-right-radius: 4px; 81 | border-bottom-right-radius: 4px; 82 | transition: all 250ms; 83 | overflow-y: scroll; 84 | } 85 | 86 | .sheet-only-actor-list.collapse { 87 | display: none !important; 88 | } 89 | 90 | .dragged { 91 | transform: scale(1.1); 92 | box-shadow: #191813 0 0 10px; 93 | overflow: hidden; 94 | } 95 | 96 | .dragged * { 97 | overflow: hidden; 98 | } 99 | 100 | /* chat input box */ 101 | .sheet-only-chat #chat-form, 102 | .sheet-only-chat #chat-controls, 103 | .sheet-only-chat .dice-tray { 104 | display: none; 105 | } 106 | 107 | .sheet-only-chat.collapse { 108 | display: none; 109 | } 110 | 111 | .sheet-only-actor-list img { 112 | border: none; 113 | } 114 | 115 | .sheet-only-chat-popout { 116 | right: 0; 117 | top: 0; 118 | } -------------------------------------------------------------------------------- /styles/main_media.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 800px) { 2 | .sheet-only-sheet.small-display { 3 | margin-top: 0; 4 | margin-bottom: 0; 5 | padding-bottom: 53px; 6 | } 7 | 8 | .sheet-only-container.small-display { 9 | padding-bottom: 53px; 10 | } 11 | 12 | .sheet-only-chat { 13 | padding-top: 35px; 14 | padding-bottom: 53px; 15 | } 16 | 17 | #so-main-buttons.small-display{ 18 | display: flex !important; 19 | position: fixed; 20 | bottom: 0; 21 | left: 0; 22 | right: 0; 23 | height: 50px; 24 | } 25 | 26 | #so-main-buttons.small-display > button { 27 | height: 100%; 28 | } 29 | 30 | #so-main-buttons.small-display > button > i { 31 | font-size: 24px; 32 | } 33 | 34 | /** Display jump fix */ 35 | #hud { 36 | display: none; 37 | } 38 | 39 | .sheet-only-sheet { 40 | margin-top: 0; 41 | margin-bottom: 0; 42 | } 43 | 44 | /* Item dialog improvements */ 45 | .window-app { 46 | min-width: auto !important; 47 | max-width: 100vw; 48 | } 49 | 50 | .window-app.sheet.item { 51 | min-width: 100vw !important; 52 | max-height: 85%; 53 | } 54 | 55 | /* For Real-Dice Module*/ 56 | body > div.real-roll { 57 | z-index: 10000 !important; 58 | top: 30dvh !important; 59 | left: calc(50dvw - 100px) !important; 60 | } 61 | 62 | /* v12 native manual roll resolver*/ 63 | body > .roll-resolver { 64 | z-index: 10000 !important; 65 | top: 30vh !important; 66 | left: 50% !important; 67 | transform: translateX(-50%); 68 | max-width: 100vw; 69 | } 70 | } 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /styles/tidy5e_media.css: -------------------------------------------------------------------------------- 1 | @media (max-width: 800px) { 2 | /** Override official tidy vars **/ 3 | .tidy5e-sheet:is(.character, .npc, .vehicle) form .tidy-sheet-body { 4 | --t5e-tab-contents-padding-top: .25rem; 5 | --t5e-tab-contents-padding-right: .25rem; 6 | --t5e-tab-contents-padding-bottom: .25rem; 7 | --t5e-tab-contents-padding-left: .25rem; 8 | } 9 | /** End of override **/ 10 | 11 | .tidy5e-sheet.actor.character.sheet-only-sheet { 12 | font-size: 16px; 13 | 14 | * { 15 | scrollbar-width: auto; 16 | } 17 | 18 | .tidy5e-sheet-header { 19 | --sheet-only-tiny5e-header-left-width: 30dvw; 20 | --sheet-only-tiny5e-header-portrait-size: 25dvw; 21 | --sheet-only-tiny5e-header-right-width: 65dvw; 22 | 23 | display: revert; 24 | 25 | /** Header left **/ 26 | .flex-0 { 27 | width: var(--sheet-only-tiny5e-header-left-width); 28 | display: inline-block; 29 | 30 | .profile-wrap, 31 | .profile { 32 | max-width: var(--sheet-only-tiny5e-header-portrait-size); 33 | max-height: var(--sheet-only-tiny5e-header-portrait-size); 34 | } 35 | } 36 | 37 | /** Header right **/ 38 | .flex-grow-1 { 39 | display: inline-block; 40 | 41 | &>.flex-row:first-child { 42 | position: absolute; 43 | top: 0; 44 | right: 0; 45 | width: var(--sheet-only-tiny5e-header-right-width); 46 | height: 2rem; 47 | } 48 | 49 | &>.class-list { 50 | position: absolute; 51 | top: 2rem; 52 | right: 0; 53 | width: var(--sheet-only-tiny5e-header-right-width); 54 | height: 2rem; 55 | padding-top: 0; 56 | } 57 | 58 | &>.origin-summary { 59 | border: 0; 60 | 61 | position: absolute; 62 | top: 4rem; 63 | right: 0; 64 | width: var(--sheet-only-tiny5e-header-right-width); 65 | height: 4rem; 66 | line-height: 1rem; 67 | } 68 | 69 | &>.flex-row.extra-small-gap { 70 | position: absolute; 71 | top: 8rem; 72 | right: 0; 73 | width: var(--sheet-only-tiny5e-header-right-width); 74 | height: 2rem; 75 | 76 | .movement { 77 | padding: 0; 78 | } 79 | } 80 | 81 | /** Hide potential ddbImport button **/ 82 | &>.flex-row:first-child .ddbCharacterName { 83 | display: none; 84 | } 85 | 86 | &>.flex-row:nth-child(1)>.actor-name { 87 | flex: 0.8; 88 | } 89 | 90 | &>.flex-row:nth-child(1)>.flex-row:last-child { 91 | flex: 0.2; 92 | } 93 | 94 | 95 | &>.class-list { 96 | font-size: 18px; 97 | } 98 | 99 | 100 | &>.origin-summary { 101 | flex-direction: column; 102 | align-items: start; 103 | } 104 | 105 | &>.origin-summary>.origin-points { 106 | flex: 0.6; 107 | font-size: 14px; 108 | grid-template-columns: min-content min-content; 109 | grid-template-rows: min-content; 110 | column-gap: 1.25rem; 111 | } 112 | 113 | &>.origin-summary>.origin-points span:nth-child(2n) { 114 | display: none; 115 | } 116 | 117 | &>.origin-summary>.origin-points>button.configure-creature-type { 118 | text-align: left; 119 | } 120 | 121 | /* Proficiency */ 122 | &>.origin-summary>span.flex-row { 123 | flex: 0.4; 124 | font-size: 15px; 125 | align-items: start; 126 | width: 100%; 127 | } 128 | 129 | &>.flex-row:nth-child(4) { 130 | flex-direction: column; 131 | } 132 | 133 | /* Speed */ 134 | &>.flex-row:nth-child(4)>section.movement { 135 | font-size: 15px; 136 | flex: 1; 137 | } 138 | 139 | /* Concentration */ 140 | &>.flex-row:nth-child(4)>span.special-save { 141 | font-size: 20px; 142 | flex: 1; 143 | } 144 | 145 | /* Actor Stats */ 146 | &>.actor-stats { 147 | width: 100dvw; 148 | 149 | display: grid; 150 | grid-template-columns: 1fr 2fr 2fr 2fr; 151 | grid-template-rows: 1fr 1fr; 152 | grid-template-areas: 153 | "ac stat stat stat" 154 | "ini stat stat stat"; 155 | 156 | background: var(--t5e-header-background); 157 | } 158 | 159 | &>.actor-stats>.vertical-line-separator { 160 | display: none; 161 | } 162 | 163 | &>.actor-stats>.ac-display { 164 | grid-area: ac; 165 | } 166 | 167 | &>.actor-stats>.ac-display .ac-shield { 168 | width: 3rem; 169 | } 170 | 171 | &>.actor-stats>.ac-display button { 172 | font-size: 30px; 173 | } 174 | 175 | 176 | &>.actor-stats>div:nth-child(3) { 177 | grid-area: ini; 178 | 179 | .config-button { 180 | display: none; 181 | } 182 | } 183 | 184 | &>.actor-stats .ability-score-container { 185 | display: grid; 186 | grid-template-columns: 1fr 1fr 1fr 1fr; 187 | width: 80%; 188 | row-gap: 5px; 189 | } 190 | 191 | /* Stat score */ 192 | &>.actor-stats .ability-score-container>button { 193 | grid-column-start: span 4; 194 | } 195 | 196 | /* Stat score header */ 197 | &>.actor-stats .ability-score-container>button h4 { 198 | font-size: 25px; 199 | } 200 | 201 | &>.actor-stats .ability-score-container .block-score { 202 | padding-right: 5px; 203 | } 204 | 205 | &>.actor-stats .ability-score-container .ability-modifiers { 206 | grid-column-start: span 2; 207 | align-items: unset; 208 | } 209 | 210 | &>.actor-stats .ability-score-container .proficiency-toggle-readonly { 211 | position: absolute; 212 | top: 30%; 213 | right: 0; 214 | bottom: unset; 215 | left: unset; 216 | transform: translateX(150%); 217 | } 218 | 219 | } 220 | 221 | } 222 | 223 | /** End of Header **/ 224 | 225 | 226 | 227 | /** Navigation **/ 228 | nav.tidy-tabs { 229 | display: grid; 230 | grid-template-columns: repeat(3, auto); 231 | justify-content: unset; 232 | 233 | } 234 | 235 | nav.tidy-tabs>button.tab-option { 236 | font-size: 20px; 237 | } 238 | 239 | nav.tidy-tabs .sheet-edit-mode-toggle { 240 | display: none; 241 | } 242 | 243 | /** End of Navigation **/ 244 | 245 | /** Attributes Tab **/ 246 | .attributes-tab-contents { 247 | flex-direction: column; 248 | 249 | .side-panel { 250 | width: 100%; 251 | 252 | .skills-list { 253 | display: grid; 254 | grid-template-columns: 1fr 1fr; 255 | grid-template-rows: repeat(9, 1fr); 256 | column-gap: 0.5rem; 257 | grid-auto-flow: column; 258 | 259 | .skill { 260 | height: 1.5rem; 261 | 262 | & button { 263 | font-size: 1.1rem; 264 | line-height: 1.1rem; 265 | } 266 | 267 | font-size: 1rem; 268 | } 269 | } 270 | } 271 | } 272 | 273 | /** End of Attributes Tab **/ 274 | 275 | /** General Table-Tab changes **/ 276 | .tidy-tab { 277 | 278 | .utility-toolbar { 279 | display: none; 280 | } 281 | 282 | .item-table-header-row { 283 | line-height: 2.5rem; 284 | 285 | .item-table-column, 286 | .item-table-column>span { 287 | font-size: 1.25rem; 288 | } 289 | 290 | i.expand-indicator { 291 | display: none; 292 | } 293 | } 294 | 295 | .item-table { 296 | .item-table-row { 297 | 298 | /* Item image and name */ 299 | .item-table-cell:nth-child(1) { 300 | .item-image { 301 | flex: 0 0 3rem; 302 | height: 3rem; 303 | } 304 | 305 | .item-name { 306 | font-size: 1.3rem; 307 | 308 | .ammo { 309 | display: none; 310 | } 311 | } 312 | } 313 | 314 | .item-table-cell { 315 | font-size: 1rem; 316 | } 317 | 318 | .tidy5e-classic-controls button { 319 | font-size: 1rem; 320 | } 321 | } 322 | 323 | /* Item expandable */ 324 | .expandable { 325 | 326 | p, 327 | li { 328 | font-size: 1.3rem; 329 | } 330 | } 331 | } 332 | } 333 | 334 | /** End of general Table-Tab changes **/ 335 | 336 | /** Action Tab **/ 337 | .tidy-tab.actions { 338 | .item-table { 339 | .item-table-row { 340 | 341 | /* Hide Uses */ 342 | .item-table-cell:nth-child(2)>.item-uses { 343 | display: none; 344 | } 345 | } 346 | } 347 | } 348 | 349 | /** End of Action Tab **/ 350 | 351 | /** Inventory Tab **/ 352 | .tidy-tab.inventory { 353 | /* Move money bar to the top */ 354 | flex-direction: column-reverse; 355 | 356 | /* Money bar */ 357 | .tab-footer { 358 | margin: -5px 0 1rem -1rem; 359 | 360 | .attunement-and-currency { 361 | gap: .25rem; 362 | 363 | .attunement-tracker { 364 | padding-left: 0; 365 | margin-right: 0; 366 | } 367 | 368 | ol.currency { 369 | gap: .25rem; 370 | margin: 0; 371 | } 372 | } 373 | 374 | .currency-item.convert { 375 | display: none; 376 | } 377 | } 378 | 379 | .item-table-header-row { 380 | 381 | /* Hide Weight */ 382 | .item-table-column:nth-child(3) { 383 | display: none; 384 | } 385 | 386 | /* Hide Quantity */ 387 | .item-table-column:nth-child(6) { 388 | display: none; 389 | } 390 | } 391 | 392 | .item-table { 393 | .item-table-row { 394 | 395 | /* Hide Weight */ 396 | .item-table-cell:nth-child(3) { 397 | display: none; 398 | } 399 | 400 | /* Hide Quantity */ 401 | .item-table-cell:nth-child(6) { 402 | display: none; 403 | } 404 | } 405 | } 406 | } 407 | 408 | /** End of Inventory Tab **/ 409 | 410 | /** Spellbook Tab **/ 411 | .tidy-tab.spellbook { 412 | 413 | .item-table-header-row { 414 | 415 | /* Spell level */ 416 | .item-table-column:nth-child(2) { 417 | .spell-slot-markers { 418 | margin-left: 0.5rem; 419 | 420 | .pip { 421 | width: 1.25rem; 422 | height: 1.25rem; 423 | } 424 | } 425 | } 426 | 427 | /* Hide School */ 428 | .item-table-column:nth-child(4) { 429 | display: none; 430 | } 431 | 432 | /* Hide Target */ 433 | .item-table-column:nth-child(5) { 434 | display: none; 435 | } 436 | 437 | /* Hide Range */ 438 | .item-table-column:nth-child(6) { 439 | display: none; 440 | } 441 | } 442 | 443 | .item-table { 444 | .item-table-row { 445 | 446 | /* Hide School */ 447 | .item-table-cell:nth-child(3) { 448 | display: none; 449 | } 450 | 451 | /* Hide Target */ 452 | .item-table-cell:nth-child(4) { 453 | display: none; 454 | } 455 | 456 | /* Hide Range */ 457 | .item-table-cell:nth-child(5) { 458 | display: none; 459 | } 460 | } 461 | } 462 | 463 | .tab-footer { 464 | 465 | p, 466 | span { 467 | font-size: 1.25rem; 468 | } 469 | 470 | .spellcasting-attribute { 471 | display: none; 472 | } 473 | } 474 | } 475 | 476 | /** End of Spellbook Tab **/ 477 | 478 | /** Effects Tab **/ 479 | .tidy-tab.effects { 480 | 481 | .item-table-header-row { 482 | 483 | /* Hide Source */ 484 | .item-table-column:nth-child(2) { 485 | display: none; 486 | } 487 | } 488 | 489 | .item-table { 490 | .item-table-row { 491 | 492 | /* Item image and name */ 493 | .item-table-cell:nth-child(1) { 494 | .item-image { 495 | flex: 0 0 2rem; 496 | height: 2rem; 497 | } 498 | 499 | .item-name { 500 | font-size: 1.3rem; 501 | 502 | .ammo { 503 | display: none; 504 | } 505 | } 506 | } 507 | 508 | /* Hide Source */ 509 | .item-table-cell:nth-child(2) { 510 | display: none; 511 | } 512 | } 513 | } 514 | } 515 | 516 | /** End of Effects Tab **/ 517 | } 518 | } 519 | 520 | @media (max-width: 500px) { 521 | 522 | /** Header **/ 523 | .tidy5e-sheet.actor.character.sheet-only-sheet form .tidy5e-sheet-header { 524 | --sheet-only-tiny5e-header-left-width: 40dvw; 525 | --sheet-only-tiny5e-header-portrait-size: 25dvw; 526 | --sheet-only-tiny5e-header-right-width: 55dvw; 527 | padding: 0.25rem; 528 | 529 | .flex-0 { 530 | .profile-wrap { 531 | height: 32dvw; 532 | max-height: 32dvw; 533 | 534 | .profile { 535 | height: 32dvw; 536 | max-height: 32dvw; 537 | 538 | display: grid; 539 | grid-template-columns: var(--sheet-only-tiny5e-header-portrait-size) 8dvw 8dvw; 540 | grid-template-rows: 8dvw 8dvw 8dvw 8dvw; 541 | column-gap: .5dvw; 542 | row-gap: .5dvw; 543 | 544 | .portrait { 545 | grid-area: 1 / 1 / 4 / 1; 546 | } 547 | 548 | .exhaustion-container { 549 | grid-area: 1 / 3 / 1 / 3; 550 | position: relative; 551 | } 552 | 553 | .inspiration { 554 | position: relative; 555 | grid-area: 1 / 2 / 1 / 2; 556 | } 557 | 558 | .portrait-hp { 559 | position: revert; 560 | grid-area: 4 / 1 / 4 / 3; 561 | transform: revert; 562 | width: 41dvw; 563 | } 564 | 565 | .rest-container { 566 | position: revert; 567 | grid-area: 2 / 3 / 2 / 3; 568 | 569 | z-index: 10; 570 | } 571 | 572 | .portrait-hd { 573 | position: revert; 574 | grid-area: 2 / 2 / 2 / 2; 575 | } 576 | } 577 | } 578 | 579 | .profile-temp { 580 | input { 581 | font-size: 15px; 582 | flex: auto; 583 | } 584 | 585 | .temphp { 586 | text-align: left; 587 | } 588 | 589 | .max-temphp { 590 | font-size: 15px; 591 | text-align: right; 592 | } 593 | } 594 | } 595 | 596 | .flex-grow-1 { 597 | &>.origin-summary { 598 | height: 1.5rem; 599 | 600 | &>.origin-points { 601 | display: none; 602 | } 603 | } 604 | 605 | &>.flex-row.extra-small-gap { 606 | top: 5.5rem; 607 | } 608 | 609 | .button-menu-wrapper { 610 | display: none; 611 | } 612 | 613 | &>.actor-stats { 614 | &>div { 615 | margin-top: auto; 616 | margin-bottom: auto; 617 | 618 | .ability-score-container { 619 | grid-template-columns: 1fr 1fr 1fr; 620 | 621 | &>button { 622 | grid-column-start: span 3; 623 | } 624 | 625 | .block-score { 626 | padding-right: 0; 627 | grid-column-start: 2; 628 | } 629 | 630 | .ability-modifiers { 631 | display: none; 632 | 633 | } 634 | } 635 | } 636 | 637 | .ini-bonus { 638 | display: none; 639 | } 640 | } 641 | } 642 | } 643 | 644 | 645 | 646 | /** Attributes Tab **/ 647 | .tidy5e-sheet.actor.character.sheet-only-sheet { 648 | & .attributes-tab-contents { 649 | & .side-panel { 650 | .skills-list { 651 | grid-template-columns: 1fr; 652 | grid-template-rows: repeat(18, 1fr); 653 | } 654 | } 655 | } 656 | } 657 | 658 | /** End of Attributes Tab **/ 659 | 660 | /** General Table-Tab **/ 661 | .tidy5e-sheet.actor.character.sheet-only-sheet { 662 | & .tidy-tab { 663 | .item-table-header-row { 664 | .item-table-column:last-child { 665 | display: none; 666 | } 667 | } 668 | 669 | .item-table-row { 670 | .item-table-cell:last-child { 671 | display: none; 672 | } 673 | } 674 | } 675 | } 676 | 677 | /** Actions Tab **/ 678 | .tidy5e-sheet.actor.character.sheet-only-sheet { 679 | & .tidy-tab.actions { 680 | .item-table-header-row { 681 | 682 | /* Hide Range */ 683 | .item-table-column:nth-child(3) { 684 | display: none; 685 | } 686 | 687 | /* Hide Hit / DC */ 688 | .item-table-column:nth-child(4) { 689 | display: none; 690 | } 691 | } 692 | 693 | .item-table-row { 694 | 695 | /* Hide Range */ 696 | .item-table-cell:nth-child(2) { 697 | display: none; 698 | } 699 | 700 | /* Hide Hit / DC */ 701 | .item-table-cell:nth-child(3) { 702 | display: none; 703 | } 704 | } 705 | } 706 | } 707 | 708 | /** End of Actions Tab **/ 709 | 710 | /** Features Tab **/ 711 | .tidy5e-sheet.actor.character.sheet-only-sheet { 712 | & .tidy-tab.features { 713 | .item-table-header-row { 714 | 715 | .item-table-column.primary { 716 | white-space: nowrap; 717 | } 718 | 719 | /* Hide Requirements */ 720 | .item-table-column:nth-last-child(2) { 721 | display: none; 722 | } 723 | } 724 | 725 | .item-table-row { 726 | 727 | /* Hide Range */ 728 | .item-table-cell:nth-last-child(2) { 729 | display: none; 730 | } 731 | } 732 | } 733 | } 734 | 735 | /** End of Features Tab **/ 736 | } -------------------------------------------------------------------------------- /templates/buttons-small-display.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 23 |
24 | 25 | 34 | 35 |
36 | 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /templates/buttons.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 |
12 | 16 | 17 | 18 | 19 | 20 | 21 | 27 |
28 | 29 | 38 | 39 |
40 | 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /templates/controller.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
    6 |
  1. 7 |

    {{localize 'Sheet-Only.players'}}

    8 | 9 | 10 | 11 |
    12 | 13 |
    14 |
    15 | 16 |
    17 | 18 |
  2. 19 | 20 |
      21 | {{#each players}} 22 |
    1. 23 |
      24 |

      25 | {{this.name}} 26 |

      27 |
      28 |
      29 | 30 |
      31 |
      32 | 33 |
      34 |
    2. 35 | {{/each}} 36 |
    37 |
38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 |
46 | --------------------------------------------------------------------------------