This commit is contained in:
2025-07-28 14:57:27 +02:00
parent 48eb799861
commit 6ab0cab5a0
18 changed files with 437 additions and 34 deletions

5
modules/config.js Normal file
View File

@@ -0,0 +1,5 @@
export const POKEMON = {};
POKEMON.attributes = {
Test: "TEST!"
}

0
modules/dialog.js Normal file
View File

0
modules/dice.js Normal file
View File

View File

View File

@@ -0,0 +1,34 @@
export default class pokemonActor extends Actor {
preparedata() {
// In case some steps need to be overwritten later
super.preparedata();
}
prepareDerivedData() {
const actorData = this.system;
this._preparePlayerCharacterData(actorData);
}
_preparePlayerCharacterData(actorData) {
this._setCharacterValues(actorData);
}
async _setCharacterValues(data) {
// Calculations of values here
}
setNote(note) {
this.update({"system.note ": note});
}
addLogEntry(entry) {
// Add a log entry to the character event log
let log = this.system.log;
log.push(entry);
this.update({"system.log": log})
}
}

View File

@@ -1,5 +0,0 @@
export default class PokemonItemSheet extends foundry.appv1.sheets.ItemSheet {
get template() {
return `systems/pokemon/templates/sheets/${this.item.type}-sheet.html`
}
}

View File

@@ -0,0 +1,80 @@
const api = foundry.applications.api;
const sheets = foundry.applications.sheets;
export default class pokemonCharacterSheet extends api.HandlebarApplicationMixin(sheets.ActorSheetV2) {
sheetContext = {};
static DEFAULT_OPTIONS = {
tag: "form",
classes: ["pokemon", "sheet", "characterSheet"],
actions: {
},
form: {
submitOnChange: true,
closeOnSubmit: false
},
position: {
width: 650
}
}
static PARTS = {
header: { template: "systems/pokemon/templates/sheets/character/header.hbs" },
sidebar: { template: "systems/pokemon/templates/sheets/character/sidebar.hbs" }
}
get title() {
return this.actor.name;
}
/** @override */
_configureRenderOptions(options) {
super._configureRenderOptions(options);
if (this.document.limited) options.parts = ["header"]
else options.parts = ["header", "sidebar"];
}
/** @override */
async _prepareContext(options) {
// #################################################################################################
// #################################################################################################
// ## ##
// ## Creates Basic Datamodel, which is used to fill the HTML together with Handelbars with Data. ##
// ## ##
// #################################################################################################
// #################################################################################################
const baseData = await super._prepareContext();
let context = {
// Set General Values
owner: baseData.document.isOwner,
editable: baseData.editable,
actor: baseData.document,
system: baseData.document.system,
items: baseData.document.items,
config: CONFIG.POKEMON,
isGM: baseData.user.isGM,
effects: baseData.document.effects
};
this.sheetContext = context;
return context;
}
/** @override */
_onRender(context, options) {
const tabs = new foundry.applications.ux.Tabs({navSelector: ".tabs", contentSelector: ".content", initial: "tab1"});
tabs.bind(this.element);
const tabs2 = new foundry.applications.ux.Tabs({navSelector: ".tabs2", contentSelector: ".content2", initial: "tab2-1"});
tabs2.bind(this.element);
}
}

0
modules/utils.js Normal file
View File