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",
|
||||
"zauber": "Zauber",
|
||||
"biographie": "Biographie",
|
||||
"hintergrund": "Hintergrund"
|
||||
"hintergrund": "Hintergrund",
|
||||
"sperre": "Sperre"
|
||||
},
|
||||
"spezialisierung": "Spezialisierung"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
function defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
locked: new fields.BooleanField({ initial: false }),
|
||||
biographie: new fields.SchemaField({
|
||||
mondgestalt: new fields.StringField({ initial: "" }),
|
||||
abenteuertyp: new fields.StringField({ initial: "" }),
|
||||
|
||||
@@ -15,8 +15,9 @@ export const loadHelpers = async function () {
|
||||
return foundry.utils.getProperty(actor, arg);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper("isdefined", function (value) {
|
||||
return value !== undefined;
|
||||
Handlebars.registerHelper("isdefined", function (value, options) {
|
||||
console.warn(value, value !== undefined);
|
||||
return value !== undefined ? options.fn(this) : options.inverse(this);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper("localizeConcat", function (arg1, arg2) {
|
||||
|
||||
@@ -28,6 +28,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
rollWeapon: this.#rollWeapon,
|
||||
rollSpell: this.#rollSpell,
|
||||
cycleEquip: this.#cycleEquip,
|
||||
cycleLock: this.#cycleLock,
|
||||
addSpezialisierung: addSpezialisierung,
|
||||
editSepzialisierung: editSepzialisierung,
|
||||
increaseDoc: this.#increaseDoc,
|
||||
@@ -161,7 +162,7 @@ export class M6ActorSheet extends api.HandlebarsApplicationMixin(sheets.ActorShe
|
||||
flags: this.actor.flags,
|
||||
config: CONFIG
|
||||
});
|
||||
|
||||
console.warn(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 {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@@ -38,11 +38,14 @@
|
||||
type="number"
|
||||
name="{{field.fieldPath}}"
|
||||
value="{{value}}"
|
||||
{{#if @root.system.locked}}disabled{{/if}}
|
||||
/>
|
||||
<a
|
||||
data-action="addSpezialisierung"
|
||||
data-name="{{field.label}}"
|
||||
data-path="{{field.fieldPath}}"
|
||||
{{#if @root.system.locked}}disabled{{/if}}
|
||||
|
||||
>+</a>
|
||||
</div>
|
||||
<div class="col d-flex flex-wrap" style="gap: 4px 8px; width: 100%">
|
||||
@@ -52,6 +55,8 @@
|
||||
data-level="{{level}}"
|
||||
data-path="{{path}}"
|
||||
style="white-space: nowrap;"
|
||||
{{#if @root.system.locked}}disabled{{/if}}
|
||||
|
||||
{{#unless @last}}style="margin-right: 4px"{{/unless}}>{{name}}: {{level}}{{#unless @last}},{{/unless}}</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
@@ -84,6 +89,7 @@
|
||||
type="number"
|
||||
name="{{field.fieldPath}}"
|
||||
value="{{value}}"
|
||||
{{#if @root.system.locked}}disabled{{/if}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -117,6 +123,7 @@
|
||||
type="number"
|
||||
name="system.resources.leben.max"
|
||||
value="{{system.resources.leben.max}}"
|
||||
{{#if @root.system.locked}}disabled{{/if}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,6 +149,7 @@
|
||||
type="number"
|
||||
name="system.resources.ausdauer.max"
|
||||
value="{{system.resources.ausdauer.max}}"
|
||||
{{#if @root.system.locked}}disabled{{/if}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<input 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 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.name"}}" name="name" value="{{actor.name}}" />
|
||||
<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 {{#if @root.system.locked}}disabled{{/if}} class="text" type="text" placeholder="{{localize "Midgard6.Biographie.kultur"}}" name="system.biographie.kultur" value="{{system.biographie.kultur}}" />
|
||||
</div>
|
||||
<img
|
||||
class="profile-img"
|
||||
@@ -19,9 +19,9 @@
|
||||
height="100" width="100"
|
||||
>
|
||||
<div class="col-6">
|
||||
<input 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 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.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.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.mondgestalt"}}" name="system.biographie.mondgestalt" value="{{system.biographie.mondgestalt}}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,31 +28,31 @@
|
||||
<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" />
|
||||
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||
<div class="document-controls">
|
||||
<a
|
||||
class="item-control"
|
||||
data-action="decreaseDoc"
|
||||
data-item-id="{{item._id}}"
|
||||
>
|
||||
<i class="fas fa-minus"></i>
|
||||
</a>
|
||||
<a
|
||||
{{#if @root.editable}}
|
||||
<div class="document-controls">
|
||||
<a
|
||||
class="item-control"
|
||||
data-action="increaseDoc"
|
||||
data-action="decreaseDoc"
|
||||
data-item-id="{{item._id}}"
|
||||
>
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
<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}}
|
||||
>
|
||||
<i class="fas fa-minus"></i>
|
||||
</a>
|
||||
<a
|
||||
class="item-control"
|
||||
data-action="increaseDoc"
|
||||
data-item-id="{{item._id}}"
|
||||
>
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
<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>
|
||||
<a
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||
@@ -60,8 +60,8 @@
|
||||
>
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
@@ -93,14 +93,14 @@
|
||||
<img src="{{item.img}}" alt="{{item.name}}" width="24" height="24" />
|
||||
<div class="item-name">{{item.system.anzahl}}x {{item.name}}</div>
|
||||
<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}}
|
||||
<a
|
||||
class="item-control item-edit"
|
||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||
data-action="viewDoc"
|
||||
>
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||
@@ -146,24 +146,24 @@
|
||||
<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>
|
||||
<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}}
|
||||
<a
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||
data-action="deleteDoc"
|
||||
>
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<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
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||
data-action="deleteDoc"
|
||||
>
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
@@ -199,14 +199,14 @@
|
||||
<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>
|
||||
<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}}
|
||||
<a
|
||||
class="item-control item-edit"
|
||||
title="{{localize 'DOCUMENT.Update' type=item.name}}"
|
||||
data-action="viewDoc"
|
||||
>
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a
|
||||
class="item-control item-delete"
|
||||
title="{{localize 'DOCUMENT.Delete' type=item.name}}"
|
||||
@@ -231,7 +231,7 @@
|
||||
class="progress-bar"
|
||||
value="{{gewicht.gewicht}}"
|
||||
max="{{gewicht.traglast}}"
|
||||
>65%</progress>
|
||||
></progress>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -16,4 +16,25 @@
|
||||
</div>
|
||||
</a>
|
||||
{{/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>
|
||||
Reference in new issue
Block a user