Compare commits
No commits in common. "b49f945a743535ba02ae0c23db565011312e5801" and "1993c1696fd409c88175d0ba2d64638d1f4bc3b2" have entirely different histories.
b49f945a74
...
1993c1696f
23
gulpfile.mjs
23
gulpfile.mjs
|
|
@ -5,7 +5,7 @@ import {getRandomValues} from 'node:crypto';
|
||||||
import * as dartSass from 'sass';
|
import * as dartSass from 'sass';
|
||||||
import gulpSass from 'gulp-sass';
|
import gulpSass from 'gulp-sass';
|
||||||
import {deleteAsync} from 'del';
|
import {deleteAsync} from 'del';
|
||||||
import {readdirSync, readFileSync, writeFileSync, rmdirSync, existsSync, mkdirSync, statSync} from "fs";
|
import {readdirSync, readFileSync, writeFileSync, rmdirSync, existsSync, mkdirSync} from "fs";
|
||||||
import {join} from 'node:path';
|
import {join} from 'node:path';
|
||||||
|
|
||||||
import {compilePack} from '@foundryvtt/foundryvtt-cli';
|
import {compilePack} from '@foundryvtt/foundryvtt-cli';
|
||||||
|
|
@ -30,27 +30,21 @@ function randomID(length = 16) {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
const convert = function (from, to, ofType, overwrite = true) {
|
const convert = function (from, to, ofType) {
|
||||||
|
|
||||||
const SOURCE = from;
|
const SOURCE = from;
|
||||||
const DEST = to;
|
const DEST = to;
|
||||||
const TYPE = ofType;
|
const TYPE = ofType;
|
||||||
|
|
||||||
if (overwrite) {
|
|
||||||
try {
|
try {
|
||||||
rmdirSync(DEST, {force: true, recursive: true})
|
rmdirSync(DEST, {force: true, recursive: true})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
mkdirSync(DEST)
|
mkdirSync(DEST)
|
||||||
}
|
|
||||||
|
|
||||||
const filewalker = (source) => {
|
readdirSync(SOURCE).forEach(file => {
|
||||||
console.log("entering directory", source);
|
console.log(file)
|
||||||
readdirSync(source).forEach(file => {
|
let originalSource = JSON.parse(readFileSync(join(SOURCE, file), {encoding: "utf8"}));
|
||||||
if (statSync(join(source, file)).isDirectory()) {
|
|
||||||
filewalker(join(source, file));
|
|
||||||
} else {
|
|
||||||
let originalSource = JSON.parse(readFileSync(join(source, file), {encoding: "utf8"}));
|
|
||||||
let id = randomID();
|
let id = randomID();
|
||||||
|
|
||||||
let targetSource = {
|
let targetSource = {
|
||||||
|
|
@ -65,11 +59,7 @@ const convert = function (from, to, ofType, overwrite = true) {
|
||||||
let target = JSON.stringify(targetSource, null, 2);
|
let target = JSON.stringify(targetSource, null, 2);
|
||||||
let newFileName = "./" + join(DEST, id + ".json");
|
let newFileName = "./" + join(DEST, id + ".json");
|
||||||
writeFileSync(newFileName, target, {encoding: "utf8"});
|
writeFileSync(newFileName, target, {encoding: "utf8"});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
filewalker(SOURCE)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,8 +99,7 @@ async function prepareDB() {
|
||||||
convert("./src/packs/_source/talente", "./src/packs/__source/talente", "Skill");
|
convert("./src/packs/_source/talente", "./src/packs/__source/talente", "Skill");
|
||||||
convert("./src/packs/_source/zauber", "./src/packs/__source/zauber", "Spell");
|
convert("./src/packs/_source/zauber", "./src/packs/__source/zauber", "Spell");
|
||||||
convert("./src/packs/_source/vorteile", "./src/packs/__source/vorteile", "Advantage");
|
convert("./src/packs/_source/vorteile", "./src/packs/__source/vorteile", "Advantage");
|
||||||
convert("./src/packs/_source/nachteile", "./src/packs/__source/vorteile", "Advantage", false);
|
convert("./src/packs/_source/nachteile", "./src/packs/__source/vorteile", "Advantage");
|
||||||
convert("./src/packs/_source/sonderfertigkeiten", "./src/packs/__source/sonderfertigkeiten", "SpecialAbility");
|
|
||||||
convert("./src/packs/_source/waffen", "./src/packs/__source/waffen", "Equipment");
|
convert("./src/packs/_source/waffen", "./src/packs/__source/waffen", "Equipment");
|
||||||
convert("./src/packs/_source/munition", "./src/packs/__source/munition", "Equipment");
|
convert("./src/packs/_source/munition", "./src/packs/__source/munition", "Equipment");
|
||||||
convert("./src/packs/_source/ruestzeug", "./src/packs/__source/ruestzeug", "Equipment");
|
convert("./src/packs/_source/ruestzeug", "./src/packs/__source/ruestzeug", "Equipment");
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,12 @@
|
||||||
import BaseItem from "./base-item.mjs";
|
import BaseItem from "./base-item.mjs";
|
||||||
|
|
||||||
const {
|
const {BooleanField, NumberField, SchemaField, ArrayField, StringField, HTMLField} = foundry.data.fields;
|
||||||
BooleanField,
|
|
||||||
NumberField,
|
|
||||||
SchemaField,
|
|
||||||
ArrayField,
|
|
||||||
StringField,
|
|
||||||
HTMLField,
|
|
||||||
ObjectField
|
|
||||||
} = foundry.data.fields;
|
|
||||||
|
|
||||||
export class SpecialAbilityDataModel extends BaseItem {
|
export class SpecialAbilityDataModel extends BaseItem {
|
||||||
|
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
return {
|
return {
|
||||||
name: new StringField(),
|
name: new StringField()
|
||||||
seite: new NumberField(),
|
|
||||||
aktionsText: new HTMLField(),
|
|
||||||
text: new HTMLField(),
|
|
||||||
requirements: new ObjectField(), // TODO something more meaningful with this data
|
|
||||||
waffenLimit: new ArrayField(
|
|
||||||
new StringField(),
|
|
||||||
),
|
|
||||||
mehrereAktionen: new BooleanField(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ export class SpecialAbilitySheet extends HandlebarsApplicationMixin(DocumentShee
|
||||||
static TABS = {
|
static TABS = {
|
||||||
sheet: {
|
sheet: {
|
||||||
tabs: [
|
tabs: [
|
||||||
{id: 'specialability', group: 'sheet', label: 'Sonderfertigkeit'},
|
{id: 'json', group: 'sheet', label: 'JSON'},
|
||||||
],
|
],
|
||||||
initial: 'specialability'
|
initial: 'json'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -29,8 +29,8 @@ export class SpecialAbilitySheet extends HandlebarsApplicationMixin(DocumentShee
|
||||||
form: {
|
form: {
|
||||||
template: `systems/DSA_4-1/templates/item/specialability/main-sheet.hbs`
|
template: `systems/DSA_4-1/templates/item/specialability/main-sheet.hbs`
|
||||||
},
|
},
|
||||||
specialability: {
|
json: {
|
||||||
template: `systems/DSA_4-1/templates/item/specialability/tab-specialability.hbs`
|
template: `systems/DSA_4-1/templates/item/specialability/tab-json.hbs`
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,9 +55,7 @@ export class SpecialAbilitySheet extends HandlebarsApplicationMixin(DocumentShee
|
||||||
|
|
||||||
context.system = specialabilityData.system;
|
context.system = specialabilityData.system;
|
||||||
context.flags = specialabilityData.flags;
|
context.flags = specialabilityData.flags;
|
||||||
context.text = specialabilityData.system.text;
|
context.json = JSON.stringify(specialabilityData);
|
||||||
context.aktionsText = specialabilityData.system.aktionsText;
|
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ import {Blessing} from "../documents/blessing.mjs";
|
||||||
import {Profession} from "../documents/profession.mjs";
|
import {Profession} from "../documents/profession.mjs";
|
||||||
import {Culture} from "../documents/culture.mjs";
|
import {Culture} from "../documents/culture.mjs";
|
||||||
import {Species} from "../documents/species.mjs";
|
import {Species} from "../documents/species.mjs";
|
||||||
import {SpecialAbility} from "../documents/specialAbility.mjs";
|
|
||||||
|
|
||||||
export class XmlImport {
|
export class XmlImport {
|
||||||
#months = [
|
#months = [
|
||||||
|
|
@ -274,7 +273,7 @@ export class XmlImport {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.#mapSpecialAbilities(actor, specialAbilities)
|
json.sonderfertigkeiten = specialAbilities
|
||||||
json.liturgien = liturgies
|
json.liturgien = liturgies
|
||||||
|
|
||||||
let combatValues = []
|
let combatValues = []
|
||||||
|
|
@ -511,33 +510,6 @@ export class XmlImport {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async #mapSpecialAbilities(actor, specialAbilities) {
|
|
||||||
if (actor.itemTypes["SpecialAbility"].length > 0) {
|
|
||||||
actor.itemTypes["SpecialAbility"].forEach(s => {
|
|
||||||
actor.items.get(s._id).delete()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
specialAbilities.forEach((specialAbility) => {
|
|
||||||
const compendiumOfSF = game.packs.get('DSA_4-1.sonderfertigkeiten');
|
|
||||||
const sfId = compendiumOfSF?.index.find(sf => sf.name === specialAbility.name)
|
|
||||||
|
|
||||||
if (sfId) {
|
|
||||||
compendiumOfSF.getDocument(sfId._id).then(sf => actor.createEmbeddedDocuments('Item', [sf]))
|
|
||||||
} else {
|
|
||||||
actor.createEmbeddedDocuments('Item', [
|
|
||||||
new SpecialAbility({
|
|
||||||
name: specialAbility.name,
|
|
||||||
type: "SpecialAbility",
|
|
||||||
system: {
|
|
||||||
description: specialAbility.auswahl?.wahl?.join("\n"),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async #mapSpezies(actor, spezies) {
|
async #mapSpezies(actor, spezies) {
|
||||||
if (actor.itemTypes["Species"].length > 0) {
|
if (actor.itemTypes["Species"].length > 0) {
|
||||||
actor.itemTypes["Species"].forEach(s => {
|
actor.itemTypes["Species"].forEach(s => {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
@use "../atoms/colours" as colour;
|
@use "../atoms/colours" as colour;
|
||||||
@use "./character-tabs/meta";
|
@use "./character-tabs/meta";
|
||||||
@use "./character-tabs/social";
|
@use "./character-tabs/social";
|
||||||
@use "./character-tabs/advsf";
|
@use "./character-tabs/attributes";
|
||||||
@use "./character-tabs/inventory";
|
@use "./character-tabs/inventory";
|
||||||
@use "./character-tabs/combat";
|
@use "./character-tabs/combat";
|
||||||
@use "./character-tabs/spells";
|
@use "./character-tabs/spells";
|
||||||
|
|
@ -78,8 +78,8 @@
|
||||||
@include social.tab;
|
@include social.tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab.advsf.active {
|
.tab.attributes.active {
|
||||||
@include advsf.tab;
|
@include attributes.tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab.equipment.active {
|
.tab.equipment.active {
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
@mixin tab {
|
|
||||||
|
|
||||||
.advantages-and-specialabilities {
|
|
||||||
display: flex;
|
|
||||||
height: unset;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.advantages, .special-abilities {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
text-indent: 0;
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.advantage, .special-ability {
|
|
||||||
position: relative;
|
|
||||||
border: 1px solid gold;
|
|
||||||
box-shadow: 2px 2px 4px #000;
|
|
||||||
border-radius: 8px;
|
|
||||||
height: 24px;
|
|
||||||
color: gold;
|
|
||||||
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0 8px;
|
|
||||||
margin-left: 0;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
background-image: url("/systems/DSA_4-1/assets/velvet_button.png");
|
|
||||||
background-repeat: repeat-y;
|
|
||||||
background-size: cover;
|
|
||||||
|
|
||||||
span {
|
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
line-height: 24px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.special-ability {
|
|
||||||
&::after {
|
|
||||||
background: rgba(128, 0, 96, 0.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
border-radius: 8px;
|
|
||||||
background: rgba(0, 128, 0, 0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
& + .advantage, & + .special-ability {
|
|
||||||
margin-left: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.disadvantage {
|
|
||||||
font-style: italic;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
background: rgba(128, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
@mixin tab {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.advantages-and-specialabilities {
|
||||||
|
|
||||||
|
height: unset;
|
||||||
|
display: unset;
|
||||||
|
gap: 0;
|
||||||
|
padding: unset;
|
||||||
|
|
||||||
|
.advantages, .special-abilities {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
text-indent: 0;
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.advantage, .special-ability {
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid gold;
|
||||||
|
box-shadow: 2px 2px 4px #000;
|
||||||
|
border-radius: 8px;
|
||||||
|
height: 24px;
|
||||||
|
color: gold;
|
||||||
|
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 8px;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
background-image: url("../../assets/velvet_button.png");
|
||||||
|
background-repeat: repeat-y;
|
||||||
|
background-size: cover;
|
||||||
|
|
||||||
|
span {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
line-height: 24px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.special-ability {
|
||||||
|
&::after {
|
||||||
|
background: rgba(128, 0, 96, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(0, 128, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
& + .advantage, & + .special-ability {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disadvantage {
|
||||||
|
font-style: italic;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
background: rgba(128, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "spells",
|
"name": "spells",
|
||||||
"label": "Zauber",
|
"label": "Basiszauber",
|
||||||
"system": "DSA_4-1",
|
"system": "DSA_4-1",
|
||||||
"type": "Item",
|
"type": "Item",
|
||||||
"path": "packs/zauber",
|
"path": "packs/zauber",
|
||||||
|
|
@ -43,17 +43,15 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "liturgien",
|
"name": "liturgien",
|
||||||
"label": "Liturgien",
|
"label": "Basisliturgien",
|
||||||
"system": "DSA_4-1",
|
"system": "DSA_4-1",
|
||||||
"type": "Item",
|
"type": "Item"
|
||||||
"path": "packs/liturgien"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sonderfertigkeiten",
|
"name": "sonderfertigkeiten",
|
||||||
"label": "Sonderfertigkeiten",
|
"label": "Basissonderfertigkeiten",
|
||||||
"system": "DSA_4-1",
|
"system": "DSA_4-1",
|
||||||
"type": "Item",
|
"type": "Item"
|
||||||
"path": "packs/sonderfertigkeiten"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Advantage",
|
"name": "Advantage",
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,4 @@
|
||||||
<div>
|
<div>
|
||||||
{{!-- Sheet Tab Navigation --}}
|
<!-- TODO Add this sheet with meaningful options -->
|
||||||
<nav class="sheet-tabs tabs{{#if verticalTabs}} vertical{{/if}}"
|
Sonderfertigkeiten bitte sei Besonders und Fertig
|
||||||
aria-roledescription="{{localize "SHEETS.FormNavLabel"}}">
|
|
||||||
{{#each tabs as |tab|}}
|
|
||||||
<a data-action="tab" data-group="{{tab.group}}" data-tab="{{tab.id}}"
|
|
||||||
{{#if tab.cssClass}}class="{{tab.cssClass}}"{{/if}}
|
|
||||||
{{#if tab.tooltip}}data-tooltip="{{tab.tooltip}}"{{/if}}>
|
|
||||||
{{#if tab.icon}}<i class="{{tab.icon}}" inert></i>{{/if}}
|
|
||||||
{{#if tab.label}}<span>{{localize tab.label}}</span>{{/if}}
|
|
||||||
</a>
|
|
||||||
{{/each}}
|
|
||||||
</nav>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
<section class="tab {{tabs.specialability.id}} {{tabs.specialability.cssClass}}"
|
|
||||||
data-tab="{{tabs.specialability.id}}"
|
|
||||||
data-group="{{tabs.specialability.group}}">
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<label>Name</label>
|
|
||||||
<input name="system.name" value="{{system.name}}"/>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="body">
|
|
||||||
<label>Aktionstext</label>
|
|
||||||
<prose-mirror
|
|
||||||
name=" system.aktionsText"
|
|
||||||
button="false"
|
|
||||||
editable="{{editable}}"
|
|
||||||
toggled="true"
|
|
||||||
value="{{aktionsText}}">
|
|
||||||
{{{aktionsText}}}
|
|
||||||
</prose-mirror>
|
|
||||||
</div>
|
|
||||||
<div class="body">
|
|
||||||
<label>Beschreibung</label>
|
|
||||||
<prose-mirror
|
|
||||||
name=" system.text"
|
|
||||||
button="false"
|
|
||||||
editable="{{editable}}"
|
|
||||||
toggled="true"
|
|
||||||
value="{{text}}">
|
|
||||||
{{{text}}}
|
|
||||||
</prose-mirror>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
<div class="advantage {{#if isDisadvantage}}disadvantage{{/if}}">
|
<div class="advantage {{#if isDisadvantage}}disadvantage{{/if}}">
|
||||||
<span class="name" data-action="openEmbeddedDocument" data-item-id="{{this.id}}">{{this.name}} {{#if this.value}}
|
<span class="name" data-id="{{this.id}}">{{this.name}} {{#if this.value}}: {{this.value}}{{/if}}</span>
|
||||||
: {{this.value}}{{/if}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<div class="special-ability">
|
<div class="special-ability">
|
||||||
<span class="name" data-action="openEmbeddedDocument" data-item-id="{{this.id}}">{{this.name}}</span>
|
<span class="name" data-id="{{this.id}}">{{this.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue