add basic ItemSheet
This commit is contained in:
parent
f0a82fef45
commit
fc5913e742
11
ItemSheets/Armor.html
Normal file
11
ItemSheets/Armor.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form class="item-sheet {{ cssClass }}" autocomplete="off">
|
||||||
|
<header>
|
||||||
|
{{#if editable}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}" data-edit="img" >
|
||||||
|
<input name="name" type="text" value="{{ item.name }}" placeholder="Name">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
{{/if}}
|
||||||
|
</header>
|
||||||
|
</form>
|
||||||
11
ItemSheets/Generic Item.html
Normal file
11
ItemSheets/Generic Item.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form class="item-sheet {{ cssClass }}" autocomplete="off">
|
||||||
|
<header>
|
||||||
|
{{#if editable}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}" data-edit="img" >
|
||||||
|
<input name="name" type="text" value="{{ item.name }}" placeholder="Name">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
{{/if}}
|
||||||
|
</header>
|
||||||
|
</form>
|
||||||
11
ItemSheets/Melee Weapon.html
Normal file
11
ItemSheets/Melee Weapon.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form class="item-sheet {{ cssClass }}" autocomplete="off">
|
||||||
|
<header>
|
||||||
|
{{#if editable}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}" data-edit="img" >
|
||||||
|
<input name="name" type="text" value="{{ item.name }}" placeholder="Name">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
{{/if}}
|
||||||
|
</header>
|
||||||
|
</form>
|
||||||
11
ItemSheets/Ranged Weapon.html
Normal file
11
ItemSheets/Ranged Weapon.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form class="item-sheet {{ cssClass }}" autocomplete="off">
|
||||||
|
<header>
|
||||||
|
{{#if editable}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}" data-edit="img" >
|
||||||
|
<input name="name" type="text" value="{{ item.name }}" placeholder="Name">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
{{/if}}
|
||||||
|
</header>
|
||||||
|
</form>
|
||||||
11
ItemSheets/Shield.html
Normal file
11
ItemSheets/Shield.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form class="item-sheet {{ cssClass }}" autocomplete="off">
|
||||||
|
<header>
|
||||||
|
{{#if editable}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}" data-edit="img" >
|
||||||
|
<input name="name" type="text" value="{{ item.name }}" placeholder="Name">
|
||||||
|
{{else}}
|
||||||
|
<img src="{{ item.img }}" title="{{ item.name }}">
|
||||||
|
<div>{{ item.name }}</div>
|
||||||
|
{{/if}}
|
||||||
|
</header>
|
||||||
|
</form>
|
||||||
21
src/main.css
Normal file
21
src/main.css
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
.item-sheet header {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-sheet header img {
|
||||||
|
flex: 0 0 64px;
|
||||||
|
height: 64px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-sheet header input,
|
||||||
|
.item-sheet header div {
|
||||||
|
flex: 1;
|
||||||
|
height: 48px;
|
||||||
|
line-height: 48px;
|
||||||
|
margin: 8px;
|
||||||
|
font-size: 2em;
|
||||||
|
}
|
||||||
41
src/main.mjs
41
src/main.mjs
@ -1,14 +1,43 @@
|
|||||||
console.log("Hello World! This code runs immediately when the file is loaded.");
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
console.log("INIT");
|
console.log("INIT");
|
||||||
console.log(foundry.documents.BaseItem.metadata.types);
|
|
||||||
foundry.documents.BaseItem.metadata.types.push("talent");
|
//DocumentSheetConfig.unregisterSheet(Item, "core", ItemSheet);
|
||||||
|
DocumentSheetConfig.registerSheet(Item, "dsa41", DSA41_ItemSheet, {
|
||||||
|
makeDefault: true,
|
||||||
|
types: [
|
||||||
|
"Generic Item",
|
||||||
|
"Melee Weapon",
|
||||||
|
"Ranged Weapon",
|
||||||
|
"Armor",
|
||||||
|
"Shield",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class DSA41_ItemSheet extends ItemSheet {
|
||||||
|
get template() {
|
||||||
|
return "systems/dsa-4th-edition/ItemSheets/" + this.item.type + ".html"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
const data = super.getData();
|
||||||
|
console.log(data);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ready() {
|
function ready() {
|
||||||
console.log("READY");
|
console.log("READY");
|
||||||
}
|
}
|
||||||
|
|
||||||
Hooks.on("init", init);
|
function setup() {
|
||||||
Hooks.on("ready", ready);
|
console.log("SETUP");
|
||||||
|
//Item.create({"name": "TestItem4", "type": "spell", "system": {"price": "15"}});
|
||||||
|
}
|
||||||
|
|
||||||
|
Hooks.once("init", init);
|
||||||
|
Hooks.once("ready", ready);
|
||||||
|
Hooks.once("setup", setup);
|
||||||
|
|||||||
@ -2,9 +2,8 @@
|
|||||||
"id": "dsa-4th-edition",
|
"id": "dsa-4th-edition",
|
||||||
"title": "Custom Das Schwarze Auge 4.1",
|
"title": "Custom Das Schwarze Auge 4.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"esmodules": [
|
"esmodules": ["src/main.mjs"],
|
||||||
"src/main.mjs"
|
"styles": ["src/main.css"],
|
||||||
],
|
|
||||||
|
|
||||||
"version": "0.1.5",
|
"version": "0.1.5",
|
||||||
"manifest": "https://gitea.ammerhai.com/foundry/dsa-4th-edition/releases/download/latest/system.json",
|
"manifest": "https://gitea.ammerhai.com/foundry/dsa-4th-edition/releases/download/latest/system.json",
|
||||||
|
|||||||
@ -1,19 +1,20 @@
|
|||||||
{
|
{
|
||||||
"Item": {
|
"Item": {
|
||||||
"templates": {
|
"templates": {
|
||||||
"rarity": {
|
|
||||||
"rarity": "Common",
|
|
||||||
"price": 20
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"types": ["weapon", "spell"],
|
"types": [
|
||||||
|
"Generic Item",
|
||||||
|
"Melee Weapon",
|
||||||
|
"Ranged Weapon",
|
||||||
|
"Armor",
|
||||||
|
"Shield"
|
||||||
|
],
|
||||||
"weapon": {
|
"weapon": {
|
||||||
"templates": ["rarity"],
|
"templates": []
|
||||||
"damage": 5
|
|
||||||
},
|
},
|
||||||
"spell": {
|
"spell": {
|
||||||
"templates": ["rarity"],
|
"templates": []
|
||||||
"cost": 2
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user