#70-classes-as-items #92
|
|
@ -207,7 +207,7 @@ export class M5Character extends Actor {
|
||||||
const aggregate = new M5ModAggregate(data, ret);
|
const aggregate = new M5ModAggregate(data, ret);
|
||||||
|
|
||||||
context.items
|
context.items
|
||||||
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "klasse") && item.system.equipped)
|
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "class") && item.system.equipped)
|
||||||
.forEach((item) => {
|
.forEach((item) => {
|
||||||
const mods = item.system.mods;
|
const mods = item.system.mods;
|
||||||
//console.log("Actor item mods", mods)
|
//console.log("Actor item mods", mods)
|
||||||
|
|
@ -497,11 +497,19 @@ export class M5Character extends Actor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skip?.class) {
|
if (!skip?.class) {
|
||||||
const item = context.items?.find((item) => item.type === "class");
|
const item = context.items
|
||||||
if (item) {
|
?.filter((item) => item.type === "class")
|
||||||
data.info.class = item.name;
|
.forEach((item) => {
|
||||||
data.info.magicUsing = item.system.magicUsing;
|
if (item) {
|
||||||
}
|
if (typeof data.info.class === "string") {
|
||||||
|
data.info.class = {};
|
||||||
|
}
|
||||||
|
data.info.class[item.id] = item.name;
|
||||||
|
if (item.system.magicUsing) {
|
||||||
|
data.info.magicUsing = item.system.magicUsing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skip?.effects) {
|
if (!skip?.effects) {
|
||||||
|
|
|
||||||
|
|
@ -433,6 +433,14 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
html.find(".class-item-edit").on("click", async (event) => {
|
||||||
|
this.actor.items.find((x) => x.type === "class").sheet.render(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
html.find(".class-item-delete").on("click", async (event) => {
|
||||||
|
this.actor.items.find((x) => x.type === "class").delete();
|
||||||
|
});
|
||||||
|
|
||||||
// Drag & Drop
|
// Drag & Drop
|
||||||
const dragDrop = new DragDrop({
|
const dragDrop = new DragDrop({
|
||||||
dragSelector: ".items-list .item",
|
dragSelector: ".items-list .item",
|
||||||
|
|
|
||||||
|
|
@ -365,4 +365,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chip {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 25px;
|
||||||
|
height: 35px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 35px;
|
||||||
|
border-radius: 25px;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.closebtn {
|
||||||
|
padding-left: 10px;
|
||||||
|
color: #888;
|
||||||
|
font-weight: bold;
|
||||||
|
float: right;
|
||||||
|
font-size: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.closebtn:hover {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"info": {
|
"info": {
|
||||||
"description": "",
|
"description": "",
|
||||||
"background": "",
|
"background": "",
|
||||||
"class": "",
|
"class": {},
|
||||||
"race": "",
|
"race": "",
|
||||||
"magicUsing": false,
|
"magicUsing": false,
|
||||||
"showAllItems": false,
|
"showAllItems": false,
|
||||||
|
|
@ -259,7 +259,7 @@
|
||||||
"zauberschutz": "midgard5.spell-process-zauberschutz",
|
"zauberschutz": "midgard5.spell-process-zauberschutz",
|
||||||
"zaubersiegel": "midgard5.spell-process-zaubersiegel",
|
"zaubersiegel": "midgard5.spell-process-zaubersiegel",
|
||||||
"zaubertaenze": "midgard5.spell-process-zaubertaenze",
|
"zaubertaenze": "midgard5.spell-process-zaubertaenze",
|
||||||
"zerstoeren": "midgard5.spell-process-zerstoeren"
|
"zerstoeren": "midgard5.spell-process-zerstoeren"
|
||||||
},
|
},
|
||||||
"spellTypeSelection": {
|
"spellTypeSelection": {
|
||||||
"gedanke": "midgard5.spell-type-gedanke",
|
"gedanke": "midgard5.spell-type-gedanke",
|
||||||
|
|
@ -467,7 +467,7 @@
|
||||||
"calc": {}
|
"calc": {}
|
||||||
},
|
},
|
||||||
"class": {
|
"class": {
|
||||||
"templates": ["itemDescription", "stats"],
|
"templates": ["itemDescription"],
|
||||||
"magicUsing": false,
|
"magicUsing": false,
|
||||||
"equipped": true,
|
"equipped": true,
|
||||||
"resistanceBody": 1,
|
"resistanceBody": 1,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,14 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td >{{localize "midgard5.class"}}</td>
|
<td >{{localize "midgard5.class"}}</td>
|
||||||
<td><input name="data.info.class" type="text" disabled="true" value="{{data.info.class}}" data-dtype="String" /></td>
|
<td >
|
||||||
|
{{#each data.info.class as |class id|}}
|
||||||
|
<div class="chip" data-item-id="{{id}}">
|
||||||
|
<a class="edit-item" name="data.info.class" type="text" disabled="true" value="" data-dtype="String">{{class}}</a>
|
||||||
|
<span><a class="closebtn item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></span>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</td>
|
||||||
<td >{{localize "midgard5.level"}}</td>
|
<td >{{localize "midgard5.level"}}</td>
|
||||||
<td>{{data.calc.level}}</td>
|
<td>{{data.calc.level}}</td>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue