repairs visuals advantages and special abilities
parent
523cbb9f62
commit
eb88377f14
|
|
@ -0,0 +1,45 @@
|
||||||
|
export default {
|
||||||
|
_prepareContext: async (context, options, object) => {
|
||||||
|
|
||||||
|
const actorData = context.document
|
||||||
|
context.system = actorData.system
|
||||||
|
context.flags = actorData.flags
|
||||||
|
context.derived = context.document.system
|
||||||
|
context.originalName = actorData.name
|
||||||
|
context.name = context.derived.name ?? actorData.name
|
||||||
|
context.effects = actorData.effects ?? []
|
||||||
|
context.advantages = []
|
||||||
|
|
||||||
|
actorData.itemTypes.Advantage.forEach((item) => {
|
||||||
|
context.advantages.push({
|
||||||
|
id: item._id,
|
||||||
|
name: item.name,
|
||||||
|
value: item.system.value,
|
||||||
|
options: item.system.auswahl,
|
||||||
|
description: item.system.description,
|
||||||
|
isAdvantage: !item.system.nachteil,
|
||||||
|
isDisadvantage: item.system.nachteil,
|
||||||
|
isBadAttribute: item.system.schlechteEigenschaft
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
context.specialAbilities = []
|
||||||
|
actorData.itemTypes.SpecialAbility.forEach((item) => {
|
||||||
|
context.specialAbilities.push({
|
||||||
|
id: item._id,
|
||||||
|
name: item.name,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return context
|
||||||
|
},
|
||||||
|
_onRender: (context, options) => {
|
||||||
|
|
||||||
|
},
|
||||||
|
_getTabConfig: (group) => {
|
||||||
|
group.tabs.push({id: "advsf", group: "sheet", label: "Vorteile"})
|
||||||
|
},
|
||||||
|
template: `systems/DSA_4-1/templates/actor/character/tab-advsf.hbs`
|
||||||
|
}
|
||||||
|
|
@ -1,128 +0,0 @@
|
||||||
export default {
|
|
||||||
_prepareContext: async (context, options, object) => {
|
|
||||||
|
|
||||||
const actorData = context.document
|
|
||||||
context.system = actorData.system
|
|
||||||
context.flags = actorData.flags
|
|
||||||
context.derived = context.document.system
|
|
||||||
context.originalName = actorData.name
|
|
||||||
context.name = context.derived.name ?? actorData.name
|
|
||||||
context.effects = actorData.effects ?? []
|
|
||||||
context.advantages = []
|
|
||||||
|
|
||||||
const getModsOfAttribute = async (keyPath, object) => {
|
|
||||||
let returnValue = [];
|
|
||||||
Array.from(object.appliedEffects).forEach(
|
|
||||||
(e) =>
|
|
||||||
e.changes.filter(c => c.key === keyPath).forEach(change => {
|
|
||||||
returnValue.push({
|
|
||||||
name: e.name,
|
|
||||||
value: change.value > 0 ? "+" + change.value : "" + change.value,
|
|
||||||
icon: e.icon,
|
|
||||||
})
|
|
||||||
}))
|
|
||||||
return returnValue
|
|
||||||
}
|
|
||||||
|
|
||||||
context.mods = {
|
|
||||||
"mu": await getModsOfAttribute('system.attribute.mu.mod', actorData),
|
|
||||||
"kl": await getModsOfAttribute('system.attribute.kl.mod', actorData),
|
|
||||||
"in": await getModsOfAttribute('system.attribute.in.mod', actorData),
|
|
||||||
"ch": await getModsOfAttribute('system.attribute.ch.mod', actorData),
|
|
||||||
"ff": await getModsOfAttribute('system.attribute.ff.mod', actorData),
|
|
||||||
"ge": await getModsOfAttribute('system.attribute.ge.mod', actorData),
|
|
||||||
"ko": await getModsOfAttribute('system.attribute.ko.mod', actorData),
|
|
||||||
"kk": await getModsOfAttribute('system.attribute.kk.mod', actorData),
|
|
||||||
"at": await getModsOfAttribute('system.at.mod', actorData),
|
|
||||||
"pa": await getModsOfAttribute('system.pa.mod', actorData),
|
|
||||||
"fk": await getModsOfAttribute('system.fk.mod', actorData),
|
|
||||||
}
|
|
||||||
|
|
||||||
context.attributes = [
|
|
||||||
{
|
|
||||||
eigenschaft: "mu",
|
|
||||||
name: "MU",
|
|
||||||
tooltip: "Mut",
|
|
||||||
wert: context.derived.attribute.mu.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "kl",
|
|
||||||
name: "KL",
|
|
||||||
tooltip: "Klugheit",
|
|
||||||
wert: context.derived.attribute.kl.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "in",
|
|
||||||
name: "IN",
|
|
||||||
tooltip: "Intuition",
|
|
||||||
wert: context.derived.attribute.in.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "ch",
|
|
||||||
name: "CH",
|
|
||||||
tooltip: "Charisma",
|
|
||||||
wert: context.derived.attribute.ch.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "ff",
|
|
||||||
name: "FF",
|
|
||||||
tooltip: "Fingerfertigkeit",
|
|
||||||
wert: context.derived.attribute.ff.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "ge",
|
|
||||||
name: "GE",
|
|
||||||
tooltip: "Geschicklichkeit",
|
|
||||||
wert: context.derived.attribute.ge.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "ko",
|
|
||||||
name: "KO",
|
|
||||||
tooltip: "Konstitution",
|
|
||||||
wert: context.derived.attribute.ko.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
eigenschaft: "kk",
|
|
||||||
name: "KK",
|
|
||||||
tooltip: "Körperkraft",
|
|
||||||
wert: context.derived.attribute.kk.aktuell ?? 0,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
Object.values(actorData.items).forEach((item) => {
|
|
||||||
if (item.type === "Advantage") {
|
|
||||||
context.advantages.push({
|
|
||||||
id: item._id,
|
|
||||||
name: item.name,
|
|
||||||
value: item.system.value,
|
|
||||||
options: item.system.auswahl,
|
|
||||||
description: item.system.description,
|
|
||||||
isAdvantage: !item.system.nachteil,
|
|
||||||
isDisadvantage: item.system.nachteil,
|
|
||||||
isBadAttribute: item.system.schlechteEigenschaft
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
context.specialAbilities = []
|
|
||||||
Object.values(actorData.items).forEach((item) => {
|
|
||||||
if (item.type === "SpecialAbility") {
|
|
||||||
context.specialAbilities.push({
|
|
||||||
id: item._id,
|
|
||||||
name: item.name,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return context
|
|
||||||
},
|
|
||||||
_onRender: (context, options) => {
|
|
||||||
|
|
||||||
},
|
|
||||||
_getTabConfig: (group) => {
|
|
||||||
group.tabs.push({id: "attributes", group: "sheet", label: "Eigenschaften"})
|
|
||||||
},
|
|
||||||
template: `systems/DSA_4-1/templates/actor/character/tab-attributes.hbs`
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import Attributes from "./character/attributes.mjs"
|
import Advsf from "./character/advsf.mjs"
|
||||||
import Combat from "./character/combat.mjs"
|
import Combat from "./character/combat.mjs"
|
||||||
import Effects from "./character/effects.mjs"
|
import Effects from "./character/effects.mjs"
|
||||||
import Equipment from "./character/equipment.mjs"
|
import Equipment from "./character/equipment.mjs"
|
||||||
|
|
@ -55,8 +55,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
social: {
|
social: {
|
||||||
template: Social.template
|
template: Social.template
|
||||||
},
|
},
|
||||||
attributes: {
|
advsf: {
|
||||||
template: Attributes.template
|
template: Advsf.template
|
||||||
},
|
},
|
||||||
combat: {
|
combat: {
|
||||||
template: Combat.template
|
template: Combat.template
|
||||||
|
|
@ -146,7 +146,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
|
const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
|
||||||
Meta._getTabConfig(tabs, this);
|
Meta._getTabConfig(tabs, this);
|
||||||
Social._getTabConfig(tabs, this);
|
Social._getTabConfig(tabs, this);
|
||||||
Attributes._getTabConfig(tabs, this)
|
Advsf._getTabConfig(tabs, this)
|
||||||
Combat._getTabConfig(tabs, this)
|
Combat._getTabConfig(tabs, this)
|
||||||
Equipment._getTabConfig(tabs, this)
|
Equipment._getTabConfig(tabs, this)
|
||||||
Skills._getTabConfig(tabs, this)
|
Skills._getTabConfig(tabs, this)
|
||||||
|
|
@ -341,8 +341,8 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
case "social":
|
case "social":
|
||||||
await Social._prepareContext(context, this.document)
|
await Social._prepareContext(context, this.document)
|
||||||
break
|
break
|
||||||
case "attributes":
|
case "advsf":
|
||||||
await Attributes._prepareContext(context, this.document)
|
await Advsf._prepareContext(context, this.document)
|
||||||
break
|
break
|
||||||
case "combat":
|
case "combat":
|
||||||
await Combat._prepareContext(context, this.document)
|
await Combat._prepareContext(context, this.document)
|
||||||
|
|
@ -369,7 +369,7 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||||
_onRender(context, options) {
|
_onRender(context, options) {
|
||||||
Meta._onRender(context, options, this.element)
|
Meta._onRender(context, options, this.element)
|
||||||
Social._onRender(context, options, this.element)
|
Social._onRender(context, options, this.element)
|
||||||
Attributes._onRender(context, options, this.element)
|
Advsf._onRender(context, options, this.element)
|
||||||
Combat._onRender(context, options, this.element)
|
Combat._onRender(context, options, this.element)
|
||||||
Effects._onRender(context, options, this.element)
|
Effects._onRender(context, options, this.element)
|
||||||
Equipment._onRender(context, options, this)
|
Equipment._onRender(context, options, this)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
label,
|
label,
|
||||||
.sheet-tabs.tabs a,
|
.sheet-tabs.tabs a,
|
||||||
h2 {
|
h2, h3 {
|
||||||
font-family: Gentium, sans-serif;
|
font-family: Gentium, sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,12 @@
|
||||||
@mixin tab {
|
@mixin tab {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.attribute {
|
.advantages-and-specialabilities {
|
||||||
padding: 8px 0;
|
|
||||||
display: flex;
|
|
||||||
gap: 0 8px;
|
|
||||||
|
|
||||||
label {
|
height: unset;
|
||||||
width: 120px;
|
display: unset;
|
||||||
text-align: right;
|
gap: 0;
|
||||||
vertical-align: middle;
|
padding: unset;
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
max-width: 80px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mod {
|
|
||||||
color: grey;
|
|
||||||
text-shadow: 0 -1px 0 #ccc;
|
|
||||||
box-Shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
|
|
||||||
border-radius: 4px;
|
|
||||||
height: 24px;
|
|
||||||
width: 24px;
|
|
||||||
background: linear-gradient(0deg, rgba(24, 24, 24, 1) 0%, rgba(80, 80, 80, 1) 100%);;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
vertical-align: middle;
|
|
||||||
line-height: 24px;
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.attributes-overview {
|
|
||||||
|
|
||||||
columns: 2;
|
|
||||||
gap: 0 16px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.resource-overview {
|
|
||||||
|
|
||||||
.attribute {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.advantages, .special-abilities {
|
.advantages, .special-abilities {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
|
|
@ -118,4 +76,5 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<section class="tab {{tabs.advsf.id}} {{tabs.advsf.cssClass}}"
|
||||||
|
data-tab="{{tabs.advsf.id}}"
|
||||||
|
data-group="{{tabs.advsf.group}}">
|
||||||
|
<div class="advantages-and-specialabilities">
|
||||||
|
<div class="advantages">
|
||||||
|
<h3>Vor- und Nachteile</h3>
|
||||||
|
<ul>
|
||||||
|
{{#each this.advantages}}
|
||||||
|
<li>{{> "systems/DSA_4-1/templates/ui/partial-advantage-button.hbs" this}}</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="special-abilities">
|
||||||
|
<h3>Sonderfertigkeiten</h3>
|
||||||
|
<ul>
|
||||||
|
{{#each this.specialAbilities}}
|
||||||
|
<li>{{> "systems/DSA_4-1/templates/ui/partial-sf-button.hbs" this}}</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
@ -1,161 +0,0 @@
|
||||||
<section class="tab {{tabs.attributes.id}} {{tabs.attributes.cssClass}}"
|
|
||||||
data-tab="{{tabs.attributes.id}}"
|
|
||||||
data-group="{{tabs.attributes.group}}">
|
|
||||||
|
|
||||||
<div class="attributes-overview">
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Mut</label>
|
|
||||||
<input value="{{this.system.attribute.mu.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.mu}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Klugheit</label>
|
|
||||||
<input value="{{this.system.attribute.kl.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.kl}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Intuition</label>
|
|
||||||
<input value="{{this.system.attribute.in.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.in}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Charisma</label>
|
|
||||||
<input value="{{this.system.attribute.ch.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.ch}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Fingerfertigkeit</label>
|
|
||||||
<input value="{{this.system.attribute.ff.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.ff}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Geschicklichkeit</label>
|
|
||||||
<input value="{{this.system.attribute.ge.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.ge}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Konstitution</label>
|
|
||||||
<input value="{{this.system.attribute.ko.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.ko}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Körperkraft</label>
|
|
||||||
<input value="{{this.system.attribute.kk.aktuell}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.kk}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Sozialstatus</label>
|
|
||||||
<input value="{{this.system.attribute.so.aktuell}}">
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>AT-Basis</label>
|
|
||||||
<input value="{{derived.at.basis}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.at}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>PA-Basis</label>
|
|
||||||
<input value="{{derived.pa.basis}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.pa}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="attribute">
|
|
||||||
<label>FK-Basis</label>
|
|
||||||
<input value="{{derived.fk.basis}}">
|
|
||||||
<div class="mods">
|
|
||||||
{{#each this.mods.fk}}
|
|
||||||
<span class="mod" title="{{this.name}}">{{this.value}}</span>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="resources-overview">
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Lebensenergie</label>
|
|
||||||
<input value="{{actor.system.lep.aktuell}}">
|
|
||||||
<input value="{{actor.system.lep.max}}">
|
|
||||||
</div>
|
|
||||||
{{#if ausdauer}}
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Ausdauer</label>
|
|
||||||
<input value="{{actor.system.aup.aktuell}}">
|
|
||||||
<input value="{{actor.system.aup.max}}">
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{#if hasSpells}}
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Astralenergie</label>
|
|
||||||
<input value="{{actor.system.asp.aktuell}}">
|
|
||||||
<input value="{{actor.system.asp.max}}">
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
{{#if hasLiturgies}}
|
|
||||||
<div class="attribute">
|
|
||||||
<label>Karmaenergie</label>
|
|
||||||
<input value="{{actor.system.kap.aktuell}}">
|
|
||||||
<input value="{{actor.system.kap.max}}">
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
<div class="advantages">
|
|
||||||
<h3>Vor- und Nachteile</h3>
|
|
||||||
<ul>
|
|
||||||
{{#each this.advantages}}
|
|
||||||
<li>{{> "systems/DSA_4-1/templates/ui/partial-advantage-button.hbs" this}}</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="special-abilities">
|
|
||||||
<h3>Sonderfertigkeiten</h3>
|
|
||||||
<ul>
|
|
||||||
{{#each this.specialAbilities}}
|
|
||||||
<li>{{> "systems/DSA_4-1/templates/ui/partial-sf-button.hbs" this}}</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</section>
|
|
||||||
Loading…
Reference in New Issue