Edit Sperre für Charakter
This commit is contained in:
1 parent
0da6fa67ac
commit
5da7534d91
9 files changed
+111
-68
No files matched your search
+2
-1
@@ -94,7 +94,8 @@
|
|||||||
"effects": "Effekte",
|
"effects": "Effekte",
|
||||||
"zauber": "Zauber",
|
"zauber": "Zauber",
|
||||||
"biographie": "Biographie",
|
"biographie": "Biographie",
|
||||||
"hintergrund": "Hintergrund"
|
"hintergrund": "Hintergrund",
|
||||||
|
"sperre": "Sperre"
|
||||||
},
|
},
|
||||||
"spezialisierung": "Spezialisierung"
|
"spezialisierung": "Spezialisierung"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
function defineSchema() {
|
function defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
|
locked: new fields.BooleanField({ initial: false }),
|
||||||
biographie: new fields.SchemaField({
|
biographie: new fields.SchemaField({
|
||||||
mondgestalt: new fields.StringField({ initial: "" }),
|
mondgestalt: new fields.StringField({ initial: "" }),
|
||||||
abenteuertyp: new fields.StringField({ initial: "" }),
|
abenteuertyp: new fields.StringField({ initial: "" }),
|
||||||
|
|||||||
@@ -15,8 +15,9 @@ export const loadHelpers = async function () {
|
|||||||
return foundry.utils.getProperty(actor, arg);
|
return foundry.utils.getProperty(actor, arg);
|
||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper("isdefined", function (value) {
|
Handlebars.registerHelper("isdefined", function (value, options) {
|
||||||
return value !== undefined;
|
console.warn(value, value !== undefined);
|
||||||
|
return value !== undefined ? options.fn(this) : options.inverse(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper("localizeConcat", function (arg1, arg2) {
|
Handlebars.registerHelper("localizeConcat", function (arg1, arg2) {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
rollWeapon: this.#rollWeapon,
|
rollWeapon: this.#rollWeapon,
|
||||||
rollSpell: this.#rollSpell,
|
rollSpell: this.#rollSpell,
|
||||||
cycleEquip: this.#cycleEquip,
|
cycleEquip: this.#cycleEquip,
|
||||||
|
cycleLock: this.#cycleLock,
|
||||||
addSpezialisierung: addSpezialisierung,
|
addSpezialisierung: addSpezialisierung,
|
||||||
editSepzialisierung: editSepzialisierung,
|
editSepzialisierung: editSepzialisierung,
|
||||||
increaseDoc: this.#increaseDoc,
|
increaseDoc: this.#increaseDoc,
|
||||||
@@ -161,7 +162,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
flags: this.actor.flags,
|
flags: this.actor.flags,
|
||||||
config: CONFIG
|
config: CONFIG
|
||||||
});
|
});
|
||||||
|
console.warn(context);
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,6 +335,13 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async #cycleLock(event) {
|
||||||
|
const actor = this.actor;
|
||||||
|
|
||||||
|
// Update the locked state
|
||||||
|
actor.update({ "system.locked": !actor.system.locked });
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -78,6 +78,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
input:disabled {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
input:focus {
|
input:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,11 +38,14 @@
|
|||||||
type="number"
|
type="number"
|
||||||
name="{{field.fieldPath}}"
|
name="{{field.fieldPath}}"
|
||||||
value="{{value}}"
|
value="{{value}}"
|
||||||
|
{{#if @root.system.locked}}disabled{{/if}}
|
||||||
/>
|
/>
|
||||||
<a
|
<a
|
||||||
data-action="addSpezialisierung"
|
data-action="addSpezialisierung"
|
||||||
data-name="{{field.label}}"
|
data-name="{{field.label}}"
|
||||||
data-path="{{field.fieldPath}}"
|
data-path="{{field.fieldPath}}"
|
||||||
|
{{#if @root.system.locked}}disabled{{/if}}
|
||||||
|
|
||||||
>+</a>
|
>+</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col d-flex flex-wrap" style="gap: 4px 8px; width: 100%">
|
<div class="col d-flex flex-wrap" style="gap: 4px 8px; width: 100%">
|
||||||
@@ -52,6 +55,8 @@
|
|||||||
data-level="{{level}}"
|
data-level="{{level}}"
|
||||||
data-path="{{path}}"
|
data-path="{{path}}"
|
||||||
style="white-space: nowrap;"
|
style="white-space: nowrap;"
|
||||||
|
{{#if @root.system.locked}}disabled{{/if}}
|
||||||
|
|
||||||
{{#unless @last}}style="margin-right: 4px"{{/unless}}>{{name}}: {{level}}{{#unless @last}},{{/unless}}</a>
|
{{#unless @last}}style="margin-right: 4px"{{/unless}}>{{name}}: {{level}}{{#unless @last}},{{/unless}}</a>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
@@ -84,6 +89,7 @@
|
|||||||
type="number"
|
type="number"
|
||||||
name="{{field.fieldPath}}"
|
name="{{field.fieldPath}}"
|
||||||
value="{{value}}"
|
value="{{value}}"
|
||||||
|
{{#if @root.system.locked}}disabled{{/if}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -117,6 +123,7 @@
|
|||||||
type="number"
|
type="number"
|
||||||
name="system.resources.leben.max"
|
name="system.resources.leben.max"
|
||||||
value="{{system.resources.leben.max}}"
|
value="{{system.resources.leben.max}}"
|
||||||
|
{{#if @root.system.locked}}disabled{{/if}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -142,6 +149,7 @@
|
|||||||
type="number"
|
type="number"
|
||||||
name="system.resources.ausdauer.max"
|
name="system.resources.ausdauer.max"
|
||||||
value="{{system.resources.ausdauer.max}}"
|
value="{{system.resources.ausdauer.max}}"
|
||||||
|
{{#if @root.system.locked}}disabled{{/if}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<input class="text" type="text" placeholder="{{localize "Midgard6.name"}}" name="name" value="{{actor.name}}" />
|
<input {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.name"}}" name="name" value="{{actor.name}}" />
|
||||||
<input class="text" type="text" placeholder="{{localize "Midgard6.Biographie.spezies"}}" name="system.biographie.spezies" value="{{system.biographie.spezies}}" />
|
<input {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.Biographie.spezies"}}" name="system.biographie.spezies" value="{{system.biographie.spezies}}" />
|
||||||
<input class="text" type="text" placeholder="{{localize "Midgard6.Biographie.kultur"}}" name="system.biographie.kultur" value="{{system.biographie.kultur}}" />
|
<input {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.Biographie.kultur"}}" name="system.biographie.kultur" value="{{system.biographie.kultur}}" />
|
||||||
</div>
|
</div>
|
||||||
<img
|
<img
|
||||||
class="profile-img"
|
class="profile-img"
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
height="100" width="100"
|
height="100" width="100"
|
||||||
>
|
>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.abenteuertyp"}}" name="system.biographie.abenteuertyp" value="{{system.biographie.abenteuertyp}}" />
|
<input {{#if @root.system.locked}}disabled{{/if}} class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.abenteuertyp"}}" name="system.biographie.abenteuertyp" value="{{system.biographie.abenteuertyp}}" />
|
||||||
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.glaube"}}" name="system.biographie.glaube" value="{{system.biographie.glaube}}" />
|
<input {{#if @root.system.locked}}disabled{{/if}} class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.glaube"}}" name="system.biographie.glaube" value="{{system.biographie.glaube}}" />
|
||||||
<input class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.mondgestalt"}}" name="system.biographie.mondgestalt" value="{{system.biographie.mondgestalt}}" />
|
<input {{#if @root.system.locked}}disabled{{/if}} class="text right" type="text" placeholder="{{localize "Midgard6.Biographie.mondgestalt"}}" name="system.biographie.mondgestalt" value="{{system.biographie.mondgestalt}}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -28,31 +28,31 @@
|
|||||||
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
|
<li class="item flexrow draggable" data-item-id="{{item._id}}" data-type="Item" data-document-class="Item">
|
||||||
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
||||||
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||||
<div class="document-controls">
|
{{#if @root.editable}}
|
||||||
<a
|
<div class="document-controls">
|
||||||
class="item-control"
|
<a
|
||||||
data-action="decreaseDoc"
|
|
||||||
data-item-id="{{item._id}}"
|
|
||||||
>
|
|
||||||
<i class="fas fa-minus"></i>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
class="item-control"
|
class="item-control"
|
||||||
data-action="increaseDoc"
|
data-action="decreaseDoc"
|
||||||
data-item-id="{{item._id}}"
|
data-item-id="{{item._id}}"
|
||||||
>
|
>
|
||||||
<i class="fas fa-plus"></i>
|
<i class="fas fa-minus"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
<a
|
||||||
<div class="document-controls">
|
class="item-control"
|
||||||
<a
|
data-action="increaseDoc"
|
||||||
class="item-control item-edit"
|
data-item-id="{{item._id}}"
|
||||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
>
|
||||||
data-action="viewDoc"
|
<i class="fas fa-plus"></i>
|
||||||
>
|
</a>
|
||||||
<i class="fas fa-edit"></i>
|
</div>
|
||||||
</a>
|
<div class="document-controls">
|
||||||
{{#if @root.editable}}
|
<a
|
||||||
|
class="item-control item-edit"
|
||||||
|
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||||
|
data-action="viewDoc"
|
||||||
|
>
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
class="item-control item-delete"
|
class="item-control item-delete"
|
||||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||||
@@ -60,8 +60,8 @@
|
|||||||
>
|
>
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -93,14 +93,14 @@
|
|||||||
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
||||||
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||||
<div class="document-controls">
|
<div class="document-controls">
|
||||||
<a
|
|
||||||
class="item-control item-edit"
|
|
||||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
|
||||||
data-action="viewDoc"
|
|
||||||
>
|
|
||||||
<i class="fas fa-edit"></i>
|
|
||||||
</a>
|
|
||||||
{{#if @root.editable}}
|
{{#if @root.editable}}
|
||||||
|
<a
|
||||||
|
class="item-control item-edit"
|
||||||
|
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||||
|
data-action="viewDoc"
|
||||||
|
>
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
class="item-control item-delete"
|
class="item-control item-delete"
|
||||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||||
@@ -146,24 +146,24 @@
|
|||||||
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||||
<a class="sword" data-action="cycleEquip" data-item-id="{{item._id}}" style="{{#if item.system.equipped}}background-color: var(--M6-text-brown){{/if}}">
|
<a class="sword" data-action="cycleEquip" data-item-id="{{item._id}}" style="{{#if item.system.equipped}}background-color: var(--M6-text-brown){{/if}}">
|
||||||
</a>
|
</a>
|
||||||
<div class="document-controls">
|
<div class="document-controls">
|
||||||
<a
|
{{#if @root.editable}}
|
||||||
class="item-control item-edit"
|
<a
|
||||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
class="item-control item-edit"
|
||||||
data-action="viewDoc"
|
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||||
>
|
data-action="viewDoc"
|
||||||
<i class="fas fa-edit"></i>
|
>
|
||||||
</a>
|
<i class="fas fa-edit"></i>
|
||||||
{{#if @root.editable}}
|
</a>
|
||||||
<a
|
<a
|
||||||
class="item-control item-delete"
|
class="item-control item-delete"
|
||||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||||
data-action="deleteDoc"
|
data-action="deleteDoc"
|
||||||
>
|
>
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -199,14 +199,14 @@
|
|||||||
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||||
<a class="fa-solid fa-shield" data-action="cycleEquip" data-item-id="{{item._id}}" style="{{#if item.system.equipped}}color: var(--M6-text-brown){{/if}}"></a>
|
<a class="fa-solid fa-shield" data-action="cycleEquip" data-item-id="{{item._id}}" style="{{#if item.system.equipped}}color: var(--M6-text-brown){{/if}}"></a>
|
||||||
<div class="document-controls">
|
<div class="document-controls">
|
||||||
<a
|
|
||||||
class="item-control item-edit"
|
|
||||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
|
||||||
data-action="viewDoc"
|
|
||||||
>
|
|
||||||
<i class="fas fa-edit"></i>
|
|
||||||
</a>
|
|
||||||
{{#if @root.editable}}
|
{{#if @root.editable}}
|
||||||
|
<a
|
||||||
|
class="item-control item-edit"
|
||||||
|
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||||
|
data-action="viewDoc"
|
||||||
|
>
|
||||||
|
<i class="fas fa-edit"></i>
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
class="item-control item-delete"
|
class="item-control item-delete"
|
||||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
class="progress-bar"
|
class="progress-bar"
|
||||||
value="{{gewicht.gewicht}}"
|
value="{{gewicht.gewicht}}"
|
||||||
max="{{gewicht.traglast}}"
|
max="{{gewicht.traglast}}"
|
||||||
>65%</progress>
|
></progress>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -16,4 +16,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
{{#isdefined system.locked}}
|
||||||
|
<a
|
||||||
|
class="sheet-stack {{cssClass}}"
|
||||||
|
data-tab="lock"
|
||||||
|
data-group="primary"
|
||||||
|
data-action="cycleLock"
|
||||||
|
data-tooltip="{{localize 'Midgard6.Sheets.Tabs.sperre'}}"
|
||||||
|
>
|
||||||
|
<div class="container">
|
||||||
|
<div class="background"></div>
|
||||||
|
<div class="border"></div>
|
||||||
|
<span class="value">
|
||||||
|
{{#if system.locked}}
|
||||||
|
<i class="fa fa-lock"></i>
|
||||||
|
{{else}}
|
||||||
|
<i class="fa fa-lock-open"></i>
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{{/isdefined}}
|
||||||
</nav>
|
</nav>
|
||||||
Reference in new issue
Block a user