Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
"TYPES.Item.floor": "Floor",
"TYPES.Item.wall": "Wall",

"BASICFANTASYRPG.Tab.cargo": "Cargo",
"BASICFANTASYRPG.Tab.combat": "Combat",
"BASICFANTASYRPG.Tab.description": "Description",
"BASICFANTASYRPG.Tab.features": "Special Abilities",
"BASICFANTASYRPG.Tab.floors": "Floors & Walls",
"BASICFANTASYRPG.Tab.items": "Equipment",
"BASICFANTASYRPG.Tab.spells": "Spells",

"BASICFANTASYRPG.TabCargo": "Cargo",
"BASICFANTASYRPG.TabCombat": "Combat",
"BASICFANTASYRPG.TabDescription": "Description",
Expand Down
8 changes: 8 additions & 0 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
"BASICFANTASYRPG.TabItems": "Équipement",
"BASICFANTASYRPG.TabSpells": "Sortilèges",

"BASICFANTASYRPG.Tab.cargo": "Cargo",
"BASICFANTASYRPG.Tab.combat": "Combat",
"BASICFANTASYRPG.Tab.description": "Description",
"BASICFANTASYRPG.Tab.features": "Capacité spéciale",
"BASICFANTASYRPG.Tab.floors": "Sols & Murs",
"BASICFANTASYRPG.Tab.items": "Équipement",
"BASICFANTASYRPG.Tab.spells": "Sortilèges",

"BASICFANTASYRPG.AbilityStr": "Force",
"BASICFANTASYRPG.AbilityCon": "Constitution",
"BASICFANTASYRPG.AbilityDex": "Dextérité",
Expand Down
12 changes: 10 additions & 2 deletions module/basicfantasyrpg.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { BasicFantasyRPGItem } from './documents/item.mjs';
// Import sheet classes.
import { BasicFantasyRPGActorSheet } from './sheets/actor-sheet.mjs';
import { BasicFantasyRPGItemSheet } from './sheets/item-sheet.mjs';
import { CharacterSheet } from './sheets/character-sheet.mjs';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ActorSheet was for any actor types - both characters and monsters. Is the new sheet for the same or only for Characters?

I'd like the naming to remain consistent with the previous sheets and avoid any potential collisions in future, unless this naming is expected by application v2?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember well, at the time I pushed this, I had only implemented the character sheet with v2, and the other actors were supposed to continue using v1. I have since implemented the new sheets as base classes, and would be happy to push them here as well.


// Import helper/utility classes and constants.
import { preloadHandlebarsTemplates } from './helpers/templates.mjs';
import { BASICFANTASYRPG } from './helpers/config.mjs';
Expand Down Expand Up @@ -40,7 +42,13 @@ Hooks.once('init', async function() {

// Register sheet application classes
Actors.unregisterSheet('core', ActorSheet);
Actors.registerSheet('basicfantasyrpg', BasicFantasyRPGActorSheet, { makeDefault: true });
Actors.registerSheet('basicfantasyrpg', BasicFantasyRPGActorSheet,
{ makeDefault: true }
);
Actors.registerSheet('basicfantasyrpg',
CharacterSheet,
{ types: ['character'], makeDefault: true, label: "Character Sheet V2"}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are 2 makeDefault attributes possible?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly. The idea was that since at the time of the MR only characters were implemented with v2, the other actor types would get the existing v1 sheet as default (i.e., the new sheet would override the default for characters only).

);
Items.unregisterSheet('core', ItemSheet);
Items.registerSheet('basicfantasyrpg', BasicFantasyRPGItemSheet, { makeDefault: true });

Expand Down Expand Up @@ -94,7 +102,7 @@ Handlebars.registerHelper('toLowerCase', function(str) {
});

Handlebars.registerHelper('selected', function(value) {
return Boolean(value) ? "selected" : "";
return value ? "selected" : "";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the rationale for this change? If I recall (and it was some time ago), I coerced to boolean here to ensure the return was a true or false value if the helper existed, otherwise it would return the empty string. Did you run into an issue with that logic?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, I don't remember why. It's been a while I wrote this, but it looks like it would be safer to add the coercion back.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize now that it was actually my IDE (WebStorm) automatically deleting it. I'm not very experienced in javascript, but it looks like the coercion in practice doesn't change anything.

});

Handlebars.registerPartial('iconDamage', `<i class="fa-solid fa-heart-crack fa-2xl" title="{{localize 'BASICFANTASYRPG.Roll'}} {{localize 'BASICFANTASYRPG.Damage'}}"></i>`);
Expand Down
Loading