restores drag and drop functionality for items onto character sheet
Pull Request Check / testing (pull_request) Successful in 21s Details

feature/applicationv2
macniel 2025-10-20 18:11:52 +02:00
parent ad28cf48f3
commit 321ba7d3d6
37 changed files with 434 additions and 417 deletions

View File

@ -1,12 +1,12 @@
import {Equipment} from "../documents/equipment.mjs";
const { const {
SchemaField, SchemaField,
NumberField, NumberField,
StringField, StringField,
HTMLField, HTMLField,
EmbeddedDocumentField,
DocumentIdField, DocumentIdField,
ArrayField, ArrayField,
ForeignDocumentField
} = foundry.data.fields; } = foundry.data.fields;
export class PlayerCharacterDataModel extends foundry.abstract.TypeDataModel { export class PlayerCharacterDataModel extends foundry.abstract.TypeDataModel {

View File

@ -1,7 +1,8 @@
import BaseItem from "./base-item.mjs"; import BaseItem from "./base-item.mjs";
import {Equipment} from "../documents/equipment.mjs";
const { const {
ArrayField, NumberField, StringField, HTMLField ArrayField, EmbeddedCollectionField, SchemaField, NumberField, StringField, HTMLField
} = foundry.data.fields; } = foundry.data.fields;
export class EquipmentDataModel extends BaseItem { export class EquipmentDataModel extends BaseItem {
@ -34,9 +35,23 @@ export class EquipmentDataModel extends BaseItem {
rangedAttackDamage: new StringField(), rangedAttackDamage: new StringField(),
rangedReloadTime: new NumberField({required: false}), rangedReloadTime: new NumberField({required: false}),
armorValue: new NumberField({required: false}), armorValue: new SchemaField({
total: new NumberField({required: true, initial: 0}),
arme: new NumberField({required: true, initial: 0}),
beine: new NumberField({required: true, initial: 0}),
rücken: new NumberField({required: true, initial: 0}),
bauch: new NumberField({required: true, initial: 0}),
brust: new NumberField({required: true, initial: 0}),
kopf: new NumberField({required: true, initial: 0}),
}, {required: false}),
armorHandicap: new NumberField({required: false}), armorHandicap: new NumberField({required: false}),
ammunition: new SchemaField({
max: new NumberField({required: true, initial: 1}),
count: new NumberField({required: true, initial: 1}),
}, {required: false}),
} }
} }
} }

View File

@ -35,8 +35,16 @@ export default {
return context return context
}, },
_onRender: (context, options) => { _onRender: (context, options, thisObject) => {
new foundry.applications.ux.DragDrop.implementation({
dropSelector: ".advantages, .special-abilities",
permissions: {
drop: thisObject._canDragDrop.bind(thisObject)
},
callbacks: {
drop: thisObject._onDrop.bind(thisObject),
}
}).bind(thisObject.element);
}, },
_getTabConfig: (group) => { _getTabConfig: (group) => {
group.tabs.push({id: "advsf", group: "sheet", label: "Vorteile"}) group.tabs.push({id: "advsf", group: "sheet", label: "Vorteile"})

View File

@ -137,7 +137,8 @@ export default {
}, },
callbacks: { callbacks: {
dragstart: thisObject._onDragStart.bind(thisObject), dragstart: thisObject._onDragStart.bind(thisObject),
drop: thisObject._onDrop.bind(thisObject) drop: thisObject._onDrop.bind(thisObject),
dragover: thisObject._onDragOver.bind(thisObject)
} }
}).bind(thisObject.element); }).bind(thisObject.element);

View File

@ -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)
Advsf._onRender(context, options, this.element) Advsf._onRender(context, options, this)
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)
@ -378,6 +378,11 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
Spells._onRender(context, options, this.element) Spells._onRender(context, options, this.element)
} }
async _canDragDrop() {
return true
}
// TODO needs to be fixed once Character Sheet is migrated to ActorSheetV2 // TODO needs to be fixed once Character Sheet is migrated to ActorSheetV2
async _onDrop(event) { async _onDrop(event) {
const data = TextEditor.implementation.getDragEventData(event); const data = TextEditor.implementation.getDragEventData(event);
@ -389,11 +394,14 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
const documentClass = foundry.utils.getDocumentClass(data.type); const documentClass = foundry.utils.getDocumentClass(data.type);
if (documentClass) { if (documentClass) {
const document = await documentClass.fromDropData(data); const document = await documentClass.fromDropData(data);
await this._onDropDocument(event, document);
// No duplication by moving items from one actor to another if (document.type === "Equipment" || document.type === "Advantage" || document.type === "Spell" || document.type === "Liturgy" || document.type === "ActiveEffect" || document.type === "SpecialAbility") {
if (document.parent) { // No duplication by moving items from one actor to another
document.parent.items.get(document._id).delete() if (document.parent && document.parent !== this.actor) {
document.parent.items.get(document._id).delete()
}
await this._onDropDocument(event, document);
} }
} }
} }

View File

@ -56,12 +56,16 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
ranged: { ranged: {
template: `systems/DSA_4-1/templates/item/equipment/tab-ranged.hbs` template: `systems/DSA_4-1/templates/item/equipment/tab-ranged.hbs`
}, },
container: { ammunition: {
template: `systems/DSA_4-1/templates/item/equipment/tab-container.hbs` template: `systems/DSA_4-1/templates/item/equipment/tab-ammunition.hbs`
}, },
armor: { armor: {
template: `systems/DSA_4-1/templates/item/equipment/tab-armor.hbs` template: `systems/DSA_4-1/templates/item/equipment/tab-armor.hbs`
} },
settings: {
template: `systems/DSA_4-1/templates/item/equipment/tab-settings.hbs`
},
} }
/** /**
@ -84,6 +88,17 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
} }
}) })
// manage categories into array
normalisedFormData['system.category'] = []
if (normalisedFormData.isMelee) normalisedFormData['system.category'].push("Nahkampfwaffe")
delete normalisedFormData.isMelee
if (normalisedFormData.isRanged) normalisedFormData['system.category'].push("Fernkampfwaffe")
delete normalisedFormData.isRanged
if (normalisedFormData.isAmmunition) normalisedFormData['system.category'].push("Munition")
delete normalisedFormData.isAmmunition
if (normalisedFormData.isArmor) normalisedFormData['system.category'].push("Rüstung")
delete normalisedFormData.isArmor
await this.document.update(normalisedFormData) // Note: formData.object await this.document.update(normalisedFormData) // Note: formData.object
} }
@ -98,12 +113,12 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
case 'ranged': case 'ranged':
this.#prepareRangedContext(context) this.#prepareRangedContext(context)
break; break;
case 'container':
this.#prepareContainerContext(context)
break;
case 'armor': case 'armor':
this.#prepareArmorContext(context) this.#prepareArmorContext(context)
break; break;
case 'settings':
this.#prepareSettingsContext(context)
break;
} }
context.tab = context.tabs[partId] context.tab = context.tabs[partId]
return context return context
@ -123,7 +138,6 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
Nahkampfwaffe: "Nahkampfwaffe", Nahkampfwaffe: "Nahkampfwaffe",
Fernkampfwaffe: "Fernkampfwaffe", Fernkampfwaffe: "Fernkampfwaffe",
Behälter: "Behälter", Behälter: "Behälter",
Rüstung: "Rüstung",
}, },
entries: equipmentData.category, entries: equipmentData.category,
targetField: "category" targetField: "category"
@ -171,7 +185,7 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
} }
} }
#prepareContainerContext(context) { #prepareAmmunitionContext(context) {
} }
@ -179,44 +193,49 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
} }
#prepareSettingsContext(context) {
context.isMelee = this.document.system.category.includes("Nahkampfwaffe")
context.isRanged = this.document.system.category.includes("Fernkampfwaffe")
context.isAmmunition = this.document.system.category.includes("Munition")
context.isArmor = this.document.system.category.includes("Rüstung")
}
/** /**
* Adds Tabs based on the items nature * Adds Tabs based on the items nature
* *
* @param {String} tabGroup * @param {String} group
* @private * @private
*/ */
_prepareTabs(tabGroup) { _getTabsConfig(group) {
const currentTabs = super._prepareTabs(tabGroup) const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
const category = this.document.system.category const category = this.document.system.category
/** /**
* *
* @type {[{ApplicationTab}]} * @type {[{ApplicationTab}]}
*/ */
let tabs = currentTabs
if (category.includes("Nahkampfwaffe")) { if (category.includes("Nahkampfwaffe")) {
tabs.melee = { tabs.tabs.push({
id: 'melee', group: tabGroup, label: 'Nahkampfwaffe' id: 'melee', group: group, label: 'Nahkampfwaffe'
} })
} }
if (category.includes("Fernkampfwaffe")) { if (category.includes("Fernkampfwaffe")) {
tabs.ranged = { tabs.tabs.push({
id: 'ranged', group: tabGroup, label: 'Fernkampfwaffe' id: 'ranged', group: group, label: 'Fernkampfwaffe'
} })
}
if (category.includes("Behälter")) {
tabs.container = {
id: 'container', group: tabGroup, label: 'Behälter'
}
} }
if (category.includes("Rüstung")) { if (category.includes("Rüstung")) {
tabs.armor = { tabs.tabs.push({
id: 'armor', group: tabGroup, label: 'Rüstung' id: 'armor', group: group, label: 'Rüstung'
} })
} }
tabs.tabs.push({
id: 'settings', group: group, label: 'Einstellungen'
})
return tabs return tabs
} }
@ -226,6 +245,8 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
const context = await super._prepareContext(options) const context = await super._prepareContext(options)
context.price = context.document.system.price context.price = context.document.system.price
context.weight = context.document.system.weight context.weight = context.document.system.weight
context.inventoryItems = []
context.containerVolume = context.document.system.containerVolume
return context return context
} }
@ -238,14 +259,38 @@ export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2)
* @protected * @protected
*/ */
_onRender(context, options) { _onRender(context, options) {
this.element.querySelector('.array-editor select').addEventListener('change', (evt) => {
const addingValue = evt.currentTarget.value
const fieldToTarget = evt.currentTarget.dataset.targetField
const newSkills = [...this.document.system[fieldToTarget], addingValue]
this.document.update({system: {[fieldToTarget]: newSkills}}) new foundry.applications.ux.DragDrop.implementation({
evt.currentTarget.value = "" dropSelector: ".inventory-table",
}) permissions: {
drop: this._canDragDrop.bind(this)
},
callbacks: {
drop: this._onDrop.bind(this)
}
}).bind(this.element);
}
_canDragDrop(event) {
console.log(event)
return true
}
async _onDrop(event) {
const data = TextEditor.implementation.getDragEventData(event);
// Dropped Documents
const documentClass = foundry.utils.getDocumentClass(data.type);
if (documentClass) {
const document = await documentClass.fromDropData(data)
console.log(document, document.parent)
// Dropped Documents
document.update({"parent": this.document})
}
} }
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Balläster)", "name": "Munition (Balläster)",
"image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.125, "weight": 0.125,
"price": 0.6, "price": 0.6,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Eisenwalder)", "name": "Munition (Eisenwalder)",
"image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0, "weight": 0,
"price": 1.5, "price": 1.5,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 10,
"parryModifier": 0, "count": 10
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Elfenbogen)", "name": "Munition (Elfenbogen)",
"image": "systems/DSA_4-1/assets/arsenal/arrow2.png", "image": "systems/DSA_4-1/assets/arsenal/arrow2.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.075, "weight": 0.075,
"price": 0.4, "price": 0.4,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Kompositbogen)", "name": "Munition (Kompositbogen)",
"image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.05, "weight": 0.05,
"price": 0.25, "price": 0.25,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Kriegsbogen)", "name": "Munition (Kriegsbogen)",
"image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.1, "weight": 0.1,
"price": 0.6, "price": 0.6,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Kurzbogen)", "name": "Munition (Kurzbogen)",
"image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.05, "weight": 0.05,
"price": 0.25, "price": 0.25,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Langbogen)", "name": "Munition (Langbogen)",
"image": "systems/DSA_4-1/assets/arsenal/arrow1.png", "image": "systems/DSA_4-1/assets/arsenal/arrow1.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.075, "weight": 0.075,
"price": 0.4, "price": 0.4,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Leichte Armbrust)", "name": "Munition (Leichte Armbrust)",
"image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.075, "weight": 0.075,
"price": 1.5, "price": 1.5,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -2,24 +2,14 @@
"name": "Munition (Windenarmbrust)", "name": "Munition (Windenarmbrust)",
"image": "systems/DSA_4-1/assets/arsenal/arrow3.png", "image": "systems/DSA_4-1/assets/arsenal/arrow3.png",
"category": [ "category": [
"Gegenstand" "Gegenstand",
"Munition"
], ],
"weight": 0.1, "weight": 0.1,
"price": 2, "price": 2,
"breakFactor": 0, "description": "",
"iniModifier": 0, "ammunition": {
"attackModifier": 0, "max": 1,
"parryModifier": 0, "count": 1
"meleeAttackModifier": 0, }
"meleeAttackModifierIncrement": 0,
"meleeSkills": [],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 0,
"armorHandicap": 0,
"description": ""
} }

View File

@ -8,21 +8,13 @@
"weight": 1, "weight": 1,
"price": 40, "price": 40,
"breakFactor": 0, "breakFactor": 0,
"iniModifier": 0, "iniModifier": -1,
"attackModifier": 0, "attackModifier": -2,
"parryModifier": 1, "parryModifier": -1,
"meleeAttackModifier": 0, "meleeAttackModifier": 0,
"meleeAttackModifierIncrement": 0, "meleeAttackModifierIncrement": 0,
"meleeSkills": [ "meleeSkills": [
"Schilde" "Schilde"
], ],
"meleeAttackDamage": "",
"rangedSkills": [],
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 1,
"armorHandicap": 1,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 3, "weight": 3,
"price": 0, "price": 0,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 1,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 1,
"meleeAttackModifier": 0, "rücken": 1,
"meleeAttackModifierIncrement": 0, "bauch": 1,
"meleeSkills": [], "arme": 1,
"meleeAttackDamage": "", "beine": 1
"rangedSkills": [], },
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 1,
"armorHandicap": 1, "armorHandicap": 1,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 14, "weight": 14,
"price": 750, "price": 750,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 5,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 6,
"meleeAttackModifier": 0, "rücken": 5,
"meleeAttackModifierIncrement": 0, "bauch": 6,
"meleeSkills": [], "arme": 5,
"meleeAttackDamage": "", "beine": 4
"rangedSkills": [], },
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 6,
"armorHandicap": 4, "armorHandicap": 4,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 17, "weight": 17,
"price": 1000, "price": 1000,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 6,
"attackModifier": 0, "kopf": 3,
"parryModifier": 0, "brust": 7,
"meleeAttackModifier": 0, "rücken": 5,
"meleeAttackModifierIncrement": 0, "bauch": 7,
"meleeSkills": [], "arme": 5,
"meleeAttackDamage": "", "beine": 5
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 4,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 8,
"armorHandicap": 5,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 6.5, "weight": 6.5,
"price": 150, "price": 150,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 3,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 4,
"meleeAttackModifier": 0, "rücken": 4,
"meleeAttackModifierIncrement": 0, "bauch": 4,
"meleeSkills": [], "arme": 2,
"meleeAttackDamage": "", "beine": 1
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 2,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 3,
"armorHandicap": 3,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 30, "weight": 30,
"price": 2500, "price": 2500,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 8,
"attackModifier": 0, "kopf": 8,
"parryModifier": 0, "brust": 8,
"meleeAttackModifier": 0, "rücken": 7,
"meleeAttackModifierIncrement": 0, "bauch": 8,
"meleeSkills": [], "arme": 7,
"meleeAttackDamage": "", "beine": 7
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 8,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 12,
"armorHandicap": 10,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 4, "weight": 4,
"price": 60, "price": 60,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 2,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 3,
"meleeAttackModifier": 0, "rücken": 2,
"meleeAttackModifierIncrement": 0, "bauch": 2,
"meleeSkills": [], "arme": 1,
"meleeAttackDamage": "", "beine": 0
"rangedSkills": [], },
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 3,
"armorHandicap": 2, "armorHandicap": 2,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 4, "weight": 4,
"price": 110, "price": 110,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 2,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 5,
"meleeAttackModifier": 0, "rücken": 1,
"meleeAttackModifierIncrement": 0, "bauch": 2,
"meleeSkills": [], "arme": 0,
"meleeAttackDamage": "", "beine": 0
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 1,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 3,
"armorHandicap": 2,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 10, "weight": 10,
"price": 180, "price": 180,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 3,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 4,
"meleeAttackModifier": 0, "rücken": 4,
"meleeAttackModifierIncrement": 0, "bauch": 4,
"meleeSkills": [], "arme": 3,
"meleeAttackDamage": "", "beine": 2
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 2,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 4,
"armorHandicap": 4,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 4.5, "weight": 4.5,
"price": 80, "price": 80,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 2,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 3,
"meleeAttackModifier": 0, "rücken": 3,
"meleeAttackModifierIncrement": 0, "bauch": 3,
"meleeSkills": [], "arme": 0,
"meleeAttackDamage": "", "beine": 0
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 1,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 3,
"armorHandicap": 3,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 7.5, "weight": 7.5,
"price": 250, "price": 250,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 3,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 5,
"meleeAttackModifier": 0, "rücken": 4,
"meleeAttackModifierIncrement": 0, "bauch": 5,
"meleeSkills": [], "arme": 0,
"meleeAttackDamage": "", "beine": 2
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 2,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 4,
"armorHandicap": 3,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 12, "weight": 12,
"price": 1000, "price": 1000,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 4,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 5,
"meleeAttackModifier": 0, "rücken": 5,
"meleeAttackModifierIncrement": 0, "bauch": 5,
"meleeSkills": [], "arme": 3,
"meleeAttackDamage": "", "beine": 3
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 4,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 5,
"armorHandicap": 5,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 10, "weight": 10,
"price": 1000, "price": 1000,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 4,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 5,
"meleeAttackModifier": 0, "rücken": 5,
"meleeAttackModifierIncrement": 0, "bauch": 5,
"meleeSkills": [], "arme": 3,
"meleeAttackDamage": "", "beine": 2
"rangedSkills": [], },
"rangedRangeModifier": "", "armorHandicap": 3,
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 5,
"armorHandicap": 4,
"description": "" "description": ""
} }

View File

@ -20,7 +20,15 @@
"rangedRangeDamageModifier": "", "rangedRangeDamageModifier": "",
"rangedAttackDamage": "", "rangedAttackDamage": "",
"rangedReloadTime": 0, "rangedReloadTime": 0,
"armorValue": 1, "armorValue": {
"total": 1.5,
"kopf": 0,
"brust": 1,
"rücken": 1,
"bauch": 1,
"arme": 1,
"beine": 1
},
"armorHandicap": 1, "armorHandicap": 1,
"description": "" "description": ""
} }

View File

@ -7,20 +7,15 @@
], ],
"weight": 3, "weight": 3,
"price": 40, "price": 40,
"breakFactor": 0, "armorValue": {
"iniModifier": 0, "total": 2,
"attackModifier": 0, "kopf": 0,
"parryModifier": 0, "brust": 2,
"meleeAttackModifier": 0, "rücken": 2,
"meleeAttackModifierIncrement": 0, "bauch": 2,
"meleeSkills": [], "arme": 1,
"meleeAttackDamage": "", "beine": 1
"rangedSkills": [], },
"rangedRangeModifier": "",
"rangedRangeDamageModifier": "",
"rangedAttackDamage": "",
"rangedReloadTime": 0,
"armorValue": 2,
"armorHandicap": 2, "armorHandicap": 2,
"description": "" "description": ""
} }

View File

@ -0,0 +1,27 @@
.droppable {
.inventory-table {
position: relative;
}
.inventory-table::after {
content: 'Gegenstände hier fallen lassen';
pointer-events: none;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-radius: 8px;
border-style: dashed;
border-color: gray;
line-height: 34px;
height: 34px;
vertical-align: middle;
text-align: center;
background-color: rgba(0, 0, 0, 0.4);
color: gray;
}
}

View File

@ -0,0 +1,15 @@
<section class="tab {{tabs.ammunition.id}} {{tabs.ammunition.cssClass}}"
data-tab="{{tabs.ammunition.id}}"
data-group="{{tabs.ammunition.group}}">
<div>
<div>
<label>Kapazität (1 wenn es sich hierbei um kein Magazin handelt)
<input type="text" name="system.ammunition.max" value="{{system.ammunition.max}}"/>
</label>
<label>
Geschossanzahl
<input type="text" name="system.ammunition.count" value="{{system.ammunition.count}}"/>
</label>
</div>
</div>
</section>

View File

@ -3,11 +3,48 @@
data-group="{{tabs.armor.group}}"> data-group="{{tabs.armor.group}}">
<div> <div>
<div> <fieldset>
<label>Gesamt Rüstungswert <legend>Rüstungswerte</legend>
<input type="text" name="system.armorValue" value="{{system.armorValue}}"/>
</label> <div>
</div> <label>Gesamt Rüstungswert
<input type="text" name="system.armorValue.total" value="{{system.armorValue.total}}"/>
</label>
</div>
<div>
<label>Arme
<input type="text" name="system.armorValue.arme" value="{{system.armorValue.arme}}"/>
</label>
</div>
<div>
<label>Beine
<input type="text" name="system.armorValue.beine" value="{{system.armorValue.beine}}"/>
</label>
</div>
<div>
<label>Bauch
<input type="text" name="system.armorValue.bauch" value="{{system.armorValue.bauch}}"/>
</label>
</div>
<div>
<label>Brust
<input type="text" name="system.armorValue.brust" value="{{system.armorValue.brust}}"/>
</label>
</div>
<div>
<label>Rücken
<input type="text" name="system.armorValue.rücken" value="{{system.armorValue.rücken}}"/>
</label>
</div>
<div>
<label>Kopf
<input type="text" name="system.armorValue.kopf" value="{{system.armorValue.kopf}}"/>
</label>
</div>
</fieldset>
<div> <div>
<label>Gesamt Behinderung <label>Gesamt Behinderung
<input type="text" name="system.armorHandicap" value="{{system.armorHandicap}}"/> <input type="text" name="system.armorHandicap" value="{{system.armorHandicap}}"/>

View File

@ -1,7 +0,0 @@
<section class="tab {{tabs.container.id}} {{tabs.container.cssClass}}"
data-tab="{{tabs.container.id}}"
data-group="{{tabs.container.group}}">
<div>
Behälter Specs
</div>
</section>

View File

@ -14,9 +14,7 @@
value="{{quantity}}"/> value="{{quantity}}"/>
</label> </label>
</div> </div>
<div class="category"><label>Kategorie: {{!-- categories are now in their on tab --}}
{{> "systems/DSA_4-1/templates/ui/partial-array-editor.hbs" this.categoryAndOptions}}
</label></div>
<div class="description"> <div class="description">
<label>Beschreibungstext</label> <label>Beschreibungstext</label>
<prose-mirror <prose-mirror

View File

@ -0,0 +1,25 @@
<section class="tab {{tabs.settings.id}} {{tabs.settings.cssClass}}"
data-tab="{{tabs.settings.id}}"
data-group="{{tabs.settings.group}}">
<div>
<fieldset>
<legend>Art des Gegenstands</legend>
<label>
<input type="checkbox" name="isMelee" {{checked isMelee}}>
<span>Nahkampfwaffe</span>
</label>
<label>
<input type="checkbox" name="isRanged" {{checked isRanged}}>
<span>Fernkampfwaffe</span>
</label>
<label>
<input type="checkbox" name="isAmmunition" {{checked isAmmunition}}>
<span>Munition</span>
</label>
<label>
<input type="checkbox" name="isArmor" {{checked isArmor}}>
<span>Rüstzeug</span>
</label>
</fieldset>
</div>
</section>

View File

@ -12,7 +12,7 @@
{{#each this}} {{#each this}}
<tr class="equipment" data-item-id="{{this.id}}" draggable="true" data-action="openEmbeddedDocument"> <tr class="equipment" data-item-id="{{this.id}}" draggable="true" data-action="openEmbeddedDocument">
<td class="icon"><img alt="" src="{{this.icon}}" width="16" height="16"></td> <td class="icon"><img alt="" src="{{this.icon}}" width="32" height="32"></td>
<td class="name">{{this.name}}</td> <td class="name">{{this.name}}</td>
<td class="quantity">{{this.quantity}}</td> <td class="quantity">{{this.quantity}}</td>
<td class="weight">{{#if this.worn}}({{/if}}{{this.weight}}{{#if this.worn}}){{/if}}</td> <td class="weight">{{#if this.worn}}({{/if}}{{this.weight}}{{#if this.worn}}){{/if}}</td>