tidy5e-sheet icon indicating copy to clipboard operation
tidy5e-sheet copied to clipboard

Is it possible to open the sheet at a specfic tab?

Open RHeynsZa opened this issue 2 years ago • 2 comments

Using a macro or something like this:

    game.actors.getName('Leleiah Scald').sheet.render(true, {tabs: [{navSelector: ".tabs", contentSelector: ".sheet-body", initial: 'journal'}})

I cant seem to figure it out

RHeynsZa avatar Aug 27 '22 17:08 RHeynsZa

As far as I know the sheet remembers the last opened tab and will always open to this after the first time until the session restarts. This is a default thing though and I don't know how to circumvent this. Sorry!

sdenec avatar Sep 02 '22 06:09 sdenec

I don't know if this is helpful but it's a function in the sheet that was put in there when the actions tab was released and lets you chose wheter to open on this tab or the default . Maybe xou can modify it to suit your needs as a macro? Don't even know if this would work ...

static get defaultOptions() {
		let defaultTab = game.settings.get("tidy5e-sheet", "defaultActionsTab") != 'default' ? 'attributes' : 'actions';
		if (!game.modules.get('character-actions-list-5e')?.active) defaultTab = 'description';

	  return mergeObject(super.defaultOptions, {
			classes: ["tidy5e", "sheet", "actor", "character"],
			blockFavTab: true,
			width: game.settings.get("tidy5e-sheet", "playerSheetWidth") ?? 740,
			height: 840,
			tabs: [{navSelector: ".tabs", contentSelector: ".sheet-body", initial: defaultTab}]
		});
	}
	```

sdenec avatar Sep 02 '22 17:09 sdenec