starts cleaning code and also localisation
parent
5104f43e2f
commit
12c9b0766a
|
|
@ -1 +1,22 @@
|
|||
{}
|
||||
{
|
||||
"TYPES": {
|
||||
"Actor": {
|
||||
"Character": "Held",
|
||||
"Creature": "Kreatur",
|
||||
"Group": "Heldengruppe",
|
||||
"Merchant": "Händler"
|
||||
},
|
||||
"Item": {
|
||||
"ActiveEffect": "Aktiver Effekt",
|
||||
"Equipment": "Ausrüstungsgegenstand",
|
||||
"Skill": "Talent",
|
||||
"Advantage": "Vor-/Nachteil",
|
||||
"SpecialAbility": "Sonderfertigkeit",
|
||||
"Spell": "Zauber",
|
||||
"Liturgy": "Liturgie",
|
||||
"Species": "Spezies",
|
||||
"Culture": "Kultur",
|
||||
"Profession": "Profession"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
import BaseItem from "./baseItem.mjs";
|
||||
|
||||
const {ArrayField, BooleanField, NumberField, AnyField, StringField, HTMLField} = foundry.data.fields;
|
||||
|
||||
|
|
@ -1,8 +1,15 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {ArrayField, SchemaField, BooleanField, NumberField, StringField, HTMLField} = foundry.data.fields;
|
||||
const {
|
||||
ArrayField,
|
||||
SchemaField,
|
||||
BooleanField,
|
||||
NumberField,
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class VornachteileDataModel extends BaseItem {
|
||||
export class AdvantageDataModel extends BaseItem {
|
||||
|
||||
static defineSchema() {
|
||||
return {
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {BooleanField, StringField, HTMLField} = foundry.data.fields;
|
||||
const {
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class CultureDataModel extends BaseItem {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
import {Equipment} from "../documents/equipment.mjs";
|
||||
|
||||
const {
|
||||
ArrayField, EmbeddedCollectionField, SchemaField, NumberField, StringField, HTMLField
|
||||
ArrayField,
|
||||
SchemaField,
|
||||
NumberField,
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class EquipmentDataModel extends BaseItem {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ const {
|
|||
ObjectField,
|
||||
NumberField,
|
||||
StringField,
|
||||
EmbeddedDocumentField,
|
||||
DocumentIdField,
|
||||
ArrayField,
|
||||
ForeignDocumentField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class GroupDataModel extends foundry.abstract.TypeDataModel {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {BooleanField, NumberField, SchemaField, ArrayField, StringField, HTMLField} = foundry.data.fields;
|
||||
const {
|
||||
NumberField,
|
||||
SchemaField,
|
||||
ArrayField,
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class LiturgyDataModel extends BaseItem {
|
||||
|
||||
|
|
@ -17,14 +23,14 @@ export class LiturgyDataModel extends BaseItem {
|
|||
wirkungsdauer: new StringField(),
|
||||
zauberdauer: new StringField(),
|
||||
auswirkung: new SchemaField({
|
||||
I: new StringField(),
|
||||
II: new StringField(),
|
||||
III: new StringField(),
|
||||
IV: new StringField(),
|
||||
V: new StringField(),
|
||||
VI: new StringField(),
|
||||
VII: new StringField(),
|
||||
VIII: new StringField(),
|
||||
I: new HTMLField(),
|
||||
II: new HTMLField(),
|
||||
III: new HTMLField(),
|
||||
IV: new HTMLField(),
|
||||
V: new HTMLField(),
|
||||
VI: new HTMLField(),
|
||||
VII: new HTMLField(),
|
||||
VIII: new HTMLField(),
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
const {
|
||||
SchemaField,
|
||||
NumberField,
|
||||
ObjectField,
|
||||
StringField,
|
||||
HTMLField,
|
||||
FilePathField,
|
||||
DocumentIdField,
|
||||
ArrayField,
|
||||
} = foundry.data.fields;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {BooleanField, StringField, HTMLField} = foundry.data.fields;
|
||||
const {
|
||||
BooleanField,
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class ProfessionDataModel extends BaseItem {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {
|
||||
BooleanField,
|
||||
DocumentIdField,
|
||||
ArrayField,
|
||||
NumberField,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {
|
||||
AnyField,
|
||||
BooleanField,
|
||||
NumberField,
|
||||
SchemaField,
|
||||
ArrayField,
|
||||
StringField,
|
||||
HTMLField,
|
||||
ObjectField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class SpecialAbilityDataModel extends BaseItem {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {BooleanField, ArrayField, SchemaField, NumberField, StringField, HTMLField} = foundry.data.fields;
|
||||
const {
|
||||
ArrayField,
|
||||
SchemaField,
|
||||
NumberField,
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class SpeciesDataModel extends BaseItem {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import BaseItem from "./base-item.mjs";
|
||||
|
||||
const {BooleanField, NumberField, SchemaField, ArrayField, StringField, HTMLField} = foundry.data.fields;
|
||||
const {
|
||||
BooleanField,
|
||||
NumberField,
|
||||
ArrayField,
|
||||
StringField,
|
||||
HTMLField
|
||||
} = foundry.data.fields;
|
||||
|
||||
export class SpellDataModel extends BaseItem {
|
||||
|
||||
|
|
@ -14,7 +20,7 @@ export class SpellDataModel extends BaseItem {
|
|||
hauszauber: new BooleanField(),
|
||||
technik: new StringField(),
|
||||
zauberdauer: new StringField(),
|
||||
wirkung: new StringField(),
|
||||
wirkung: new HTMLField(),
|
||||
kosten: new StringField(),
|
||||
zielobjekt: new StringField(),
|
||||
reichweite: new StringField({required: true}),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
import {LiturgyData} from "../data/miracle/liturgydata.mjs";
|
||||
import {Talent} from "../data/talent.mjs";
|
||||
import {ATTRIBUTE, ATTRIBUTE_DESCRIPTIONS} from "../data/attribute.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
export class AttributeDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import {ActionManager} from "../sheets/actions/action-manager.mjs";
|
||||
import {Talent} from "../data/talent.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -179,7 +181,7 @@ export class BattleDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
|
||||
async _prepareContext(options) {
|
||||
const context = await super._prepareContext(options)
|
||||
context.actors = game.actors.filter(actor => actor.type === "character" || actor.type === "creature")
|
||||
context.actors = game.actors.filter(actor => actor.type === "Character" || actor.type === "Creature")
|
||||
|
||||
context.offenseTalent = this._offenseTalent ?? ''
|
||||
context.offenseTalents = {}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import {ActionManager} from "../sheets/actions/action-manager.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -55,32 +58,52 @@ export class CombatActionDialog extends HandlebarsApplicationMixin(ApplicationV2
|
|||
this._weaponId = null
|
||||
this._defenseManeuverId = null
|
||||
this._actionManager = new ActionManager(this._actor)
|
||||
CombatActionDialog._instance = this
|
||||
}
|
||||
|
||||
static _instance = null
|
||||
|
||||
|
||||
static async #onSelectTarget(event, target) {
|
||||
|
||||
async #processOnSelectTarget(event, target) {
|
||||
const {targetId} = target.dataset
|
||||
this._targetId = this._targetId === targetId ? null : targetId
|
||||
this.render({parts: ["form"]})
|
||||
}
|
||||
|
||||
static async #onSelectManeuver(event, target) {
|
||||
static async #onSelectTarget(event, target) {
|
||||
event.preventDefault()
|
||||
CombatActionDialog._instance.#processOnSelectTarget(event, target)
|
||||
}
|
||||
|
||||
|
||||
async #processOnSelectManeuver(event, target) {
|
||||
const {maneuverId} = target.dataset
|
||||
this._defenseManeuverId = this._defenseManeuverId === maneuverId ? null : maneuverId
|
||||
this.render({parts: ["form"]})
|
||||
}
|
||||
|
||||
|
||||
static async #onSelectWeaponAndSkill(event, target) {
|
||||
static async #onSelectManeuver(event, target) {
|
||||
event.preventDefault()
|
||||
CombatActionDialog._instance.#processOnSelectManeuver(event, target)
|
||||
}
|
||||
|
||||
async #processOnSelectWeaponAndSkill(event, target) {
|
||||
const {weaponId, skillId} = target.dataset
|
||||
this._weaponId = this._weaponId === weaponId ? null : weaponId
|
||||
this._skillId = this._skillId === skillId ? null : skillId
|
||||
this.render({parts: ["form"]})
|
||||
}
|
||||
|
||||
static async #onSubmitForm(event, form, formData) {
|
||||
|
||||
static async #onSelectWeaponAndSkill(event, target) {
|
||||
event.preventDefault()
|
||||
const maneuver = this.#evaluateManeuvers().find(p => p.id === this._defenseManeuverId)
|
||||
CombatActionDialog._instance.#processOnSelectWeaponAndSkill(event, target)
|
||||
}
|
||||
|
||||
async #processOnSubmitForm(event, form, formData) {
|
||||
const maneuver = CombatActionDialog._instance.#evaluateManeuvers().find(p => p.id === this._defenseManeuverId)
|
||||
const weapon = this._actor.itemTypes["Equipment"].find(p => p._id === this._weaponId)
|
||||
const skill = this._actor.itemTypes["Skill"].find(p => p._id === this._skillId)
|
||||
const target = game.actors.get(game.scenes.current.tokens.find(p => p._id === this._targetId).actorId)
|
||||
|
|
@ -129,6 +152,12 @@ export class CombatActionDialog extends HandlebarsApplicationMixin(ApplicationV2
|
|||
}
|
||||
}
|
||||
|
||||
static async #onSubmitForm(event, form, formData) {
|
||||
event.preventDefault()
|
||||
|
||||
CombatActionDialog._instance.#processOnSubmitForm(event, form, formData)
|
||||
}
|
||||
|
||||
_configureRenderOptions(options) {
|
||||
super._configureRenderOptions(options)
|
||||
if (options.window) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import {ActionManager} from "../sheets/actions/action-manager.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
import {LiturgyData} from "../data/miracle/liturgydata.mjs";
|
||||
import {Talent} from "../data/talent.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
export class LiturgyDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {XmlImport} from "../xml-import/xml-import.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
export class RestingDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ import {LiturgyData} from "../data/miracle/liturgydata.mjs";
|
|||
import {Talent} from "../data/talent.mjs";
|
||||
import {ATTRIBUTE} from "../data/attribute.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
export class TalentDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import {XmlImport} from "../xml-import/xml-import.mjs";
|
||||
|
||||
const {ApplicationV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
const {
|
||||
ApplicationV2,
|
||||
HandlebarsApplicationMixin
|
||||
} = foundry.applications.api
|
||||
|
||||
export class XmlImportDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export class Character extends Actor {
|
|||
*/
|
||||
prepareDerivedData() {
|
||||
|
||||
if (this.type === "character") {
|
||||
if (this.type === "Character") {
|
||||
const actorData = this;
|
||||
const systemData = actorData.system;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,10 @@ function weight(money) {
|
|||
const stone = Math.floor(baseValue / 1000)
|
||||
const remainder = baseValue - (stone * 1000)
|
||||
const ounces = remainder / 25
|
||||
let stoneRepresentation = ''
|
||||
let ouncesRepresentation = ''
|
||||
|
||||
return {
|
||||
stone: stoneRepresentation,
|
||||
ounces: ouncesRepresentation,
|
||||
stone,
|
||||
ounces,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ function initDocumentClasses(config) {
|
|||
|
||||
function initDataModels(config) {
|
||||
config.Actor.dataModels = {
|
||||
character: PlayerCharacterDataModel,
|
||||
group: GroupDataModel,
|
||||
creature: CreatureDataModel,
|
||||
Character: PlayerCharacterDataModel,
|
||||
Group: GroupDataModel,
|
||||
Creature: CreatureDataModel,
|
||||
Merchant: MerchantDataModel,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@ import {MerchantSheet} from "../sheets/merchantSheet.mjs";
|
|||
function setUpActorSheets(registry) {
|
||||
|
||||
registry.registerSheet('dsa41.character', CharacterSheet, {
|
||||
types: ["character"],
|
||||
types: ["Character"],
|
||||
makeDefault: true,
|
||||
})
|
||||
registry.registerSheet('dsa41.creature', CreatureSheet, {
|
||||
types: ["creature"],
|
||||
types: ["Creature"],
|
||||
makeDefault: true,
|
||||
})
|
||||
registry.registerSheet('dsa41.group', GroupSheet, {
|
||||
types: ["group"],
|
||||
types: ["Group"],
|
||||
makeDefault: true,
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -11,14 +11,12 @@ import {CombatActionDialog} from "../dialog/combatAction.mjs";
|
|||
import {ActionManager} from "./actions/action-manager.mjs";
|
||||
import {DefenseActionDialog} from "../dialog/defenseAction.mjs";
|
||||
import {RestingDialog} from "../dialog/restingDialog.mjs";
|
||||
import {Character} from "../documents/character.mjs";
|
||||
import {LiturgyDialog} from "../dialog/liturgyDialog.mjs";
|
||||
import {TalentDialog} from "../dialog/talentDialog.mjs";
|
||||
import {AttributeDialog} from "../dialog/attributeDialog.mjs";
|
||||
|
||||
const {HandlebarsApplicationMixin, DocumentSheetV2} = foundry.applications.api
|
||||
const {ActorSheetV2} = foundry.applications.sheets
|
||||
const {ContextMenu} = foundry.applications.ux
|
||||
|
||||
|
||||
class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
||||
|
|
|
|||
|
|
@ -1,16 +1,5 @@
|
|||
const {DocumentSheetV2, HandlebarsApplicationMixin} = foundry.applications.api
|
||||
|
||||
/**
|
||||
* @typedef ApplicationTab
|
||||
* @property {string} id
|
||||
* @property {string} group
|
||||
* @property {boolean} active
|
||||
* @property {string} cssClass
|
||||
* @property {string} [label]
|
||||
* @property {string} [icon]
|
||||
* @property {string} [tooltip]
|
||||
*/
|
||||
|
||||
export class EquipmentSheet extends HandlebarsApplicationMixin(DocumentSheetV2) {
|
||||
|
||||
/** @inheritDoc */
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
}
|
||||
|
||||
async #onUpdateCharacterSettings(data) {
|
||||
if (data.type === "character") {
|
||||
if (data.type === "Character") {
|
||||
|
||||
// update group
|
||||
let settings = {...this.document.system.settings}
|
||||
|
|
@ -265,10 +265,10 @@ export class GroupSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
// Update Group Members when either an Actor was moved into the linked Folder or removed from the linked Folder
|
||||
Hooks.on('updateActor', (data) => {
|
||||
if (data._id !== this.document._id) { // dont update yourself when you update yourself... baka!
|
||||
if (data.type === "character" && data.folder?._id === this.document.system.groupId) {
|
||||
if (data.type === "Character" && data.folder?._id === this.document.system.groupId) {
|
||||
this.#onUpdateCharacterSettings(data)
|
||||
this.render()
|
||||
} else if (data.type === "character") {
|
||||
} else if (data.type === "Character") {
|
||||
this.render()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export class MerchantSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
|
|||
const item = this.document.items.get(itemId)
|
||||
|
||||
let selections = ''
|
||||
game.actors.filter(p => p.isOwner && p.type === "character").forEach(actor => {
|
||||
game.actors.filter(p => p.isOwner && p.type === "Character").forEach(actor => {
|
||||
selections += `<option value=${actor.id}>${actor.name}</option>`
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -182,9 +182,9 @@
|
|||
],
|
||||
"documentTypes": {
|
||||
"Actor": {
|
||||
"creature": {},
|
||||
"group": {},
|
||||
"character": {
|
||||
"Creature": {},
|
||||
"Group": {},
|
||||
"Character": {
|
||||
"numberFields": [
|
||||
"groesse",
|
||||
"alter",
|
||||
|
|
|
|||
Loading…
Reference in New Issue