mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
Fixed so that the Homebrew settings screen for homebrew weapon/armor features gets a correct title instead of 'Downtime Moves' (#1263)
This commit is contained in:
parent
54109bf655
commit
d1caded970
3 changed files with 15 additions and 4 deletions
|
|
@ -2347,6 +2347,9 @@
|
||||||
},
|
},
|
||||||
"Homebrew": {
|
"Homebrew": {
|
||||||
"newDowntimeMove": "Downtime Move",
|
"newDowntimeMove": "Downtime Move",
|
||||||
|
"downtimeMove": "Downtime Move",
|
||||||
|
"armorFeature": "Armor Feature",
|
||||||
|
"weaponFeature": "Weapon Feaure",
|
||||||
"newFeature": "New ItemFeature",
|
"newFeature": "New ItemFeature",
|
||||||
"downtimeMoves": "Downtime Moves",
|
"downtimeMoves": "Downtime Moves",
|
||||||
"itemFeatures": "Item Features",
|
"itemFeatures": "Item Features",
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,14 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
|
||||||
const path = isDowntime ? `restMoves.${type}.moves.${id}` : `itemFeatures.${type}.${id}`;
|
const path = isDowntime ? `restMoves.${type}.moves.${id}` : `itemFeatures.${type}.${id}`;
|
||||||
const featureBase = isDowntime ? this.settings.restMoves[type].moves[id] : this.settings.itemFeatures[type][id];
|
const featureBase = isDowntime ? this.settings.restMoves[type].moves[id] : this.settings.itemFeatures[type][id];
|
||||||
|
|
||||||
|
const configTitle = isDowntime
|
||||||
|
? game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.downtimeMove')
|
||||||
|
: type === 'armorFeatures'
|
||||||
|
? game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.armorFeature')
|
||||||
|
: game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.weaponFeature');
|
||||||
|
|
||||||
const editedBase = await game.system.api.applications.sheetConfigs.SettingFeatureConfig.configure(
|
const editedBase = await game.system.api.applications.sheetConfigs.SettingFeatureConfig.configure(
|
||||||
|
configTitle,
|
||||||
featureBase,
|
featureBase,
|
||||||
path,
|
path,
|
||||||
this.settings,
|
this.settings,
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ import DHActionConfig from './action-config.mjs';
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
export default class SettingFeatureConfig extends HandlebarsApplicationMixin(ApplicationV2) {
|
export default class SettingFeatureConfig extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
constructor(move, movePath, settings, optionalParts, options) {
|
constructor(configTitle, move, movePath, settings, optionalParts, options) {
|
||||||
super(options);
|
super(options);
|
||||||
|
|
||||||
|
this.configTitle = configTitle;
|
||||||
this.move = move;
|
this.move = move;
|
||||||
|
|
||||||
this.movePath = movePath;
|
this.movePath = movePath;
|
||||||
|
|
@ -19,7 +20,7 @@ export default class SettingFeatureConfig extends HandlebarsApplicationMixin(App
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
return game.i18n.localize('DAGGERHEART.SETTINGS.Homebrew.downtimeMoves');
|
return this.configTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
|
|
@ -200,9 +201,9 @@ export default class SettingFeatureConfig extends HandlebarsApplicationMixin(App
|
||||||
if (!options.submitted) this.move = null;
|
if (!options.submitted) this.move = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async configure(move, movePath, settings, optionalParts, options = {}) {
|
static async configure(configTitle, move, movePath, settings, optionalParts, options = {}) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const app = new this(move, movePath, settings, optionalParts, options);
|
const app = new this(configTitle, move, movePath, settings, optionalParts, options);
|
||||||
app.addEventListener('close', () => resolve(app.move), { once: true });
|
app.addEventListener('close', () => resolve(app.move), { once: true });
|
||||||
app.render({ force: true });
|
app.render({ force: true });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue