Compare commits
No commits in common. "fca38ec50750aa9fcd9e1b7b71bca8bc1582b1ca" and "7849ba2a90de83d8f4ad4d56a918e3ac6de52572" have entirely different histories.
fca38ec507
...
7849ba2a90
|
|
@ -97,6 +97,7 @@ Hooks.once("init", () => {
|
|||
|
||||
movementActions.climb.canSelect = (token) => {
|
||||
const actor = token.actor | null;
|
||||
console.log
|
||||
return (actor.type === "Character" && actor.system.itemTypes["Skill"].find(p => p.name === "Klettern")?.system.taw > 0) || actor.type === "Creature"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export default {
|
|||
|
||||
context.equipments = []
|
||||
context.carryingweight = 0
|
||||
actorData.itemTypes["Equipment"].sort((a, b) => a.sort - b.sort).forEach((item, index) => {
|
||||
actorData.itemTypes.Equipment.forEach((item, index) => {
|
||||
|
||||
// worn items are halved weight
|
||||
|
||||
|
|
@ -41,10 +41,13 @@ export default {
|
|||
context.wealth = 0
|
||||
|
||||
actorData.itemTypes["Equipment"].forEach(coin => {
|
||||
console.log(coin.name, coin.system.category)
|
||||
if (coin.system.category.indexOf("Währung") !== -1) {
|
||||
console.log(context.wealth, coin)
|
||||
context.wealth += (coin.system.quantity * coin.system.currencyDenominator)
|
||||
}
|
||||
})
|
||||
console.log(context.wealth)
|
||||
|
||||
const maxSets = 3
|
||||
const romanNumerals = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"]
|
||||
|
|
|
|||
|
|
@ -491,13 +491,15 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
}
|
||||
|
||||
|
||||
// TODO needs to be fixed once Character Sheet is migrated to ActorSheetV2
|
||||
async _onDrop(event) {
|
||||
const data = TextEditor.implementation.getDragEventData(event);
|
||||
const actor = this.actor;
|
||||
const targetDocument = this.actor.itemTypes["Equipment"].find(p => p._id === event.target.dataset['itemId'])
|
||||
//const allowed = Hooks.call("dropActorSheetData", actor, this, data);
|
||||
//if (allowed === false) return;
|
||||
|
||||
console.log("looted or dropped", data)
|
||||
|
||||
// Dropped Documents
|
||||
const documentClass = foundry.utils.getDocumentClass(data.type);
|
||||
if (documentClass) {
|
||||
|
|
@ -505,27 +507,11 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
|
||||
if (document.type === "Equipment" || document.type === "Advantage" || document.type === "Spell" || document.type === "Liturgy" || document.type === "ActiveEffect" || document.type === "SpecialAbility") {
|
||||
// No duplication by moving items from one actor to another
|
||||
|
||||
if ((targetDocument?.name ?? false) === document.name && targetDocument._id !== document._id && await foundry.applications.api.DialogV2.confirm({
|
||||
content: `<span>Gegenstände der Art <strong>${document.name}</strong> (Neue Anzahl: ${targetDocument.system.quantity + document.system.quantity}) zusammenlegen?</span>`,
|
||||
rejectClose: false,
|
||||
modal: true,
|
||||
window: {
|
||||
title: `Gegenstände zusammenlegen`
|
||||
}
|
||||
})) {
|
||||
// combine
|
||||
await targetDocument.update({"system.quantity": targetDocument.system.quantity + document.system.quantity})
|
||||
await this.actor.deleteEmbeddedDocuments('Item', [document._id])
|
||||
return false
|
||||
} else {
|
||||
|
||||
if (document.parent && document.parent !== this.actor) {
|
||||
document.parent.items.get(document._id).delete()
|
||||
}
|
||||
|
||||
await this._onDropDocument(event, document)
|
||||
}
|
||||
await this._onDropDocument(event, document);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ export class CreatureSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
handler: CreatureSheet.#onSubmitForm
|
||||
},
|
||||
actions: {
|
||||
openEmbeddedDocument: CreatureSheet.#openEmbeddedDocument,
|
||||
removeAttack: CreatureSheet.#removeAttack,
|
||||
addAttack: CreatureSheet.#addAttack,
|
||||
roll: CreatureSheet.#dieRoll,
|
||||
|
|
@ -83,12 +82,6 @@ export class CreatureSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
await this.document.update(formData.object) // Note: formData.object
|
||||
}
|
||||
|
||||
static #openEmbeddedDocument(event, target) {
|
||||
const dataset = target.dataset
|
||||
const id = dataset.itemId ?? dataset.id
|
||||
this.document.items.get(id).sheet.render(true)
|
||||
}
|
||||
|
||||
static async #removeAttack(evt) {
|
||||
const {index} = evt.srcElement.dataset;
|
||||
let sans = Array.from(this.document.system.attacks);
|
||||
|
|
@ -189,6 +182,7 @@ export class CreatureSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
const actor = this.actor;
|
||||
//const allowed = Hooks.call("dropActorSheetData", actor, this, data);
|
||||
// if (allowed === false) return;
|
||||
console.log("dropped")
|
||||
// Dropped Documents
|
||||
const documentClass = foundry.utils.getDocumentClass(data.type);
|
||||
if (documentClass) {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ export class MerchantSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
*/
|
||||
static async #onSubmitForm(event, form, formData) {
|
||||
event.preventDefault()
|
||||
|
||||
console.log(formData.object)
|
||||
|
||||
await this.document.update(formData.object) // Note: formData.object
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ export class XmlImport {
|
|||
}
|
||||
|
||||
async #addSkillFromCompendiumByNameToActor(talentName, taw, actor, combatStatistics, attributes) {
|
||||
const compendiumOfSkills = game.packs.get('DSA_4-1.Skills');
|
||||
const compendiumOfSkills = game.packs.get('DSA_4-1.talente');
|
||||
const talentId = compendiumOfSkills.index.find(skill => skill.name === talentName)
|
||||
if (talentId) {
|
||||
|
||||
|
|
@ -383,7 +383,7 @@ export class XmlImport {
|
|||
}
|
||||
|
||||
async #addSpellsFromCompendiumByNameToActor(spellName, zfw, representation, hauszauber, actor) {
|
||||
const compendiumOfSpells = game.packs.get('DSA_4-1.Spells');
|
||||
const compendiumOfSpells = game.packs.get('DSA_4-1.spells');
|
||||
const SCREAMING_NAME = spellName.toUpperCase()
|
||||
const spellId = compendiumOfSpells.index.find(spell => spell.name === SCREAMING_NAME)
|
||||
if (spellId) {
|
||||
|
|
@ -400,7 +400,7 @@ export class XmlImport {
|
|||
}
|
||||
|
||||
async #addLiturgiesFromCompendiumByNameToActor(liturgyName, actor) {
|
||||
const compendiumOfLiturgies = game.packs.get('DSA_4-1.Liturgies');
|
||||
const compendiumOfLiturgies = game.packs.get('DSA_4-1.liturgien');
|
||||
const liturgyId = compendiumOfLiturgies.index.find(liturgy => {
|
||||
return liturgy.name === LiturgyData.lookupAlias(liturgyName.split(" (")[0])
|
||||
})
|
||||
|
|
@ -494,7 +494,6 @@ export class XmlImport {
|
|||
actor.items.get(e._id).delete()
|
||||
})
|
||||
}
|
||||
let i = 100
|
||||
held.gegenstände?.gegenstand?.forEach(e => {
|
||||
const compendiumOfArmor = game.packs.get('DSA_4-1.Armor');
|
||||
const compendiumOfWeapons = game.packs.get('DSA_4-1.Weapons');
|
||||
|
|
@ -526,15 +525,13 @@ export class XmlImport {
|
|||
{
|
||||
name: e.modallgemein?.name?.value ?? e.name,
|
||||
type: "Equipment",
|
||||
sort: (i++) * 100,
|
||||
system: {
|
||||
quantity: e.anzahl,
|
||||
price: e.modallgemein?.preis.value,
|
||||
weight: e.modallgemein?.gewicht.value,
|
||||
|
||||
}
|
||||
})
|
||||
])
|
||||
})])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,47 @@
|
|||
|
||||
.dsa41.sheet {
|
||||
|
||||
nav.sheet-tabs.tabs {
|
||||
|
||||
position: relative;
|
||||
display: flow;
|
||||
border-top: unset;
|
||||
border-bottom: unset;
|
||||
margin-bottom: 0;
|
||||
|
||||
a.item[data-tab] {
|
||||
|
||||
background-color: colours.$tab-inactive-background-color;
|
||||
|
||||
&.active {
|
||||
border-left: numbers.$tab-border-width solid colours.$tab-border-color;
|
||||
border-top: numbers.$tab-border-width solid colours.$tab-border-color;
|
||||
border-right: numbers.$tab-border-width solid colours.$tab-border-color;
|
||||
border-bottom: 0;
|
||||
top: numbers.$tab-border-width*2*2;
|
||||
background: assets.$tab-background;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
section.sheet-body {
|
||||
|
||||
border: numbers.$tab-border-width solid colours.$tab-border-color;
|
||||
background: assets.$tab-pane-background;
|
||||
|
||||
div.tab {
|
||||
|
||||
overflow: auto;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Tabs v2
|
||||
|
||||
.sheet-tabs {
|
||||
|
|
@ -13,7 +54,6 @@
|
|||
border-top: unset;
|
||||
border-bottom: unset;
|
||||
margin-bottom: 0;
|
||||
top: 1px;
|
||||
|
||||
a[data-action="tab"] {
|
||||
|
||||
|
|
@ -34,21 +74,14 @@
|
|||
border-top: numbers.$tab-border-width solid colours.$tab-border-color;
|
||||
border-right: numbers.$tab-border-width solid colours.$tab-border-color;
|
||||
border-bottom: 0;
|
||||
top: numbers.$tab-border-width*2;
|
||||
background: assets.$tab-background;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
box-shadow: numbers.$tab-shadow-right numbers.$tab-shadow-bottom numbers.$tab-shadow-blur-radius colours.$tab-shadow;
|
||||
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 3px;
|
||||
background: assets.$tab-background;
|
||||
z-index: 5;
|
||||
span {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
"label": "Rüstzeug",
|
||||
"system": "DSA_4-1",
|
||||
"type": "Item",
|
||||
"path": "packs/Ruestzeug",
|
||||
"path": "packs/ruestzeug",
|
||||
"private": false
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue