Merge pull request 'Add a way to choose whether a sheet is the toggled mode or the always-editing mode.' (#20) from feature/edit-mode-setting into main
Reviewed-on: #20
This commit is contained in:
commit
47e5eab951
5 changed files with 21 additions and 3 deletions
|
|
@ -29,7 +29,8 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sheet-names": {
|
"sheet-names": {
|
||||||
"PlayerSheet": "Player Sheet"
|
"PlayerSheet": "Player Sheet",
|
||||||
|
"SingleModePlayerSheet": "Player Sheet (Always Editing)"
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
"Key": "Key",
|
"Key": "Key",
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,9 @@ export class PlayerSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
};
|
};
|
||||||
|
|
||||||
async _prepareContent(ctx) {
|
async _prepareContent(ctx) {
|
||||||
|
// Whether or not the prose-mirror is toggled or always-edit
|
||||||
|
ctx.toggled = true;
|
||||||
|
|
||||||
const TextEditor = foundry.applications.ux.TextEditor.implementation;
|
const TextEditor = foundry.applications.ux.TextEditor.implementation;
|
||||||
ctx.enriched = {
|
ctx.enriched = {
|
||||||
system: {
|
system: {
|
||||||
|
|
|
||||||
8
module/apps/SingleModePlayerSheet.mjs
Normal file
8
module/apps/SingleModePlayerSheet.mjs
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
import { PlayerSheet } from "./PlayerSheet.mjs";
|
||||||
|
|
||||||
|
export class SingleModePlayerSheet extends PlayerSheet {
|
||||||
|
async _prepareContent(ctx) {
|
||||||
|
await super._prepareContent(ctx);
|
||||||
|
ctx.toggled = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
// Apps
|
// Apps
|
||||||
import { PlayerSheet } from "../apps/PlayerSheet.mjs";
|
import { PlayerSheet } from "../apps/PlayerSheet.mjs";
|
||||||
|
import { SingleModePlayerSheet } from "../apps/SingleModePlayerSheet.mjs";
|
||||||
|
|
||||||
// Data Models
|
// Data Models
|
||||||
import { PlayerData } from "../data/Player.mjs";
|
import { PlayerData } from "../data/Player.mjs";
|
||||||
|
|
@ -39,6 +40,11 @@ Hooks.on(`init`, () => {
|
||||||
label: `taf.sheet-names.PlayerSheet`,
|
label: `taf.sheet-names.PlayerSheet`,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
foundry.documents.collections.Actors.registerSheet(
|
||||||
|
__ID__,
|
||||||
|
SingleModePlayerSheet,
|
||||||
|
{ label: `taf.sheet-names.SingleModePlayerSheet` },
|
||||||
|
);
|
||||||
|
|
||||||
registerWorldSettings();
|
registerWorldSettings();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
value="{{system.content}}"
|
value="{{system.content}}"
|
||||||
collaborate="true"
|
collaborate="true"
|
||||||
data-document-uuid="{{actor.uuid}}"
|
data-document-uuid="{{actor.uuid}}"
|
||||||
toggled="true"
|
{{ifThen toggled "toggled" ""}}
|
||||||
>
|
>
|
||||||
{{{ enriched.system.content }}}
|
{{{ enriched.system.content }}}
|
||||||
</prose-mirror>
|
</prose-mirror>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue