+ Button für Skills
Changes: + Styling anpassung für + buttons + CreatItem funktion angepasst, man kann optionen reingeben + button um skills zu erstellen eingefügt
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Logger from "../../utils/Logger";
|
||||
import { M5Character } from "../actors/M5Character";
|
||||
import { M5Item } from "../items/M5Item";
|
||||
import { M5ItemType, M5SkillLearned, M5SkillUnlearned } from "../M5Base";
|
||||
import { M5ItemType, M5SkillLearned, M5SkillType, M5SkillUnlearned } from "../M5Base";
|
||||
import { M5Roll } from "../rolls/M5Roll";
|
||||
|
||||
export default class M5CharacterSheet extends ActorSheet {
|
||||
@@ -270,11 +270,12 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
|
||||
const context = this.actor as any;
|
||||
const item = context.items.get(itemId);
|
||||
if (item.system.equipped === true) {
|
||||
item.system.equipped = false;
|
||||
} else {
|
||||
item.system.equipped = true;
|
||||
}
|
||||
item.update({
|
||||
data: {
|
||||
equipped: !item.system.equipped,
|
||||
},
|
||||
});
|
||||
|
||||
this.render();
|
||||
});
|
||||
|
||||
@@ -282,14 +283,7 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.item"), M5ItemType.ITEM).then((i) => {
|
||||
const item = i as any;
|
||||
item.update({
|
||||
data: {
|
||||
quantity: 1,
|
||||
},
|
||||
});
|
||||
});
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.item"), M5ItemType.ITEM, { quantity: 1 });
|
||||
});
|
||||
|
||||
html.find(".add-weapon").on("click", async (event) => {
|
||||
@@ -317,42 +311,51 @@ export default class M5CharacterSheet extends ActorSheet {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.container"), M5ItemType.CONTAINER).then((i) => {
|
||||
const item = i as any;
|
||||
item.update({
|
||||
data: {
|
||||
quantity: 1,
|
||||
},
|
||||
});
|
||||
});
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.container"), M5ItemType.CONTAINER, { quantity: 1 });
|
||||
});
|
||||
|
||||
html.find(".add-innate-skill").on("click", async (event) => {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.innate-ability"), M5ItemType.SKILL, { type: M5SkillType.INNATE });
|
||||
});
|
||||
|
||||
html.find(".add-general-skill").on("click", async (event) => {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.skill"), M5ItemType.SKILL, { type: M5SkillType.GENERAL });
|
||||
});
|
||||
|
||||
html.find(".add-combat-skill").on("click", async (event) => {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.weapon-skill"), M5ItemType.SKILL, { type: M5SkillType.COMBAT });
|
||||
});
|
||||
|
||||
html.find(".add-language-skill").on("click", async (event) => {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.language"), M5ItemType.SKILL, { type: M5SkillType.LANGUAGE });
|
||||
});
|
||||
|
||||
html.find(".add-spell").on("click", async (event) => {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.spell"), M5ItemType.SPELL).then((i) => {
|
||||
const item = i as any;
|
||||
item.update({
|
||||
data: {
|
||||
process: "none",
|
||||
},
|
||||
});
|
||||
});
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.spell"), M5ItemType.SPELL, { process: "none" });
|
||||
});
|
||||
|
||||
html.find(".add-kampfkunst").on("click", async (event) => {
|
||||
const data = this.actor.system;
|
||||
|
||||
const character = this.actor as M5Character;
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.kampfkunst"), M5ItemType.KAMPFKUNST).then((i) => {
|
||||
const item = i as any;
|
||||
item.update({
|
||||
data: {
|
||||
type: "angriff",
|
||||
variante: "anstuermen",
|
||||
},
|
||||
});
|
||||
character.createItem((game as Game).i18n.localize("TYPES.Item.kampfkunst"), M5ItemType.KAMPFKUNST, {
|
||||
type: "angriff",
|
||||
variante: "anstuermen",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user