First character sheet, wip
This commit is contained in:
@@ -7,14 +7,14 @@ import { Imperium5Utility } from "./imperium5-utility.js";
|
||||
import { Imperium5RollDialog } from "./imperium5-roll-dialog.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class PegasusActorSheet extends ActorSheet {
|
||||
export class Imperium5ActorSheet extends ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
|
||||
return mergeObject(super.defaultOptions, {
|
||||
classes: ["fvtt-pegasus-rpg", "sheet", "actor"],
|
||||
template: "systems/fvtt-pegasus-rpg/templates/actor-sheet.html",
|
||||
classes: ["fvtt-imperium5", "sheet", "actor"],
|
||||
template: "systems/fvtt-imperium5/templates/actor-sheet.html",
|
||||
width: 920,
|
||||
height: 720,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "combat" }],
|
||||
@@ -25,9 +25,9 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = PegasusUtility.data(this.object);
|
||||
const objectData = Imperium5Utility.data(this.object);
|
||||
|
||||
let actorData = duplicate(PegasusUtility.templateData(this.object));
|
||||
let actorData = duplicate(Imperium5Utility.templateData(this.object));
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
@@ -38,28 +38,11 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: actorData,
|
||||
archetype: this.actor.getArchetype(),
|
||||
specialites: this.actor.getSpecialites(),
|
||||
familiarites: this.actor.getFamiliarites(),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
limited: this.object.limited,
|
||||
specs: this.actor.getSpecs( ),
|
||||
optionsDiceList: PegasusUtility.getOptionsDiceList(),
|
||||
optionsLevel: PegasusUtility.getOptionsLevel(),
|
||||
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
|
||||
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
|
||||
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields()) ),
|
||||
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
|
||||
perks: duplicate(this.actor.getPerks()),
|
||||
abilities: duplicate(this.actor.getAbilities()),
|
||||
activePerks: duplicate(this.actor.getActivePerks()),
|
||||
powers: duplicate(this.actor.getPowers()),
|
||||
subActors: duplicate(this.actor.getSubActors()),
|
||||
race: duplicate(this.actor.getRace()),
|
||||
role: duplicate(this.actor.getRole()),
|
||||
effects: duplicate(this.actor.getEffects()),
|
||||
moneys: duplicate(this.actor.getMoneys()),
|
||||
encCapacity: this.actor.getEncumbranceCapacity(),
|
||||
containersTree: this.actor.containersTree,
|
||||
encCurrent: this.actor.encCurrent,
|
||||
encHindrance: this.actor.encHindrance,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
editScore: this.options.editScore,
|
||||
@@ -73,13 +56,13 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async openGenericRoll() {
|
||||
let rollData = PegasusUtility.getBasicRollData()
|
||||
let rollData = Imperium5Utility.getBasicRollData()
|
||||
rollData.alias = "Dice Pool Roll",
|
||||
rollData.mode = "generic"
|
||||
rollData.title = `Dice Pool Roll`
|
||||
rollData.img = "icons/dice/d12black.svg"
|
||||
|
||||
let rollDialog = await PegasusRollDialog.create( this.actor, rollData);
|
||||
let rollDialog = await Imperium5RollDialog.create( this.actor, rollData);
|
||||
rollDialog.render( true );
|
||||
}
|
||||
|
||||
@@ -87,7 +70,7 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
async rollIDR( itemId, diceValue) {
|
||||
let item = this.actor.data.items.get( itemId) ?? {name: "Unknown"}
|
||||
let myRoll = new Roll(diceValue+"x").roll({ async: false })
|
||||
await PegasusUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
await Imperium5Utility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
let chatData = {
|
||||
user: game.user.id,
|
||||
rollMode: game.settings.get("core", "rollMode"),
|
||||
@@ -119,7 +102,7 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
PegasusUtility.confirmDelete(this, li);
|
||||
Imperium5Utility.confirmDelete(this, li);
|
||||
});
|
||||
|
||||
html.find('.spec-group-activate').click(ev => {
|
||||
@@ -337,11 +320,11 @@ export class PegasusActorSheet extends ActorSheet {
|
||||
/* -------------------------------------------- */
|
||||
async _onDropItem(event, dragData) {
|
||||
console.log(">>>>>> DROPPED!!!!")
|
||||
let item = await PegasusUtility.searchItem( dragData)
|
||||
let item = await Imperium5Utility.searchItem( dragData)
|
||||
if (item == undefined) {
|
||||
item = this.actor.items.get( dragData.data._id )
|
||||
}
|
||||
this.actor.preprocessItem( event, item, true )
|
||||
//this.actor.preprocessItem( event, item, true )
|
||||
super._onDropItem(event, dragData)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user