This commit is contained in:
MartinSDampier 2025-03-25 15:14:47 -05:00
parent dc12abdf1c
commit b323e0dc4d
3 changed files with 11 additions and 18 deletions

View file

@ -2,6 +2,9 @@
This plugin is designed to be used in conjunction with the TTRPG Draw Steel by MCDM. The plugin allows users to manage and track combat encounters in a initiative tracker.
## Initiative Tracker
In order to use the initiative tracker, you must simple press the scroll ribbon. This will open a view with the tracker inside of it. The tracker allows for a DM to have two tables for tracking Draw Steel style initiative.
## Settings
In the settings of the plugin there is an option to add player characters. When a player character is added they will be automatically added to any initiative tracker upon generation.

View file

@ -108,7 +108,6 @@ export class InitiativeView extends ItemView {
var heroButtonComp = new ButtonComponent(this.formEl);
heroButtonComp.setButtonText("Hero");
heroButtonComp.setClass("padded-input");
console.log(heroButtonComp.buttonEl.classList);
heroButtonComp.onClick( () => this.createCreatureRow(undefined, true));
var villainButtonComp = new ButtonComponent(this.formEl);
villainButtonComp.setButtonText("Villain");
@ -119,7 +118,7 @@ export class InitiativeView extends ItemView {
createRoundSection(){
this.roundEl= this.gridEl.createDiv( {cls: "tableStyle "});
this.setRound(0);
this.setRound(1);
this.setMalice(0);
}
@ -310,7 +309,6 @@ export class InitiativeView extends ItemView {
updateStamina(row: HTMLTableRowElement, stamina: string, isMinion: boolean){
try{
var staminaCell = row.children[1] as HTMLTableCellElement;
console.log("updateStamina parent Id: " + staminaCell.parentElement?.id);
var parsedId = staminaCell.parentElement?.id.split(" ");
var maxStamina = 0;
var minionStamina;
@ -324,7 +322,6 @@ export class InitiativeView extends ItemView {
}
}
staminaCell.empty();
console.log(stamina);
let staminaDiv = staminaCell.createDiv({ cls: "tableStyle"})
staminaDiv.createDiv({ text: "Max: " + maxStamina, cls: "tableCell"})
if (isMinion)

View file

@ -38,13 +38,13 @@ export default class ForbiddenLandsCharacterSheet extends Plugin {
editor.replaceRange(TableFormat, editor.getCursor());
}
});
this.addCommand({
id: 'import-table-to-tracker',
name: 'Import Table To Tracker',
editorCallback: (editor: Editor) => {
this.importSelectionToTracker(editor);
}
});
// this.addCommand({
// id: 'import-table-to-tracker',
// name: 'Import Table To Tracker',
// editorCallback: (editor: Editor) => {
// this.importSelectionToTracker(editor);
// }
// });
}
importSelectionToTracker(editor: Editor){
@ -144,15 +144,10 @@ class SampleSettingTab extends PluginSettingTab {
.onClick( () => {
this.buildCharacterInput(containerEl)
} );
console.log(this.plugin.creatures.length);
console.log(this.plugin.settings.playerCharacters.length);
console.log(containerEl.children.length);
console.log("Adding Characters");
this.plugin.settings.playerCharacters.forEach((x) => this.buildCharacterInput(containerEl, x))
}
buildCharacterInput(containerEl: HTMLElement, character?: Creature){
console.log("HI!!!!");
var player = character ?? new Creature();
player.Type = CreatureTypes.Hero;
if (character == undefined)
@ -168,7 +163,6 @@ class SampleSettingTab extends PluginSettingTab {
.setPlaceholder('Name')
.setValue(player.Name)
.onChange(async (value) => {
console.log('Secret: ' + value);
player.Name = value;
await this.plugin.saveSettings();
}))
@ -176,7 +170,6 @@ class SampleSettingTab extends PluginSettingTab {
.setPlaceholder('Stamina')
.setValue(staminaInput)
.onChange(async (value) => {
console.log('Secret: ' + value);
if (value != null && value != "")
{
player.MaxStamina = +value;