From 284debad7a2ce35445a7cf18f54046f982e65ebe Mon Sep 17 00:00:00 2001 From: LorduFreeman Date: Sat, 25 May 2024 20:33:01 +0200 Subject: [PATCH 01/64] More translation corrections (german) --- lang/de/vampire-de.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/de/vampire-de.json b/lang/de/vampire-de.json index 558e13e4..05a12469 100644 --- a/lang/de/vampire-de.json +++ b/lang/de/vampire-de.json @@ -22,8 +22,8 @@ "Humanity": "Menschlichkeit", "Predator": "Jagdverhalten", "Hunger": "Hunger", - "HungerFull1": "Hunger maximal.", - "HungerFull2": "Maximaler Hunger, kann nicht erhöht werden.", + "HungerFull1": "Hunger maximal", + "HungerFull2": "Hunger kann nicht weiter steigen.", "Rouse": "Wallung", "Frenzy": "Raserei", "Remorse": "Reue", From 8d0634982866a487270e322efc99df033eacafe2 Mon Sep 17 00:00:00 2001 From: Veilza Date: Wed, 5 Jun 2024 19:07:39 -0500 Subject: [PATCH 02/64] Fix an issue where "Show to chat" button wouldn't send the description --- module/actor/wod-v5-sheet.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 9b50066a..8125ed89 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -235,7 +235,8 @@ export class WoDActor extends ActorSheet { const item = actor.getEmbeddedDocument('Item', li.data('itemId')) renderTemplate('systems/vtm5e/templates/chat/chat-message.hbs', { name: item.name, - img: item.img + img: item.img, + description: item.system.description }).then(html => { ChatMessage.create({ content: html From c5da551dc6b63e19004eb72cc149c7399592800a Mon Sep 17 00:00:00 2001 From: Veilza Date: Wed, 5 Jun 2024 19:08:34 -0500 Subject: [PATCH 03/64] The tiniest release in history --- .github/workflows/release.yml | 2 +- system.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4dabd9d6..99e70c4c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: "notes": "https://github.com/Rayji96/foundry-V5/releases/tag/${{ github.event.release.tag_name }}", "compatibility": { "minimum": "11", - "verified": "12.324", + "verified": "12.325", "maximum": "" } } diff --git a/system.json b/system.json index 543a573b..002b9970 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "vtm5e", "title": "World of Darkness 5e", "description": "World of Darkness 5e system for Foundry VTT", - "version": "4.3.2", + "version": "4.3.3", "compatibility": { "minimum": "11", "verified": "12.325", @@ -291,8 +291,8 @@ "url": "https://github.com/Rayji96/foundry-V5", "bugs": "https://github.com/Rayji96/foundry-V5/issues", "background": "systems/vtm5e/assets/images/wodcity.jpg", - "manifest": "https://github.com/Rayji96/foundry-V5/releases/download/4.3.2/system.json", - "download": "https://github.com/Rayji96/foundry-V5/releases/download/4.3.2/vtm5e-4.3.2.zip", + "manifest": "https://github.com/Rayji96/foundry-V5/releases/download/4.3.3/system.json", + "download": "https://github.com/Rayji96/foundry-V5/releases/download/4.3.3/vtm5e-4.3.3.zip", "flags": { "hotReload": { "extensions": ["css", "hbs", "json"], From 05341abf38e7daccdefd85c2c899f87e7dc1a60e Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 7 Jun 2024 06:25:12 -0500 Subject: [PATCH 04/64] Add methods to load custom attributes/settings from game settings --- module/def/attributes.js | 15 ++++ module/def/skills.js | 145 ++++----------------------------------- 2 files changed, 30 insertions(+), 130 deletions(-) diff --git a/module/def/attributes.js b/module/def/attributes.js index 32585be6..3ef357e1 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -10,6 +10,15 @@ export class Attributes { .map(([key, value]) => ({ [key]: value })) } + // Method to add extra attributes + static addCustom(customAttributes) { + for (const [key, value] of Object.entries(customAttributes)) { + if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + this[key] = value + } + } + } + // Localize the labels static initializeLabels () { const modifications = game.settings.get('vtm5e', 'modifiedAttributes') @@ -37,6 +46,12 @@ export class Attributes { // Run any necessary compilation on ready static onReady () { + const customAttributes = game.settings.get('vtm5e', 'customAttributes') + + if (customAttributes) { + Attributes.addCustom(customAttributes) + } + Attributes.initializeLabels() } diff --git a/module/def/skills.js b/module/def/skills.js index ba6ed646..a06cc0d0 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -10,6 +10,15 @@ export class Skills { .map(([key, value]) => ({ [key]: value })) } + // Method to add extra skills + static addCustom(customSkills) { + for (const [key, value] of Object.entries(customSkills)) { + if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + this[key] = value + } + } + } + // Localize the labels static initializeLabels () { const modifications = game.settings.get('vtm5e', 'modifiedSkills') @@ -37,6 +46,12 @@ export class Skills { // Run any necessary compilation on ready static onReady () { + const customSkills = game.settings.get('vtm5e', 'customSkills') + + if (customSkills) { + Skills.addCustom(customSkills) + } + Skills.initializeLabels() } @@ -44,136 +59,6 @@ export class Skills { label: 'WOD5E.Skills.Athletics', type: 'physical' } - - static animalken = { - label: 'WOD5E.Skills.AnimalKen', - type: 'social' - } - - static academics = { - label: 'WOD5E.Skills.Academics', - type: 'mental' - } - - static brawl = { - label: 'WOD5E.Skills.Brawl', - type: 'physical' - } - - static etiquette = { - label: 'WOD5E.Skills.Etiquette', - type: 'social' - } - - static awareness = { - label: 'WOD5E.Skills.Awareness', - type: 'mental' - } - - static craft = { - label: 'WOD5E.Skills.Craft', - type: 'physical' - } - - static insight = { - label: 'WOD5E.Skills.Insight', - type: 'social' - } - - static finance = { - label: 'WOD5E.Skills.Finance', - type: 'mental' - } - - static drive = { - label: 'WOD5E.Skills.Drive', - type: 'physical' - } - - static intimidation = { - label: 'WOD5E.Skills.Intimidation', - type: 'social' - } - - static investigation = { - label: 'WOD5E.Skills.Investigation', - type: 'mental' - } - - static firearms = { - label: 'WOD5E.Skills.Firearms', - type: 'physical' - } - - static leadership = { - label: 'WOD5E.Skills.Leadership', - type: 'social' - } - - static medicine = { - label: 'WOD5E.Skills.Medicine', - type: 'mental' - } - - static larceny = { - label: 'WOD5E.Skills.Larceny', - type: 'physical' - } - - static performance = { - label: 'WOD5E.Skills.Performance', - type: 'social' - } - - static occult = { - label: 'WOD5E.Skills.Occult', - type: 'mental' - } - - static melee = { - label: 'WOD5E.Skills.Melee', - type: 'physical' - } - - static persuasion = { - label: 'WOD5E.Skills.Persuasion', - type: 'social' - } - - static politics = { - label: 'WOD5E.Skills.Politics', - type: 'mental' - } - - static stealth = { - label: 'WOD5E.Skills.Stealth', - type: 'physical' - } - - static streetwise = { - label: 'WOD5E.Skills.Streetwise', - type: 'social' - } - - static science = { - label: 'WOD5E.Skills.Science', - type: 'mental' - } - - static survival = { - label: 'WOD5E.Skills.Survival', - type: 'physical' - } - - static subterfuge = { - label: 'WOD5E.Skills.Subterfuge', - type: 'social' - } - - static technology = { - label: 'WOD5E.Skills.Technology', - type: 'mental' - } } // Hook to call onReady when the game is ready From 20bd345b19833012d0de1ced676784aed78e9dd3 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 8 Jun 2024 17:54:21 -0500 Subject: [PATCH 05/64] Update verified version --- .github/workflows/release.yml | 2 +- system.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99e70c4c..e746e2af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,7 @@ jobs: "notes": "https://github.com/Rayji96/foundry-V5/releases/tag/${{ github.event.release.tag_name }}", "compatibility": { "minimum": "11", - "verified": "12.325", + "verified": "12.327", "maximum": "" } } diff --git a/system.json b/system.json index 002b9970..9c1bf9a0 100644 --- a/system.json +++ b/system.json @@ -5,7 +5,7 @@ "version": "4.3.3", "compatibility": { "minimum": "11", - "verified": "12.325", + "verified": "12.327", "maximum": "" }, "authors": [ From 0295dfe88bca7f3e04ab9a76a4ca4ae19b72fac9 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sun, 9 Jun 2024 16:22:40 -0500 Subject: [PATCH 06/64] Pull in some new Russian translations, especially for Werewolf --- lang/ru/hunter-ru.json | 2 +- lang/ru/werewolf-ru.json | 124 +++++++++++++++++++-------------------- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/lang/ru/hunter-ru.json b/lang/ru/hunter-ru.json index 3ed27038..3a7aaf81 100644 --- a/lang/ru/hunter-ru.json +++ b/lang/ru/hunter-ru.json @@ -24,7 +24,7 @@ "PossibleDesperationFailure": "Возможный Перебор или Безысходный провал", "DespairFailure": "Безысходный провал", "DesperationUnavailable": "Отчаяние недоступно при Безысходности", - "_Drive": "", + "Drive": "Мотивация", "Arsenal": "Арсенал", "Fleet": "Автопарк", diff --git a/lang/ru/werewolf-ru.json b/lang/ru/werewolf-ru.json index e869ea06..b9bab7c8 100644 --- a/lang/ru/werewolf-ru.json +++ b/lang/ru/werewolf-ru.json @@ -3,80 +3,80 @@ "WTA": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", - "_Label": "", + "Label": "Оборотень", "_Pack": "", "_WerewolfDice": "", "_RageDice": "", - "_GiftsandRites": "", - "_Rage": "", - "_RageCost": "", + "GiftsandRites": "Дары и Обряды", + "Rage": "Ярость", + "RageCost": "Кубик ярости", "_WillpowerCost": "", - "_PossibleRageFailure": "", - "_RollRageDamageWillpower": "", + "PossibleRageFailure": "Возможен разгром", + "RollRageDamageWillpower": "Проверка ярости", "_HasCost": "", - "_Gift": "", - "_SelectGift": "", - "_GiftType": "", - "_AddGift": "", - "_NewGift": "", - "_AddRite": "", - "_NewRite": "", - "_TheWolf": "", - "_Tribe": "", - "_Auspice": "", - "_Harano": "", - "_HaranoTest": "", - "_Hauglosk": "", - "_HaugloskTest": "", + "Gift": "дара", + "SelectGift": "Выбор дара", + "GiftType": "Тип дара", + "AddGift": "Добавить дар", + "NewGift": "Новый дар", + "AddRite": "Добавить обряд", + "NewRite": "Новый обряд", + "TheWolf": "Волк", + "Tribe": "Племя", + "Auspice": "Покровительство", + "Harano": "Харано", + "HaranoTest": "Проверка Харано", + "Hauglosk": "Хауглоск", + "HaugloskTest": "Проверка Хауглоск", "Frenzy": "Проверка Ярости", - "_EnterFrenzy": "", - "_EndFrenzy": "", - "_FrenzyActiveWarning": "", - "_Active": "", - "_FrenzyActiveWarning2": "", + "EnterFrenzy": "Впасть в Безумие", + "EndFrenzy": "Прекратить Безумие", + "FrenzyActiveWarning": "Безумие активно", + "Active": "Активно", + "FrenzyActiveWarning2": "Вы не можете использовать дары или обряды, находясь в безумии.", "_LostTheWolf": "", "_LostWolfWarning": "", - "_LostWolfFormChange": "", + "LostWolfFormChange": "Волк потерян: вы не можете обращаться в сверхъестественную форму.", "_LostWolfShiftDown": "", "_LostWolfShiftAnyway": "", - "_Renown": "", + "Renown": "Почёт", "_AddRenown": "", - "_Wisdom": "", - "_Glory": "", - "_Honor": "", - "_FormsOfGarou": "", - "_HomidName": "", - "_HomidTitle": "", - "_GlabroName": "", - "_GlabroTitle": "", + "Wisdom": "Мудрость", + "Glory": "Слава", + "Honor": "Честь", + "FormsOfGarou": "Формы Гару", + "HomidName": "Хомид", + "HomidTitle": "Человек", + "GlabroName": "Глабро", + "GlabroTitle": "Почти человеческая форма", "_CrinosName": "", - "_CrinosTitle": "", - "_HispoName": "", - "_HispoTitle": "", - "_LupusName": "", - "_LupusTitle": "", - "_PostFormToChat": "", - "_Patron": "", - "_Favor": "", - "_Ban": "", - "_Native": "", - "_Ragabash": "", - "_Theurge": "", - "_Philodox": "", - "_Galliard": "", - "_Ahroun": "", - "_BlackFury": "", - "_BoneGnawer": "", - "_ChildrenOfGaia": "", - "_Galestalker": "", - "_GhostCouncil": "", - "_GlassWalker": "", - "_HartWarden": "", - "_RedTalon": "", - "_ShadowLord": "", - "_SilentStrider": "", - "_SilverFang": "", - "_Rite": "" + "CrinosTitle": "Полу-волчья боевая форма", + "HispoName": "Хиспо", + "HispoTitle": "Почти волчья форма", + "LupusName": "Люпус", + "LupusTitle": "Волчья форма", + "PostFormToChat": "В чат", + "Patron": "Дух-Покровитель", + "Favor": "Долг", + "Ban": "Запрет", + "Native": "Коренной", + "Ragabash": "Рагабаш", + "Theurge": "Теург", + "Philodox": "Филодокс", + "Galliard": "Галлиард", + "Ahroun": "Арун", + "BlackFury": "Чёрные фурии", + "BoneGnawer": "Костегрызы", + "ChildrenOfGaia": "Дети Гайи", + "Galestalker": "Штормовые гончие", + "GhostCouncil": "Призрачный совет", + "GlassWalker": "Ходящие по стеклу", + "HartWarden": "Оленьи стражи", + "RedTalon": "Красные когти", + "ShadowLord": "Теневые владыки", + "SilentStrider": "Безмолвные странники", + "SilverFang": "Серебряные клыки", + "Rite": "Обряд" } } } From a54cf898dd29d514bbc759f6b28a6816e73bdd26 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sun, 9 Jun 2024 17:06:12 -0500 Subject: [PATCH 07/64] Most of the way there; custom attributes are working now! --- css/parts/menus.css | 4 +- css/wod5e.css | 1 - module/actor/scripts/counters.js | 35 +++-- module/actor/wod-v5-sheet.js | 14 +- module/def/attributes.js | 2 +- module/def/skills.js | 132 +++++++++++++++++- module/menus/storyteller-menu.js | 100 +++++++++++-- module/settings.js | 46 ++++-- module/templates.js | 2 + .../ui/parts/storyteller-menu/custom-menu.hbs | 24 ++++ .../storyteller-menu/modification-menu.hbs | 52 +++++++ templates/ui/storyteller-menu.hbs | 71 +++------- 12 files changed, 392 insertions(+), 91 deletions(-) create mode 100644 templates/ui/parts/storyteller-menu/custom-menu.hbs create mode 100644 templates/ui/parts/storyteller-menu/modification-menu.hbs diff --git a/css/parts/menus.css b/css/parts/menus.css index 962a0e67..b4c217bb 100644 --- a/css/parts/menus.css +++ b/css/parts/menus.css @@ -28,13 +28,13 @@ text-align: center; } -.wod5e-config-form.storyteller-menu .add-mod-button { +.wod5e-config-form.storyteller-menu .addition-button { border-radius: 0; font-weight: bold; letter-spacing: 0.05em; } -.wod5e-config-form.storyteller-menu .add-mod-button:hover { +.wod5e-config-form.storyteller-menu .addition-button:hover { cursor: pointer; outline: none; transition-duration: 0.3s; diff --git a/css/wod5e.css b/css/wod5e.css index 49e8d460..b6f50a00 100644 --- a/css/wod5e.css +++ b/css/wod5e.css @@ -355,7 +355,6 @@ .wod5e .sheet-body, .wod5e .sheet-body .tab, .wod5e .sheet-body .tab .editor { - height: 100%; min-height: 160px; } diff --git a/module/actor/scripts/counters.js b/module/actor/scripts/counters.js index 74b62a96..24873bc1 100644 --- a/module/actor/scripts/counters.js +++ b/module/actor/scripts/counters.js @@ -248,24 +248,35 @@ function parseCounterStates (states) { }, {}) } -// There's gotta be a better way to do this but for the life of me I can't figure it out -export const _assignToActorField = async function (fields, value, actor) { - // Top-level variables +// Handle assigning a new value to the appropriate actor field +export const _assignToActorField = async (fields, value, actor) => { const actorData = foundry.utils.duplicate(actor) - // update actor owned items + // Handle updating actor owned items if (fields.length === 2 && fields[0] === 'items') { - for (const item of actorData.items) { - if (fields[1] === item._id) { - item.system.points = value - break - } + const itemId = fields[1] + const item = actorData.items.find(item => item._id === itemId) + if (item) { + item.system.points = value + } else { + console.warn(`Item with ID ${itemId} not found.`) } } else { - const lastField = fields.pop() - fields.reduce((data, field) => data[field], actorData)[lastField] = value + try { + const lastField = fields.pop() + const target = fields.reduce((data, field) => { + if (!(field in data)) { + throw new Error(`Field "${field}" not found in actor data.`) + } + return data[field] + }, actorData) + target[lastField] = value + } catch (error) { + console.error(`Error updating actor field: ${error.message}`) + return + } } // Update the actor with the new data - actor.update(actorData) + await actor.update(actorData) } diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 8125ed89..f536c205 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -88,6 +88,14 @@ export class WoDActor extends ActorSheet { const attributesList = Attributes.getList() const actorAttributes = actorData.system?.abilities if (actorAttributes) { + // Clean up non-existent attributes, such as custom ones that no longer exist + const validAttributes = new Set(attributesList.map(entry => Object.keys(entry)[0])) + for (const id of Object.keys(actorAttributes)) { + if (!validAttributes.has(id)) { + delete actorAttributes[id] + } + } + for (const entry of attributesList) { // Assign the data to a value const [, value] = Object.entries(entry)[0] @@ -100,7 +108,11 @@ export class WoDActor extends ActorSheet { id, value: actorAttributes[id].value }, value) - } else { // Otherwise, use the default + } else { // Otherwise, add it to the actor and set it as some default data + await this.actor.update({ [`system.abilities.${id}`]: { + value + } }) + attributeData = Object.assign({ id, value: 1 diff --git a/module/def/attributes.js b/module/def/attributes.js index 3ef357e1..20d36178 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -14,7 +14,7 @@ export class Attributes { static addCustom(customAttributes) { for (const [key, value] of Object.entries(customAttributes)) { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { - this[key] = value + this[value.id] = value } } } diff --git a/module/def/skills.js b/module/def/skills.js index a06cc0d0..3b4416c6 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -46,7 +46,7 @@ export class Skills { // Run any necessary compilation on ready static onReady () { - const customSkills = game.settings.get('vtm5e', 'customSkills') + const customSkills = [] //game.settings.get('vtm5e', 'customSkills') if (customSkills) { Skills.addCustom(customSkills) @@ -59,6 +59,136 @@ export class Skills { label: 'WOD5E.Skills.Athletics', type: 'physical' } + + static animalken = { + label: 'WOD5E.Skills.AnimalKen', + type: 'social' + } + + static academics = { + label: 'WOD5E.Skills.Academics', + type: 'mental' + } + + static brawl = { + label: 'WOD5E.Skills.Brawl', + type: 'physical' + } + + static etiquette = { + label: 'WOD5E.Skills.Etiquette', + type: 'social' + } + + static awareness = { + label: 'WOD5E.Skills.Awareness', + type: 'mental' + } + + static craft = { + label: 'WOD5E.Skills.Craft', + type: 'physical' + } + + static insight = { + label: 'WOD5E.Skills.Insight', + type: 'social' + } + + static finance = { + label: 'WOD5E.Skills.Finance', + type: 'mental' + } + + static drive = { + label: 'WOD5E.Skills.Drive', + type: 'physical' + } + + static intimidation = { + label: 'WOD5E.Skills.Intimidation', + type: 'social' + } + + static investigation = { + label: 'WOD5E.Skills.Investigation', + type: 'mental' + } + + static firearms = { + label: 'WOD5E.Skills.Firearms', + type: 'physical' + } + + static leadership = { + label: 'WOD5E.Skills.Leadership', + type: 'social' + } + + static medicine = { + label: 'WOD5E.Skills.Medicine', + type: 'mental' + } + + static larceny = { + label: 'WOD5E.Skills.Larceny', + type: 'physical' + } + + static performance = { + label: 'WOD5E.Skills.Performance', + type: 'social' + } + + static occult = { + label: 'WOD5E.Skills.Occult', + type: 'mental' + } + + static melee = { + label: 'WOD5E.Skills.Melee', + type: 'physical' + } + + static persuasion = { + label: 'WOD5E.Skills.Persuasion', + type: 'social' + } + + static politics = { + label: 'WOD5E.Skills.Politics', + type: 'mental' + } + + static stealth = { + label: 'WOD5E.Skills.Stealth', + type: 'physical' + } + + static streetwise = { + label: 'WOD5E.Skills.Streetwise', + type: 'social' + } + + static science = { + label: 'WOD5E.Skills.Science', + type: 'mental' + } + + static survival = { + label: 'WOD5E.Skills.Survival', + type: 'physical' + } + + static subterfuge = { + label: 'WOD5E.Skills.Subterfuge', + type: 'social' + } + + static technology = { + label: 'WOD5E.Skills.Technology', + type: 'mental' + } } // Hook to call onReady when the game is ready diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 09082590..5eeb9b79 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -8,9 +8,14 @@ export class StorytellerMenu extends FormApplication { classes: ['wod5e'], template: 'systems/vtm5e/templates/ui/storyteller-menu.hbs', width: 500, - height: 'auto', + height: 450, resizable: true, - closeOnSubmit: true + closeOnSubmit: true, + tabs: [{ + navSelector: '.sheet-tabs', + contentSelector: '.sheet-body', + initial: 'modifications' + }] }) } @@ -20,10 +25,19 @@ export class StorytellerMenu extends FormApplication { async getData () { const data = await super.getData() + data.attributeTypes = { + physical: 'WOD5E.SPC.Physical', + social: 'WOD5E.SPC.Social', + mental: 'WOD5E.SPC.Mental' + } + // Grab the modifications from the game settings and add them to the application data data.attributeModifications = game.settings.get('vtm5e', 'modifiedAttributes') data.skillModifications = game.settings.get('vtm5e', 'modifiedSkills') + // Grab the custom attributes from the game settings and add them to the application data + data.customAttributes = game.settings.get('vtm5e', 'customAttributes') + return data } @@ -37,7 +51,7 @@ export class StorytellerMenu extends FormApplication { const data = event.target.dataset const type = data.type - generatePrompt(type) + _onGeneratePrompt(type) }) html.find('.remove-mod-button').click(function (event) { @@ -47,20 +61,55 @@ export class StorytellerMenu extends FormApplication { const type = data.type const id = data.id - removeChange(type, id) + _onRemoveChange(type, id) + }) + + html.find('.add-custom-button').click(function (event) { + event.preventDefault() + + const data = event.target.dataset + const type = data.type + + // Get the list of custom attributes + const customAttributes = game.settings.get('vtm5e', 'customAttributes') + + // Define the new attribute and push it to the list + const newAttribute = { + id: foundry.utils.randomID(8), + label: 'New Attribute', + type: 'physical' + } + customAttributes.push(newAttribute) + + console.log(customAttributes) + + // Set the new list of attributes + game.settings.set('vtm5e', 'customAttributes', customAttributes) + }) + + html.find('.remove-custom-button').click(function (event) { + event.preventDefault() + + const data = event.target.dataset + const type = data.type + const id = data.id + + _onRemoveCustom(type, id) }) html.find('.save-modifications').click(function (event) { event.preventDefault() const attributeModifications = [] + const customAttributes = [] const skillModifications = [] + // Modifications to existing features html.find('.modification-row').each(function () { - const modification = $(this)[0] - const id = modification.dataset.id - const type = modification.dataset.type - const label = modification.dataset.label + const featureMod = $(this)[0] + const id = featureMod.dataset.id + const type = featureMod.dataset.type + const label = featureMod.dataset.label const rename = $(this).find('.mod-rename')[0].value const hidden = $(this).find('.mod-hidden')[0].checked @@ -82,15 +131,40 @@ export class StorytellerMenu extends FormApplication { } }) + // Custom additions to existing features + html.find('.customization-row').each(function () { + const customFeature = $(this)[0] + const id = customFeature.dataset.id + const type = customFeature.dataset.type + + const label = $(this).find('.label')[0].value + const attrType = $(this).find('.attr-type')[0].value + + if (type === 'attribute') { + customAttributes.push({ + id, + type: attrType, + label + }) + }/* else if (type === 'skill') { + #customSkills.push({ + id, + type, + label + }) + }*/ + }) + // Save the new settings game.settings.set('vtm5e', 'modifiedAttributes', attributeModifications) + game.settings.set('vtm5e', 'customAttributes', customAttributes) game.settings.set('vtm5e', 'modifiedSkills', skillModifications) }) } } // Function for getting the information necessary for the selection dialog -async function generatePrompt (type) { +async function _onGeneratePrompt (type) { if (type === 'attribute') { const attributes = WOD5E.Attributes.getList() const attributesList = [] @@ -108,7 +182,7 @@ async function generatePrompt (type) { } // Render the dialog - renderPromptDialog('attribute', attributesList, game.i18n.localize('WOD5E.Attributes.Label')) + _onRenderPromptDialog('attribute', attributesList, game.i18n.localize('WOD5E.Attributes.Label')) } else if (type === 'skill') { const skills = WOD5E.Skills.getList() const skillsList = [] @@ -127,12 +201,12 @@ async function generatePrompt (type) { } // Render the dialog - renderPromptDialog('skill', skillsList, game.i18n.localize('WOD5E.Skills.Label')) + _onRenderPromptDialog('skill', skillsList, game.i18n.localize('WOD5E.Skills.Label')) } } // Function for rendering the dialog for adding a new modification -async function renderPromptDialog (type, list, title) { +async function _onRenderPromptDialog (type, list, title) { // Render the template const template = 'systems/vtm5e/templates/ui/select-dialog.hbs' const content = await renderTemplate(template, { list }) @@ -195,7 +269,7 @@ async function renderPromptDialog (type, list, title) { } // Function for removing a change -async function removeChange (type, id) { +async function _onRemoveChange (type, id) { if (type === 'attribute') { // Get the list of modified attributes let modifiedAttributes = game.settings.get('vtm5e', 'modifiedAttributes') diff --git a/module/settings.js b/module/settings.js index 54baa5cb..5d48bce7 100644 --- a/module/settings.js +++ b/module/settings.js @@ -144,6 +144,7 @@ export const loadSettings = async function () { Storyteller Settings */ + // Register the storyteller menu game.settings.registerMenu('vtm5e', 'storytellerMenu', { name: 'Storyteller Menu', label: 'Storyteller Settings', @@ -153,6 +154,7 @@ export const loadSettings = async function () { restricted: true }) + // Register the modified attributes game.settings.register('vtm5e', 'modifiedAttributes', { name: 'Attribute Modifications', hint: 'Allows for modification of existing attributes.', @@ -162,11 +164,31 @@ export const loadSettings = async function () { type: Array, onChange: async () => { // Re-render the storyteller menu window once settings are updated - const StorytellerWindow = Object.values(ui.windows).filter(w => (w.id === 'wod5e-storyteller'))[0] + this._rerenderStorytellerWindow() - if (StorytellerMenu) { - StorytellerWindow.render() - } + // Re-init labels + WOD5E.Attributes.initializeLabels() + + // Reload actorsheets + resetActors() + } + }) + + // Register the custom attributes + game.settings.register('vtm5e', 'customAttributes', { + name: 'Custom Attributes', + hint: 'Allows for the creation of custom attributes.', + scope: 'world', + config: false, + default: [], + type: Array, + onChange: async (customAttributes) => { + + // Re-render the storyteller menu window once settings are updated + _rerenderStorytellerWindow() + + // Grab the custom attributes and send them to the function to update the list + WOD5E.Attributes.addCustom(customAttributes) // Re-init labels WOD5E.Attributes.initializeLabels() @@ -176,6 +198,7 @@ export const loadSettings = async function () { } }) + // Register the modified skills game.settings.register('vtm5e', 'modifiedSkills', { name: 'Skill Modifications', hint: 'Allows for modification of existing skills.', @@ -185,11 +208,10 @@ export const loadSettings = async function () { type: Array, onChange: async () => { // Re-render the storyteller menu window once settings are updated - const StorytellerWindow = Object.values(ui.windows).filter(w => (w.id === 'wod5e-storyteller'))[0] + this._rerenderStorytellerWindow() - if (StorytellerWindow) { - StorytellerWindow.render() - } + // Grab the custom skills and send them to the function to update the list + WOD5E.Skills.addCustom(customAttributes) // Re-init labels WOD5E.Skills.initializeLabels() @@ -199,3 +221,11 @@ export const loadSettings = async function () { } }) } + +function _rerenderStorytellerWindow () { + const storytellerWindow = Object.values(ui.windows).filter(w => (w.id === 'wod5e-storyteller'))[0] + + if (storytellerWindow) { + storytellerWindow.render() + } +} diff --git a/module/templates.js b/module/templates.js index 6845d483..2600140c 100644 --- a/module/templates.js +++ b/module/templates.js @@ -93,6 +93,8 @@ export const preloadHandlebarsTemplates = async function () { // Menu Partials 'systems/vtm5e/templates/ui/automation-menu.hbs', 'systems/vtm5e/templates/ui/storyteller-menu.hbs', + 'systems/vtm5e/templates/ui/parts/storyteller-menu/modification-menu.hbs', + 'systems/vtm5e/templates/ui/parts/storyteller-menu/custom-menu.hbs', 'systems/vtm5e/templates/ui/select-dialog.hbs' ] diff --git a/templates/ui/parts/storyteller-menu/custom-menu.hbs b/templates/ui/parts/storyteller-menu/custom-menu.hbs new file mode 100644 index 00000000..adc1d168 --- /dev/null +++ b/templates/ui/parts/storyteller-menu/custom-menu.hbs @@ -0,0 +1,24 @@ +
+
+

Custom Attributes

+
+

Allows the storyteller to add custom attributes to the actor sheets.

+
+
Label
+
Attribute Type
+
+ {{#each customAttributes as |attribute id|}} +
+ + +
+ {{/each}} + +
+
+
diff --git a/templates/ui/parts/storyteller-menu/modification-menu.hbs b/templates/ui/parts/storyteller-menu/modification-menu.hbs new file mode 100644 index 00000000..06a0743f --- /dev/null +++ b/templates/ui/parts/storyteller-menu/modification-menu.hbs @@ -0,0 +1,52 @@ +
+
+

Modified Attributes

+
+

Allows the storyteller to modify the attributes on actor sheets.

+
+
Attribute
+
Rename
+
Hidden
+
+ {{#each attributeModifications as |attribute id|}} +
+
+ + {{attribute.label}} +
+ + +
+ {{/each}} + +
+
+
+

Modified Skills

+
+

Allows the storyteller to modify the skills on actor sheets.

+
+
Skill
+
Rename
+
Hidden
+
+ {{#each skillModifications as |skill id|}} +
+
+ + {{skill.label}} +
+ + +
+ {{/each}} + +
+
+
diff --git a/templates/ui/storyteller-menu.hbs b/templates/ui/storyteller-menu.hbs index d2894f0f..30fbf7e3 100644 --- a/templates/ui/storyteller-menu.hbs +++ b/templates/ui/storyteller-menu.hbs @@ -1,55 +1,22 @@
-
-

Modified Attributes

-
-

Allows the storyteller to modify the attributes on actor sheets.

-
-
Attribute
-
Rename
-
Hidden
-
- {{#each attributeModifications as |attribute id|}} -
-
- - {{attribute.label}} -
- - -
- {{/each}} - + {{!-- Cell Sheet Tab Navigation --}} + + + {{!-- Menu Body --}} +
+ {{!-- Modifications Tab --}} + {{> "systems/vtm5e/templates/ui/parts/storyteller-menu/modification-menu.hbs"}} + + {{!-- Custom Tab --}} + {{> "systems/vtm5e/templates/ui/parts/storyteller-menu/custom-menu.hbs"}} + + {{!-- Save button --}} +
+
+
-
-
-

Modified Skills

-
-

Allows the storyteller to modify the skills on actor sheets.

-
-
Skill
-
Rename
-
Hidden
-
- {{#each skillModifications as |skill id|}} -
-
- - {{skill.label}} -
- - -
- {{/each}} - -
-
-
- -
+ From a4b7f3841a5a5c446339a7f904ac5d37602f0856 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sun, 9 Jun 2024 17:09:20 -0500 Subject: [PATCH 08/64] Fix layout in the custom menu --- templates/ui/parts/storyteller-menu/custom-menu.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ui/parts/storyteller-menu/custom-menu.hbs b/templates/ui/parts/storyteller-menu/custom-menu.hbs index adc1d168..5d0603fc 100644 --- a/templates/ui/parts/storyteller-menu/custom-menu.hbs +++ b/templates/ui/parts/storyteller-menu/custom-menu.hbs @@ -3,7 +3,7 @@

Custom Attributes

Allows the storyteller to add custom attributes to the actor sheets.

-
+
Label
Attribute Type
From 81f545218a5ea895b1db99b7983300689cca3890 Mon Sep 17 00:00:00 2001 From: Veilza Date: Mon, 10 Jun 2024 20:56:45 -0500 Subject: [PATCH 09/64] Upgrades to the generateLabelAndLocalize function to allow for custom keys, removes toLowerCase --- module/api/wod5e-api.js | 71 +++++++++++++---------------------------- 1 file changed, 22 insertions(+), 49 deletions(-) diff --git a/module/api/wod5e-api.js b/module/api/wod5e-api.js index a37ba1de..8378026f 100644 --- a/module/api/wod5e-api.js +++ b/module/api/wod5e-api.js @@ -318,63 +318,36 @@ export class wod5eAPI { } } - static async generateLabelAndLocalize ({ + static async generateLabelAndLocalize({ string = '' }) { - // Always lowercase any labels we're localizing - // customRoll is the one exception to this rule - const str = string === 'customRoll' ? 'customRoll' : string.toLowerCase() - // Lists - const attributes = WOD5E.Attributes.getList() - const skills = WOD5E.Skills.getList() - const features = WOD5E.Features.getList() - const items = WOD5E.ItemTypes.getList() - const disciplines = WOD5E.Disciplines.getList() - const renown = WOD5E.Renown.getList() - const edges = WOD5E.Edges.getList() - - // Attributes - if (attributes.find(obj => str in obj)) { - return findLabel(attributes, str) - } - // Skills - if (skills.find(obj => str in obj)) { - return findLabel(skills, str) - } - // Features - if (features.find(obj => str in obj)) { - return findLabel(features, str) - } - // Items - if (items.find(obj => str in obj)) { - return findLabel(items, str) - } - // Disciplines - if (disciplines.find(obj => str in obj)) { - return findLabel(disciplines, str) - } - // Renown - if (renown.find(obj => str in obj)) { - return findLabel(renown, str) - } - // Edges - if (edges.find(obj => str in obj)) { - return findLabel(edges, str) + const lists = [ + WOD5E.Attributes.getList(), + WOD5E.Skills.getList(), + WOD5E.Features.getList(), + WOD5E.ItemTypes.getList(), + WOD5E.Disciplines.getList(), + WOD5E.Renown.getList(), + WOD5E.Edges.getList() + ] + + // Iterate through each list to find the label + for (const list of lists) { + const label = findLabel(list, string) + + if (label) { + return label + } } // Return the base localization if nothing else is found - return game.i18n.localize(`WOD5E.${str}`) + return game.i18n.localize(`WOD5E.${string}`) // Function to actually grab the localized label - function findLabel (list, string) { - const stringObject = list.find(obj => string in obj) - - // Return the localized string if found - if (stringObject) return stringObject[string].displayName - - // Return nothing - return '' + function findLabel(list, str) { + const strObject = list.find(obj => str in obj) + return strObject ? strObject[str].displayName : '' } } } From ea9f899dffc37a70d84555081602ac871d254a51 Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 17:40:02 -0500 Subject: [PATCH 10/64] Fixed an issue where the ifEquals selector wouldn't reveal the extra fields if it was a new bonus --- module/item/scripts/item-bonuses.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/module/item/scripts/item-bonuses.js b/module/item/scripts/item-bonuses.js index 18d88052..e5fb6303 100644 --- a/module/item/scripts/item-bonuses.js +++ b/module/item/scripts/item-bonuses.js @@ -74,7 +74,23 @@ export const _onAddBonus = async function (event, item) { label: game.i18n.localize('WOD5E.Cancel') } }, - default: 'add' + default: 'add', + render: (html) => { + // Active When Handler + const activeWhenCheck = html.find('#activeWhenCheck') + const activeWhenPath = html.find('#activeWhenPath').parent() + const activeWhenValue = html.find('#activeWhenValue').parent() + + activeWhenCheck.on('change', function () { + if (activeWhenCheck.val() === 'ifEquals') { + activeWhenPath.css('visibility', 'visible') + activeWhenValue.css('visibility', 'visible') + } else { + activeWhenPath.css('visibility', 'hidden') + activeWhenValue.css('visibility', 'hidden') + } + }) + } } ).render(true) } From 9caaedfc01c242e0c4635e7e3b07438fe73c5719 Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 19:17:49 -0500 Subject: [PATCH 11/64] Rework how getList() actually returns the list to cut down on unnecessary code --- module/actor/actor.js | 12 ++--- module/actor/hunter-actor-sheet.js | 8 ++-- module/actor/scripts/roll.js | 2 +- module/actor/scripts/specialty-bonuses.js | 6 +-- module/actor/werewolf-actor-sheet.js | 12 ++--- module/actor/wod-v5-sheet.js | 39 ++++++++-------- module/api/wod5e-api.js | 39 ++-------------- module/def/actortypes.js | 5 +- module/def/attributes.js | 5 +- module/def/disciplines.js | 5 +- module/def/edges.js | 5 +- module/def/features.js | 5 +- module/def/gifts.js | 10 ++-- module/def/itemtypes.js | 5 +- module/def/renown.js | 5 +- module/def/skills.js | 5 +- module/def/systems.js | 5 +- module/def/were-forms.js | 10 ++-- module/helpers.js | 56 ++++------------------- module/item/item.js | 16 +++---- module/main.js | 3 +- module/menus/storyteller-menu.js | 31 +------------ module/scripts/system-rolls.js | 2 +- module/scripts/willpower-reroll.js | 2 +- templates/item/parts/attributes.hbs | 4 +- templates/item/parts/skills.hbs | 4 +- 26 files changed, 119 insertions(+), 182 deletions(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index 18cbb754..174537a6 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -40,13 +40,11 @@ export class ActorInfo extends Actor { // Reorganize the actor templates into something usable for the creation form const actorTypes = {} - for (const i in actorTemplateTypes) { - const actorType = actorTemplateTypes[i] - - // If the actor template has a label, add it to the types list - // Otherwise, default to the actor's key - const actorFromList = WOD5E.ActorTypes.getList().find(obj => actorType in obj) - actorTypes[actorType] = actorFromList ? actorFromList[actorType].label : actorType + const actorTypesList = WOD5E.ActorTypes.getList() + // Cycle through all the template types, and use a label if one is found; + // default to just the base type (key) provided + for (const actorType of actorTemplateTypes) { + actorTypes[actorType] = actorTypesList[actorType] ? actorTypesList[actorType].label : actorType } // Render the document creation form diff --git a/module/actor/hunter-actor-sheet.js b/module/actor/hunter-actor-sheet.js index 267b3ef0..b17ec149 100644 --- a/module/actor/hunter-actor-sheet.js +++ b/module/actor/hunter-actor-sheet.js @@ -188,8 +188,8 @@ export class HunterActorSheet extends WoDActor { // If the type of edge is already set, we don't need to ask for it if (header.dataset.edge) { // Get the image for the item, if one is available from the item definitions - const itemFromList = WOD5E.ItemTypes.getList().find(obj => 'perk' in obj) - const img = itemFromList.perk.img ? itemFromList.perk.img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + const img = itemsList?.perk?.img ? itemsList.perk.img : 'systems/vtm5e/assets/icons/items/item-default.svg' // Prepare the item object. const itemData = { @@ -230,8 +230,8 @@ export class HunterActorSheet extends WoDActor { const edge = html.find('#edgeSelect')[0].value // Get the image for the item, if one is available from the item definitions - const itemFromList = WOD5E.ItemTypes.getList().find(obj => 'perk' in obj) - const img = itemFromList.perk.img ? itemFromList.perk.img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + const img = itemsList?.perk?.img ? itemsList.perk.img : 'systems/vtm5e/assets/icons/items/item-default.svg' // Prepare the item object. const itemData = { diff --git a/module/actor/scripts/roll.js b/module/actor/scripts/roll.js index 995960cd..5e2dca79 100644 --- a/module/actor/scripts/roll.js +++ b/module/actor/scripts/roll.js @@ -77,7 +77,7 @@ export const _onConfirmRoll = async function (dataset, actor) { } // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Some quick modifications to vampire and werewolf rolls // in order to properly display the dice in the dialog window diff --git a/module/actor/scripts/specialty-bonuses.js b/module/actor/scripts/specialty-bonuses.js index b01dae08..c786a7f4 100644 --- a/module/actor/scripts/specialty-bonuses.js +++ b/module/actor/scripts/specialty-bonuses.js @@ -7,7 +7,7 @@ export const _onAddBonus = async function (event, actor, data, SkillEditDialog) const bonusPath = header.dataset.bonusPath // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Default values for a new specialty const bonusData = { @@ -98,7 +98,7 @@ export const _onDeleteBonus = async function (event, actor, data, SkillEditDialo const bonusPath = header.dataset.bonusPath // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Define the existing list of bonuses const bonusKeys = bonusPath.split('.') @@ -133,7 +133,7 @@ export const _onEditBonus = async function (event, actor, data, SkillEditDialog) } // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Render the template const bonusTemplate = 'systems/vtm5e/templates/actor/parts/specialty-display.hbs' diff --git a/module/actor/werewolf-actor-sheet.js b/module/actor/werewolf-actor-sheet.js index f3e560f2..98e759e4 100644 --- a/module/actor/werewolf-actor-sheet.js +++ b/module/actor/werewolf-actor-sheet.js @@ -258,8 +258,8 @@ export class WerewolfActorSheet extends WoDActor { // If the type of gift is already set, we don't need to ask for it if (header.dataset.gift) { // Get the image for the item, if one is available from the item definitions - const itemFromList = WOD5E.ItemTypes.getList().find(obj => 'gift' in obj) - const img = itemFromList.gift.img ? itemFromList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + const img = itemsList?.gift?.img ? itemsList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' // Prepare the item object. const itemData = { @@ -300,8 +300,8 @@ export class WerewolfActorSheet extends WoDActor { const gift = html.find('#giftSelect')[0].value // Get the image for the item, if one is available from the item definitions - const itemFromList = WOD5E.ItemTypes.getList().find(obj => 'gift' in obj) - const img = itemFromList.gift.img ? itemFromList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + const img = itemsList?.gift?.img ? itemsList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' // Prepare the item object. const itemData = { @@ -350,8 +350,8 @@ export class WerewolfActorSheet extends WoDActor { const actor = this.actor // Get the image for the item, if one is available from the item definitions - const itemFromList = WOD5E.ItemTypes.getList().find(obj => 'gift' in obj) - const img = itemFromList.gift.img ? itemFromList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + const img = itemsList?.gift?.img ? itemsList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' // Prepare the item object. const itemData = { diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index f536c205..38f6aea3 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -87,19 +87,17 @@ export class WoDActor extends ActorSheet { // Loop through each entry in the attributes list, get the data (if available), and then push to the containers const attributesList = Attributes.getList() const actorAttributes = actorData.system?.abilities + if (actorAttributes) { // Clean up non-existent attributes, such as custom ones that no longer exist - const validAttributes = new Set(attributesList.map(entry => Object.keys(entry)[0])) + const validAttributes = new Set(Object.keys(attributesList)) for (const id of Object.keys(actorAttributes)) { if (!validAttributes.has(id)) { delete actorAttributes[id] } } - for (const entry of attributesList) { - // Assign the data to a value - const [, value] = Object.entries(entry)[0] - const id = Object.getOwnPropertyNames(entry)[0] + for (const [id, value] of Object.entries(attributesList)) { let attributeData = {} // If the actor has an attribute with the key, grab its current values @@ -109,9 +107,7 @@ export class WoDActor extends ActorSheet { value: actorAttributes[id].value }, value) } else { // Otherwise, add it to the actor and set it as some default data - await this.actor.update({ [`system.abilities.${id}`]: { - value - } }) + await this.actor.update({ [`system.abilities.${id}`]: { value } }) attributeData = Object.assign({ id, @@ -119,9 +115,10 @@ export class WoDActor extends ActorSheet { }, value) } - // Push to the container in the appropraite type + // Push to the container in the appropriate type // as long as the attribute isn't "hidden" if (!attributeData.hidden) { + if (!attributes[value.type]) attributes[value.type] = [] // Ensure the type exists attributes[value.type].push(attributeData) } } @@ -132,15 +129,20 @@ export class WoDActor extends ActorSheet { const actorSkills = actorData.system?.skills if (actorSkills) { - for (const entry of skillsList) { - // Assign the data to a value - const [, value] = Object.entries(entry)[0] - const id = Object.getOwnPropertyNames(entry)[0] + // Clean up non-existent skills, such as custom ones that no longer exist + const validSkills = new Set(Object.keys(skillsList)) + for (const id of Object.keys(actorSkills)) { + if (!validSkills.has(id)) { + delete actorSkills[id] + } + } + + for (const [id, value] of Object.entries(skillsList)) { let skillData = {} let hasSpecialties = false const specialtiesList = [] - if (actorSkills[id].bonuses.length > 0) { + if (actorSkills[id]?.bonuses?.length > 0) { hasSpecialties = true for (const bonus of actorSkills[id].bonuses) { @@ -166,9 +168,10 @@ export class WoDActor extends ActorSheet { }, value) } - // Push to the container in the appropraite type + // Push to the container in the appropriate type // as long as the skill isn't "hidden" if (!skillData.hidden) { + if (!skills[value.type]) skills[value.type] = [] // Ensure the type exists skills[value.type].push(skillData) } } @@ -357,8 +360,8 @@ export class WoDActor extends ActorSheet { } // Get the image for the item, if one is available from the item definitions - const itemFromList = WOD5E.ItemTypes.getList().find(obj => type in obj) - const img = itemFromList[type].img ? itemFromList[type].img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + const img = itemsList[type]?.img ? itemsList[type].img : 'systems/vtm5e/assets/icons/items/item-default.svg' // Initialize a default name. const name = await WOD5E.api.generateLabelAndLocalize({ string: prelocalizeString }) @@ -391,7 +394,7 @@ export class WoDActor extends ActorSheet { const skill = header.dataset.skill // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Render selecting a skill/attribute to roll const skillTemplate = 'systems/vtm5e/templates/actor/parts/skill-dialog.hbs' diff --git a/module/api/wod5e-api.js b/module/api/wod5e-api.js index 8378026f..892f10d3 100644 --- a/module/api/wod5e-api.js +++ b/module/api/wod5e-api.js @@ -96,40 +96,12 @@ export class wod5eAPI { const { skill, attribute, discipline, renown } = dataset // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Attribute definitions - const attributes = WOD5E.Attributes.getList() - const attributesList = [] - - for (const attribute of attributes) { - // Assign the data to a value - const [, value] = Object.entries(attribute)[0] - const id = Object.getOwnPropertyNames(attribute)[0] - const displayName = value.displayName - - attributesList.push({ - id, - displayName - }) - } - + const attributesList = WOD5E.Attributes.getList() // Skill definitions - const skills = WOD5E.Skills.getList() - const skillsList = [] - - for (const skill of skills) { - // Assign the data to a value - const [, value] = Object.entries(skill)[0] - const id = Object.getOwnPropertyNames(skill)[0] - - const displayName = value.displayName - - skillsList.push({ - id, - displayName - }) - } + const skillsList = WOD5E.Skills.getList() // Render selecting a skill/attribute to roll const dialogTemplate = 'systems/vtm5e/templates/ui/select-dice-dialog.hbs' @@ -299,7 +271,7 @@ export class wod5eAPI { const actorData = actor.system // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' if (system === 'vampire' && actor.type !== 'ghoul' && actor.type !== 'spc') { // Define actor's hunger dice, ensuring it can't go below 0 @@ -346,8 +318,7 @@ export class wod5eAPI { // Function to actually grab the localized label function findLabel(list, str) { - const strObject = list.find(obj => str in obj) - return strObject ? strObject[str].displayName : '' + return str in list ? list[str].displayName : '' } } } diff --git a/module/def/actortypes.js b/module/def/actortypes.js index 1f1786ee..0ee65508 100644 --- a/module/def/actortypes.js +++ b/module/def/actortypes.js @@ -19,7 +19,10 @@ export class ActorTypes { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/attributes.js b/module/def/attributes.js index 20d36178..f076bb4e 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -7,7 +7,10 @@ export class Attributes { static getList (type) { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && (!type || value.type === type)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Method to add extra attributes diff --git a/module/def/disciplines.js b/module/def/disciplines.js index c4ac7c3b..daedfd99 100644 --- a/module/def/disciplines.js +++ b/module/def/disciplines.js @@ -6,7 +6,10 @@ export class Disciplines { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/edges.js b/module/def/edges.js index 609c4f6e..5b885708 100644 --- a/module/def/edges.js +++ b/module/def/edges.js @@ -6,7 +6,10 @@ export class Edges { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/features.js b/module/def/features.js index 60fb6bfe..e038b0b1 100644 --- a/module/def/features.js +++ b/module/def/features.js @@ -6,7 +6,10 @@ export class Features { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/gifts.js b/module/def/gifts.js index f787e780..c5f42718 100644 --- a/module/def/gifts.js +++ b/module/def/gifts.js @@ -3,11 +3,13 @@ export class Gifts { // Function to help with quickly grabbing all the listed values; // Will only retrieve objects (definitions) - // Optional string can be provided to filter by type - static getList (type) { + static getList () { return Object.entries(this) - .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && (!type || value.type === type)) - .map(([key, value]) => ({ [key]: value })) + .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/itemtypes.js b/module/def/itemtypes.js index 15401779..01a4a178 100644 --- a/module/def/itemtypes.js +++ b/module/def/itemtypes.js @@ -6,7 +6,10 @@ export class ItemTypes { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/renown.js b/module/def/renown.js index 395a5bf8..042a1913 100644 --- a/module/def/renown.js +++ b/module/def/renown.js @@ -6,7 +6,10 @@ export class Renown { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/skills.js b/module/def/skills.js index 3b4416c6..2bcc1166 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -7,7 +7,10 @@ export class Skills { static getList (type) { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && (!type || value.type === type)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Method to add extra skills diff --git a/module/def/systems.js b/module/def/systems.js index 0b2b1803..66f6c27d 100644 --- a/module/def/systems.js +++ b/module/def/systems.js @@ -6,7 +6,10 @@ export class Systems { static getList () { return Object.entries(this) .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) - .map(([key, value]) => ({ [key]: value })) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/def/were-forms.js b/module/def/were-forms.js index bde30494..67509a08 100644 --- a/module/def/were-forms.js +++ b/module/def/were-forms.js @@ -3,11 +3,13 @@ export class WereForms { // Function to help with quickly grabbing all the listed values; // Will only retrieve objects (definitions) - // Optional string can be provided to filter by type - static getList (type) { + static getList () { return Object.entries(this) - .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && (!type || value.type === type)) - .map(([key, value]) => ({ [key]: value })) + .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value)) + .reduce((accumulator, [key, value]) => { + accumulator[key] = value + return accumulator + }, {}) } // Localize the labels diff --git a/module/helpers.js b/module/helpers.js index a43d4b53..d2039b0a 100644 --- a/module/helpers.js +++ b/module/helpers.js @@ -71,48 +71,12 @@ export const loadHelpers = async function () { // Helper to define attributes lists Handlebars.registerHelper('getAttributesList', function () { - // Attribute definitions - const attributes = WOD5E.Attributes.getList() - const attributesList = [] - - for (const attribute of attributes) { - // Assign the data to a value - const [, value] = Object.entries(attribute)[0] - const id = Object.getOwnPropertyNames(attribute)[0] - const displayName = value.displayName - const hidden = value.hidden - - attributesList.push({ - id, - displayName, - hidden - }) - } - - return attributesList + return WOD5E.Attributes.getList() }) // Helper to define skills lists Handlebars.registerHelper('getSkillsList', function () { - // Skill definitions - const skills = WOD5E.Skills.getList() - const skillsList = [] - - for (const skill of skills) { - // Assign the data to a value - const [, value] = Object.entries(skill)[0] - const id = Object.getOwnPropertyNames(skill)[0] - const displayName = value.displayName - const hidden = value.hidden - - skillsList.push({ - id, - displayName, - hidden - }) - } - - return skillsList + return WOD5E.Skills.getList() }) Handlebars.registerHelper('generateLocalizedLabel', function (str) { @@ -125,27 +89,27 @@ export const loadHelpers = async function () { const edges = WOD5E.Edges.getList() // Attributes - if (attributes.find(obj => str in obj)) { + if (str in attributes) { return findLabel(attributes, str) } // Skills - if (skills.find(obj => str in obj)) { + if (str in skills) { return findLabel(skills, str) } // Features - if (features.find(obj => str in obj)) { + if (str in features) { return findLabel(features, str) } // Disciplines - if (disciplines.find(obj => str in obj)) { + if (str in disciplines) { return findLabel(disciplines, str) } // Renown - if (renown.find(obj => str in obj)) { + if (str in renown) { return findLabel(renown, str) } // Edges - if (edges.find(obj => str in obj)) { + if (str in edges) { return findLabel(edges, str) } @@ -155,8 +119,8 @@ export const loadHelpers = async function () { // Function to actually grab the localized label function findLabel (list, string) { - const stringObject = list.find(obj => string in obj)[string] - + const stringObject = list[string] + // Return the localized string if found if (stringObject?.displayName) return stringObject.displayName if (stringObject?.label) return stringObject.label diff --git a/module/item/item.js b/module/item/item.js index 06bdeb3c..b5e47aec 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -40,13 +40,11 @@ export class ItemInfo extends Item { // Reorganize the item templates into something usable for the creation form const itemTypes = {} - for (const i in itemTemplateTypes) { - const itemType = itemTemplateTypes[i] - - // If the item template has a label, add it to the types list - // Otherwise, default to the item's key - const itemFromList = WOD5E.ItemTypes.getList().find(obj => itemType in obj) - itemTypes[itemType] = itemFromList ? itemFromList[itemType].label : itemType + const itemTypesList = WOD5E.ItemTypes.getList() + // Cycle through all the template types, and use a label if one is found; + // default to just the base type (key) provided + for (const itemType of itemTemplateTypes) { + itemTypes[itemType] = itemTypesList[itemType] ? itemTypesList[itemType].label : itemType } // Render the document creation form @@ -74,8 +72,8 @@ export class ItemInfo extends Item { // Force a default name if none is given if (!data.name) data.name = game.i18n.format('DOCUMENT.New', { type: itemTypes[data.type] }) // Generate a default image depending on the item type - const itemFromList = WOD5E.ItemTypes.getList().find(obj => data.type in obj) - data.img = itemFromList[data.type].img ? itemFromList[data.type].img : 'systems/vtm5e/assets/icons/items/item-default.svg' + const itemsList = WOD5E.ItemTypes.getList() + data.img = itemsList[data.type].img ? itemsList[data.type].img : 'systems/vtm5e/assets/icons/items/item-default.svg' // If folder isn't given, delete the field if (!data.folder) delete data.folder // Choose the default item type if there's only one diff --git a/module/main.js b/module/main.js index 552a2cff..cc9fa40c 100644 --- a/module/main.js +++ b/module/main.js @@ -56,8 +56,7 @@ Hooks.once('init', async function () { Actors.unregisterSheet('core', ActorSheet) // Loop through each entry in the actorTypesList and register their sheet classes const actorTypesList = ActorTypes.getList() - for (const entry of actorTypesList) { - const [, value] = Object.entries(entry)[0] + for (const [key, value] of Object.entries(actorTypesList)) { const { types, sheetClass } = value Actors.registerSheet('vtm5e', sheetClass, { diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 5eeb9b79..9fba7be1 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -166,39 +166,12 @@ export class StorytellerMenu extends FormApplication { // Function for getting the information necessary for the selection dialog async function _onGeneratePrompt (type) { if (type === 'attribute') { - const attributes = WOD5E.Attributes.getList() - const attributesList = [] - - for (const attribute of attributes) { - // Assign the data to a value - const [, value] = Object.entries(attribute)[0] - const id = Object.getOwnPropertyNames(attribute)[0] - const label = value.label - - attributesList.push({ - id, - label - }) - } + const attributesList = WOD5E.Attributes.getList() // Render the dialog _onRenderPromptDialog('attribute', attributesList, game.i18n.localize('WOD5E.Attributes.Label')) } else if (type === 'skill') { - const skills = WOD5E.Skills.getList() - const skillsList = [] - - for (const skill of skills) { - // Assign the data to a value - const [, value] = Object.entries(skill)[0] - const id = Object.getOwnPropertyNames(skill)[0] - - const label = value.label - - skillsList.push({ - id, - label - }) - } + const skillsList = WOD5E.Skills.getList() // Render the dialog _onRenderPromptDialog('skill', skillsList, game.i18n.localize('WOD5E.Skills.Label')) diff --git a/module/scripts/system-rolls.js b/module/scripts/system-rolls.js index df86e779..8fbab983 100644 --- a/module/scripts/system-rolls.js +++ b/module/scripts/system-rolls.js @@ -57,7 +57,7 @@ class WOD5eDice { advancedCheckDice = 0 }) { // Define the actor's gamesystem, defaulting to 'mortal' if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Handle getting any situational modifiers const situationalModifiers = await getSituationalModifiers({ diff --git a/module/scripts/willpower-reroll.js b/module/scripts/willpower-reroll.js index c5b049b0..b2b39dc4 100644 --- a/module/scripts/willpower-reroll.js +++ b/module/scripts/willpower-reroll.js @@ -16,7 +16,7 @@ export const willpowerReroll = async (roll) => { const actor = game.actors.get(message.speaker.actor) // Define the actor's gamesystem, defaulting to 'mortal' if it's not in the systems list - const system = WOD5E.Systems.getList().find(obj => actor.system.gamesystem in obj) ? actor.system.gamesystem : 'mortal' + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Go through the message's dice and add them to the diceRolls array Object.keys(dice).forEach(function (i) { diff --git a/templates/item/parts/attributes.hbs b/templates/item/parts/attributes.hbs index 03de74e5..567ecfa1 100644 --- a/templates/item/parts/attributes.hbs +++ b/templates/item/parts/attributes.hbs @@ -1,5 +1,5 @@ -{{#each (getAttributesList) as |attribute|}} +{{#each (getAttributesList) as |attribute key|}} {{#unless attribute.hidden}} - + {{/unless}} {{/each}} diff --git a/templates/item/parts/skills.hbs b/templates/item/parts/skills.hbs index df27f0db..20f152bb 100644 --- a/templates/item/parts/skills.hbs +++ b/templates/item/parts/skills.hbs @@ -1,5 +1,5 @@ -{{#each (getSkillsList) as |skill|}} +{{#each (getSkillsList) as |skill key|}} {{#unless skill.hidden}} - + {{/unless}} {{/each}} From 199063f66cf72e89471920c33ae13e5d6f872862 Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 19:18:03 -0500 Subject: [PATCH 12/64] Fix issue with re-rendering the storyteller menu --- module/settings.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/module/settings.js b/module/settings.js index 5d48bce7..9cb9f4e9 100644 --- a/module/settings.js +++ b/module/settings.js @@ -164,7 +164,7 @@ export const loadSettings = async function () { type: Array, onChange: async () => { // Re-render the storyteller menu window once settings are updated - this._rerenderStorytellerWindow() + _rerenderStorytellerWindow() // Re-init labels WOD5E.Attributes.initializeLabels() @@ -208,10 +208,7 @@ export const loadSettings = async function () { type: Array, onChange: async () => { // Re-render the storyteller menu window once settings are updated - this._rerenderStorytellerWindow() - - // Grab the custom skills and send them to the function to update the list - WOD5E.Skills.addCustom(customAttributes) + _rerenderStorytellerWindow() // Re-init labels WOD5E.Skills.initializeLabels() From 908f15c82b0d5a29fded60ce1329a16bcda7f319 Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 20:06:26 -0500 Subject: [PATCH 13/64] Various fixes to situational modifiers and its "ifEquals" field --- module/item/scripts/item-bonuses.js | 4 ++-- module/scripts/rolls/situational-modifiers.js | 2 +- templates/item/parts/bonus-display.hbs | 10 +++++----- templates/item/parts/bonuses.hbs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/module/item/scripts/item-bonuses.js b/module/item/scripts/item-bonuses.js index e5fb6303..502317f1 100644 --- a/module/item/scripts/item-bonuses.js +++ b/module/item/scripts/item-bonuses.js @@ -82,7 +82,7 @@ export const _onAddBonus = async function (event, item) { const activeWhenValue = html.find('#activeWhenValue').parent() activeWhenCheck.on('change', function () { - if (activeWhenCheck.val() === 'ifEquals') { + if (activeWhenCheck.val() === 'isEqual') { activeWhenPath.css('visibility', 'visible') activeWhenValue.css('visibility', 'visible') } else { @@ -185,7 +185,7 @@ export const _onEditBonus = async function (event, item) { const activeWhenValue = html.find('#activeWhenValue').parent() activeWhenCheck.on('change', function () { - if (activeWhenCheck.val() === 'ifEquals') { + if (activeWhenCheck.val() === 'isEqual') { activeWhenPath.css('visibility', 'visible') activeWhenValue.css('visibility', 'visible') } else { diff --git a/module/scripts/rolls/situational-modifiers.js b/module/scripts/rolls/situational-modifiers.js index b681da68..adba3ca7 100644 --- a/module/scripts/rolls/situational-modifiers.js +++ b/module/scripts/rolls/situational-modifiers.js @@ -72,7 +72,7 @@ export async function getSituationalModifiers ({ if (check === 'isEqual') { const pathValue = path.split('.').reduce((obj, key) => obj[key], data) modifier.isActive = true - return pathValue === value + return String(pathValue) === value } // If the modifier should be shown no matter what, still return it diff --git a/templates/item/parts/bonus-display.hbs b/templates/item/parts/bonus-display.hbs index c4d7ecca..29864d5c 100644 --- a/templates/item/parts/bonus-display.hbs +++ b/templates/item/parts/bonus-display.hbs @@ -16,17 +16,17 @@
{{localize "WOD5E.Bonus.ActiveWhen"}} - - +
-
+
{{localize "WOD5E.Bonus.PathToCheck"}}
-
+
{{localize "WOD5E.Bonus.ValueToCheck"}}
@@ -35,4 +35,4 @@ {{localize "WOD5E.Bonus.PathsSeparatedBySemicolons"}}
-
\ No newline at end of file +
diff --git a/templates/item/parts/bonuses.hbs b/templates/item/parts/bonuses.hbs index f4fdc0fc..89a6fb1f 100644 --- a/templates/item/parts/bonuses.hbs +++ b/templates/item/parts/bonuses.hbs @@ -32,10 +32,10 @@
- {{#ifeq bonus.activeWhen.check 'ifEquals'}} + {{#ifeq bonus.activeWhen.check 'isEqual'}}
{{localize "WOD5E.Bonus.PathToCheck"}} @@ -59,4 +59,4 @@ {{localize "WOD5E.Bonus.AddNewBonus"}}
-
\ No newline at end of file +
From 73c65ef3a82f11070710e0910a35435d95320bd4 Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 20:18:11 -0500 Subject: [PATCH 14/64] Linting --- module/api/wod5e-api.js | 4 +- module/def/attributes.js | 4 +- module/def/skills.js | 4 +- module/helpers.js | 2 +- module/main.js | 2 +- module/menus/storyteller-menu.js | 69 +++++++++++++++++++++++--------- module/settings.js | 1 - 7 files changed, 59 insertions(+), 27 deletions(-) diff --git a/module/api/wod5e-api.js b/module/api/wod5e-api.js index 892f10d3..7da16fa5 100644 --- a/module/api/wod5e-api.js +++ b/module/api/wod5e-api.js @@ -290,7 +290,7 @@ export class wod5eAPI { } } - static async generateLabelAndLocalize({ + static async generateLabelAndLocalize ({ string = '' }) { // Lists @@ -317,7 +317,7 @@ export class wod5eAPI { return game.i18n.localize(`WOD5E.${string}`) // Function to actually grab the localized label - function findLabel(list, str) { + function findLabel (list, str) { return str in list ? list[str].displayName : '' } } diff --git a/module/def/attributes.js b/module/def/attributes.js index f076bb4e..62e64ede 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -14,8 +14,8 @@ export class Attributes { } // Method to add extra attributes - static addCustom(customAttributes) { - for (const [key, value] of Object.entries(customAttributes)) { + static addCustom (customAttributes) { + for (const [, value] of Object.entries(customAttributes)) { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { this[value.id] = value } diff --git a/module/def/skills.js b/module/def/skills.js index 2bcc1166..02106b75 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -14,7 +14,7 @@ export class Skills { } // Method to add extra skills - static addCustom(customSkills) { + static addCustom (customSkills) { for (const [key, value] of Object.entries(customSkills)) { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { this[key] = value @@ -49,7 +49,7 @@ export class Skills { // Run any necessary compilation on ready static onReady () { - const customSkills = [] //game.settings.get('vtm5e', 'customSkills') + const customSkills = [] // game.settings.get('vtm5e', 'customSkills') if (customSkills) { Skills.addCustom(customSkills) diff --git a/module/helpers.js b/module/helpers.js index d2039b0a..b2e747a3 100644 --- a/module/helpers.js +++ b/module/helpers.js @@ -120,7 +120,7 @@ export const loadHelpers = async function () { // Function to actually grab the localized label function findLabel (list, string) { const stringObject = list[string] - + // Return the localized string if found if (stringObject?.displayName) return stringObject.displayName if (stringObject?.label) return stringObject.label diff --git a/module/main.js b/module/main.js index cc9fa40c..1b6136a8 100644 --- a/module/main.js +++ b/module/main.js @@ -56,7 +56,7 @@ Hooks.once('init', async function () { Actors.unregisterSheet('core', ActorSheet) // Loop through each entry in the actorTypesList and register their sheet classes const actorTypesList = ActorTypes.getList() - for (const [key, value] of Object.entries(actorTypesList)) { + for (const [, value] of Object.entries(actorTypesList)) { const { types, sheetClass } = value Actors.registerSheet('vtm5e', sheetClass, { diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 9fba7be1..4ce6849b 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -70,21 +70,35 @@ export class StorytellerMenu extends FormApplication { const data = event.target.dataset const type = data.type - // Get the list of custom attributes - const customAttributes = game.settings.get('vtm5e', 'customAttributes') - - // Define the new attribute and push it to the list - const newAttribute = { - id: foundry.utils.randomID(8), - label: 'New Attribute', - type: 'physical' - } - customAttributes.push(newAttribute) - - console.log(customAttributes) + if (type === 'attribute') { + // Get the list of custom attributes + const customAttributes = game.settings.get('vtm5e', 'customAttributes') + + // Define the new attribute and push it to the list + const newAttribute = { + id: foundry.utils.randomID(8), + label: 'New Attribute', + type: 'physical' + } + customAttributes.push(newAttribute) + + // Set the new list of attributes + game.settings.set('vtm5e', 'customAttributes', customAttributes) + } else if (type === 'skill') { + // Get the list of custom skills + const customSkills = game.settings.get('vtm5e', 'customSkills') + + // Define the new skill and push it to the list + const newSkill = { + id: foundry.utils.randomID(8), + label: 'New Skill', + type: 'physical' + } + customSkills.push(newSkill) - // Set the new list of attributes - game.settings.set('vtm5e', 'customAttributes', customAttributes) + // Set the new list of attributes + game.settings.set('vtm5e', 'customSkills', customSkills) + } }) html.find('.remove-custom-button').click(function (event) { @@ -146,13 +160,13 @@ export class StorytellerMenu extends FormApplication { type: attrType, label }) - }/* else if (type === 'skill') { - #customSkills.push({ + } else if (type === 'skill') { + customSkills.push({ id, - type, + type: attrType, label }) - }*/ + } }) // Save the new settings @@ -259,3 +273,22 @@ async function _onRemoveChange (type, id) { game.settings.set('vtm5e', 'modifiedSkills', modifiedSkills) } } + +// Function for removing a custom feature +async function _onRemoveCustom (type, id) { + if (type === 'attribute') { + // Get the list of custom attributes + let customAttributes = game.settings.get('vtm5e', 'customAttributes') + + // Remove the attribute by id then update the game settings + customAttributes = customAttributes.filter(attribute => (attribute.id !== id)) + game.settings.set('vtm5e', 'customAttributes', customAttributes) + } else if (type === 'skill') { + // Get the list of custom skills + let customSkills = game.settings.get('vtm5e', 'customSkills') + + // Remove the skill by id then update the game settings + customSkills = customSkills.filter(skill => (skill.id !== id)) + game.settings.set('vtm5e', 'customSkills', customSkills) + } +} diff --git a/module/settings.js b/module/settings.js index 9cb9f4e9..dbe3b7dc 100644 --- a/module/settings.js +++ b/module/settings.js @@ -183,7 +183,6 @@ export const loadSettings = async function () { default: [], type: Array, onChange: async (customAttributes) => { - // Re-render the storyteller menu window once settings are updated _rerenderStorytellerWindow() From dee9274470e67de1be446c4faaa13f509773651c Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 20:21:04 -0500 Subject: [PATCH 15/64] Linting --- module/menus/storyteller-menu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 4ce6849b..05434b7f 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -73,7 +73,7 @@ export class StorytellerMenu extends FormApplication { if (type === 'attribute') { // Get the list of custom attributes const customAttributes = game.settings.get('vtm5e', 'customAttributes') - + // Define the new attribute and push it to the list const newAttribute = { id: foundry.utils.randomID(8), @@ -87,7 +87,7 @@ export class StorytellerMenu extends FormApplication { } else if (type === 'skill') { // Get the list of custom skills const customSkills = game.settings.get('vtm5e', 'customSkills') - + // Define the new skill and push it to the list const newSkill = { id: foundry.utils.randomID(8), @@ -117,6 +117,7 @@ export class StorytellerMenu extends FormApplication { const attributeModifications = [] const customAttributes = [] const skillModifications = [] + const customSkills = [] // Modifications to existing features html.find('.modification-row').each(function () { From 98e88a6ca8b2e5bd3d49cd17f7c253ba1ac2b5e7 Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 20:26:08 -0500 Subject: [PATCH 16/64] Add the actual setting for customSkills --- module/settings.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/module/settings.js b/module/settings.js index dbe3b7dc..a665f30d 100644 --- a/module/settings.js +++ b/module/settings.js @@ -216,6 +216,29 @@ export const loadSettings = async function () { resetActors() } }) + + // Register the custom attributes + game.settings.register('vtm5e', 'customSkills', { + name: 'Custom Skills', + hint: 'Allows for the creation of custom skills.', + scope: 'world', + config: false, + default: [], + type: Array, + onChange: async (customSkills) => { + // Re-render the storyteller menu window once settings are updated + _rerenderStorytellerWindow() + + // Grab the custom skills and send them to the function to update the list + WOD5E.Skills.addCustom(customSkills) + + // Re-init labels + WOD5E.Skills.initializeLabels() + + // Reload actorsheets + resetActors() + } + }) } function _rerenderStorytellerWindow () { From 3d1dd94d98ac9bc05c5e23221adb85bf5224ab4d Mon Sep 17 00:00:00 2001 From: Veilza Date: Thu, 13 Jun 2024 21:30:12 -0500 Subject: [PATCH 17/64] Various fixes for custom skills/attributes --- module/actor/wod-v5-sheet.js | 8 ++++--- module/def/skills.js | 6 ++--- module/menus/storyteller-menu.js | 4 +++- .../ui/parts/storyteller-menu/custom-menu.hbs | 23 +++++++++++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 38f6aea3..28103e85 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -107,7 +107,7 @@ export class WoDActor extends ActorSheet { value: actorAttributes[id].value }, value) } else { // Otherwise, add it to the actor and set it as some default data - await this.actor.update({ [`system.abilities.${id}`]: { value } }) + await this.actor.update({ [`system.abilities.${id}`]: { value: 1 } }) attributeData = Object.assign({ id, @@ -159,7 +159,9 @@ export class WoDActor extends ActorSheet { specialtiesList, macroid: actorSkills[id].macroid }, value) - } else { // Otherwise, use the default + } else { // Otherwise, add it to the actor and set it as some default data + await this.actor.update({ [`system.skills.${id}`]: { value: 0 } }) + skillData = Object.assign({ id, value: 0, @@ -409,7 +411,7 @@ export class WoDActor extends ActorSheet { // Render the dialog window to select which skill/attribute combo to use const SkillEditDialog = new Dialog( { - title: game.i18n.localize(actor.system.skills[skill].name), + title: WOD5E.Skills.getList()[skill].displayName, content, buttons: { }, close: (html) => { diff --git a/module/def/skills.js b/module/def/skills.js index 02106b75..d0241833 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -15,9 +15,9 @@ export class Skills { // Method to add extra skills static addCustom (customSkills) { - for (const [key, value] of Object.entries(customSkills)) { + for (const [, value] of Object.entries(customSkills)) { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { - this[key] = value + this[value.id] = value } } } @@ -49,7 +49,7 @@ export class Skills { // Run any necessary compilation on ready static onReady () { - const customSkills = [] // game.settings.get('vtm5e', 'customSkills') + const customSkills = game.settings.get('vtm5e', 'customSkills') if (customSkills) { Skills.addCustom(customSkills) diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 05434b7f..cd782402 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -35,8 +35,9 @@ export class StorytellerMenu extends FormApplication { data.attributeModifications = game.settings.get('vtm5e', 'modifiedAttributes') data.skillModifications = game.settings.get('vtm5e', 'modifiedSkills') - // Grab the custom attributes from the game settings and add them to the application data + // Grab the custom features from the game settings and add them to the application data data.customAttributes = game.settings.get('vtm5e', 'customAttributes') + data.customSkills = game.settings.get('vtm5e', 'customSkills') return data } @@ -174,6 +175,7 @@ export class StorytellerMenu extends FormApplication { game.settings.set('vtm5e', 'modifiedAttributes', attributeModifications) game.settings.set('vtm5e', 'customAttributes', customAttributes) game.settings.set('vtm5e', 'modifiedSkills', skillModifications) + game.settings.set('vtm5e', 'customSkills', customSkills) }) } } diff --git a/templates/ui/parts/storyteller-menu/custom-menu.hbs b/templates/ui/parts/storyteller-menu/custom-menu.hbs index 5d0603fc..e7ee2937 100644 --- a/templates/ui/parts/storyteller-menu/custom-menu.hbs +++ b/templates/ui/parts/storyteller-menu/custom-menu.hbs @@ -21,4 +21,27 @@ + +
+

Custom Skills

+
+

Allows the storyteller to add custom skills to the actor sheets.

+
+
Label
+
Skill Type
+
+ {{#each customSkills as |skill id|}} +
+ + +
+ {{/each}} + +
+
From b02b73839e31aa4aa5d9aa0ccf8bbbfbc8b2bae4 Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 14 Jun 2024 10:36:54 -0500 Subject: [PATCH 18/64] Remove unnecessary werewolfdie class from dice dropdown --- templates/chat/roll-message.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/chat/roll-message.hbs b/templates/chat/roll-message.hbs index 7b4bf7af..491aad96 100644 --- a/templates/chat/roll-message.hbs +++ b/templates/chat/roll-message.hbs @@ -30,7 +30,7 @@
    {{#each basicDice.results as |die key|}} -
  1. {{die.result}}
  2. +
  3. {{die.result}}
  4. {{/each}}
From abafd0bb85e640aa853cd48c2803427acdb34df4 Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 14 Jun 2024 15:48:08 -0500 Subject: [PATCH 19/64] Small updates to the readme --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1a1f3bc3..9e658c79 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,16 @@ Replace the 1s with however many you want to roll for each type, and let the dic Bugs or feature requests created to this repository are greatly appreciate. Please use the [Issues](https://github.com/Rayji96/foundry-V5/issues) page for these! -Please reach out to me at "weinerdolphin" or "veilza" on Discord with any pressing issues, I'd love to help you get your game running smoothly! +You can also reach out to "weinerdolphin" or "veilza" on Discord, or leave a message in the #wod channel in the official Foundry Discord server, with any issues. We'd love to help you get your game running smoothly! Please check the issues list before suggesting new features. ## Credits +### Core Developers +* Lead System Developer: [Veilza] +* Quality Assurance: [Rayji96] + Huge thanks to these folks for their contributions! ### System Contributors @@ -46,7 +50,6 @@ Huge thanks to these folks for their contributions! * Incredible work on dot and box counters by [erizocosmico] * Refactors and enhancements by [bmgraves] * Partial HTML, character types, migrations, bugfixes, and refactors by [Dakayl] -* In-chat willpower rerolling, dark theme, Werewolf v5 support, and numerous other features and fixes by [Veilza] * Adding blood potency bonus to discipline rolls by [MarkusOzgur] * Various upgrades and CSS design improvements by [LorduFreeman] * Dicebox by [crcroberts] @@ -107,4 +110,5 @@ Licensed WoD 5e materials will not be provided as this system is provided for pu [gbursson]: https://github.com/gbursson [MrDionysus]: https://github.com/MrDionysus [LorduFreeman]: https://github.com/LorduFreeman -[Xuula]: https://github.com/Xuula \ No newline at end of file +[Xuula]: https://github.com/Xuula +[Rayji96]: https://github.com/Rayji96 From 03ff43be8e80ec389ca068e2933f95f41d28e4df Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 14 Jun 2024 21:04:57 -0500 Subject: [PATCH 20/64] Some improvements for the rendering of skills, particularly with the edit-skill button in the unlocked sheet state --- css/wod5e.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/wod5e.css b/css/wod5e.css index b6f50a00..b7739f34 100644 --- a/css/wod5e.css +++ b/css/wod5e.css @@ -113,6 +113,7 @@ .wod5e .resource-label { font-weight: 500; + position: relative; } .wod5e .description-content { @@ -306,6 +307,9 @@ .wod5e.sheet.actor .window-content .skills .skill .edit-skill { font-size: 14px; + position: absolute; + left: -20px; + top: 2px; } .wod5e .window-content .sheet-body .tab > .resource-label { From ce2795db7f6b12055d2931f481c2abbaf5a4722f Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 14 Jun 2024 21:08:47 -0500 Subject: [PATCH 21/64] Fix various localization displays as a result of the last update --- css/lang/de.css | 6 +++--- css/lang/pl.css | 6 +++--- css/lang/ru.css | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/css/lang/de.css b/css/lang/de.css index 089bb995..1fcfc39d 100644 --- a/css/lang/de.css +++ b/css/lang/de.css @@ -1,4 +1,4 @@ .de .attribute, .de .skill { - margin-left: 10px; - margin-right: 10px; -} \ No newline at end of file + margin-left: 15px; + margin-right: 15px; +} diff --git a/css/lang/pl.css b/css/lang/pl.css index e92a90fd..1c5b9709 100644 --- a/css/lang/pl.css +++ b/css/lang/pl.css @@ -1,4 +1,4 @@ .pl .attribute, .pl .skill { - margin-left: 10px; - margin-right: 10px; -} \ No newline at end of file + margin-left: 15px; + margin-right: 15px; +} diff --git a/css/lang/ru.css b/css/lang/ru.css index c5fa714a..844abc61 100644 --- a/css/lang/ru.css +++ b/css/lang/ru.css @@ -1,4 +1,4 @@ .ru .attribute, .ru .skill { - margin-left: 10px; - margin-right: 10px; -} \ No newline at end of file + margin-left: 15px; + margin-right: 15px; +} From 53e40479e5c99960a1ab73bd4209fd4902d63905 Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 14 Jun 2024 21:58:01 -0500 Subject: [PATCH 22/64] Small CSS adjustments; enable clicking actor image in group sheets to open sheet --- css/parts/group-sheet.css | 1 + css/parts/resource-counters.css | 6 +++++- css/wod5e.css | 1 + templates/actor/parts/group/group-members.hbs | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/css/parts/group-sheet.css b/css/parts/group-sheet.css index ad29face..a65e9994 100644 --- a/css/parts/group-sheet.css +++ b/css/parts/group-sheet.css @@ -34,6 +34,7 @@ .group-sheet .members .group-member .actor-image img { margin: 0 3px; + cursor: pointer; } .group-sheet .members .group-member .sub-item { diff --git a/css/parts/resource-counters.css b/css/parts/resource-counters.css index 617621ce..a58fa3db 100644 --- a/css/parts/resource-counters.css +++ b/css/parts/resource-counters.css @@ -1,3 +1,7 @@ +.wod5e .resource-value { + align-self: flex-end; +} + .wod5e .resource-value .resource-value-step { height: 14px; width: 14px; @@ -152,4 +156,4 @@ span.resource-counter-step:nth-child(5n) { span.resource-counter-step:last-child { margin-right: 0; -} \ No newline at end of file +} diff --git a/css/wod5e.css b/css/wod5e.css index b7739f34..e4ad01e5 100644 --- a/css/wod5e.css +++ b/css/wod5e.css @@ -126,6 +126,7 @@ .wod5e .window-content .resource-label { text-transform: initial; font-size: 1.2em; + text-align: left; } .wod5e .window-content .abilities .ability .resource-label { diff --git a/templates/actor/parts/group/group-members.hbs b/templates/actor/parts/group/group-members.hbs index df9e08e7..86d77102 100644 --- a/templates/actor/parts/group/group-members.hbs +++ b/templates/actor/parts/group/group-members.hbs @@ -4,7 +4,7 @@
- {{member.name}}
From 9cce21881928cafe5813e913b8452572bb45aece Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 14 Jun 2024 22:02:44 -0500 Subject: [PATCH 23/64] Shove dice tray components into a folder until I can properly fix it --- module/templates.js | 3 ++- .../ui/parts/{ => dice-roller}/pool1-select-attribute.hbs | 0 .../ui/parts/{ => dice-roller}/pool1-select-discipline.hbs | 0 templates/ui/parts/{ => dice-roller}/pool1-select-skill.hbs | 0 templates/ui/parts/{ => dice-roller}/pool2-nothing.hbs | 0 .../ui/parts/{ => dice-roller}/pool2-select-attribute.hbs | 0 .../ui/parts/{ => dice-roller}/pool2-select-discipline.hbs | 0 templates/ui/parts/{ => dice-roller}/pool2-select-skill.hbs | 0 templates/ui/{ => parts/dice-roller}/tray.hbs | 0 9 files changed, 2 insertions(+), 1 deletion(-) rename templates/ui/parts/{ => dice-roller}/pool1-select-attribute.hbs (100%) rename templates/ui/parts/{ => dice-roller}/pool1-select-discipline.hbs (100%) rename templates/ui/parts/{ => dice-roller}/pool1-select-skill.hbs (100%) rename templates/ui/parts/{ => dice-roller}/pool2-nothing.hbs (100%) rename templates/ui/parts/{ => dice-roller}/pool2-select-attribute.hbs (100%) rename templates/ui/parts/{ => dice-roller}/pool2-select-discipline.hbs (100%) rename templates/ui/parts/{ => dice-roller}/pool2-select-skill.hbs (100%) rename templates/ui/{ => parts/dice-roller}/tray.hbs (100%) diff --git a/module/templates.js b/module/templates.js index 2600140c..7ed07413 100644 --- a/module/templates.js +++ b/module/templates.js @@ -68,6 +68,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/vtm5e/templates/item/parts/macro.hbs', // Dice Tray Partials + /* 'systems/vtm5e/templates/ui/parts/select-character.hbs', 'systems/vtm5e/templates/ui/parts/pool1-select-attribute.hbs', 'systems/vtm5e/templates/ui/parts/pool1-select-skill.hbs', @@ -75,7 +76,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/vtm5e/templates/ui/parts/pool2-select-attribute.hbs', 'systems/vtm5e/templates/ui/parts/pool2-select-skill.hbs', 'systems/vtm5e/templates/ui/parts/pool2-select-discipline.hbs', - 'systems/vtm5e/templates/ui/parts/pool2-nothing.hbs', + 'systems/vtm5e/templates/ui/parts/pool2-nothing.hbs',*/ // Roll dialog Partials 'systems/vtm5e/templates/ui/parts/roll-dialog-base.hbs', diff --git a/templates/ui/parts/pool1-select-attribute.hbs b/templates/ui/parts/dice-roller/pool1-select-attribute.hbs similarity index 100% rename from templates/ui/parts/pool1-select-attribute.hbs rename to templates/ui/parts/dice-roller/pool1-select-attribute.hbs diff --git a/templates/ui/parts/pool1-select-discipline.hbs b/templates/ui/parts/dice-roller/pool1-select-discipline.hbs similarity index 100% rename from templates/ui/parts/pool1-select-discipline.hbs rename to templates/ui/parts/dice-roller/pool1-select-discipline.hbs diff --git a/templates/ui/parts/pool1-select-skill.hbs b/templates/ui/parts/dice-roller/pool1-select-skill.hbs similarity index 100% rename from templates/ui/parts/pool1-select-skill.hbs rename to templates/ui/parts/dice-roller/pool1-select-skill.hbs diff --git a/templates/ui/parts/pool2-nothing.hbs b/templates/ui/parts/dice-roller/pool2-nothing.hbs similarity index 100% rename from templates/ui/parts/pool2-nothing.hbs rename to templates/ui/parts/dice-roller/pool2-nothing.hbs diff --git a/templates/ui/parts/pool2-select-attribute.hbs b/templates/ui/parts/dice-roller/pool2-select-attribute.hbs similarity index 100% rename from templates/ui/parts/pool2-select-attribute.hbs rename to templates/ui/parts/dice-roller/pool2-select-attribute.hbs diff --git a/templates/ui/parts/pool2-select-discipline.hbs b/templates/ui/parts/dice-roller/pool2-select-discipline.hbs similarity index 100% rename from templates/ui/parts/pool2-select-discipline.hbs rename to templates/ui/parts/dice-roller/pool2-select-discipline.hbs diff --git a/templates/ui/parts/pool2-select-skill.hbs b/templates/ui/parts/dice-roller/pool2-select-skill.hbs similarity index 100% rename from templates/ui/parts/pool2-select-skill.hbs rename to templates/ui/parts/dice-roller/pool2-select-skill.hbs diff --git a/templates/ui/tray.hbs b/templates/ui/parts/dice-roller/tray.hbs similarity index 100% rename from templates/ui/tray.hbs rename to templates/ui/parts/dice-roller/tray.hbs From b28a9ef9343851391177c4e9ba7fedaf6c0ea651 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 21:37:02 -0500 Subject: [PATCH 24/64] Enable blood surges to be done on the second roll menu, enable removing custom skills/attributes, fix confusing appearance of hunger warning --- css/parts/menus.css | 17 ++++++++- lang/de/core-de.json | 3 +- lang/en/core-en.json | 3 +- lang/es/core-es.json | 3 +- lang/fr/core-fr.json | 3 +- lang/it/core-it.json | 3 +- lang/lang_template/core-template.json | 3 +- lang/pl/core-pl.json | 3 +- lang/pt-BR/core-pt-BR.json | 3 +- lang/ru/core-ru.json | 3 +- lang/uk/core-uk.json | 3 +- module/actor/ghoul-actor-sheet.js | 4 +- module/actor/hunter-actor-sheet.js | 2 +- module/actor/scripts/roll.js | 15 +++----- module/actor/vampire-actor-sheet.js | 10 +++-- module/actor/werewolf-actor-sheet.js | 4 +- module/actor/wod-v5-sheet.js | 7 ++-- module/api/wod5e-api.js | 8 ++-- module/def/attributes.js | 21 ++++++++-- module/def/skills.js | 19 +++++++++- module/helpers.js | 8 ++-- module/item/scripts/item-bonuses.js | 4 ++ module/menus/storyteller-menu.js | 10 ++--- module/scripts/rolls/increase-hunger.js | 6 +-- module/scripts/rolls/situational-modifiers.js | 38 ++++++++++++++----- module/scripts/system-rolls.js | 9 ++++- templates/actor/parts/vampire/humanity.hbs | 2 +- templates/item/parts/bonus-display.hbs | 1 + templates/item/parts/bonuses.hbs | 6 +++ templates/ui/parts/situational-modifiers.hbs | 3 +- .../ui/parts/storyteller-menu/custom-menu.hbs | 10 ++++- templates/ui/select-dialog.hbs | 6 +-- 32 files changed, 168 insertions(+), 72 deletions(-) diff --git a/css/parts/menus.css b/css/parts/menus.css index b4c217bb..c3929e36 100644 --- a/css/parts/menus.css +++ b/css/parts/menus.css @@ -8,14 +8,22 @@ text-align: center; } -.wod5e-config-form.storyteller-menu .modification-row { +.wod5e-config-form.storyteller-menu .modification-row, .wod5e-config-form.storyteller-menu .custom-row { margin-top: 3px; margin-bottom: 3px; } -.wod5e-config-form.storyteller-menu .modification-row .mod-label { +.wod5e-config-form.storyteller-menu .mod-label { font-weight: bold; text-align: center; + display: flex; + flex-direction: row; + margin-left: auto; + margin-right: auto; +} + +.wod5e-config-form.storyteller-menu .mod-label input { + margin-left: 5px; } .wod5e-config-form.storyteller-menu .modification-row .mod-hidden { @@ -43,3 +51,8 @@ .wod5e-config-form.storyteller-menu .remove-mod-button { cursor: pointer; } + +.wod5e-config-form.storyteller-menu .remove-custom-button { + cursor: pointer; + margin-top: 5px; +} diff --git a/lang/de/core-de.json b/lang/de/core-de.json index 1286527f..db84d051 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -58,7 +58,8 @@ "DisplayWhenInactive": "Anzeigen, wenn inaktiv", "Unless": "Außer, wenn …", "PathToCheck": "Pfad", - "ValueToCheck": "Wert" + "ValueToCheck": "Wert", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/en/core-en.json b/lang/en/core-en.json index bcaf7980..fdc1dc22 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -55,7 +55,8 @@ "DisplayWhenInactive": "Display When Inactive", "Unless": "Unless", "PathToCheck": "Path to Check", - "ValueToCheck": "Value to Check" + "ValueToCheck": "Value to Check", + "IfPathIs": "If path is..." }, "SPC": { diff --git a/lang/es/core-es.json b/lang/es/core-es.json index e21e02ab..6431f59f 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -56,7 +56,8 @@ "_DisplayWhenInactive": "", "_Unless": "", "_PathToCheck": "", - "_ValueToCheck": "" + "_ValueToCheck": "", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index a8869984..8dbd60d0 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -58,7 +58,8 @@ "DisplayWhenInactive": "Montrer quand inactif", "Unless": "Minimum", "_PathToCheck": "", - "ValueToCheck": "Valeur vérifiée" + "ValueToCheck": "Valeur vérifiée", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/it/core-it.json b/lang/it/core-it.json index d3c05e17..d37b2872 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -58,7 +58,8 @@ "_DisplayWhenInactive": "", "_Unless": "", "_PathToCheck": "", - "_ValueToCheck": "" + "_ValueToCheck": "", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index bd68980c..8af3fb93 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -56,7 +56,8 @@ "DisplayWhenInactive": "", "Unless": "", "PathToCheck": "", - "ValueToCheck": "" + "ValueToCheck": "", + "IfPathIs": "" }, "SPC": { diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index aa234dda..3a1e5ac3 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -58,7 +58,8 @@ "_DisplayWhenInactive": "", "_Unless": "", "_PathToCheck": "", - "_ValueToCheck": "" + "_ValueToCheck": "", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index d1e337b5..6e4ab822 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -58,7 +58,8 @@ "_DisplayWhenInactive": "", "_Unless": "", "_PathToCheck": "", - "_ValueToCheck": "" + "_ValueToCheck": "", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index 6226c017..fd6db104 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -58,7 +58,8 @@ "_DisplayWhenInactive": "", "_Unless": "", "_PathToCheck": "", - "_ValueToCheck": "" + "_ValueToCheck": "", + "_IfPathIs": "" }, "SPC": { diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index dcf91bd9..17a61669 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -58,7 +58,8 @@ "_DisplayWhenInactive": "", "_Unless": "", "_PathToCheck": "", - "_ValueToCheck": "" + "_ValueToCheck": "", + "_IfPathIs": "" }, "SPC": { diff --git a/module/actor/ghoul-actor-sheet.js b/module/actor/ghoul-actor-sheet.js index 55e41f44..d46c0d7d 100644 --- a/module/actor/ghoul-actor-sheet.js +++ b/module/actor/ghoul-actor-sheet.js @@ -180,7 +180,7 @@ export class GhoulActorSheet extends MortalActorSheet { // Send the roll to the system WOD5eDice.Roll({ - advancedDice: cost + activeBonuses, + advancedDice: cost + activeBonuses.totalValue, title: game.i18n.localize('WOD5E.VTM.RousingBlood'), actor, disableBasicDice: true, @@ -352,7 +352,7 @@ export class GhoulActorSheet extends MortalActorSheet { selectors }) - const dicePool = dice1 + dice2 + activeBonuses + const dicePool = dice1 + dice2 + activeBonuses.totalValue WOD5eDice.Roll({ basicDice: Math.max(dicePool - hunger, 0), diff --git a/module/actor/hunter-actor-sheet.js b/module/actor/hunter-actor-sheet.js index b17ec149..357ed320 100644 --- a/module/actor/hunter-actor-sheet.js +++ b/module/actor/hunter-actor-sheet.js @@ -306,7 +306,7 @@ export class HunterActorSheet extends WoDActor { }) // Add it all together - const dicePool = dice1 + dice2 + activeBonuses + const dicePool = dice1 + dice2 + activeBonuses.totalValue // Send the roll to the system WOD5eDice.Roll({ diff --git a/module/actor/scripts/roll.js b/module/actor/scripts/roll.js index 5e2dca79..f8a0cf7d 100644 --- a/module/actor/scripts/roll.js +++ b/module/actor/scripts/roll.js @@ -41,35 +41,35 @@ export const _onConfirmRoll = async function (dataset, actor) { // Variables yet to be defined let basicDice, advancedDice - let advancedCheckDice // Handle getting any situational modifiers const activeBonuses = await getActiveBonuses({ actor, selectors }) + let advancedCheckDice = activeBonuses.totalACDValue // Get the number of basicDice and advancedDice if (disableBasicDice && useAbsoluteValue) { // For when basic dice are disabled and we want the // advanced dice to equal the absoluteValue given - advancedDice = absoluteValue + activeBonuses + advancedDice = absoluteValue + activeBonuses.totalValue basicDice = 0 } else if (disableBasicDice) { // If just the basicDice are disabled, set it to 0 // and retrieve the appropriate amount of advanced dice basicDice = 0 - advancedDice = disableAdvancedDice ? 0 + activeBonuses : await WOD5E.api.getAdvancedDice(actor) + activeBonuses + advancedDice = disableAdvancedDice ? 0 + activeBonuses.totalValue : await WOD5E.api.getAdvancedDice(actor) + activeBonuses.totalValue } else { // Calculate basicDice based on different conditions if (useAbsoluteValue) { // If basic dice aren't disabled, but we use the absolute // value, add the absoluteValue and the flatMod together - basicDice = absoluteValue + flatMod + activeBonuses + basicDice = absoluteValue + flatMod + activeBonuses.totalValue } else { // All other, more normal, circumstances where basicDice // are calculated normally - basicDice = await WOD5E.api.getBasicDice({ valuePaths: dataset.valuePaths, flatMod: flatMod + activeBonuses, actor }) + basicDice = await WOD5E.api.getBasicDice({ valuePaths: dataset.valuePaths, flatMod: flatMod + activeBonuses.totalValue, actor }) } // Retrieve the appropriate amount of advanced dice @@ -103,11 +103,6 @@ export const _onConfirmRoll = async function (dataset, actor) { } } - // Check if this roll contains a rouse check - if (selectors.indexOf('blood-surge') > -1) { - advancedCheckDice = 1 - } - // Send the roll to the system WOD5eDice.Roll({ basicDice, diff --git a/module/actor/vampire-actor-sheet.js b/module/actor/vampire-actor-sheet.js index bf1a63ce..760236ca 100644 --- a/module/actor/vampire-actor-sheet.js +++ b/module/actor/vampire-actor-sheet.js @@ -83,11 +83,14 @@ export class VampireActorSheet extends GhoulActorSheet { { source: game.i18n.localize('WOD5E.VTM.BloodSurge'), value: actorData.system.bloodPotency.surge, - paths: ['blood-surge'], + paths: ['all'], + unless: ['willpower', 'humanity', 'extended'], + displayWhenInactive: true, activeWhen: { - check: 'always' + check: 'isPath', + path: 'blood-surge' }, - forceDiceType: 'advanced' + advancedCheckDice: 1 } ] } @@ -125,6 +128,7 @@ export class VampireActorSheet extends GhoulActorSheet { WOD5eDice.Roll({ basicDice: dicePool, title: game.i18n.localize('WOD5E.VTM.RollingRemorse'), + paths: ['humanity'], actor, data: actor.system, quickRoll: true, diff --git a/module/actor/werewolf-actor-sheet.js b/module/actor/werewolf-actor-sheet.js index 98e759e4..9468f0b5 100644 --- a/module/actor/werewolf-actor-sheet.js +++ b/module/actor/werewolf-actor-sheet.js @@ -225,7 +225,7 @@ export class WerewolfActorSheet extends WoDActor { }) // Add all values together - const dicePool = dice1 + dice2 + activeBonuses + const dicePool = dice1 + dice2 + activeBonuses.totalValue // Send the roll to the system WOD5eDice.Roll({ @@ -503,7 +503,7 @@ export class WerewolfActorSheet extends WoDActor { // Roll the rage dice necessary WOD5eDice.Roll({ - advancedDice: diceCount + activeBonuses, + advancedDice: diceCount + activeBonuses.totalValue, title: form, actor, data: actor.system, diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 28103e85..5a155342 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -85,7 +85,7 @@ export class WoDActor extends ActorSheet { const gear = [] // Loop through each entry in the attributes list, get the data (if available), and then push to the containers - const attributesList = Attributes.getList() + const attributesList = Attributes.getList({}) const actorAttributes = actorData.system?.abilities if (actorAttributes) { @@ -125,7 +125,7 @@ export class WoDActor extends ActorSheet { } // Loop through each entry in the skills list, get the data (if available), and then push to the containers - const skillsList = Skills.getList() + const skillsList = Skills.getList({}) const actorSkills = actorData.system?.skills if (actorSkills) { @@ -411,7 +411,7 @@ export class WoDActor extends ActorSheet { // Render the dialog window to select which skill/attribute combo to use const SkillEditDialog = new Dialog( { - title: WOD5E.Skills.getList()[skill].displayName, + title: WOD5E.Skills.getList({})[skill].displayName, content, buttons: { }, close: (html) => { @@ -521,6 +521,7 @@ export class WoDActor extends ActorSheet { WOD5eDice.Roll({ basicDice: dicePool, title: game.i18n.localize('WOD5E.Chat.RollingWillpower'), + paths: ['willpower'], actor, data: actor.system, quickRoll: false, diff --git a/module/api/wod5e-api.js b/module/api/wod5e-api.js index 7da16fa5..06285ea5 100644 --- a/module/api/wod5e-api.js +++ b/module/api/wod5e-api.js @@ -99,9 +99,9 @@ export class wod5eAPI { const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' // Attribute definitions - const attributesList = WOD5E.Attributes.getList() + const attributesList = WOD5E.Attributes.getList({}) // Skill definitions - const skillsList = WOD5E.Skills.getList() + const skillsList = WOD5E.Skills.getList({}) // Render selecting a skill/attribute to roll const dialogTemplate = 'systems/vtm5e/templates/ui/select-dice-dialog.hbs' @@ -295,8 +295,8 @@ export class wod5eAPI { }) { // Lists const lists = [ - WOD5E.Attributes.getList(), - WOD5E.Skills.getList(), + WOD5E.Attributes.getList({}), + WOD5E.Skills.getList({}), WOD5E.Features.getList(), WOD5E.ItemTypes.getList(), WOD5E.Disciplines.getList(), diff --git a/module/def/attributes.js b/module/def/attributes.js index 62e64ede..eb4e8fbc 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -4,9 +4,16 @@ export class Attributes { // Function to help with quickly grabbing all the listed values; // Will only retrieve objects (definitions) // Optional string can be provided to filter by type - static getList (type) { + static getList ({ + type = '', + custom = false + }) { return Object.entries(this) - .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && (!type || value.type === type)) + // Filter out any entries with improper formats + .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) + // Filter based on given filters provided with the function, if any + && (!type || value.type === type) && (!custom || value.custom === custom)) + // Reduce into a format the system can work with .reduce((accumulator, [key, value]) => { accumulator[key] = value return accumulator @@ -17,6 +24,9 @@ export class Attributes { static addCustom (customAttributes) { for (const [, value] of Object.entries(customAttributes)) { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + // Note this feature as being a custom feature + value.custom = true + this[value.id] = value } } @@ -31,10 +41,15 @@ export class Attributes { const checkModification = modifications.filter(attribute => attribute.id === key) value.label = game.i18n.localize(value.label) - + + // If there are modifications, update the attribute if (checkModification.length > 0) { value.rename = checkModification[0].rename value.hidden = checkModification[0].hidden + } else { + // If there are no modifications, use default values + value.rename = '' + value.hidden = false } } diff --git a/module/def/skills.js b/module/def/skills.js index d0241833..a50bd6c3 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -4,9 +4,16 @@ export class Skills { // Function to help with quickly grabbing all the listed values; // Will only retrieve objects (definitions) // Optional string can be provided to filter by type - static getList (type) { + static getList ({ + type = '', + custom = false + }) { return Object.entries(this) - .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && (!type || value.type === type)) + // Filter out any entries with improper formats + .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) + // Filter based on given filters provided with the function, if any + && (!type || value.type === type) && (!custom || value.custom === custom)) + // Reduce into a format the system can work with .reduce((accumulator, [key, value]) => { accumulator[key] = value return accumulator @@ -17,6 +24,9 @@ export class Skills { static addCustom (customSkills) { for (const [, value] of Object.entries(customSkills)) { if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + // Note this feature as being a custom feature + value.custom = true + this[value.id] = value } } @@ -32,9 +42,14 @@ export class Skills { value.label = game.i18n.localize(value.label) + // If there are modifications, update the attribute if (checkModification.length > 0) { value.rename = checkModification[0].rename value.hidden = checkModification[0].hidden + } else { + // If there are no modifications, use default values + value.rename = '' + value.hidden = false } } diff --git a/module/helpers.js b/module/helpers.js index b2e747a3..df0eb65b 100644 --- a/module/helpers.js +++ b/module/helpers.js @@ -71,18 +71,18 @@ export const loadHelpers = async function () { // Helper to define attributes lists Handlebars.registerHelper('getAttributesList', function () { - return WOD5E.Attributes.getList() + return WOD5E.Attributes.getList({}) }) // Helper to define skills lists Handlebars.registerHelper('getSkillsList', function () { - return WOD5E.Skills.getList() + return WOD5E.Skills.getList({}) }) Handlebars.registerHelper('generateLocalizedLabel', function (str) { // Lists - const attributes = WOD5E.Attributes.getList() - const skills = WOD5E.Skills.getList() + const attributes = WOD5E.Attributes.getList({}) + const skills = WOD5E.Skills.getList({}) const features = WOD5E.Features.getList() const disciplines = WOD5E.Disciplines.getList() const renown = WOD5E.Renown.getList() diff --git a/module/item/scripts/item-bonuses.js b/module/item/scripts/item-bonuses.js index 502317f1..473e7cb5 100644 --- a/module/item/scripts/item-bonuses.js +++ b/module/item/scripts/item-bonuses.js @@ -85,6 +85,8 @@ export const _onAddBonus = async function (event, item) { if (activeWhenCheck.val() === 'isEqual') { activeWhenPath.css('visibility', 'visible') activeWhenValue.css('visibility', 'visible') + } if (activeWhenCheck.val() === 'isPath') { + activeWhenPath.css('visibility', 'visible') } else { activeWhenPath.css('visibility', 'hidden') activeWhenValue.css('visibility', 'hidden') @@ -188,6 +190,8 @@ export const _onEditBonus = async function (event, item) { if (activeWhenCheck.val() === 'isEqual') { activeWhenPath.css('visibility', 'visible') activeWhenValue.css('visibility', 'visible') + } if (activeWhenCheck.val() === 'isPath') { + activeWhenPath.css('visibility', 'visible') } else { activeWhenPath.css('visibility', 'hidden') activeWhenValue.css('visibility', 'hidden') diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index cd782402..1222bfc6 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -52,7 +52,7 @@ export class StorytellerMenu extends FormApplication { const data = event.target.dataset const type = data.type - _onGeneratePrompt(type) + _onGenerateModPrompt(type) }) html.find('.remove-mod-button').click(function (event) { @@ -181,14 +181,14 @@ export class StorytellerMenu extends FormApplication { } // Function for getting the information necessary for the selection dialog -async function _onGeneratePrompt (type) { +async function _onGenerateModPrompt (type) { if (type === 'attribute') { - const attributesList = WOD5E.Attributes.getList() + const attributesList = WOD5E.Attributes.getList({}) // Render the dialog _onRenderPromptDialog('attribute', attributesList, game.i18n.localize('WOD5E.Attributes.Label')) } else if (type === 'skill') { - const skillsList = WOD5E.Skills.getList() + const skillsList = WOD5E.Skills.getList({}) // Render the dialog _onRenderPromptDialog('skill', skillsList, game.i18n.localize('WOD5E.Skills.Label')) @@ -213,7 +213,7 @@ async function _onRenderPromptDialog (type, list, title) { // Grab the id from the select element const id = html.find('[id=optionSelect]').val() // Define the label - const label = list.filter(item => item.id === id)[0].label + const label = id in list ? list[id]?.label : id if (type === 'attribute') { // Get the list of modified attributes diff --git a/module/scripts/rolls/increase-hunger.js b/module/scripts/rolls/increase-hunger.js index 22ac0c1e..8bf97883 100644 --- a/module/scripts/rolls/increase-hunger.js +++ b/module/scripts/rolls/increase-hunger.js @@ -5,9 +5,9 @@ export async function _increaseHunger (actor, amount) { const currentHunger = actor.system.hunger.value const newHungerAmount = Math.min(currentHunger + amount, 5) - // If the roll would push the actor's hunger above 4 when their hunger was previously - // below 5, send a message in the chat to warn them. - if (newHungerAmount > 4 && currentHunger < 5) { + // If the actor is already at max hunger, send a message in the chat to warn them + // that their hunger cannot be increased further + if (amount > 0 && currentHunger === 5) { renderTemplate('systems/vtm5e/templates/chat/chat-message.hbs', { name: game.i18n.localize('WOD5E.VTM.HungerFull1'), img: 'systems/vtm5e/assets/icons/dice/vampire/bestial-failure.png', diff --git a/module/scripts/rolls/situational-modifiers.js b/module/scripts/rolls/situational-modifiers.js index adba3ca7..609169e6 100644 --- a/module/scripts/rolls/situational-modifiers.js +++ b/module/scripts/rolls/situational-modifiers.js @@ -21,21 +21,28 @@ export async function getSituationalModifiers ({ function getModifiers (data, selectors) { const modifiers = [] + // Run a search for bonuses within the actor's data + searchBonuses(data, '') function searchBonuses (obj, path) { + // Ensure that we're receiving a valid object if (typeof obj !== 'object' || obj === null) { return } + // Check if there's a "bonuses" path that is an array if (obj.bonuses && Array.isArray(obj.bonuses)) { + // Check for matching bonuses, or 'all' const matchingBonuses = obj.bonuses.filter(bonus => - selectors.some(selector => bonus.paths.includes(selector)) + selectors.some(selector => bonus.paths.includes(selector)) || bonus.paths.includes('all') ) + // If there are any matching bonuses, push it to the modifiers list if (matchingBonuses.length > 0) { modifiers.push(...matchingBonuses) } } + // If there are further objects to search, search those for bonuses as well Object.entries(obj).forEach(([key, value]) => { const currentPath = path ? `${path}.${key}` : key @@ -45,16 +52,16 @@ export async function getSituationalModifiers ({ }) } - searchBonuses(data, '') - return modifiers } + // Filter out only modifiers that apply to the roll we're doing function filterModifiers (data, modifiers) { return modifiers.filter(modifier => { const { check, path, value } = modifier?.activeWhen || {} const displayWhenInactive = modifier?.displayWhenInactive || '' const unless = modifier?.unless || '' + let showModifier = false // Check if any 'unless' strings are present in the 'selectors' array if (unless && unless.some(value => selectors.indexOf(value) !== -1)) { @@ -65,23 +72,29 @@ export async function getSituationalModifiers ({ // As long as the path is found, the modifier will be active if (check === 'always') { modifier.isActive = true - return true + showModifier = true } // If the path has a qualifier, it's checked for here if (check === 'isEqual') { const pathValue = path.split('.').reduce((obj, key) => obj[key], data) modifier.isActive = true - return String(pathValue) === value + showModifier = String(pathValue) === value } - // If the modifier should be shown no matter what, still return it - if (displayWhenInactive) { + // If the qualifier is the path, the modifier will be active + if (check === 'isPath' && selectors.indexOf(path) > -1) { + modifier.isActive = true + showModifier = true + } + + // If the modifier should be shown no matter what, still show it but don't make it active + if (displayWhenInactive && !modifier.isActive) { modifier.isActive = false - return true + showModifier = true } - return false + return showModifier }) } } @@ -104,10 +117,15 @@ export async function getActiveBonuses ({ }) const activeModifiers = situationalModifiers.filter(modifier => modifier.isActive === true) let totalValue = 0 + let totalACDValue = 0 activeModifiers.forEach((modifier) => { totalValue += parseInt(modifier.value) + totalACDValue += parseInt(modifier.advancedCheckDice) }) - return totalValue + return { + totalValue, + totalACDValue + } } diff --git a/module/scripts/system-rolls.js b/module/scripts/system-rolls.js index 8fbab983..25061fe2 100644 --- a/module/scripts/system-rolls.js +++ b/module/scripts/system-rolls.js @@ -149,7 +149,7 @@ class WOD5eDice { } // Roll any advanced check dice that need to be rolled in a separate rollmessage - if (advancedCheckDice) { + if (advancedCheckDice > 0) { await this.Roll({ actor, data, @@ -318,6 +318,7 @@ class WOD5eDice { // Get the values of basic and advanced dice const basicValue = basicDiceInput.val() ? parseInt(basicDiceInput.val()) : 0 const advancedValue = advancedDiceInput.val() ? parseInt(advancedDiceInput.val()) : 0 + const aCDValue = parseInt(event.currentTarget.dataset.advancedCheckDice) // Determine whether any alterations need to be made to basic dice or advanced dice let applyDiceTo = 'basic' @@ -358,6 +359,9 @@ class WOD5eDice { newValue = basicValue + modifier basicDiceInput.val(newValue) } + + // Apply the advancedCheckDice value + advancedCheckDice = advancedCheckDice + aCDValue } else { // Removing the modifier if (applyDiceTo === 'advanced' && advancedValue > 0) { @@ -383,6 +387,9 @@ class WOD5eDice { basicDiceInput.val(newValue) } + + // Apply the advancedCheckDice value while ensuring the value can't go below 0 + advancedCheckDice = Math.max(advancedCheckDice - aCDValue, 0) } // Ensure that there can't be negative dice diff --git a/templates/actor/parts/vampire/humanity.hbs b/templates/actor/parts/vampire/humanity.hbs index 966f8451..3c2112f3 100644 --- a/templates/actor/parts/vampire/humanity.hbs +++ b/templates/actor/parts/vampire/humanity.hbs @@ -4,7 +4,7 @@
-
+
{{#numLoop 10}} {{/numLoop}} diff --git a/templates/item/parts/bonus-display.hbs b/templates/item/parts/bonus-display.hbs index 29864d5c..c55d1688 100644 --- a/templates/item/parts/bonus-display.hbs +++ b/templates/item/parts/bonus-display.hbs @@ -20,6 +20,7 @@ +
diff --git a/templates/item/parts/bonuses.hbs b/templates/item/parts/bonuses.hbs index 89a6fb1f..33683cfa 100644 --- a/templates/item/parts/bonuses.hbs +++ b/templates/item/parts/bonuses.hbs @@ -33,6 +33,7 @@ +
{{#ifeq bonus.activeWhen.check 'isEqual'}} @@ -44,6 +45,11 @@ {{localize "WOD5E.Bonus.ValueToCheck"}}
+ {{else if (eq bonus.activeWhen.check "isPath")}} +
+ {{localize "WOD5E.Bonus.PathToCheck"}} + +
{{/ifeq}}
diff --git a/templates/ui/parts/situational-modifiers.hbs b/templates/ui/parts/situational-modifiers.hbs index ca2aeb35..f336fcda 100644 --- a/templates/ui/parts/situational-modifiers.hbs +++ b/templates/ui/parts/situational-modifiers.hbs @@ -12,7 +12,8 @@
{{localize mod.source}}
{{mod.value}}
- +
{{/each}} diff --git a/templates/ui/parts/storyteller-menu/custom-menu.hbs b/templates/ui/parts/storyteller-menu/custom-menu.hbs index e7ee2937..176db6e7 100644 --- a/templates/ui/parts/storyteller-menu/custom-menu.hbs +++ b/templates/ui/parts/storyteller-menu/custom-menu.hbs @@ -9,7 +9,10 @@
{{#each customAttributes as |attribute id|}}
- +
+ + +
@@ -32,7 +35,10 @@
{{#each customSkills as |skill id|}}
- +
+ + +
diff --git a/templates/ui/select-dialog.hbs b/templates/ui/select-dialog.hbs index ae982109..2d388199 100644 --- a/templates/ui/select-dialog.hbs +++ b/templates/ui/select-dialog.hbs @@ -1,9 +1,9 @@
-
\ No newline at end of file + From 9029042d642e3f699d8c829c6f245781e3ade79e Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 21:39:30 -0500 Subject: [PATCH 25/64] German localization improvements --- lang/de/hunter-de.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/de/hunter-de.json b/lang/de/hunter-de.json index 9ebbde73..0de73977 100644 --- a/lang/de/hunter-de.json +++ b/lang/de/hunter-de.json @@ -30,15 +30,15 @@ "Arsenal": "Arsenal", "Fleet": "Flotte", - "Ordnance": "Artillerie", + "Ordnance": "Sprengstoff", "Library": "Bibliothek", "ImprovisedGear": "Improvisierte Ausrüstung", - "GlobalAccess": "Globaler Zugang", + "GlobalAccess": "Globaler Zugriff", "DroneJockey": "Drohnenjockey", "BeastWhisperer": "Tierflüsterer", - "SenseTheUnnatural": "Das Unnatürliche spüren", - "RepelTheUnnatural": "Das Unnatürliche abwehren", - "ThwartTheUnnatural": "Das Unnatürliche verhindern", + "SenseTheUnnatural": "Übernatürliches spüren", + "RepelTheUnnatural": "Übernatürliches zurücktreiben", + "ThwartTheUnnatural": "Übernatürliches vereiteln", "Artifact": "Artefakt" } } From 76aec5830a3fe49918efc7e425d1a9a9acd4026d Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 21:43:40 -0500 Subject: [PATCH 26/64] Linting --- module/actor/scripts/roll.js | 2 +- module/def/attributes.js | 6 +++--- module/def/skills.js | 4 ++-- module/templates.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/actor/scripts/roll.js b/module/actor/scripts/roll.js index f8a0cf7d..450c2b1b 100644 --- a/module/actor/scripts/roll.js +++ b/module/actor/scripts/roll.js @@ -47,7 +47,7 @@ export const _onConfirmRoll = async function (dataset, actor) { actor, selectors }) - let advancedCheckDice = activeBonuses.totalACDValue + const advancedCheckDice = activeBonuses.totalACDValue // Get the number of basicDice and advancedDice if (disableBasicDice && useAbsoluteValue) { diff --git a/module/def/attributes.js b/module/def/attributes.js index eb4e8fbc..16e801cd 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -10,9 +10,9 @@ export class Attributes { }) { return Object.entries(this) // Filter out any entries with improper formats - .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) + .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && // Filter based on given filters provided with the function, if any - && (!type || value.type === type) && (!custom || value.custom === custom)) + (!type || value.type === type) && (!custom || value.custom === custom)) // Reduce into a format the system can work with .reduce((accumulator, [key, value]) => { accumulator[key] = value @@ -41,7 +41,7 @@ export class Attributes { const checkModification = modifications.filter(attribute => attribute.id === key) value.label = game.i18n.localize(value.label) - + // If there are modifications, update the attribute if (checkModification.length > 0) { value.rename = checkModification[0].rename diff --git a/module/def/skills.js b/module/def/skills.js index a50bd6c3..1c5284ba 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -10,9 +10,9 @@ export class Skills { }) { return Object.entries(this) // Filter out any entries with improper formats - .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) + .filter(([, value]) => typeof value === 'object' && value !== null && !Array.isArray(value) && // Filter based on given filters provided with the function, if any - && (!type || value.type === type) && (!custom || value.custom === custom)) + (!type || value.type === type) && (!custom || value.custom === custom)) // Reduce into a format the system can work with .reduce((accumulator, [key, value]) => { accumulator[key] = value diff --git a/module/templates.js b/module/templates.js index 7ed07413..b9c54f4e 100644 --- a/module/templates.js +++ b/module/templates.js @@ -68,7 +68,7 @@ export const preloadHandlebarsTemplates = async function () { 'systems/vtm5e/templates/item/parts/macro.hbs', // Dice Tray Partials - /* + /* 'systems/vtm5e/templates/ui/parts/select-character.hbs', 'systems/vtm5e/templates/ui/parts/pool1-select-attribute.hbs', 'systems/vtm5e/templates/ui/parts/pool1-select-skill.hbs', From 73778b21cebe4b7bf1549b060686f63d01c5b23b Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 21:46:31 -0500 Subject: [PATCH 27/64] Linting --- module/templates.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/module/templates.js b/module/templates.js index b9c54f4e..858d3211 100644 --- a/module/templates.js +++ b/module/templates.js @@ -68,15 +68,14 @@ export const preloadHandlebarsTemplates = async function () { 'systems/vtm5e/templates/item/parts/macro.hbs', // Dice Tray Partials - /* - 'systems/vtm5e/templates/ui/parts/select-character.hbs', - 'systems/vtm5e/templates/ui/parts/pool1-select-attribute.hbs', - 'systems/vtm5e/templates/ui/parts/pool1-select-skill.hbs', - 'systems/vtm5e/templates/ui/parts/pool1-select-discipline.hbs', - 'systems/vtm5e/templates/ui/parts/pool2-select-attribute.hbs', - 'systems/vtm5e/templates/ui/parts/pool2-select-skill.hbs', - 'systems/vtm5e/templates/ui/parts/pool2-select-discipline.hbs', - 'systems/vtm5e/templates/ui/parts/pool2-nothing.hbs',*/ + //'systems/vtm5e/templates/ui/parts/select-character.hbs', + //'systems/vtm5e/templates/ui/parts/pool1-select-attribute.hbs', + //'systems/vtm5e/templates/ui/parts/pool1-select-skill.hbs', + //'systems/vtm5e/templates/ui/parts/pool1-select-discipline.hbs', + //'systems/vtm5e/templates/ui/parts/pool2-select-attribute.hbs', + //'systems/vtm5e/templates/ui/parts/pool2-select-skill.hbs', + //'systems/vtm5e/templates/ui/parts/pool2-select-discipline.hbs', + //'systems/vtm5e/templates/ui/parts/pool2-nothing.hbs', // Roll dialog Partials 'systems/vtm5e/templates/ui/parts/roll-dialog-base.hbs', From be3a5afb5df38338e8403bca0c76c341227b0d1a Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 21:48:40 -0500 Subject: [PATCH 28/64] Linting --- module/templates.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/module/templates.js b/module/templates.js index 858d3211..9160b3ff 100644 --- a/module/templates.js +++ b/module/templates.js @@ -68,14 +68,14 @@ export const preloadHandlebarsTemplates = async function () { 'systems/vtm5e/templates/item/parts/macro.hbs', // Dice Tray Partials - //'systems/vtm5e/templates/ui/parts/select-character.hbs', - //'systems/vtm5e/templates/ui/parts/pool1-select-attribute.hbs', - //'systems/vtm5e/templates/ui/parts/pool1-select-skill.hbs', - //'systems/vtm5e/templates/ui/parts/pool1-select-discipline.hbs', - //'systems/vtm5e/templates/ui/parts/pool2-select-attribute.hbs', - //'systems/vtm5e/templates/ui/parts/pool2-select-skill.hbs', - //'systems/vtm5e/templates/ui/parts/pool2-select-discipline.hbs', - //'systems/vtm5e/templates/ui/parts/pool2-nothing.hbs', + // 'systems/vtm5e/templates/ui/parts/select-character.hbs', + // 'systems/vtm5e/templates/ui/parts/pool1-select-attribute.hbs', + // 'systems/vtm5e/templates/ui/parts/pool1-select-skill.hbs', + // 'systems/vtm5e/templates/ui/parts/pool1-select-discipline.hbs', + // 'systems/vtm5e/templates/ui/parts/pool2-select-attribute.hbs', + // 'systems/vtm5e/templates/ui/parts/pool2-select-skill.hbs', + // 'systems/vtm5e/templates/ui/parts/pool2-select-discipline.hbs', + // 'systems/vtm5e/templates/ui/parts/pool2-nothing.hbs', // Roll dialog Partials 'systems/vtm5e/templates/ui/parts/roll-dialog-base.hbs', From 7e40152bde61bc4723dc7cf4b9c42f73f7dea2d5 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 22:30:38 -0500 Subject: [PATCH 29/64] Set up localization keys for all the settings menu(s) --- lang/en/core-en.json | 61 +++++++++++++++++++ module/settings.js | 60 +++++++++--------- .../ui/parts/storyteller-menu/custom-menu.hbs | 20 +++--- .../storyteller-menu/modification-menu.hbs | 24 ++++---- templates/ui/storyteller-menu.hbs | 6 +- 5 files changed, 116 insertions(+), 55 deletions(-) diff --git a/lang/en/core-en.json b/lang/en/core-en.json index fdc1dc22..52146c9a 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -16,6 +16,7 @@ "Exp": "Exp", "None": "None", "Value": "Value", + "Label": "Label", "Mortal": "Mortal", "GroupSheet": "Group Sheet", @@ -192,6 +193,66 @@ "Macro": { "MacroID": "Macro ID", "MacroNote": "If a macro is listed, then it will execute directly after the item is clicked or the roll is made." + }, + + "Settings": { + "SaveChanges": "Save Changes", + + "Modifications": "Modifications", + "Custom": "Custom", + + "Rename": "Rename", + "Hidden": "Hidden", + + "AddAttributeModification": "Add Attribute Modification", + "AddSkillModification": "Add Skill Modification", + "AddCustomAttribute": "Add Custom Attribute", + "AddCustomSkill": "Add Custom Skill", + + "AttributeType": "Attribute Type", + "SkillType": "Skill Type", + + "WorldVersion": "World Version", + "WorldVersionHint": "Automatically upgrades data when the system.json is upgraded.", + + "DarkTheme": "Dark Theme", + "DarkThemeHint": "Display sheets using a darker theme on a per-user basis.", + + "ActorBanner": "Enable Character Type Banner", + "ActorBannerHint": "Display a banner at the top of actor sheets to represent the character type.", + + "AutomationSettings": "Automation Settings", + "AutomationSettingsHint": "Access various automation settings.", + + "DisableAutomation": "Disable All Automation", + "DisableAutomationHint": "Disables all automation without having to individually press all the below buttons.", + + "AutomateWillpower": "Automate Willpower Damage", + "AutomateWillpowerHint": "If enabled, using features that deal Willpower damage will automatically tick Willpower damage on the associated actor.", + + "AutomateHunger": "Automate Hunger Increase", + "AutomateHungerHint": "If enabled, rolling Hunger Dice and failing will automatically increase the Hunger of the associated actor.", + + "AutomateOblivion": "Automate Oblivion Stains", + "AutomateOblivionHint": "If enabled, rolling 1 or 10 on rouse checks on Oblivion discipline powers will grant a stain on the humanity of the associated actor.", + + "AutomateRage": "Automate Rage Dice", + "AutomateRageHint": "If enabled, rolling Rage Dice and failing will automatically decrease Rage from the associated actor.", + + "StorytellerMenu": "Storyteller Menu", + "StorytellerMenuHint": "Modify the system, such as renaming existing and creating custom skills and attributes.", + + "ModifiedAttributes": "Attribute Modifications", + "ModifiedAttributesHint": "Allows for modification of existing attributes.", + + "ModifiedSkills": "Skill Modifications", + "ModifiedSkillsHint": "Allows for modification of existing skills.", + + "CustomAttributes": "Custom Attributes", + "CustomAttributesHint": "Allows for the creation of custom attributes.", + + "CustomSkills": "Custom Skills", + "CustomSkillsHint": "Allows for the creation of custom skills." } } } diff --git a/module/settings.js b/module/settings.js index a665f30d..b9f4adfd 100644 --- a/module/settings.js +++ b/module/settings.js @@ -10,8 +10,8 @@ import { resetActors } from './scripts/reset-actors.js' */ export const loadSettings = async function () { game.settings.register('vtm5e', 'worldVersion', { - name: 'World Version', - hint: 'Automatically upgrades data when the system.json is upgraded.', + name: game.i18n.localize('WOD5E.Settings.WorldVersion'), + hint: game.i18n.localize('WOD5E.Settings.WorldVersionHint'), scope: 'world', config: true, default: '1.5', @@ -19,8 +19,8 @@ export const loadSettings = async function () { }) game.settings.register('vtm5e', 'darkTheme', { - name: 'Dark Theme', - hint: 'Display sheets using a darker theme on a per-user basis.', + name: game.i18n.localize('WOD5E.Settings.DarkTheme'), + hint: game.i18n.localize('WOD5E.Settings.DarkThemeHint'), scope: 'client', config: true, default: false, @@ -31,8 +31,8 @@ export const loadSettings = async function () { }) game.settings.register('vtm5e', 'actorBanner', { - name: 'Enable Character Type Banner', - hint: 'Display a banner at the top of actor sheets to represent the character type.', + name: game.i18n.localize('WOD5E.Settings.ActorBanner'), + hint: game.i18n.localize('WOD5E.Settings.ActorBannerHint'), scope: 'client', config: true, default: true, @@ -68,17 +68,17 @@ export const loadSettings = async function () { */ game.settings.registerMenu('vtm5e', 'automationMenu', { - name: 'Automation Settings', - label: 'WOD5E Automation', - hint: 'Access various automation settings.', + name: game.i18n.localize('WOD5E.Settings.AutomationSettings'), + hint: game.i18n.localize('WOD5E.Settings.AutomationSettingsHint'), + label: game.i18n.localize('WOD5E.Settings.AutomationSettings'), icon: 'fas fa-wrench', type: AutomationMenu, restricted: true }) game.settings.register('vtm5e', 'disableAutomation', { - name: 'Disable All Automation', - hint: 'Disables all automation without having to individually press all the below buttons.', + name: game.i18n.localize('WOD5E.Settings.DisableAutomation'), + hint: game.i18n.localize('WOD5E.Settings.DisableAutomationHint'), scope: 'world', config: false, default: false, @@ -105,8 +105,8 @@ export const loadSettings = async function () { }) game.settings.register('vtm5e', 'automatedWillpower', { - name: 'Automate Willpower Damage', - hint: 'If enabled, using features that deal Willpower damage will automatically tick Willpower damage on the associated actor.', + name: game.i18n.localize('WOD5E.Settings.AutomateWillpower'), + hint: game.i18n.localize('WOD5E.Settings.AutomateWillpowerHint'), scope: 'world', config: false, default: true, @@ -114,8 +114,8 @@ export const loadSettings = async function () { }) game.settings.register('vtm5e', 'automatedHunger', { - name: 'Automate Hunger Increase', - hint: 'If enabled, rolling Hunger Dice and failing will automatically increase the Hunger of the associated actor.', + name: game.i18n.localize('WOD5E.Settings.AutomateHunger'), + hint: game.i18n.localize('WOD5E.Settings.AutomateHungerHint'), scope: 'world', config: false, default: true, @@ -123,8 +123,8 @@ export const loadSettings = async function () { }) game.settings.register('vtm5e', 'automatedOblivion', { - name: 'Automate Oblivion Stains', - hint: 'If enabled, rolling 1 or 10 on rouse checks on Oblivion discipline powers will grant a stain on the humanity of the associated actor.', + name: game.i18n.localize('WOD5E.Settings.AutomateOblivion'), + hint: game.i18n.localize('WOD5E.Settings.AutomateOblivionHint'), scope: 'world', config: false, default: true, @@ -132,8 +132,8 @@ export const loadSettings = async function () { }) game.settings.register('vtm5e', 'automatedRage', { - name: 'Automate Rage Dice', - hint: 'If enabled, rolling Rage Dice and failing will automatically decrease Rage from the associated actor.', + name: game.i18n.localize('WOD5E.Settings.AutomateRage'), + hint: game.i18n.localize('WOD5E.Settings.AutomateRageHint'), scope: 'world', config: false, default: true, @@ -146,9 +146,9 @@ export const loadSettings = async function () { // Register the storyteller menu game.settings.registerMenu('vtm5e', 'storytellerMenu', { - name: 'Storyteller Menu', - label: 'Storyteller Settings', - hint: 'Modify the system, such as renaming skills and attributes.', + name: game.i18n.localize('WOD5E.Settings.StorytellerMenu'), + hint: game.i18n.localize('WOD5E.Settings.StorytellerMenuHint'), + label: game.i18n.localize('WOD5E.Settings.StorytellerMenu'), icon: 'fas fa-bars', type: StorytellerMenu, restricted: true @@ -156,8 +156,8 @@ export const loadSettings = async function () { // Register the modified attributes game.settings.register('vtm5e', 'modifiedAttributes', { - name: 'Attribute Modifications', - hint: 'Allows for modification of existing attributes.', + name: game.i18n.localize('WOD5E.Settings.ModifiedAttributes'), + hint: game.i18n.localize('WOD5E.Settings.ModifiedAttributesHint'), scope: 'world', config: false, default: [], @@ -176,8 +176,8 @@ export const loadSettings = async function () { // Register the custom attributes game.settings.register('vtm5e', 'customAttributes', { - name: 'Custom Attributes', - hint: 'Allows for the creation of custom attributes.', + name: game.i18n.localize('WOD5E.Settings.CustomAttributes'), + hint: game.i18n.localize('WOD5E.Settings.CustomAttributes'), scope: 'world', config: false, default: [], @@ -199,8 +199,8 @@ export const loadSettings = async function () { // Register the modified skills game.settings.register('vtm5e', 'modifiedSkills', { - name: 'Skill Modifications', - hint: 'Allows for modification of existing skills.', + name: game.i18n.localize('WOD5E.Settings.ModifiedSkills'), + hint: game.i18n.localize('WOD5E.Settings.ModifiedSkillsHint'), scope: 'world', config: false, default: [], @@ -219,8 +219,8 @@ export const loadSettings = async function () { // Register the custom attributes game.settings.register('vtm5e', 'customSkills', { - name: 'Custom Skills', - hint: 'Allows for the creation of custom skills.', + name: game.i18n.localize('WOD5E.Settings.CustomSkills'), + hint: game.i18n.localize('WOD5E.Settings.CustomSkillsHint'), scope: 'world', config: false, default: [], diff --git a/templates/ui/parts/storyteller-menu/custom-menu.hbs b/templates/ui/parts/storyteller-menu/custom-menu.hbs index 176db6e7..5856506e 100644 --- a/templates/ui/parts/storyteller-menu/custom-menu.hbs +++ b/templates/ui/parts/storyteller-menu/custom-menu.hbs @@ -1,11 +1,11 @@
-

Custom Attributes

+

{{localize 'WOD5E.Settings.CustomAttributes'}}

-

Allows the storyteller to add custom attributes to the actor sheets.

+

{{localize 'WOD5E.Settings.CustomAttributesHint'}}

-
Label
-
Attribute Type
+
{{localize 'WOD5E.Label'}}
+
{{localize 'WOD5E.Settings.AttributeType'}}
{{#each customAttributes as |attribute id|}}
@@ -20,18 +20,18 @@ {{/each}}
-

Custom Skills

+

{{localize 'WOD5E.Settings.CustomSkills'}}

-

Allows the storyteller to add custom skills to the actor sheets.

+

{{localize 'WOD5E.Settings.CustomSkillsHint'}}

-
Label
-
Skill Type
+
{{localize 'WOD5E.Label'}}
+
{{localize 'WOD5E.Settings.SkillType'}}
{{#each customSkills as |skill id|}}
@@ -46,7 +46,7 @@ {{/each}}
diff --git a/templates/ui/parts/storyteller-menu/modification-menu.hbs b/templates/ui/parts/storyteller-menu/modification-menu.hbs index 06a0743f..a3b07a4f 100644 --- a/templates/ui/parts/storyteller-menu/modification-menu.hbs +++ b/templates/ui/parts/storyteller-menu/modification-menu.hbs @@ -1,12 +1,12 @@
-

Modified Attributes

+

{{localize 'WOD5E.Settings.ModifiedAttributes'}}

-

Allows the storyteller to modify the attributes on actor sheets.

+

{{localize 'WOD5E.Settings.ModifiedAttributesHint'}}

-
Attribute
-
Rename
-
Hidden
+
{{localize 'WOD5E.Attributes.Label'}}
+
{{localize 'WOD5E.Settings.Rename'}}
+
{{localize 'WOD5E.Settings.Hidden'}}
{{#each attributeModifications as |attribute id|}}
@@ -20,18 +20,18 @@ {{/each}}
-

Modified Skills

+

{{localize 'WOD5E.Settings.ModifiedSkills'}}

-

Allows the storyteller to modify the skills on actor sheets.

+

{{localize 'WOD5E.Settings.ModifiedSkillsHint'}}

-
Skill
-
Rename
-
Hidden
+
{{localize 'WOD5E.Skills.Label'}}
+
{{localize 'WOD5E.Settings.Rename'}}
+
{{localize 'WOD5E.Settings.Hidden'}}
{{#each skillModifications as |skill id|}}
@@ -45,7 +45,7 @@ {{/each}}
diff --git a/templates/ui/storyteller-menu.hbs b/templates/ui/storyteller-menu.hbs index 30fbf7e3..60124dd5 100644 --- a/templates/ui/storyteller-menu.hbs +++ b/templates/ui/storyteller-menu.hbs @@ -1,8 +1,8 @@
{{!-- Cell Sheet Tab Navigation --}} {{!-- Menu Body --}} @@ -16,7 +16,7 @@ {{!-- Save button --}}
- +
From e171bccdec7a7ba9a1215e73b709841688fd4104 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 22:37:10 -0500 Subject: [PATCH 30/64] Add in new localization keys to the other localization files --- lang/de/core-de.json | 61 ++++++++++++++++++++++++++ lang/es/core-es.json | 63 +++++++++++++++++++++++++++ lang/fr/core-fr.json | 61 ++++++++++++++++++++++++++ lang/it/core-it.json | 61 ++++++++++++++++++++++++++ lang/lang_template/core-template.json | 61 ++++++++++++++++++++++++++ lang/pl/core-pl.json | 61 ++++++++++++++++++++++++++ lang/pt-BR/core-pt-BR.json | 61 ++++++++++++++++++++++++++ lang/ru/core-ru.json | 61 ++++++++++++++++++++++++++ lang/uk/core-uk.json | 61 ++++++++++++++++++++++++++ 9 files changed, 551 insertions(+) diff --git a/lang/de/core-de.json b/lang/de/core-de.json index db84d051..f5064678 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -18,6 +18,7 @@ "Exp": "EP", "None": "Kein", "Value": "Wert", + "_Label": "", "Mortal": "Sterblicher", "GroupSheet": "Gruppen-Bogen", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/es/core-es.json b/lang/es/core-es.json index 6431f59f..f66f1a37 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -1,5 +1,7 @@ { "WOD5E": { + "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", + "Name": "Nombre", "Confirm": "Confirmar", "Close": "Cerrar", @@ -16,6 +18,7 @@ "Exp": "Experiencia", "None": "Ninguno", "Value": "Valor", + "_Label": "", "Mortal": "Mortal", "_GroupSheet": "", @@ -193,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index 8dbd60d0..fcb24b45 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -18,6 +18,7 @@ "Exp": "Exp", "None": "Aucun", "Value": "Valeur", + "_Label": "", "Mortal": "Mortel", "_GroupSheet": "", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/it/core-it.json b/lang/it/core-it.json index d37b2872..ba548532 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -18,6 +18,7 @@ "Exp": "Esp", "None": "Nssuno", "Value": "Valore", + "_Label": "", "Mortal": "Mortale", "_GroupSheet": "", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index 8af3fb93..33a514d7 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -16,6 +16,7 @@ "Exp": "", "None": "", "Value": "", + "Label": "", "Mortal": "", "GroupSheet": "", @@ -193,6 +194,66 @@ "Macro": { "MacroID": "", "MacroNote": "" + }, + + "Settings": { + "SaveChanges": "", + + "Modifications": "", + "Custom": "", + + "Rename": "", + "Hidden": "", + + "AddAttributeModification": "", + "AddSkillModification": "", + "AddCustomAttribute": "", + "AddCustomSkill": "", + + "AttributeType": "", + "SkillType": "", + + "WorldVersion": "", + "WorldVersionHint": "", + + "DarkTheme": "", + "DarkThemeHint": "", + + "ActorBanner": "", + "ActorBannerHint": "", + + "AutomationSettings": "", + "AutomationSettingsHint": "", + + "DisableAutomation": "", + "DisableAutomationHint": "", + + "AutomateWillpower": "", + "AutomateWillpowerHint": "", + + "AutomateHunger": "", + "AutomateHungerHint": "", + + "AutomateOblivion": "", + "AutomateOblivionHint": "", + + "AutomateRage": "", + "AutomateRageHint": "", + + "StorytellerMenu": "", + "StorytellerMenuHint": "", + + "ModifiedAttributes": "", + "ModifiedAttributesHint": "", + + "ModifiedSkills": "", + "ModifiedSkillsHint": "", + + "CustomAttributes": "", + "CustomAttributesHint": "", + + "CustomSkills": "", + "CustomSkillsHint": "" } } } diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index 3a1e5ac3..0b2d41ea 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -18,6 +18,7 @@ "Exp": "PD", "None": "Brak", "Value": "Wartość", + "_Label": "", "Mortal": "Śmiertelnik", "_GroupSheet": "", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index 6e4ab822..55487347 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -18,6 +18,7 @@ "Exp": "Experiência", "None": "Nenhum", "Value": "Valor", + "_Label": "", "Mortal": "Mortal", "_GroupSheet": "", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index fd6db104..2d196fb0 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -18,6 +18,7 @@ "Exp": "Опыт", "None": "Нет", "Value": "Значение", + "_Label": "", "Mortal": "Смертный", "_GroupSheet": "", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index 17a61669..9a8fb32a 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -18,6 +18,7 @@ "Exp": "Досвід", "None": "Немає", "Value": "Значення", + "_Label": "", "Mortal": "Смертний", "_GroupSheet": "", @@ -195,6 +196,66 @@ "Macro": { "_MacroID": "", "_MacroNote": "" + }, + + "Settings": { + "_SaveChanges": "", + + "_Modifications": "", + "_Custom": "", + + "_Rename": "", + "_Hidden": "", + + "_AddAttributeModification": "", + "_AddSkillModification": "", + "_AddCustomAttribute": "", + "_AddCustomSkill": "", + + "_AttributeType": "", + "_SkillType": "", + + "_WorldVersion": "", + "_WorldVersionHint": "", + + "_DarkTheme": "", + "_DarkThemeHint": "", + + "_ActorBanner": "", + "_ActorBannerHint": "", + + "_AutomationSettings": "", + "_AutomationSettingsHint": "", + + "_DisableAutomation": "", + "_DisableAutomationHint": "", + + "_AutomateWillpower": "", + "_AutomateWillpowerHint": "", + + "_AutomateHunger": "", + "_AutomateHungerHint": "", + + "_AutomateOblivion": "", + "_AutomateOblivionHint": "", + + "_AutomateRage": "", + "_AutomateRageHint": "", + + "_StorytellerMenu": "", + "_StorytellerMenuHint": "", + + "_ModifiedAttributes": "", + "_ModifiedAttributesHint": "", + + "_ModifiedSkills": "", + "_ModifiedSkillsHint": "", + + "_CustomAttributes": "", + "_CustomAttributesHint": "", + + "_CustomSkills": "", + "_CustomSkillsHint": "" } } } From 3241b83efa87685bd318e05b41e992b799da3213 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 23:31:58 -0500 Subject: [PATCH 31/64] Fix some styling issues in the item bonuses menu --- css/themes/dark-theme.css | 4 ++++ module/item/scripts/item-bonuses.js | 6 ++++-- templates/item/parts/bonus-display.hbs | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/css/themes/dark-theme.css b/css/themes/dark-theme.css index a7386ac7..fb36ffd4 100644 --- a/css/themes/dark-theme.css +++ b/css/themes/dark-theme.css @@ -17,6 +17,10 @@ color: #e0e0e0; } +.dark-theme .wod5e.item.sheet .bonuses input { + color: #000; +} + .dark-theme .wod5e .window-content nav.sheet-tabs { background: #121212; color: #790813; diff --git a/module/item/scripts/item-bonuses.js b/module/item/scripts/item-bonuses.js index 473e7cb5..8087ea24 100644 --- a/module/item/scripts/item-bonuses.js +++ b/module/item/scripts/item-bonuses.js @@ -85,8 +85,9 @@ export const _onAddBonus = async function (event, item) { if (activeWhenCheck.val() === 'isEqual') { activeWhenPath.css('visibility', 'visible') activeWhenValue.css('visibility', 'visible') - } if (activeWhenCheck.val() === 'isPath') { + } else if (activeWhenCheck.val() === 'isPath') { activeWhenPath.css('visibility', 'visible') + activeWhenValue.css('visibility', 'hidden') } else { activeWhenPath.css('visibility', 'hidden') activeWhenValue.css('visibility', 'hidden') @@ -190,8 +191,9 @@ export const _onEditBonus = async function (event, item) { if (activeWhenCheck.val() === 'isEqual') { activeWhenPath.css('visibility', 'visible') activeWhenValue.css('visibility', 'visible') - } if (activeWhenCheck.val() === 'isPath') { + } else if (activeWhenCheck.val() === 'isPath') { activeWhenPath.css('visibility', 'visible') + activeWhenValue.css('visibility', 'hidden') } else { activeWhenPath.css('visibility', 'hidden') activeWhenValue.css('visibility', 'hidden') diff --git a/templates/item/parts/bonus-display.hbs b/templates/item/parts/bonus-display.hbs index c55d1688..9aa9e4c9 100644 --- a/templates/item/parts/bonus-display.hbs +++ b/templates/item/parts/bonus-display.hbs @@ -23,7 +23,7 @@
-
+
{{localize "WOD5E.Bonus.PathToCheck"}}
From 7146a1093fdaca9be0d816e7f24336e94d75160f Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 23:34:39 -0500 Subject: [PATCH 32/64] Linting --- css/themes/dark-theme.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/css/themes/dark-theme.css b/css/themes/dark-theme.css index fb36ffd4..3760a14c 100644 --- a/css/themes/dark-theme.css +++ b/css/themes/dark-theme.css @@ -17,10 +17,6 @@ color: #e0e0e0; } -.dark-theme .wod5e.item.sheet .bonuses input { - color: #000; -} - .dark-theme .wod5e .window-content nav.sheet-tabs { background: #121212; color: #790813; @@ -216,6 +212,10 @@ color: #bb1020; } +.dark-theme .wod5e.item.sheet .bonuses input { + color: #000; +} + .wod5e.item.sheet .window-content input[type="number"] { color: #000; } From 7e29fd57fbe1ece6c022d7c9c3a8f24d5ce869b4 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 15 Jun 2024 23:38:46 -0500 Subject: [PATCH 33/64] Linting --- css/themes/dark-theme.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/css/themes/dark-theme.css b/css/themes/dark-theme.css index 3760a14c..e25a3281 100644 --- a/css/themes/dark-theme.css +++ b/css/themes/dark-theme.css @@ -212,6 +212,10 @@ color: #bb1020; } +.dark-theme .wod5e .actor-header h1.charname input { + color: #faf5ed; +} + .dark-theme .wod5e.item.sheet .bonuses input { color: #000; } @@ -220,10 +224,6 @@ color: #000; } -.dark-theme .wod5e .actor-header h1.charname input { - color: #faf5ed; -} - .dark-theme .wod5e .description-content { background: none; border: 0; From 6ba7f2eab3c0d7b6942b67add55f1bb6095e824d Mon Sep 17 00:00:00 2001 From: Veilza Date: Mon, 17 Jun 2024 04:58:05 -0500 Subject: [PATCH 34/64] Complete overhaul of how items are created in the actor sheets --- lang/en/core-en.json | 5 +- module/actor/ghoul-actor-sheet.js | 63 ----- module/actor/hunter-actor-sheet.js | 102 -------- module/actor/werewolf-actor-sheet.js | 136 ----------- module/actor/wod-v5-sheet.js | 217 +++++++++++++----- module/api/wod5e-api.js | 3 +- module/def/gifts.js | 4 + template.json | 6 +- templates/actor/parts/features.hbs | 2 +- templates/actor/parts/hunter/edges.hbs | 4 +- templates/actor/parts/stats.hbs | 3 +- templates/actor/parts/vampire/disciplines.hbs | 4 +- .../actor/parts/werewolf/gifts-rites.hbs | 8 +- 13 files changed, 181 insertions(+), 376 deletions(-) diff --git a/lang/en/core-en.json b/lang/en/core-en.json index 52146c9a..1a0bc056 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -18,6 +18,8 @@ "Value": "Value", "Label": "Label", + "New": "New {string}", + "Mortal": "Mortal", "GroupSheet": "Group Sheet", @@ -138,7 +140,8 @@ }, "Items": { - "Label": "Items", + "Label": "Item", + "Items": "Items", "ShowToChat": "Show to Chat", "CustomRoll": "Custom Roll", "CustomRolls": "Custom Rolls", diff --git a/module/actor/ghoul-actor-sheet.js b/module/actor/ghoul-actor-sheet.js index d46c0d7d..e0103172 100644 --- a/module/actor/ghoul-actor-sheet.js +++ b/module/actor/ghoul-actor-sheet.js @@ -127,9 +127,6 @@ export class GhoulActorSheet extends MortalActorSheet { // Top-level variables const actor = this.actor - // Make Discipline visible - html.find('.discipline-create').click(this._onShowDiscipline.bind(this)) - // Make Discipline hidden html.find('.discipline-delete').click(async ev => { const data = $(ev.currentTarget)[0].dataset @@ -210,66 +207,6 @@ export class GhoulActorSheet extends MortalActorSheet { html.find('.power-rollable').click(this._onVampireRoll.bind(this)) } - /** - * Handle making a discipline visible - * @param {Event} event The originating click event - * @private - */ - _onShowDiscipline (event) { - event.preventDefault() - - // Top-level variables - const actor = this.actor - - // Variables yet to be defined - let options = '' - let buttons = {} - - // Go through each discipline and add it to the list of options - for (const [key, value] of Object.entries(actor.system.disciplines)) { - options = options.concat(``) - } - - // Base template for the discipline selector - const template = ` -
-
- - -
-
` - - // Add buttons - buttons = { - submit: { - icon: '', - label: game.i18n.localize('WOD5E.Add'), - callback: async (html) => { - // Define the discipline selected - const discipline = html.find('#disciplineSelect')[0].value - - // Make the selected discipline visible - actor.update({ [`system.disciplines.${discipline}.visible`]: true }) - } - }, - cancel: { - icon: '', - label: game.i18n.localize('WOD5E.Cancel') - } - } - - // Render the dialog window - new Dialog({ - title: game.i18n.localize('WOD5E.VTM.AddDiscipline'), - content: template, - buttons, - default: 'submit' - }, - { - classes: ['wod5e', 'vampire-dialog', 'vampire-sheet'] - }).render(true) - } - async _onVampireRoll (event) { event.preventDefault() diff --git a/module/actor/hunter-actor-sheet.js b/module/actor/hunter-actor-sheet.js index 357ed320..bce85ba0 100644 --- a/module/actor/hunter-actor-sheet.js +++ b/module/actor/hunter-actor-sheet.js @@ -123,9 +123,6 @@ export class HunterActorSheet extends WoDActor { // Toggle despair html.find('.despair-toggle').click(this._onToggleDespair.bind(this)) - // Make Edge visible - html.find('.edge-create').click(this._onCreateEdge.bind(this)) - // Rollable Edge powers html.find('.edge-rollable').click(this._onEdgeRoll.bind(this)) @@ -169,105 +166,6 @@ export class HunterActorSheet extends WoDActor { } } - /** - * Handle making a new edge - * @param {Event} event The originating click event - * @private - */ - _onCreateEdge (event) { - event.preventDefault() - - // Top-level variables - const actor = this.actor - const header = event.currentTarget - - // Variables yet to be defined - let options = '' - let buttons = {} - - // If the type of edge is already set, we don't need to ask for it - if (header.dataset.edge) { - // Get the image for the item, if one is available from the item definitions - const itemsList = WOD5E.ItemTypes.getList() - const img = itemsList?.perk?.img ? itemsList.perk.img : 'systems/vtm5e/assets/icons/items/item-default.svg' - - // Prepare the item object. - const itemData = { - name: game.i18n.localize('WOD5E.HTR.NewPerk'), - type: 'perk', - img, - system: { - edge: header.dataset.edge - } - } - - // Remove the type from the dataset since it's in the itemData.type prop. - delete itemData.system.type - - // Finally, create the item! - return actor.createEmbeddedDocuments('Item', [itemData]) - } else { - // Go through the options and add them to the options variable - for (const [key, value] of Object.entries(actor.system.edges)) { - options = options.concat(``) - } - - // Define the template to be used - const template = ` -
-
- - -
-
` - - // Define the buttons to be used and push them to the buttons variable - buttons = { - submit: { - icon: '', - label: game.i18n.localize('WOD5E.Add'), - callback: async (html) => { - const edge = html.find('#edgeSelect')[0].value - - // Get the image for the item, if one is available from the item definitions - const itemsList = WOD5E.ItemTypes.getList() - const img = itemsList?.perk?.img ? itemsList.perk.img : 'systems/vtm5e/assets/icons/items/item-default.svg' - - // Prepare the item object. - const itemData = { - name: game.i18n.localize('WOD5E.HTR.NewPerk'), - type: 'perk', - img, - system: { - edge - } - } - // Remove the type from the dataset since it's in the itemData.type prop. - delete itemData.system.type - - // Finally, create the item! - return actor.createEmbeddedDocuments('Item', [itemData]) - } - }, - cancel: { - icon: '', - label: game.i18n.localize('WOD5E.Cancel') - } - } - - // Display the dialog - new Dialog({ - title: game.i18n.localize('WOD5E.WTA.AddGift'), - content: template, - buttons, - default: 'submit' - }, - { - classes: ['wod5e', 'hunter-dialog', 'hunter-sheet'] - }).render(true) - } - } - async _onEdgeRoll (event) { event.preventDefault() diff --git a/module/actor/werewolf-actor-sheet.js b/module/actor/werewolf-actor-sheet.js index 9468f0b5..fa2143a4 100644 --- a/module/actor/werewolf-actor-sheet.js +++ b/module/actor/werewolf-actor-sheet.js @@ -147,12 +147,6 @@ export class WerewolfActorSheet extends WoDActor { // Form edit buttons html.find('.were-form-edit').click(this._onFormEdit.bind(this)) - // Create a new Gift - html.find('.gift-create').click(this._onCreateGift.bind(this)) - - // Create a new Rite - html.find('.rite-create').click(this._onCreateRite.bind(this)) - // Post Gift description to the chat html.find('.gift-chat').click(ev => { const data = $(ev.currentTarget)[0].dataset @@ -239,136 +233,6 @@ export class WerewolfActorSheet extends WoDActor { }) } - /** - * Handle making a new gift - * @param {Event} event The originating click event - * @private - */ - _onCreateGift (event) { - event.preventDefault() - - // Top-level variables - const actor = this.actor - const header = event.currentTarget - - // Variables yet to be defined - let options = '' - let buttons = {} - - // If the type of gift is already set, we don't need to ask for it - if (header.dataset.gift) { - // Get the image for the item, if one is available from the item definitions - const itemsList = WOD5E.ItemTypes.getList() - const img = itemsList?.gift?.img ? itemsList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' - - // Prepare the item object. - const itemData = { - name: game.i18n.localize('WOD5E.WTA.NewGift'), - type: 'gift', - img, - system: { - giftType: header.dataset.gift - } - } - - // Remove the type from the dataset since it's in the itemData.type prop. - delete itemData.system.type - - // Finally, create the item! - return actor.createEmbeddedDocuments('Item', [itemData]) - } else { - // Go through the options and add them to the options variable - for (const [key, value] of Object.entries(actor.system.gifts)) { - options = options.concat(``) - } - - // Define the template to be used - const template = ` -
-
- - -
-
` - - // Define the buttons to be used and push them to the buttons variable - buttons = { - submit: { - icon: '', - label: game.i18n.localize('WOD5E.Add'), - callback: async (html) => { - const gift = html.find('#giftSelect')[0].value - - // Get the image for the item, if one is available from the item definitions - const itemsList = WOD5E.ItemTypes.getList() - const img = itemsList?.gift?.img ? itemsList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' - - // Prepare the item object. - const itemData = { - name: game.i18n.localize('WOD5E.WTA.NewGift'), - type: 'gift', - img, - system: { - giftType: gift - } - } - // Remove the type from the dataset since it's in the itemData.type prop. - delete itemData.system.type - - // Finally, create the item! - return actor.createEmbeddedDocuments('Item', [itemData]) - } - }, - cancel: { - icon: '', - label: game.i18n.localize('WOD5E.Cancel') - } - } - - // Display the dialog - new Dialog({ - title: game.i18n.localize('WOD5E.WTA.AddGift'), - content: template, - buttons, - default: 'submit' - }, - { - classes: ['wod5e', 'werewolf-dialog', 'werewolf-sheet'] - }).render(true) - } - } - - /** - * Handle making a new rite - * @param {Event} event The originating click event - * @private - */ - _onCreateRite (event) { - event.preventDefault() - - // Top-level variables - const actor = this.actor - - // Get the image for the item, if one is available from the item definitions - const itemsList = WOD5E.ItemTypes.getList() - const img = itemsList?.gift?.img ? itemsList.gift.img : 'systems/vtm5e/assets/icons/items/item-default.svg' - - // Prepare the item object. - const itemData = { - name: game.i18n.localize('WOD5E.WTA.NewRite'), - type: 'gift', - img, - system: { - giftType: 'rite' - } - } - // Remove the type from the dataset since it's in the itemData.type prop. - delete itemData.system.type - - // Finally, create the item! - return actor.createEmbeddedDocuments('Item', [itemData]) - } - // Handle when an actor goes into a frenzy _onBeginFrenzy (event) { event.preventDefault() diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 5a155342..83b302c6 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -241,7 +241,7 @@ export class WoDActor extends ActorSheet { html.find('.resource-value > .resource-value-empty').click(_onDotCounterEmpty.bind(this)) // Add Inventory Item - html.find('.item-create').click(this._onItemCreate.bind(this)) + html.find('.item-create').click(this._onCreateItem.bind(this)) // Edit a skill html.find('.edit-skill').click(this._onSkillEdit.bind(this)) @@ -324,64 +324,6 @@ export class WoDActor extends ActorSheet { await actor.update({ 'system.locked': !actor.system.locked }) } - /** - * Handle creating a new Owned Item for the actor using initial data defined in the HTML dataset - * @param {Event} event The originating click event - * @protected - */ - async _onItemCreate (event) { - event.preventDefault() - - // Top-level variables - const actor = this.actor - const header = event.currentTarget - const type = header.dataset.type - - // Secondary variables - const data = foundry.utils.duplicate(header.dataset) - - // Variables yet to be defined - let prelocalizeString - - // Handle situational variable changing - if (type === 'power') { // Vampire disciplines - prelocalizeString = data.discipline - } else if (type === 'perk') { - prelocalizeString = data.edge - } else if (type === 'feature') { - prelocalizeString = data.featuretype - } else { - prelocalizeString = type - } - // Handle situational variable changing part 2 - if (type === 'boon') { - data.boontype = 'Trivial' - } else if (type === 'customRoll') { - data.dice1 = 'strength' - data.dice2 = 'athletics' - } - - // Get the image for the item, if one is available from the item definitions - const itemsList = WOD5E.ItemTypes.getList() - const img = itemsList[type]?.img ? itemsList[type].img : 'systems/vtm5e/assets/icons/items/item-default.svg' - - // Initialize a default name. - const name = await WOD5E.api.generateLabelAndLocalize({ string: prelocalizeString }) - - // Prepare the item object. - const itemData = { - name, - type, - img, - system: data - } - // Remove the type from the dataset since it's in the itemData.type prop. - delete itemData.system.type - - // Finally, create the item! - return actor.createEmbeddedDocuments('Item', [itemData]) - } - /** * Handle bringing up the skill edit dialog window * @param {Event} event The originating click event @@ -528,4 +470,161 @@ export class WoDActor extends ActorSheet { disableAdvancedDice: true }) } + + /** + * Handle creating a new Owned Item for the actor using initial data defined in a dataset + * @param {Event} event The originating click event + */ + async _onCreateItem (event) { + event.preventDefault() + + // Top-level variables + const actor = this.actor + const dataset = event.currentTarget.dataset + const itemsList = WOD5E.ItemTypes.getList() + const type = dataset.type + + // Variables to be defined later + let subtype = dataset.subtype + let itemName = '' + let selectLabel = '' + let itemOptions = {} + let itemData = {} + let options = '' + + // Define the actor's gamesystem, defaulting to "mortal" if it's not in the systems list + const system = actor.system.gamesystem in WOD5E.Systems.getList() ? actor.system.gamesystem : 'mortal' + + // Generate item-specific data based on type + switch (type) { + case 'power': + selectLabel = game.i18n.localize('WOD5E.VTM.SelectDiscipline') + itemOptions = WOD5E.Disciplines.getList() + break + case 'perk': + selectLabel = game.i18n.localize('WOD5E.HTR.SelectEdge') + itemOptions = WOD5E.Edges.getList() + break + case 'gift': + selectLabel = game.i18n.localize('WOD5E.WTA.SelectGift') + itemOptions = WOD5E.Gifts.getList() + break + case 'feature': + selectLabel = "Select Feature" + itemOptions = WOD5E.Features.getList() + break + default: + console.log("Error: Invalid type provided.") + break + } + + // Get the image for the item, if available + const itemImg = itemsList[type]?.img || 'systems/vtm5e/assets/icons/items/item-default.svg' + + // Create item if subtype is already defined or not needed + if (subtype || ['customRoll', 'boon'].includes(type)) { + if (subtype) { + itemData = await this.appendSubtypeData(type, subtype, itemData) + } + + // Generate item name + itemName = subtype ? await WOD5E.api.generateLabelAndLocalize({ string: subtype }) : itemsList[type].label + + // Create the item + return this._createItem(actor, itemName, type, itemImg, itemData) + } else { + // Build the options for the select dropdown + for (const [key, value] of Object.entries(itemOptions)) { + options += `` + } + + // Template for the dialog form + const template = ` +
+
+ + +
+
` + + // Define dialog buttons + const buttons = { + submit: { + icon: '', + label: game.i18n.localize('WOD5E.Add'), + callback: async (html) => { + subtype = html.find('#subtypeSelect')[0].value + itemData = await this.appendSubtypeData(type, subtype, itemData) + + // Generate the item name + itemName = subtype ? await WOD5E.api.generateLabelAndLocalize({ string: subtype }) : itemsList[type].label + + // Create the item + return this._createItem(actor, itemName, type, itemImg, itemData) + } + }, + cancel: { + icon: '', + label: game.i18n.localize('WOD5E.Cancel') + } + } + + // Display the dialog + new Dialog({ + title: game.i18n.localize('WOD5E.Add'), + content: template, + buttons, + default: 'submit' + }, { + classes: ['wod5e', `${system}-dialog`, `${system}-sheet`] + }).render(true) + } + } + + /** + * Append subtype data to the item data based on item type + * @param {string} type The item type + * @param {string} subtype The item subtype + * @param {object} itemData The existing item data + * @returns {object} The updated item data + */ + async appendSubtypeData (type, subtype, itemData) { + switch (type) { + case 'power': + itemData.discipline = subtype + break + case 'perk': + itemData.edge = subtype + break + case 'gift': + itemData.giftType = subtype + break + case 'feature': + itemData.featuretype = subtype + break + default: + itemData.subtype = subtype + } + + return itemData + } + + /** + * Create an item for the actor + * @param {object} actor The actor object + * @param {string} itemName The name of the item + * @param {string} type The type of the item + * @param {string} itemImg The image for the item + * @param {object} itemData The data for the item + */ + async _createItem (actor, itemName, type, itemImg, itemData) { + return actor.createEmbeddedDocuments('Item', [{ + name: `${game.i18n.format('WOD5E.New', { + string: itemName + })}`, + type, + img: itemImg, + system: itemData + }]) + } } diff --git a/module/api/wod5e-api.js b/module/api/wod5e-api.js index 06285ea5..d50ef8b9 100644 --- a/module/api/wod5e-api.js +++ b/module/api/wod5e-api.js @@ -301,7 +301,8 @@ export class wod5eAPI { WOD5E.ItemTypes.getList(), WOD5E.Disciplines.getList(), WOD5E.Renown.getList(), - WOD5E.Edges.getList() + WOD5E.Edges.getList(), + WOD5E.Gifts.getList() ] // Iterate through each list to find the label diff --git a/module/def/gifts.js b/module/def/gifts.js index c5f42718..77dbf816 100644 --- a/module/def/gifts.js +++ b/module/def/gifts.js @@ -100,6 +100,10 @@ export class Gifts { static silverfang = { label: 'WOD5E.WTA.SilverFang' } + + static rite = { + label: 'WOD5E.WTA.Rite' + } } // Hook to call onReady when the game is ready diff --git a/template.json b/template.json index 6e0ec85d..47481c76 100644 --- a/template.json +++ b/template.json @@ -903,7 +903,7 @@ }, "feature": { "templates": ["base"], - "featuretype":"merit", + "featuretype": "merit", "points": 0 }, "power": { @@ -925,8 +925,8 @@ }, "customRoll": { "templates": ["base"], - "dice1" : "", - "dice2" : "", + "dice1": "strength", + "dice2": "athletics", "modifier": 0 }, "perk": { diff --git a/templates/actor/parts/features.hbs b/templates/actor/parts/features.hbs index bac03034..02ee6b45 100644 --- a/templates/actor/parts/features.hbs +++ b/templates/actor/parts/features.hbs @@ -5,7 +5,7 @@
{{localize (generateLocalizedLabel key)}}
{{localize "WOD5E.Add"}} + data-subtype="{{key}}"> {{localize "WOD5E.Add"}}
{{#each feature as |item id|}} diff --git a/templates/actor/parts/hunter/edges.hbs b/templates/actor/parts/hunter/edges.hbs index 7968c9e0..e3b8965b 100644 --- a/templates/actor/parts/hunter/edges.hbs +++ b/templates/actor/parts/hunter/edges.hbs @@ -5,7 +5,7 @@
{{localize "WOD5E.Name"}}
- + {{localize "WOD5E.HTR.AddEdge"}} @@ -22,7 +22,7 @@
- + diff --git a/templates/actor/parts/stats.hbs b/templates/actor/parts/stats.hbs index 48b5cee3..5ccf91c4 100644 --- a/templates/actor/parts/stats.hbs +++ b/templates/actor/parts/stats.hbs @@ -56,8 +56,7 @@
{{localize "WOD5E.Attributes.Label"}}
{{localize "WOD5E.Skills.Label"}}
diff --git a/templates/actor/parts/vampire/disciplines.hbs b/templates/actor/parts/vampire/disciplines.hbs index 2c1a38fd..7eeef8b1 100644 --- a/templates/actor/parts/vampire/disciplines.hbs +++ b/templates/actor/parts/vampire/disciplines.hbs @@ -6,7 +6,7 @@
{{localize "WOD5E.Level"}}
- + {{localize "WOD5E.VTM.AddDiscipline"}} @@ -33,7 +33,7 @@
- + diff --git a/templates/actor/parts/werewolf/gifts-rites.hbs b/templates/actor/parts/werewolf/gifts-rites.hbs index 27f1a11b..25695cb0 100644 --- a/templates/actor/parts/werewolf/gifts-rites.hbs +++ b/templates/actor/parts/werewolf/gifts-rites.hbs @@ -13,7 +13,7 @@
{{localize "WOD5E.WTA.Renown"}}
- + {{localize "WOD5E.WTA.AddGift"}} @@ -30,11 +30,11 @@ @@ -107,7 +107,7 @@
{{localize "WOD5E.WTA.Renown"}}
- + {{localize "WOD5E.WTA.AddRite"}} From f23c0216eba7d0e5e81c82b214059a3711de7f56 Mon Sep 17 00:00:00 2001 From: Veilza Date: Mon, 17 Jun 2024 05:02:30 -0500 Subject: [PATCH 35/64] Add new "New" localization format for all the other language files --- lang/de/core-de.json | 2 ++ lang/es/core-es.json | 2 ++ lang/fr/core-fr.json | 2 ++ lang/it/core-it.json | 2 ++ lang/lang_template/core-template.json | 2 ++ lang/pl/core-pl.json | 2 ++ lang/pt-BR/core-pt-BR.json | 2 ++ lang/ru/core-ru.json | 2 ++ lang/uk/core-uk.json | 2 ++ 9 files changed, 18 insertions(+) diff --git a/lang/de/core-de.json b/lang/de/core-de.json index f5064678..cde26fdd 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -20,6 +20,8 @@ "Value": "Wert", "_Label": "", + "New": "Neue {string}", + "Mortal": "Sterblicher", "GroupSheet": "Gruppen-Bogen", diff --git a/lang/es/core-es.json b/lang/es/core-es.json index f66f1a37..9ed57fe3 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -20,6 +20,8 @@ "Value": "Valor", "_Label": "", + "_New": "Nueva {string}", + "Mortal": "Mortal", "_GroupSheet": "", diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index fcb24b45..83564e3b 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -19,6 +19,8 @@ "None": "Aucun", "Value": "Valeur", "_Label": "", + + "New": "Nouveau {string}", "Mortal": "Mortel", "_GroupSheet": "", diff --git a/lang/it/core-it.json b/lang/it/core-it.json index ba548532..6679a71b 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -19,6 +19,8 @@ "None": "Nssuno", "Value": "Valore", "_Label": "", + + "New": "Nuova {string}", "Mortal": "Mortale", "_GroupSheet": "", diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index 33a514d7..2611c7a6 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -18,6 +18,8 @@ "Value": "", "Label": "", + "New": "{string}", + "Mortal": "", "GroupSheet": "", diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index 0b2d41ea..f173ed1e 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -19,6 +19,8 @@ "None": "Brak", "Value": "Wartość", "_Label": "", + + "_New": "New {string}", "Mortal": "Śmiertelnik", "_GroupSheet": "", diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index 55487347..773706bd 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -19,6 +19,8 @@ "None": "Nenhum", "Value": "Valor", "_Label": "", + + "_New": "New {string}", "Mortal": "Mortal", "_GroupSheet": "", diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index 2d196fb0..d551d44f 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -20,6 +20,8 @@ "Value": "Значение", "_Label": "", + "_New": "New {string}", + "Mortal": "Смертный", "_GroupSheet": "", diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index 9a8fb32a..c2ccce4d 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -20,6 +20,8 @@ "Value": "Значення", "_Label": "", + "_New": "New {string}", + "Mortal": "Смертний", "_GroupSheet": "", From d3b8edaed88f93cca089da279fd2b266e99743ce Mon Sep 17 00:00:00 2001 From: Veilza Date: Mon, 17 Jun 2024 05:05:01 -0500 Subject: [PATCH 36/64] Linter pass --- module/actor/ghoul-actor-sheet.js | 2 +- module/actor/hunter-actor-sheet.js | 2 +- module/actor/werewolf-actor-sheet.js | 2 +- module/actor/wod-v5-sheet.js | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/actor/ghoul-actor-sheet.js b/module/actor/ghoul-actor-sheet.js index e0103172..6717f62a 100644 --- a/module/actor/ghoul-actor-sheet.js +++ b/module/actor/ghoul-actor-sheet.js @@ -1,4 +1,4 @@ -/* global Dialog, game, foundry, renderTemplate, ChatMessage */ +/* global game, foundry, renderTemplate, ChatMessage */ import { WOD5eDice } from '../scripts/system-rolls.js' import { getActiveBonuses } from '../scripts/rolls/situational-modifiers.js' diff --git a/module/actor/hunter-actor-sheet.js b/module/actor/hunter-actor-sheet.js index bce85ba0..d6d988ed 100644 --- a/module/actor/hunter-actor-sheet.js +++ b/module/actor/hunter-actor-sheet.js @@ -1,4 +1,4 @@ -/* global Dialog, game, foundry, renderTemplate, ChatMessage, WOD5E */ +/* global game, foundry, renderTemplate, ChatMessage */ import { WOD5eDice } from '../scripts/system-rolls.js' import { getActiveBonuses } from '../scripts/rolls/situational-modifiers.js' diff --git a/module/actor/werewolf-actor-sheet.js b/module/actor/werewolf-actor-sheet.js index fa2143a4..560d90c1 100644 --- a/module/actor/werewolf-actor-sheet.js +++ b/module/actor/werewolf-actor-sheet.js @@ -1,4 +1,4 @@ -/* global game, foundry, renderTemplate, ChatMessage, Dialog, WOD5E */ +/* global game, foundry, renderTemplate, ChatMessage, Dialog */ import { WOD5eDice } from '../scripts/system-rolls.js' import { getActiveBonuses } from '../scripts/rolls/situational-modifiers.js' diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 83b302c6..7d6e931b 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -1,4 +1,4 @@ -/* global DEFAULT_TOKEN, ChatMessage, foundry, ActorSheet, game, renderTemplate, Dialog, TextEditor, WOD5E */ +/* global DEFAULT_TOKEN, ChatMessage, ActorSheet, game, renderTemplate, Dialog, TextEditor, WOD5E */ import { _onRoll } from './scripts/roll.js' import { _onResourceChange, _setupDotCounters, _setupSquareCounters, _onDotCounterChange, _onDotCounterEmpty, _onSquareCounterChange } from './scripts/counters.js' @@ -510,11 +510,11 @@ export class WoDActor extends ActorSheet { itemOptions = WOD5E.Gifts.getList() break case 'feature': - selectLabel = "Select Feature" + selectLabel = game.i18n.localize('WOD5E.Items.SelectFeature') itemOptions = WOD5E.Features.getList() break default: - console.log("Error: Invalid type provided.") + console.log('Error: Invalid type provided.') break } From 565777ad00e4d75a55ea921ed846c9952c1c58ad Mon Sep 17 00:00:00 2001 From: Veilza Date: Mon, 17 Jun 2024 05:06:39 -0500 Subject: [PATCH 37/64] Add missing localization keys --- lang/de/core-de.json | 3 ++- lang/en/core-en.json | 3 ++- lang/es/core-es.json | 3 ++- lang/fr/core-fr.json | 3 ++- lang/it/core-it.json | 3 ++- lang/lang_template/core-template.json | 3 ++- lang/pl/core-pl.json | 3 ++- lang/pt-BR/core-pt-BR.json | 3 ++- lang/ru/core-ru.json | 3 ++- lang/uk/core-uk.json | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/lang/de/core-de.json b/lang/de/core-de.json index cde26fdd..640fcc1e 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -161,7 +161,8 @@ "NewSpecialty": "Neue Spezialisierung", "Boon": "Gefallen", "Boons": "Gefallen", - "Macro": "Macro" + "Macro": "Macro", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/en/core-en.json b/lang/en/core-en.json index 1a0bc056..22a5220b 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -159,7 +159,8 @@ "NewSpecialty": "New Specialty", "Boon": "Boon", "Boons": "Boons", - "Macro": "Macro" + "Macro": "Macro", + "SelectFeature": "Select Feature" }, "Biography": { diff --git a/lang/es/core-es.json b/lang/es/core-es.json index 9ed57fe3..c09ed77c 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -161,7 +161,8 @@ "NewSpecialty": "Nueva Especialidad", "Boon": "Bendición", "Boons": "Favores", - "Macro": "Macro" + "Macro": "Macro", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index 83564e3b..8b200cce 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -161,7 +161,8 @@ "NewSpecialty": "Nouvelle Spécialité", "Boon": "Dette", "Boons": "Dettes", - "Macro": "Macro" + "Macro": "Macro", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/it/core-it.json b/lang/it/core-it.json index 6679a71b..697c8163 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -161,7 +161,8 @@ "NewSpecialty": "Nuova Specialità", "Boon": "Favore", "Boons": "Favori", - "Macro": "Macro" + "Macro": "Macro", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index 2611c7a6..e44c1b15 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -159,7 +159,8 @@ "NewSpecialty": "", "Boon": "", "Boons": "", - "Macro": "" + "Macro": "", + "SelectFeature": "" }, "Biography": { diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index f173ed1e..c659de33 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -161,7 +161,8 @@ "_NewSpecialty": "", "Boon": "Przysługa", "Boons": "Przysługi", - "_Macro": "Macro" + "_Macro": "", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index 773706bd..f895801a 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -161,7 +161,8 @@ "NewSpecialty": "New Specialty", "Boon": "Favor", "Boons": "Favores", - "_Macro": "Macro" + "_Macro": "", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index d551d44f..a9e66015 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -161,7 +161,8 @@ "_NewSpecialty": "", "Boon": "Долг", "Boons": "Долги", - "_Macro": "" + "_Macro": "", + "_SelectFeature": "" }, "Biography": { diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index c2ccce4d..93c26d3b 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -161,7 +161,8 @@ "_NewSpecialty": "", "Boon": "Милість", "Boons": "Милості", - "_Macro": "" + "_Macro": "", + "_SelectFeature": "" }, "Biography": { From 6b7ba9e43028e473e1671a2a8113654523b62b89 Mon Sep 17 00:00:00 2001 From: Veilza Date: Mon, 17 Jun 2024 05:18:55 -0500 Subject: [PATCH 38/64] Fix items being unable to be dropped onto group sheets --- module/actor/group-actor-sheet.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/actor/group-actor-sheet.js b/module/actor/group-actor-sheet.js index 431c91ce..76f3582b 100644 --- a/module/actor/group-actor-sheet.js +++ b/module/actor/group-actor-sheet.js @@ -77,6 +77,10 @@ export class GroupActorSheet extends WoDActor { if (data.type === 'Actor') { this._addActor(data.uuid) + } else if (data.type === 'Item') { + this.actor.createEmbeddedDocuments('Item', [ + fromUuidSync(data.uuid) + ]) } } From e2b10436087234e500358064fe4e233c5422082c Mon Sep 17 00:00:00 2001 From: Veilza Date: Tue, 18 Jun 2024 13:25:09 -0500 Subject: [PATCH 39/64] Quick revise of the localization strings for Skills, Attributes and Items due to conflicting keys with the ru-ru module. --- lang/de/core-de.json | 6 +-- lang/en/core-en.json | 6 +-- lang/es/core-es.json | 6 +-- lang/fr/core-fr.json | 6 +-- lang/it/core-it.json | 6 +-- lang/lang_template/core-template.json | 6 +-- lang/pl/core-pl.json | 6 +-- lang/pt-BR/core-pt-BR.json | 6 +-- lang/ru/core-ru.json | 6 +-- lang/uk/core-uk.json | 6 +-- module/actor/scripts/specialty-bonuses.js | 2 +- module/actor/wod-v5-sheet.js | 2 +- module/def/attributes.js | 18 +++---- module/def/features.js | 8 +-- module/def/itemtypes.js | 6 +-- module/def/skills.js | 54 +++++++++---------- module/menus/storyteller-menu.js | 4 +- packs/Macros.db | 4 -- template.json | 54 +++++++++---------- templates/actor/parts/features.hbs | 8 +-- templates/actor/parts/hunter/edges.hbs | 4 +- templates/actor/parts/skill-dialog.hbs | 4 +- templates/actor/parts/stats.hbs | 12 ++--- templates/actor/parts/vampire/disciplines.hbs | 4 +- .../actor/parts/werewolf/gifts-rites.hbs | 6 +-- templates/item/item-boon-sheet.hbs | 10 ++-- templates/item/item-customRoll-sheet.hbs | 10 ++-- templates/item/item-feature-sheet.hbs | 16 +++--- templates/item/item-gift-sheet.hbs | 10 ++-- templates/item/item-item-sheet.hbs | 8 +-- templates/item/item-perk-sheet.hbs | 10 ++-- templates/item/item-power-sheet.hbs | 12 ++--- templates/item/item-sheet.hbs | 8 +-- templates/ui/parts/dice-roller/tray.hbs | 8 +-- .../storyteller-menu/modification-menu.hbs | 4 +- templates/ui/select-dice-dialog.hbs | 8 +-- 36 files changed, 175 insertions(+), 179 deletions(-) delete mode 100644 packs/Macros.db diff --git a/lang/de/core-de.json b/lang/de/core-de.json index 640fcc1e..1201e75a 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -94,7 +94,7 @@ "Other": "Sonstige" }, - "Attributes": { + "AttributesList": { "Label": "Attribute", "Attributes": "Attribute", "Strength": "Körperkraft", @@ -108,7 +108,7 @@ "Resolve": "Entschlossenheit" }, - "Skills": { + "SkillsList": { "Label": "Fähigkeiten", "Skills": "Fähigkeiten", "Specialty": "Spezialisierung", @@ -142,7 +142,7 @@ "Technology": "Technologie" }, - "Items": { + "ItemsList": { "Label": "Gegenstände", "ShowToChat": "An Chat senden", "CustomRoll": "Benutzerdefinierter Wurf", diff --git a/lang/en/core-en.json b/lang/en/core-en.json index 22a5220b..9a5ada95 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -91,7 +91,7 @@ "Other": "Other" }, - "Attributes": { + "AttributesList": { "Label": "Attribute", "Attributes": "Attributes", "Strength": "Strength", @@ -105,7 +105,7 @@ "Resolve": "Resolve" }, - "Skills": { + "SkillsList": { "Label": "Skill", "Skills": "Skills", "Specialty": "Specialty", @@ -139,7 +139,7 @@ "Technology": "Technology" }, - "Items": { + "ItemsList": { "Label": "Item", "Items": "Items", "ShowToChat": "Show to Chat", diff --git a/lang/es/core-es.json b/lang/es/core-es.json index c09ed77c..2d66b3e1 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -94,7 +94,7 @@ "Other": "Otro" }, - "Attributes": { + "AttributesList": { "Label": "Atributo", "Attributes": "Atributos", "Strength": "Fuerza", @@ -108,7 +108,7 @@ "Resolve": "Resolución" }, - "Skills": { + "SkillsList": { "Label": "Habilidad", "Skills": "Habilidades", "Specialty": "Especialidad", @@ -142,7 +142,7 @@ "Technology": "Tecnología" }, - "Items": { + "ItemsList": { "Label": "Objeto", "ShowToChat": "Mostrar al chat", "CustomRoll": "Tirada Personalizadas", diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index 8b200cce..9daa7898 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -94,7 +94,7 @@ "Other": "Autre" }, - "Attributes": { + "AttributesList": { "Label": "Attribut", "Attributes": "Attributs", "Strength": "Force", @@ -108,7 +108,7 @@ "Resolve": "Résolution" }, - "Skills": { + "SkillsList": { "Label": "Compétence", "Skills": "Compétences", "Specialty": "Spécialité", @@ -142,7 +142,7 @@ "Technology": "Technologie" }, - "Items": { + "ItemsList": { "Label": "Objets", "ShowToChat": "Afficher pour discuter", "CustomRoll": "Jet Personnalisé", diff --git a/lang/it/core-it.json b/lang/it/core-it.json index 697c8163..6a638753 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -94,7 +94,7 @@ "Other": "Altro" }, - "Attributes": { + "AttributesList": { "Label": "Attributo", "Attributes": "Attributi", "Strength": "Forza", @@ -108,7 +108,7 @@ "Resolve": "Fermezza" }, - "Skills": { + "SkillsList": { "Label": "Abilità", "Skills": "Abilità", "Specialty": "Specialità", @@ -142,7 +142,7 @@ "Technology": "Tecnologia" }, - "Items": { + "ItemsList": { "Label": "Etichetta", "ShowToChat": "Mostra in chat", "CustomRoll": "Tiro personalizzato", diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index e44c1b15..bf0fc691 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -92,7 +92,7 @@ "Other": "" }, - "Attributes": { + "AttributesList": { "Label": "", "Attributes": "", "Strength": "", @@ -106,7 +106,7 @@ "Resolve": "" }, - "Skills": { + "SkillsList": { "Label": "", "Skills": "", "Specialty": "", @@ -140,7 +140,7 @@ "Technology": "" }, - "Items": { + "ItemsList": { "Label": "", "ShowToChat": "", "CustomRoll": "", diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index c659de33..d32850be 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -94,7 +94,7 @@ "Other": "Inne" }, - "Attributes": { + "AttributesList": { "Label": "Atrybut", "Attributes": "Atrybuty", "Strength": "Siła", @@ -108,7 +108,7 @@ "Resolve": "Determinacja" }, - "Skills": { + "SkillsList": { "Label": "Umiejętność", "Skills": "Umiejętności", "Specialty": "Specjalizacja", @@ -142,7 +142,7 @@ "Technology": "Technika" }, - "Items": { + "ItemsList": { "_Label": "", "ShowToChat": "Pokaż na czacie", "CustomRoll": "Własny Rzut", diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index f895801a..fc9333de 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -94,7 +94,7 @@ "Other": "Outro" }, - "Attributes": { + "AttributesList": { "Label": "Atributos", "Attributes": "Atributos", "Strength": "Força", @@ -108,7 +108,7 @@ "Resolve": "Determinação" }, - "Skills": { + "SkillsList": { "Label": "Habilidades", "Skills": "Habilidades", "Specialty": "Especialização", @@ -142,7 +142,7 @@ "Technology": "Tecnologia" }, - "Items": { + "ItemsList": { "Label": "Items", "ShowToChat": "Mostrar no Chat", "CustomRoll": "Rolagem Personalizada", diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index a9e66015..f5356221 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -94,7 +94,7 @@ "Other": "Прочее" }, - "Attributes": { + "AttributesList": { "Label": "Характеристика", "Attributes": "Характеристики", "Strength": "Сила", @@ -108,7 +108,7 @@ "Resolve": "Упорство" }, - "Skills": { + "SkillsList": { "Label": "Навык", "Skills": "Навыки", "Specialty": "Специализация", @@ -142,7 +142,7 @@ "Technology": "Техника" }, - "Items": { + "ItemsList": { "_Label": "", "ShowToChat": "Вывести в чат", "CustomRoll": "Уникальная проверка", diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index 93c26d3b..203ff128 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -94,7 +94,7 @@ "Other": "Інше" }, - "Attributes": { + "AttributesList": { "Label": "Атрибут", "Attributes": "Атрибути", "Strength": "Сила", @@ -108,7 +108,7 @@ "Resolve": "Зосередженість" }, - "Skills": { + "SkillsList": { "Label": "Навичка", "Skills": "Навички", "Specialty": "Спеціалізація", @@ -142,7 +142,7 @@ "Technology": "Технології" }, - "Items": { + "ItemsList": { "_Label": "", "ShowToChat": "Показати в чат", "CustomRoll": "Власна перевірка", diff --git a/module/actor/scripts/specialty-bonuses.js b/module/actor/scripts/specialty-bonuses.js index c786a7f4..ee9d6b0a 100644 --- a/module/actor/scripts/specialty-bonuses.js +++ b/module/actor/scripts/specialty-bonuses.js @@ -13,7 +13,7 @@ export const _onAddBonus = async function (event, actor, data, SkillEditDialog) const bonusData = { actor, bonus: { - source: game.i18n.localize('WOD5E.Items.NewSpecialty'), + source: game.i18n.localize('WOD5E.ItemsList.NewSpecialty'), value: 1, paths: [`skills.${skill}`] } diff --git a/module/actor/wod-v5-sheet.js b/module/actor/wod-v5-sheet.js index 7d6e931b..ea659008 100644 --- a/module/actor/wod-v5-sheet.js +++ b/module/actor/wod-v5-sheet.js @@ -510,7 +510,7 @@ export class WoDActor extends ActorSheet { itemOptions = WOD5E.Gifts.getList() break case 'feature': - selectLabel = game.i18n.localize('WOD5E.Items.SelectFeature') + selectLabel = game.i18n.localize('WOD5E.ItemsList.SelectFeature') itemOptions = WOD5E.Features.getList() break default: diff --git a/module/def/attributes.js b/module/def/attributes.js index 16e801cd..6fc46e62 100644 --- a/module/def/attributes.js +++ b/module/def/attributes.js @@ -74,47 +74,47 @@ export class Attributes { } static strength = { - label: 'WOD5E.Attributes.Strength', + label: 'WOD5E.AttributesList.Strength', type: 'physical' } static charisma = { - label: 'WOD5E.Attributes.Charisma', + label: 'WOD5E.AttributesList.Charisma', type: 'social' } static intelligence = { - label: 'WOD5E.Attributes.Intelligence', + label: 'WOD5E.AttributesList.Intelligence', type: 'mental' } static dexterity = { - label: 'WOD5E.Attributes.Dexterity', + label: 'WOD5E.AttributesList.Dexterity', type: 'physical' } static manipulation = { - label: 'WOD5E.Attributes.Manipulation', + label: 'WOD5E.AttributesList.Manipulation', type: 'social' } static wits = { - label: 'WOD5E.Attributes.Wits', + label: 'WOD5E.AttributesList.Wits', type: 'mental' } static stamina = { - label: 'WOD5E.Attributes.Stamina', + label: 'WOD5E.AttributesList.Stamina', type: 'physical' } static composure = { - label: 'WOD5E.Attributes.Composure', + label: 'WOD5E.AttributesList.Composure', type: 'social' } static resolve = { - label: 'WOD5E.Attributes.Resolve', + label: 'WOD5E.AttributesList.Resolve', type: 'mental' } } diff --git a/module/def/features.js b/module/def/features.js index e038b0b1..c2636200 100644 --- a/module/def/features.js +++ b/module/def/features.js @@ -34,19 +34,19 @@ export class Features { } static background = { - label: 'WOD5E.Items.Background' + label: 'WOD5E.ItemsList.Background' } static merit = { - label: 'WOD5E.Items.Merit' + label: 'WOD5E.ItemsList.Merit' } static flaw = { - label: 'WOD5E.Items.Flaw' + label: 'WOD5E.ItemsList.Flaw' } static boon = { - label: 'WOD5E.Items.Boon' + label: 'WOD5E.ItemsList.Boon' } } diff --git a/module/def/itemtypes.js b/module/def/itemtypes.js index 01a4a178..22016733 100644 --- a/module/def/itemtypes.js +++ b/module/def/itemtypes.js @@ -34,7 +34,7 @@ export class ItemTypes { } static feature = { - label: 'WOD5E.Items.Feature', + label: 'WOD5E.ItemsList.Feature', img: 'systems/vtm5e/assets/icons/items/feature.svg' } @@ -44,12 +44,12 @@ export class ItemTypes { } static boon = { - label: 'WOD5E.Items.Boon', + label: 'WOD5E.ItemsList.Boon', img: 'systems/vtm5e/assets/icons/items/boon.svg' } static customRoll = { - label: 'WOD5E.Items.CustomRoll', + label: 'WOD5E.ItemsList.CustomRoll', img: 'systems/vtm5e/assets/icons/items/custom-roll.png' } diff --git a/module/def/skills.js b/module/def/skills.js index 1c5284ba..2b6c3022 100644 --- a/module/def/skills.js +++ b/module/def/skills.js @@ -74,137 +74,137 @@ export class Skills { } static athletics = { - label: 'WOD5E.Skills.Athletics', + label: 'WOD5E.SkillsList.Athletics', type: 'physical' } static animalken = { - label: 'WOD5E.Skills.AnimalKen', + label: 'WOD5E.SkillsList.AnimalKen', type: 'social' } static academics = { - label: 'WOD5E.Skills.Academics', + label: 'WOD5E.SkillsList.Academics', type: 'mental' } static brawl = { - label: 'WOD5E.Skills.Brawl', + label: 'WOD5E.SkillsList.Brawl', type: 'physical' } static etiquette = { - label: 'WOD5E.Skills.Etiquette', + label: 'WOD5E.SkillsList.Etiquette', type: 'social' } static awareness = { - label: 'WOD5E.Skills.Awareness', + label: 'WOD5E.SkillsList.Awareness', type: 'mental' } static craft = { - label: 'WOD5E.Skills.Craft', + label: 'WOD5E.SkillsList.Craft', type: 'physical' } static insight = { - label: 'WOD5E.Skills.Insight', + label: 'WOD5E.SkillsList.Insight', type: 'social' } static finance = { - label: 'WOD5E.Skills.Finance', + label: 'WOD5E.SkillsList.Finance', type: 'mental' } static drive = { - label: 'WOD5E.Skills.Drive', + label: 'WOD5E.SkillsList.Drive', type: 'physical' } static intimidation = { - label: 'WOD5E.Skills.Intimidation', + label: 'WOD5E.SkillsList.Intimidation', type: 'social' } static investigation = { - label: 'WOD5E.Skills.Investigation', + label: 'WOD5E.SkillsList.Investigation', type: 'mental' } static firearms = { - label: 'WOD5E.Skills.Firearms', + label: 'WOD5E.SkillsList.Firearms', type: 'physical' } static leadership = { - label: 'WOD5E.Skills.Leadership', + label: 'WOD5E.SkillsList.Leadership', type: 'social' } static medicine = { - label: 'WOD5E.Skills.Medicine', + label: 'WOD5E.SkillsList.Medicine', type: 'mental' } static larceny = { - label: 'WOD5E.Skills.Larceny', + label: 'WOD5E.SkillsList.Larceny', type: 'physical' } static performance = { - label: 'WOD5E.Skills.Performance', + label: 'WOD5E.SkillsList.Performance', type: 'social' } static occult = { - label: 'WOD5E.Skills.Occult', + label: 'WOD5E.SkillsList.Occult', type: 'mental' } static melee = { - label: 'WOD5E.Skills.Melee', + label: 'WOD5E.SkillsList.Melee', type: 'physical' } static persuasion = { - label: 'WOD5E.Skills.Persuasion', + label: 'WOD5E.SkillsList.Persuasion', type: 'social' } static politics = { - label: 'WOD5E.Skills.Politics', + label: 'WOD5E.SkillsList.Politics', type: 'mental' } static stealth = { - label: 'WOD5E.Skills.Stealth', + label: 'WOD5E.SkillsList.Stealth', type: 'physical' } static streetwise = { - label: 'WOD5E.Skills.Streetwise', + label: 'WOD5E.SkillsList.Streetwise', type: 'social' } static science = { - label: 'WOD5E.Skills.Science', + label: 'WOD5E.SkillsList.Science', type: 'mental' } static survival = { - label: 'WOD5E.Skills.Survival', + label: 'WOD5E.SkillsList.Survival', type: 'physical' } static subterfuge = { - label: 'WOD5E.Skills.Subterfuge', + label: 'WOD5E.SkillsList.Subterfuge', type: 'social' } static technology = { - label: 'WOD5E.Skills.Technology', + label: 'WOD5E.SkillsList.Technology', type: 'mental' } } diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 1222bfc6..56cd0dcd 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -186,12 +186,12 @@ async function _onGenerateModPrompt (type) { const attributesList = WOD5E.Attributes.getList({}) // Render the dialog - _onRenderPromptDialog('attribute', attributesList, game.i18n.localize('WOD5E.Attributes.Label')) + _onRenderPromptDialog('attribute', attributesList, game.i18n.localize('WOD5E.AttributesList.Label')) } else if (type === 'skill') { const skillsList = WOD5E.Skills.getList({}) // Render the dialog - _onRenderPromptDialog('skill', skillsList, game.i18n.localize('WOD5E.Skills.Label')) + _onRenderPromptDialog('skill', skillsList, game.i18n.localize('WOD5E.SkillsList.Label')) } } diff --git a/packs/Macros.db b/packs/Macros.db deleted file mode 100644 index 8b1a44c2..00000000 --- a/packs/Macros.db +++ /dev/null @@ -1,4 +0,0 @@ -{"name":"Basic Roll","type":"script","scope":"global","author":"0uQsagcnnkt56LRN","img":"icons/svg/dice-target.svg","command":"// This macro just prompts the user to roll a dice, and they can add additional dice if they need to.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\nconst data = actor.system\n\n// Send the roll to the API\nWOD5E.api.Roll({\n title: \"Rolling...\",\n basicDice: 1,\n disableAdvancedDice: true\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3,"0uQsagcnnkt56LRN":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.1.1","coreVersion":"11.315","createdTime":1707614396503,"modifiedTime":1712928203350,"lastModifiedBy":"0uQsagcnnkt56LRN"},"_id":"RTbzoDnCvi7Y7oAe","sort":0} -{"name":"Adjust Rage","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"systems/vtm5e/assets/icons/dice/werewolf/success.png","command":"// Grab the list of selected tokens and map them\nconst tokens = canvas.tokens.controlled\nconst actorsList = tokens.map(i=>i.actor)\nlet actorsAffected = 0\nlet actorsNameList = []\n\n// First input: Will prompt a number\nlet mod = await Dialog.prompt({content: 'Adjust Rage by (+ or -) ', callback: (html) => html.find('input').val()})\n\nfor (const actor of actorsList){\n // If the actor isn't a vampire, skip them\n if (actor.type === 'werewolf') {\n // Second input: The actor's current hunger\n const oldValue = Number(actor.system.rage.value)\n // Add the inputs together\n let newValue = oldValue + Number(mod)\n\n // Check to make sure the input doesn't go over or below max/min values\n if (newValue > 5) { newValue = 5; }\n if (newValue < 0) { newValue = 0; }\n\n await actor.update({ \"system.rage.value\": newValue })\n\n // Update the number of affected actors\n actorsAffected++\n // Add the actor to the list of displayed names in the chat message\n actorsNameList.push(actor.name)\n }\n}\n\nconst actorsListTextReadable = actorsNameList.join(', ')\nconst content = `${actorsAffected} characters had their Rage adjusted by ${mod}: ${actorsListTextReadable}`\n\nChatMessage.create({\n content\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"11.315","createdTime":1701128014450,"modifiedTime":1708983861006,"lastModifiedBy":"OrOQ70SVPCGayvrw"},"_id":"msVZH2N9fH5emdEo","sort":0} -{"name":"Adjust Hunger","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"systems/vtm5e/assets/icons/dice/vampire/success.png","command":"// Grab the list of selected tokens and map them\nconst tokens = canvas.tokens.controlled\nconst actorsList = tokens.map(i=>i.actor)\n\n// First input: Will prompt a number\nlet mod = await Dialog.prompt({content: 'Adjust Hunger by (+ or -) ', callback: (html) => html.find('input').val()})\n\nfor (const actor of actorsList){\n // If the actor isn't a vampire, skip them\n if (actor.type !== 'vampire') { return; }\n\n // Second input: The actor's current hunger\n const oldValue = Number(actor.system.hunger.value)\n // Add the inputs together\n let newValue = oldValue + Number(mod)\n\n // Check to make sure the input doesn't go over or below max/min values\n if (newValue > 5) { newValue = 5; }\n if (newValue < 0) { newValue = 0; }\n\n await actor.update({ \"system.hunger.value\": newValue })\n}","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease1","coreVersion":"11.315","createdTime":1701128684097,"modifiedTime":1707813729386,"lastModifiedBy":"OrOQ70SVPCGayvrw"},"_id":"s3GbZTtgvLIpl4FP","sort":300000} -{"name":"Roll API Example","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"icons/svg/dice-target.svg","command":"// This macro is an example of how you can access the WOD5E Roll API.\n// More documentation for the API will be released in the future.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\nconst data = actor.system\n\n// Get the value of any bonuses\nconst strength = data.abilities.strength.value\nconst animalism = data.disciplines.animalism.value\n\n// Define hunger dice\nconst advancedDice = Math.max(data.hunger.value, 0)\n// Define vampire dice\nconst basicDice = Math.max((strength + animalism) - advancedDice, 0)\n\n// Send the roll to the API\nWOD5E.api.Roll({\n title: \"Custom Roll\",\n basicDice,\n advancedDice\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"11.315","createdTime":1707614396503,"modifiedTime":1708702777210,"lastModifiedBy":"OrOQ70SVPCGayvrw"},"_id":"xHe6LF89pUgEDxV3","sort":100000} diff --git a/template.json b/template.json index 47481c76..edb2089e 100644 --- a/template.json +++ b/template.json @@ -220,137 +220,137 @@ "exceptionaldicepools": { "athletics": { "value": 0, - "name": "WOD5E.Skills.Athletics", + "name": "WOD5E.SkillsList.Athletics", "visible": false }, "animalken": { "value": 0, - "name": "WOD5E.Skills.AnimalKen", + "name": "WOD5E.SkillsList.AnimalKen", "visible": false }, "academics": { "value": 0, - "name": "WOD5E.Skills.Academics", + "name": "WOD5E.SkillsList.Academics", "visible": false }, "brawl": { "value": 0, - "name": "WOD5E.Skills.Brawl", + "name": "WOD5E.SkillsList.Brawl", "visible": false }, "etiquette": { "value": 0, - "name": "WOD5E.Skills.Etiquette", + "name": "WOD5E.SkillsList.Etiquette", "visible": false }, "awareness": { "value": 0, - "name": "WOD5E.Skills.Awareness", + "name": "WOD5E.SkillsList.Awareness", "visible": false }, "craft": { "value": 0, - "name": "WOD5E.Skills.Craft", + "name": "WOD5E.SkillsList.Craft", "visible": false }, "insight": { "value": 0, - "name": "WOD5E.Skills.Insight", + "name": "WOD5E.SkillsList.Insight", "visible": false }, "finance": { "value": 0, - "name": "WOD5E.Skills.Finance", + "name": "WOD5E.SkillsList.Finance", "visible": false }, "drive": { "value": 0, - "name": "WOD5E.Skills.Drive", + "name": "WOD5E.SkillsList.Drive", "visible": false }, "intimidation": { "value": 0, - "name": "WOD5E.Skills.Intimidation", + "name": "WOD5E.SkillsList.Intimidation", "visible": false }, "investigation": { "value": 0, - "name": "WOD5E.Skills.Investigation", + "name": "WOD5E.SkillsList.Investigation", "visible": false }, "firearms": { "value": 0, - "name": "WOD5E.Skills.Firearms", + "name": "WOD5E.SkillsList.Firearms", "visible": false }, "leadership": { "value": 0, - "name": "WOD5E.Skills.Leadership", + "name": "WOD5E.SkillsList.Leadership", "visible": false }, "medicine": { "value": 0, - "name": "WOD5E.Skills.Medicine", + "name": "WOD5E.SkillsList.Medicine", "visible": false }, "larceny": { "value": 0, - "name": "WOD5E.Skills.Larceny", + "name": "WOD5E.SkillsList.Larceny", "visible": false }, "performance": { "value": 0, - "name": "WOD5E.Skills.Performance", + "name": "WOD5E.SkillsList.Performance", "visible": false }, "occult": { "value": 0, - "name": "WOD5E.Skills.Occult", + "name": "WOD5E.SkillsList.Occult", "visible": false }, "melee": { "value": 0, - "name": "WOD5E.Skills.Melee", + "name": "WOD5E.SkillsList.Melee", "visible": false }, "persuasion": { "value": 0, - "name": "WOD5E.Skills.Persuasion", + "name": "WOD5E.SkillsList.Persuasion", "visible": false }, "politics": { "value": 0, - "name": "WOD5E.Skills.Politics", + "name": "WOD5E.SkillsList.Politics", "visible": false }, "stealth": { "value": 0, - "name": "WOD5E.Skills.Stealth", + "name": "WOD5E.SkillsList.Stealth", "visible": false }, "streetwise": { "value": 0, - "name": "WOD5E.Skills.Streetwise", + "name": "WOD5E.SkillsList.Streetwise", "visible": false }, "science": { "value": 0, - "name": "WOD5E.Skills.Science", + "name": "WOD5E.SkillsList.Science", "visible": false }, "survival": { "value": 0, - "name": "WOD5E.Skills.Survival", + "name": "WOD5E.SkillsList.Survival", "visible": false }, "subterfuge": { "value": 0, - "name": "WOD5E.Skills.Subterfuge", + "name": "WOD5E.SkillsList.Subterfuge", "visible": false }, "technology": { "value": 0, - "name": "WOD5E.Skills.Technology", + "name": "WOD5E.SkillsList.Technology", "visible": false } } diff --git a/templates/actor/parts/features.hbs b/templates/actor/parts/features.hbs index 02ee6b45..147af8d7 100644 --- a/templates/actor/parts/features.hbs +++ b/templates/actor/parts/features.hbs @@ -24,7 +24,7 @@ {{/numLoop}}
- @@ -40,11 +40,11 @@ {{/each}} {{#if (or hasBoons isCharacter)}} - +
  1. {{localize "WOD5E.Name"}}
    -
    {{localize "WOD5E.Items.Type"}}
    +
    {{localize "WOD5E.ItemsList.Type"}}
    {{item.system.boontype}}
    - diff --git a/templates/actor/parts/hunter/edges.hbs b/templates/actor/parts/hunter/edges.hbs index e3b8965b..e6c26121 100644 --- a/templates/actor/parts/hunter/edges.hbs +++ b/templates/actor/parts/hunter/edges.hbs @@ -26,7 +26,7 @@ - +
    @@ -59,7 +59,7 @@ - + diff --git a/templates/actor/parts/skill-dialog.hbs b/templates/actor/parts/skill-dialog.hbs index 8f39bd41..20135d8b 100644 --- a/templates/actor/parts/skill-dialog.hbs +++ b/templates/actor/parts/skill-dialog.hbs @@ -8,8 +8,8 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} diff --git a/templates/actor/parts/stats.hbs b/templates/actor/parts/stats.hbs index 5ccf91c4..426ac903 100644 --- a/templates/actor/parts/stats.hbs +++ b/templates/actor/parts/stats.hbs @@ -1,5 +1,5 @@
    - +
    {{#each actor.system.attributes_list as |type key|}}
    @@ -19,7 +19,7 @@ {{/each}}
    - +
    {{#each actor.system.skills_list as |type key|}}
    @@ -33,7 +33,7 @@ data-label="{{skill.displayName}}" data-selectors="skills skills.{{skill.id}}" data-skill="{{skill.id}}" data-select-dialog="true" data-use-flavor-path="true" data-flavor-path="skills.{{skill.id}}.description" data-macroid="{{skill.macroid}}">{{skill.displayName}} {{#if hasSpecialties}} - + {{/if}}
    @@ -48,13 +48,13 @@ {{/each}}
    - +
    1. {{localize "WOD5E.Name"}}
      -
      {{localize "WOD5E.Attributes.Label"}}
      -
      {{localize "WOD5E.Skills.Label"}}
      +
      {{localize "WOD5E.AttributesList.Label"}}
      +
      {{localize "WOD5E.SkillsList.Label"}}
      {{localize "WOD5E.Add"}} diff --git a/templates/actor/parts/vampire/disciplines.hbs b/templates/actor/parts/vampire/disciplines.hbs index 7eeef8b1..986c8f67 100644 --- a/templates/actor/parts/vampire/disciplines.hbs +++ b/templates/actor/parts/vampire/disciplines.hbs @@ -42,7 +42,7 @@ - + @@ -85,7 +85,7 @@ - + diff --git a/templates/actor/parts/werewolf/gifts-rites.hbs b/templates/actor/parts/werewolf/gifts-rites.hbs index 25695cb0..ee43fa3e 100644 --- a/templates/actor/parts/werewolf/gifts-rites.hbs +++ b/templates/actor/parts/werewolf/gifts-rites.hbs @@ -34,7 +34,7 @@ - +
      @@ -80,7 +80,7 @@ - + @@ -149,7 +149,7 @@ - + diff --git a/templates/item/item-boon-sheet.hbs b/templates/item/item-boon-sheet.hbs index c2e3331f..3839feaf 100644 --- a/templates/item/item-boon-sheet.hbs +++ b/templates/item/item-boon-sheet.hbs @@ -10,9 +10,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -25,7 +25,7 @@ {{!-- Type Tab --}}
      - +
      @@ -36,4 +36,4 @@ {{!-- Bonuses Tab --}} {{> "systems/vtm5e/templates/item/parts/bonuses.hbs"}} - \ No newline at end of file + diff --git a/templates/item/item-customRoll-sheet.hbs b/templates/item/item-customRoll-sheet.hbs index 43954a98..7c06132d 100644 --- a/templates/item/item-customRoll-sheet.hbs +++ b/templates/item/item-customRoll-sheet.hbs @@ -10,9 +10,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -25,13 +25,13 @@ {{!-- Attributes Tab --}}
      - + - + {{#select item.system.featuretype}} - - - + + + {{/select}} - +
      diff --git a/templates/item/item-gift-sheet.hbs b/templates/item/item-gift-sheet.hbs index 62aeae88..3dbe3a53 100644 --- a/templates/item/item-gift-sheet.hbs +++ b/templates/item/item-gift-sheet.hbs @@ -34,9 +34,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -75,11 +75,11 @@ {{/if}} - + - + {{#if item.system.amalgam}} {{else}} diff --git a/templates/item/item-item-sheet.hbs b/templates/item/item-item-sheet.hbs index 7db010a3..2cd49eb8 100644 --- a/templates/item/item-item-sheet.hbs +++ b/templates/item/item-item-sheet.hbs @@ -19,9 +19,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -37,4 +37,4 @@ {{!-- Bonuses Tab --}} {{> "systems/vtm5e/templates/item/parts/bonuses.hbs"}} - \ No newline at end of file + diff --git a/templates/item/item-perk-sheet.hbs b/templates/item/item-perk-sheet.hbs index 4ba80cf9..0cd20772 100644 --- a/templates/item/item-perk-sheet.hbs +++ b/templates/item/item-perk-sheet.hbs @@ -21,9 +21,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -68,11 +68,11 @@ {{/if}} - + - + {{#if item.system.amalgam}} {{else}} diff --git a/templates/item/item-power-sheet.hbs b/templates/item/item-power-sheet.hbs index 4833b2ad..a8a6b6e7 100644 --- a/templates/item/item-power-sheet.hbs +++ b/templates/item/item-power-sheet.hbs @@ -26,9 +26,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -73,11 +73,11 @@ {{/if}} - + - + {{#if item.system.amalgam}} {{else}} @@ -98,7 +98,7 @@ {{#if item.system.rouse }} - + {{/if}}
    diff --git a/templates/item/item-sheet.hbs b/templates/item/item-sheet.hbs index d43a1f35..b0633bc9 100644 --- a/templates/item/item-sheet.hbs +++ b/templates/item/item-sheet.hbs @@ -9,9 +9,9 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -27,4 +27,4 @@ {{!-- Bonuses Tab --}} {{> "systems/vtm5e/templates/item/parts/bonuses.hbs"}} - \ No newline at end of file + diff --git a/templates/ui/parts/dice-roller/tray.hbs b/templates/ui/parts/dice-roller/tray.hbs index 207ff345..29c08cc4 100644 --- a/templates/ui/parts/dice-roller/tray.hbs +++ b/templates/ui/parts/dice-roller/tray.hbs @@ -29,11 +29,11 @@ {{text value=pool1Selection}}
    - - @@ -44,11 +44,11 @@
    - - diff --git a/templates/ui/parts/storyteller-menu/modification-menu.hbs b/templates/ui/parts/storyteller-menu/modification-menu.hbs index a3b07a4f..5ec40d15 100644 --- a/templates/ui/parts/storyteller-menu/modification-menu.hbs +++ b/templates/ui/parts/storyteller-menu/modification-menu.hbs @@ -4,7 +4,7 @@

    {{localize 'WOD5E.Settings.ModifiedAttributesHint'}}

    -
    {{localize 'WOD5E.Attributes.Label'}}
    +
    {{localize 'WOD5E.AttributesList.Label'}}
    {{localize 'WOD5E.Settings.Rename'}}
    {{localize 'WOD5E.Settings.Hidden'}}
    @@ -29,7 +29,7 @@

    {{localize 'WOD5E.Settings.ModifiedSkillsHint'}}

    -
    {{localize 'WOD5E.Skills.Label'}}
    +
    {{localize 'WOD5E.SkillsList.Label'}}
    {{localize 'WOD5E.Settings.Rename'}}
    {{localize 'WOD5E.Settings.Hidden'}}
    diff --git a/templates/ui/select-dice-dialog.hbs b/templates/ui/select-dice-dialog.hbs index 026b1aa6..d13a5560 100644 --- a/templates/ui/select-dice-dialog.hbs +++ b/templates/ui/select-dice-dialog.hbs @@ -4,7 +4,7 @@
    - {{localize "WOD5E.Skills.Label"}} + {{localize "WOD5E.SkillsList.Label"}}
    From 61d90ce6261c237f8eade14e5e321176195ba242 Mon Sep 17 00:00:00 2001 From: Veilza Date: Tue, 18 Jun 2024 13:31:48 -0500 Subject: [PATCH 40/64] Replace the Macros.db file --- packs/Macros.db | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 packs/Macros.db diff --git a/packs/Macros.db b/packs/Macros.db new file mode 100644 index 00000000..8b1a44c2 --- /dev/null +++ b/packs/Macros.db @@ -0,0 +1,4 @@ +{"name":"Basic Roll","type":"script","scope":"global","author":"0uQsagcnnkt56LRN","img":"icons/svg/dice-target.svg","command":"// This macro just prompts the user to roll a dice, and they can add additional dice if they need to.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\nconst data = actor.system\n\n// Send the roll to the API\nWOD5E.api.Roll({\n title: \"Rolling...\",\n basicDice: 1,\n disableAdvancedDice: true\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3,"0uQsagcnnkt56LRN":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.1.1","coreVersion":"11.315","createdTime":1707614396503,"modifiedTime":1712928203350,"lastModifiedBy":"0uQsagcnnkt56LRN"},"_id":"RTbzoDnCvi7Y7oAe","sort":0} +{"name":"Adjust Rage","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"systems/vtm5e/assets/icons/dice/werewolf/success.png","command":"// Grab the list of selected tokens and map them\nconst tokens = canvas.tokens.controlled\nconst actorsList = tokens.map(i=>i.actor)\nlet actorsAffected = 0\nlet actorsNameList = []\n\n// First input: Will prompt a number\nlet mod = await Dialog.prompt({content: 'Adjust Rage by (+ or -) ', callback: (html) => html.find('input').val()})\n\nfor (const actor of actorsList){\n // If the actor isn't a vampire, skip them\n if (actor.type === 'werewolf') {\n // Second input: The actor's current hunger\n const oldValue = Number(actor.system.rage.value)\n // Add the inputs together\n let newValue = oldValue + Number(mod)\n\n // Check to make sure the input doesn't go over or below max/min values\n if (newValue > 5) { newValue = 5; }\n if (newValue < 0) { newValue = 0; }\n\n await actor.update({ \"system.rage.value\": newValue })\n\n // Update the number of affected actors\n actorsAffected++\n // Add the actor to the list of displayed names in the chat message\n actorsNameList.push(actor.name)\n }\n}\n\nconst actorsListTextReadable = actorsNameList.join(', ')\nconst content = `${actorsAffected} characters had their Rage adjusted by ${mod}: ${actorsListTextReadable}`\n\nChatMessage.create({\n content\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"11.315","createdTime":1701128014450,"modifiedTime":1708983861006,"lastModifiedBy":"OrOQ70SVPCGayvrw"},"_id":"msVZH2N9fH5emdEo","sort":0} +{"name":"Adjust Hunger","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"systems/vtm5e/assets/icons/dice/vampire/success.png","command":"// Grab the list of selected tokens and map them\nconst tokens = canvas.tokens.controlled\nconst actorsList = tokens.map(i=>i.actor)\n\n// First input: Will prompt a number\nlet mod = await Dialog.prompt({content: 'Adjust Hunger by (+ or -) ', callback: (html) => html.find('input').val()})\n\nfor (const actor of actorsList){\n // If the actor isn't a vampire, skip them\n if (actor.type !== 'vampire') { return; }\n\n // Second input: The actor's current hunger\n const oldValue = Number(actor.system.hunger.value)\n // Add the inputs together\n let newValue = oldValue + Number(mod)\n\n // Check to make sure the input doesn't go over or below max/min values\n if (newValue > 5) { newValue = 5; }\n if (newValue < 0) { newValue = 0; }\n\n await actor.update({ \"system.hunger.value\": newValue })\n}","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease1","coreVersion":"11.315","createdTime":1701128684097,"modifiedTime":1707813729386,"lastModifiedBy":"OrOQ70SVPCGayvrw"},"_id":"s3GbZTtgvLIpl4FP","sort":300000} +{"name":"Roll API Example","type":"script","scope":"global","author":"OrOQ70SVPCGayvrw","img":"icons/svg/dice-target.svg","command":"// This macro is an example of how you can access the WOD5E Roll API.\n// More documentation for the API will be released in the future.\n\n// Define the actor\nconst actor = game.actors.get(ChatMessage.getSpeaker().actor)\nconst data = actor.system\n\n// Get the value of any bonuses\nconst strength = data.abilities.strength.value\nconst animalism = data.disciplines.animalism.value\n\n// Define hunger dice\nconst advancedDice = Math.max(data.hunger.value, 0)\n// Define vampire dice\nconst basicDice = Math.max((strength + animalism) - advancedDice, 0)\n\n// Send the roll to the API\nWOD5E.api.Roll({\n title: \"Custom Roll\",\n basicDice,\n advancedDice\n})","folder":null,"ownership":{"default":0,"OrOQ70SVPCGayvrw":3},"flags":{"core":{}},"_stats":{"systemId":"vtm5e","systemVersion":"4.0.0-prerelease2","coreVersion":"11.315","createdTime":1707614396503,"modifiedTime":1708702777210,"lastModifiedBy":"OrOQ70SVPCGayvrw"},"_id":"xHe6LF89pUgEDxV3","sort":100000} From 73a42c0c0abbe2a967f548957ae6be78c4cc4ec2 Mon Sep 17 00:00:00 2001 From: Veilza Date: Wed, 19 Jun 2024 01:25:29 -0500 Subject: [PATCH 41/64] Pull in Russian translation updates --- lang/ru/core-ru.json | 55 +++++++++++++++++++---------------------- lang/ru/vampire-ru.json | 18 +++++++------- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index f5356221..2af2d0d5 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -3,9 +3,9 @@ "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", "Name": "Название", - "_Confirm": "", + "Confirm": "Подтвердить", "Close": "Отмена", - "_Save": "", + "Save": "Сохранить", "_Submit": "", "System": "Бросок", "Edit": "Изменить", @@ -18,40 +18,37 @@ "Exp": "Опыт", "None": "Нет", "Value": "Значение", - "_Label": "", - - "_New": "New {string}", "Mortal": "Смертный", - "_GroupSheet": "", + "GroupSheet": "Лист Котерии", - "_OpenSheet": "", - "_RemoveFromGroup": "", - "_NoGroupMembers": "", + "_OpenSheet": "Открыть лист", + "_RemoveFromGroup": "Удалить из групы", + "_NoGroupMembers": "Нету персонажей в группе", "Roll": { - "Label": "Бросить", - "_RollMode": "", - "_MortalDice": "", + "Label": "Проверка", + "RollMode": "Режим броска", + "MortalDice": "Кости смертного", "Success": "Успех", "Successes": "Успехов", "CriticalSuccess": "Триумф", "Fail": "Провал", "Modifier": "Модификатор", "Difficulty": "Сложность", - "_SelectableModifiers": "", - "_Source": "", - "_Active": "", - "_CustomModifiers": "", - "_AddCustomModifier": "" + "SelectableModifiers": "Выбранные модификаторы", + "Source": "Источник", + "Active": "Активиный", + "CustomModifiers": "Пользовательские модификаторы", + "AddCustomModifier": "Добавить пользовательский модификатор" }, "Bonus": { - "_NewSpecialty": "", - "_AddNewSpecialty": "", - "_NewBonus": "", - "_AddNewBonus": "", - "_Active": "", + "NewSpecialty": "Новая специализация", + "AddNewSpecialty": "Добавить новую специализацию", + "NewBonus": "Новый бонус", + "AddNewBonus": "Добавить новый бонус", + "Active": "Активен", "_ActiveWhen": "", "_Always": "", "_Never": "", @@ -85,7 +82,7 @@ }, "Tabs": { - "_Members": "", + "Members": "Участники", "Stats": "Параметры", "Features": "Преимущества", "Description": "Описание", @@ -148,9 +145,9 @@ "CustomRoll": "Уникальная проверка", "CustomRolls": "Уникальные проверки", "Merit": "Достоинства", - "_Cost": "", + "Cost": "Стоимость", "Flaw": "Недостатки", - "_Bonuses": "", + "Bonuses": "Бонусы", "Background": "Факты биографии", "Points": "Точки", "UseSkill": "Использовать навыки", @@ -158,10 +155,10 @@ "Feature": "Преимущества", "FeatureType": "Тип преимущества", "Type": "Тип", - "_NewSpecialty": "", + "NewSpecialty": "Новая специализация", "Boon": "Долг", "Boons": "Долги", - "_Macro": "", + "Macro": "Макрос", "_SelectFeature": "" }, @@ -197,8 +194,8 @@ }, "Macro": { - "_MacroID": "", - "_MacroNote": "" + "MacroID": "ID Макроса", + "MacroNote": "Если макрос был указан, то он будет выполнен непосредственно после нажатия на элемент или выполнения броска." }, "Settings": { diff --git a/lang/ru/vampire-ru.json b/lang/ru/vampire-ru.json index 5fcdfdf2..3e3a39fb 100644 --- a/lang/ru/vampire-ru.json +++ b/lang/ru/vampire-ru.json @@ -11,18 +11,18 @@ "Clan": "Клан", "Generation": "Поколение", - "_Chasse": "", - "_Lien": "", - "_Portillon": "", - "_HuntingDifficulty": "", + "Chasse": "Шасс", + "Lien": "Льен", + "Portillon": "Портильон", + "HuntingDifficulty": "Сложность охоты", - "_VampireDice": "", - "_HungerDice": "", + "VampireDice": "Кости вампира", + "HungerDice": "Кости голода", "Humanity": "Человечность", "Predator": "Стиль охоты", "Hunger": "Голод", - "_HungerFull1": "", + "HungerFull1": "Полный голод", "HungerFull2": "Голод и так на максимуме, нельзя увеличить Голод.", "Rouse": "Проверка Голода", "Frenzy": "Проверка Ярости", @@ -30,7 +30,7 @@ "Discipline": "Дисциплина", "Disciplines": "Дисциплины", - "_DisciplineType": "", + "DisciplineType": "Тип Дисциплины", "Blood": "Кровь", "BloodPotency": "Сила крови", "BloodResonance": "Резонанс", @@ -54,7 +54,7 @@ "Presence": "Величие", "Protean": "Метаморфозы", "BloodSorcery": "Кровавое чародейство", - "Oblivion": "Бездна", + "Oblivion": "Обливион", "ThinBloodAlchemy": "Алхимия слабокровных", "Rituals": "Ритуалы", "Ceremonies": "Церемонии", From 916ad9877df4f72e7b7cd4450a97756a0e275bc3 Mon Sep 17 00:00:00 2001 From: Veilza Date: Wed, 19 Jun 2024 01:29:43 -0500 Subject: [PATCH 42/64] Fixing more issues with localization strings --- lang/de/core-de.json | 4 +-- lang/en/core-en.json | 4 +-- lang/es/core-es.json | 4 +-- lang/fr/core-fr.json | 4 +-- lang/it/core-it.json | 4 +-- lang/lang_template/core-template.json | 4 +-- lang/pl/core-pl.json | 4 +-- lang/pt-BR/core-pt-BR.json | 4 +-- lang/ru/core-ru.json | 4 +-- lang/uk/core-uk.json | 4 +-- module/main.js | 2 +- module/scripts/rolls/roll-message.js | 10 +++---- module/scripts/system-rolls.js | 2 +- templates/actor/limited-sheet.hbs | 4 +-- templates/actor/parts/biography.hbs | 28 +++++++++---------- templates/actor/parts/group/description.hbs | 10 +++---- templates/actor/parts/vampire/disciplines.hbs | 2 +- templates/actor/parts/vampire/frenzy.hbs | 2 +- templates/actor/parts/vampire/rouse.hbs | 2 +- .../actor/parts/werewolf/rage-button.hbs | 4 +-- templates/item/item-customRoll-sheet.hbs | 2 +- templates/ui/mortal-roll-dialog.hbs | 2 +- templates/ui/parts/dice-roller/tray.hbs | 4 +-- templates/ui/parts/roll-dialog-base.hbs | 4 +-- templates/ui/parts/situational-modifiers.hbs | 10 +++---- 25 files changed, 64 insertions(+), 64 deletions(-) diff --git a/lang/de/core-de.json b/lang/de/core-de.json index 1201e75a..85c68c70 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -29,7 +29,7 @@ "RemoveFromGroup": "Aus Gruppe entfernen", "NoGroupMembers": "Keine Gruppenmitglieder. Zum Hinzufügen aus der Akteur-Liste hierher ziehen.", - "Roll": { + "RollList": { "Label": "Wurf", "RollMode": "Wurf-Modus", "MortalDice": "Würfel", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Geschichte", "Concept": "Konzept", "Chronicle": "Chronik", diff --git a/lang/en/core-en.json b/lang/en/core-en.json index 9a5ada95..06f41824 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -27,7 +27,7 @@ "RemoveFromGroup": "Remove from group", "NoGroupMembers": "No group members added. Drag and drop from the actors sidebar to add some!", - "Roll": { + "RollList": { "Label": "Roll", "RollMode": "Roll Mode", "MortalDice": "Mortal Dice", @@ -163,7 +163,7 @@ "SelectFeature": "Select Feature" }, - "Biography": { + "BiographyList": { "Label": "Biography", "Concept": "Concept", "Chronicle": "Chronicle", diff --git a/lang/es/core-es.json b/lang/es/core-es.json index 2d66b3e1..2ea6c84a 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -29,7 +29,7 @@ "_RemoveFromGroup": "", "_NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "Tirada", "RollMode": "Modo de tirada", "MortalDice": "Dados de mortal", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Biografía", "Concept": "Concepto", "Chronicle": "Crónica", diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index 9daa7898..01439911 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -29,7 +29,7 @@ "_RemoveFromGroup": "", "_NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "Jet", "RollMode": "Type de jet", "MortalDice": "Dé mortel", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Biographie", "Concept": "Concept", "Chronicle": "Chronique", diff --git a/lang/it/core-it.json b/lang/it/core-it.json index 6a638753..2a251623 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -29,7 +29,7 @@ "_RemoveFromGroup": "", "_NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "Tira", "RollMode": "Modalità di tiro", "MortalDice": "Dadi mortale", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Biografia", "Concept": "Concetto", "Chronicle": "Cronaca", diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index bf0fc691..9eeb2c57 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -27,7 +27,7 @@ "RemoveFromGroup": "", "NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "", "RollMode": "", "MortalDice": "", @@ -163,7 +163,7 @@ "SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "", "Concept": "", "Chronicle": "", diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index d32850be..dd7deae9 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -29,7 +29,7 @@ "_RemoveFromGroup": "", "_NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "Rzut", "_RollMode": "", "_MortalDice": "", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Biografia", "Concept": "Koncept", "Chronicle": "Kronika", diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index fc9333de..d59e40f3 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -29,7 +29,7 @@ "_RemoveFromGroup": "", "_NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "Rolagem", "RollMode": "Modo de Rolagem", "MortalDice": "Dados de Mortal", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Biografia", "Concept": "Conceito", "Chronicle": "Crônica", diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index 2af2d0d5..cef1ff7c 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -26,7 +26,7 @@ "_RemoveFromGroup": "Удалить из групы", "_NoGroupMembers": "Нету персонажей в группе", - "Roll": { + "RollList": { "Label": "Проверка", "RollMode": "Режим броска", "MortalDice": "Кости смертного", @@ -162,7 +162,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Биография", "Concept": "Концепция", "Chronicle": "Хроника", diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index 203ff128..50a0beab 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -29,7 +29,7 @@ "_RemoveFromGroup": "", "_NoGroupMembers": "", - "Roll": { + "RollList": { "Label": "Перевірка", "_RollMode": "", "_MortalDice": "", @@ -165,7 +165,7 @@ "_SelectFeature": "" }, - "Biography": { + "BiographyList": { "Label": "Передісторія", "Concept": "Концепт", "Chronicle": "Хроніка", diff --git a/module/main.js b/module/main.js index 1b6136a8..ff9ec6e9 100644 --- a/module/main.js +++ b/module/main.js @@ -287,7 +287,7 @@ async function createVampireMacro (data, slot) { const item = data.system // Create the macro command - const command = `game.wod5e.rollItemMacro("${item.name}");` + const command = `game.WOD5E.RollListItemMacro("${item.name}");` let macro = game.macros.entities.find(m => (m.name === item.name) && (m.command === command)) if (!macro) { macro = await Macro.create({ diff --git a/module/scripts/rolls/roll-message.js b/module/scripts/rolls/roll-message.js index bede7dc6..d5545fd1 100644 --- a/module/scripts/rolls/roll-message.js +++ b/module/scripts/rolls/roll-message.js @@ -234,7 +234,7 @@ export async function generateRollMessage ({ if (difficulty > 0) { totalAndDifficulty += `
    - ${game.i18n.localize('WOD5E.Roll.Difficulty')} + ${game.i18n.localize('WOD5E.RollList.Difficulty')} ${difficulty} @@ -253,10 +253,10 @@ export async function generateRollMessage ({ resultLabel += totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.HTR.PossibleDesperationFailure')}
    ` } else { if (totalResult === 0 || difficulty > 0) { // Handle failures - resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.Roll.Fail')}
    ` + resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.RollList.Fail')}
    ` } else { // Show the number of successes // Handle pluralizing based on the number of successes - const successText = totalResult > 1 ? 'WOD5E.Roll.Successes' : 'WOD5E.Roll.Success' + const successText = totalResult > 1 ? 'WOD5E.RollList.Successes' : 'WOD5E.RollList.Success' if (system === 'vampire' && (advancedDice.criticals > 1 || (basicDice.criticals > 0 && advancedDice.criticals > 0))) { // Handle messy criticals if no difficulty is set resultLabel = `
    ${game.i18n.localize('WOD5E.VTM.MessyCritical')}
    @@ -274,10 +274,10 @@ export async function generateRollMessage ({ if (system === 'vampire' && (advancedDice.criticals > 1 || (basicDice.criticals > 0 && advancedDice.criticals > 0))) { // Handle messy criticals resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.VTM.MessyCritical')}
    ` } else { // Everything else is just a normal critical success - resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.Roll.CriticalSuccess')}
    ` + resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.RollList.CriticalSuccess')}
    ` } } else { // Normal success - resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.Roll.Success')}
    ` + resultLabel = totalAndDifficulty + `
    ${game.i18n.localize('WOD5E.RollList.Success')}
    ` } } } diff --git a/module/scripts/system-rolls.js b/module/scripts/system-rolls.js index 25061fe2..020f79a0 100644 --- a/module/scripts/system-rolls.js +++ b/module/scripts/system-rolls.js @@ -237,7 +237,7 @@ class WOD5eDice { buttons: { roll: { icon: '', - label: game.i18n.localize('WOD5E.Roll.Label'), + label: game.i18n.localize('WOD5E.RollList.Label'), callback: async html => { // Obtain the input fields const basicDiceInput = html.find('#inputBasicDice') diff --git a/templates/actor/limited-sheet.hbs b/templates/actor/limited-sheet.hbs index dbb9e884..1553d082 100644 --- a/templates/actor/limited-sheet.hbs +++ b/templates/actor/limited-sheet.hbs @@ -23,13 +23,13 @@
    - +
    {{editor enrichedBiography target="system.biography" button=true editable=editable}}
    - +
    {{editor enrichedAppearance target="system.appearance" button=true editable=editable}}
    diff --git a/templates/actor/parts/biography.hbs b/templates/actor/parts/biography.hbs index 03ab94e2..626c005e 100644 --- a/templates/actor/parts/biography.hbs +++ b/templates/actor/parts/biography.hbs @@ -2,20 +2,20 @@ {{#if isCharacter}}
    - - + +
    - - + +
    - - + +
    - - + +
    @@ -34,7 +34,7 @@
    - +
    {{editor enrichedTenets target="system.headers.tenets" button=true editable=editable}} @@ -42,7 +42,7 @@
    - +
    {{editor enrichedTouchstones target="system.headers.touchstones" button=true editable=editable}} @@ -63,7 +63,7 @@
    - +
    {{editor enrichedTenets target="system.headers.tenets" button=true editable=editable}} @@ -71,7 +71,7 @@
    - +
    {{editor enrichedTouchstones target="system.headers.touchstones" button=true editable=editable}} @@ -84,7 +84,7 @@
    - +
    {{editor enrichedBiography target="system.biography" button=true editable=editable}} @@ -92,7 +92,7 @@
    - +
    {{editor enrichedAppearance target="system.appearance" button=true editable=editable}} diff --git a/templates/actor/parts/group/description.hbs b/templates/actor/parts/group/description.hbs index 8fb2cb9d..61487664 100644 --- a/templates/actor/parts/group/description.hbs +++ b/templates/actor/parts/group/description.hbs @@ -1,15 +1,15 @@
    - - + +
    - - + +
    - +
    {{editor enrichedBiography target="system.biography" button=true editable=editable}}
    diff --git a/templates/actor/parts/vampire/disciplines.hbs b/templates/actor/parts/vampire/disciplines.hbs index 986c8f67..8911d336 100644 --- a/templates/actor/parts/vampire/disciplines.hbs +++ b/templates/actor/parts/vampire/disciplines.hbs @@ -37,7 +37,7 @@ - diff --git a/templates/actor/parts/vampire/frenzy.hbs b/templates/actor/parts/vampire/frenzy.hbs index 38a65bdd..d7028861 100644 --- a/templates/actor/parts/vampire/frenzy.hbs +++ b/templates/actor/parts/vampire/frenzy.hbs @@ -2,7 +2,7 @@
    diff --git a/templates/actor/parts/vampire/rouse.hbs b/templates/actor/parts/vampire/rouse.hbs index aace9faa..b24b7e94 100644 --- a/templates/actor/parts/vampire/rouse.hbs +++ b/templates/actor/parts/vampire/rouse.hbs @@ -3,6 +3,6 @@
    + title="{{localize 'WOD5E.VTM.RollRouse'}}">{{localize "WOD5E.RollList.Label"}}
    diff --git a/templates/actor/parts/werewolf/rage-button.hbs b/templates/actor/parts/werewolf/rage-button.hbs index 1b6f699c..3501fdb7 100644 --- a/templates/actor/parts/werewolf/rage-button.hbs +++ b/templates/actor/parts/werewolf/rage-button.hbs @@ -2,6 +2,6 @@
    + data-absolute-value="1" data-decrease-rage="true" data-label="{{localize 'WOD5E.WTA.RageDice'}}">{{localize "WOD5E.RollList.Label"}}
    -
    \ No newline at end of file +
    diff --git a/templates/item/item-customRoll-sheet.hbs b/templates/item/item-customRoll-sheet.hbs index 7c06132d..0afdf3aa 100644 --- a/templates/item/item-customRoll-sheet.hbs +++ b/templates/item/item-customRoll-sheet.hbs @@ -37,7 +37,7 @@ {{> "systems/vtm5e/templates/item/parts/skills.hbs"}} {{/select}} - +
    diff --git a/templates/ui/mortal-roll-dialog.hbs b/templates/ui/mortal-roll-dialog.hbs index a3e92632..a9440445 100644 --- a/templates/ui/mortal-roll-dialog.hbs +++ b/templates/ui/mortal-roll-dialog.hbs @@ -1,6 +1,6 @@
    - +
    diff --git a/templates/ui/parts/dice-roller/tray.hbs b/templates/ui/parts/dice-roller/tray.hbs index 29c08cc4..04faab41 100644 --- a/templates/ui/parts/dice-roller/tray.hbs +++ b/templates/ui/parts/dice-roller/tray.hbs @@ -24,8 +24,8 @@ {{> "systems/vtm5e/templates/ui/parts/pool2-nothing.hbs"}} {{/if}}
    - {{text value=pool1Selection}}
    diff --git a/templates/ui/parts/roll-dialog-base.hbs b/templates/ui/parts/roll-dialog-base.hbs index 5c362890..55128bc4 100644 --- a/templates/ui/parts/roll-dialog-base.hbs +++ b/templates/ui/parts/roll-dialog-base.hbs @@ -1,10 +1,10 @@ {{> "systems/vtm5e/templates/ui/parts/situational-modifiers.hbs"}}
    - +
    - + Date: Wed, 19 Jun 2024 22:34:01 -0500 Subject: [PATCH 55/64] Small fix --- templates/actor/parts/spc/exceptional-dice-pools.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/actor/parts/spc/exceptional-dice-pools.hbs b/templates/actor/parts/spc/exceptional-dice-pools.hbs index acb0c3ec..ff08a0a4 100644 --- a/templates/actor/parts/spc/exceptional-dice-pools.hbs +++ b/templates/actor/parts/spc/exceptional-dice-pools.hbs @@ -15,8 +15,8 @@ data-use-absolute-value="true" data-label="{{exceptionalskill.displayName}}">{{localize exceptionalskill.displayName}}
    - +
    From cba776a1db01273a3863dbcc4af74c2b6d5c7713 Mon Sep 17 00:00:00 2001 From: Veilza Date: Wed, 19 Jun 2024 22:34:58 -0500 Subject: [PATCH 56/64] Letting the linter know that WOD5E exists --- module/actor/spc-actor-sheet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/actor/spc-actor-sheet.js b/module/actor/spc-actor-sheet.js index fe8c6066..5b9ef2f3 100644 --- a/module/actor/spc-actor-sheet.js +++ b/module/actor/spc-actor-sheet.js @@ -1,4 +1,4 @@ -/* global Dialog, game, foundry */ +/* global Dialog, game, foundry, WOD5E */ import { WoDActor } from './wod-v5-sheet.js' import { Skills } from '../def/skills.js' From ee429e53902a6acde88115935803b6afc037a37e Mon Sep 17 00:00:00 2001 From: Veilza Date: Wed, 19 Jun 2024 23:05:31 -0500 Subject: [PATCH 57/64] No need to localize the exceptionalskill names - already localized on init --- templates/actor/parts/spc/exceptional-dice-pools.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/actor/parts/spc/exceptional-dice-pools.hbs b/templates/actor/parts/spc/exceptional-dice-pools.hbs index ff08a0a4..744c614e 100644 --- a/templates/actor/parts/spc/exceptional-dice-pools.hbs +++ b/templates/actor/parts/spc/exceptional-dice-pools.hbs @@ -12,7 +12,7 @@ {{#if exceptionalskill.visible}}
  2. Date: Thu, 20 Jun 2024 09:19:49 -0500 Subject: [PATCH 58/64] Fix an issue where macros text in dark theme would be hard to read --- css/themes/dark-theme.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/themes/dark-theme.css b/css/themes/dark-theme.css index e25a3281..6af7612e 100644 --- a/css/themes/dark-theme.css +++ b/css/themes/dark-theme.css @@ -249,7 +249,7 @@ background: #121212; } -.dark-theme textarea { +.dark-theme .actor.sheet textarea, .dark-theme .item.sheet textarea { color: #FFF; } From 07c6a968441fa406364aa414c4333ac08f3facad Mon Sep 17 00:00:00 2001 From: arcadio21 Date: Fri, 21 Jun 2024 12:27:38 +0200 Subject: [PATCH 59/64] update italian for 4.4.0 --- lang/it/core-it.json | 142 +++++++++++++++++++-------------------- lang/it/hunter-it.json | 10 ++- lang/it/vampire-it.json | 10 ++- lang/it/werewolf-it.json | 17 +++-- 4 files changed, 86 insertions(+), 93 deletions(-) diff --git a/lang/it/core-it.json b/lang/it/core-it.json index cbeae81d..ad4f182e 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -1,11 +1,10 @@ { "WOD5E": { - "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", - + "Name": "Nome", "Confirm": "Conferma", - "_Close": "Chiudi", - "_Save": "Salva", + "Close": "Chiudi", + "Save": "Salva", "Submit": "Invia", "System": "Sistema", "Edit": "Modifica", @@ -18,22 +17,22 @@ "Exp": "Esp", "None": "Nssuno", "Value": "Valore", - "_Label": "", + "Label": "Etichetta", "New": "Nuova {string}", "Mortal": "Mortale", - "_GroupSheet": "", + "GroupSheet": "Scheda di gruppo", - "_OpenSheet": "", - "_RemoveFromGroup": "", - "_NoGroupMembers": "", + "OpenSheet": "Apri scheda", + "RemoveFromGroup": "Rimuovi dal gruppo", + "NoGroupMembers": "Non ci sono membri in questo gruppo. Trascina una scheda per aggiungerla al gruppo!", "RollList": { "Label": "Tira", "RollMode": "Modalità di tiro", "MortalDice": "Dadi mortale", - "_SelectRoll": "", + "SelectRoll": "Seleziona tiro", "Success": "Successo", "Successes": "Successi", "CriticalSuccess": "Successo critico", @@ -44,27 +43,27 @@ "Source": "Fonte", "Active": "Attiva", "CustomModifiers": "Modificatori personalizzati", - "_AddCustomModifier": "", - "_Total": "" + "AddCustomModifier": "Aggiungi Modificatore personalizzato", + "Total": "Totale" }, "Bonus": { - "_NewSpecialty": "", - "_AddNewSpecialty": "", - "_NewBonus": "", - "_AddNewBonus": "", - "_Active": "", - "_ActiveWhen": "", - "_Always": "", - "_Never": "", - "_IfEquals": "", - "_Path": "", - "_PathsSeparatedBySemicolons": "", - "_DisplayWhenInactive": "", - "_Unless": "", - "_PathToCheck": "", - "_ValueToCheck": "", - "_IfPathIs": "" + "NewSpecialty": "Nuova specialità", + "AddNewSpecialty": "Aggiungi nuova specialità", + "NewBonus": "Nuovo bonus", + "AddNewBonus": "Aggiungi nuovo bonus", + "Active": "Attivo", + "ActiveWhen": "Attivo quando", + "Always": "Sempre", + "Never": "Mai", + "IfEquals": "Se uguale", + "Path": "Percorso", + "PathsSeparatedBySemicolons": "Percorsi, separati da punti e virgole (;) ", + "DisplayWhenInactive": "Mostra quando inattivo", + "Unless": "A meno che", + "PathToCheck": "Percorso da controllare", + "ValueToCheck": "Valore è", + "IfPathIs": "Percorso è" }, "SPC": { @@ -87,7 +86,7 @@ }, "Tabs": { - "_Members": "", + "Members": "Membri", "Stats": "Statistiche", "Features": "Caratteristiche", "Description": "Descrizioni", @@ -164,7 +163,7 @@ "Boon": "Favore", "Boons": "Favori", "Macro": "Macro", - "_SelectFeature": "" + "SelectFeature": "Seleziona Caratteristica" }, "BiographyList": { @@ -199,68 +198,67 @@ }, "Macro": { - "_MacroID": "", - "_MacroNote": "" + "MacroID": "ID macro", + "MacroNote": "Se è stata aggiunta una macro, verrà eseguita al click sull'oggetto o dopo aver effettuato un tiro." }, "Settings": { - "_SaveChanges": "", - - "_Modifications": "", - "_Custom": "", + "SaveChanges": "Salva modifiche", - "_Rename": "", - "_Hidden": "", + "Modifications": "Modifiche", + "Custom": "Personalizzazioni", - "_AddAttributeModification": "", - "_AddSkillModification": "", - "_AddCustomAttribute": "", - "_AddCustomSkill": "", + "Rename": "Rinomina", + "Hidden": "Nascondi", - "_AttributeType": "", - "_SkillType": "", + "AddAttributeModification": "Aggiungi modifica attributo", + "AddSkillModification": "Aggiungi modifica Abilità", + "AddCustomAttribute": "Aggiungi attributo personalizzato", + "AddCustomSkill": "Aggiungi abilità Personalizzata", - "_WorldVersion": "", - "_WorldVersionHint": "", + "AttributeType": "Tipo di attributo", + "SkillType": "Tipo di abilità", + "WorldVersion": "Versione", + "WorldVersionHint": "Si aggiorna automaticamente quando system.json viene aggiornato.", - "_DarkTheme": "", - "_DarkThemeHint": "", + "DarkTheme": "Tema Scuro", + "DarkThemeHint": "Mostra le schede con un interfaccia più scura.", - "_ActorBanner": "", - "_ActorBannerHint": "", + "ActorBanner": "Etichetta tipo personaggio", + "ActorBannerHint": "Mostra un etichetta sulla scheda che rappresenta il tipo di personaggio.", - "_AutomationSettings": "", - "_AutomationSettingsHint": "", + "AutomationSettings": "Impostazioni automazioni", + "AutomationSettingsHint": "Accedi a varie impostazioni per automazioni.", - "_DisableAutomation": "", - "_DisableAutomationHint": "", + "DisableAutomation": "Disabilita tutte le automazioni", + "DisableAutomationHint": "Disabilita tutte le automazioni senza dover cliccare tutti i pulsanti qui sotto.", - "_AutomateWillpower": "", - "_AutomateWillpowerHint": "", + "AutomateWillpower": "Automatizza Forza di volontà", + "AutomateWillpowerHint": "Se selezionato, utilizzare funzioni che fanno danno alla forza di volontà fare scendere la forza di volontà sulla scheda.", - "_AutomateHunger": "", - "_AutomateHungerHint": "", + "AutomateHunger": "Automatizza fame", + "AutomateHungerHint": "Se selezionato, tirare dadi fame e fallire farà automaticamente salire la fame sulla scheda.", - "_AutomateOblivion": "", - "_AutomateOblivionHint": "", + "AutomateOblivion": "Automatizza Oblio", + "AutomateOblivionHint": "Se selezionato, un risultato di 1 o 10 su un tiro di risveglio per oblio segnerà una macchia sulla scheda.", - "_AutomateRage": "", - "_AutomateRageHint": "", + "AutomateRage": "Automatizza furia", + "AutomateRageHint": "Se selezionato, tirare dadi furia e fallire farà automaticamente scendere la furia sulla scheda.", - "_StorytellerMenu": "", - "_StorytellerMenuHint": "", + "StorytellerMenu": "Menu del narratore", + "StorytellerMenuHint": "Effettua modifiche al sistema, come cambiare abilità e attributi o creane di nuovi", - "_ModifiedAttributes": "", - "_ModifiedAttributesHint": "", + "ModifiedAttributes": "Modifica attributi", + "ModifiedAttributesHint": "Consente di modificare Attributi esistenti", - "_ModifiedSkills": "", - "_ModifiedSkillsHint": "", + "ModifiedSkills": "Modifica abilità", + "ModifiedSkillsHint": "Consente di modificare abilità esistenti", - "_CustomAttributes": "", - "_CustomAttributesHint": "", + "CustomAttributes": "Attributi Personalizzati", + "CustomAttributesHint": "Consente di creare attributi Personalizzati", - "_CustomSkills": "", - "_CustomSkillsHint": "" + "CustomSkills": "Abilità Personalizzate", + "CustomSkillsHint": "Consente di creare abilità Personalizzate" } } } diff --git a/lang/it/hunter-it.json b/lang/it/hunter-it.json index 052b9f29..2729f73b 100644 --- a/lang/it/hunter-it.json +++ b/lang/it/hunter-it.json @@ -1,8 +1,6 @@ { "WOD5E": { "HTR": { - "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", - "Label": "Cacciatore", "HunterDice": "Dadi Cacciatore", "DesperationDice": "Dadi disperazione?", @@ -17,7 +15,7 @@ "AddEdge": "Aggiungi Privilegio", "SelectEdge": "Seleziona Privilegio", "AddPerk": "Aggiungi Beneficio", - "_NewPerk": "", + "NewPerk": "Nuovo Beneficio", "Desperation": "Disperazione", "Danger": "Pericolo", "DesperationSuccess": "Successo a un costo o fallimento disperato", @@ -30,9 +28,9 @@ "Ordnance": "Esplosivi", "Library": "Archivio", "ImprovisedGear": "Equipaggiamento improvvisato", - "GlobalAccess": "Chaive di rete", - "DroneJockey": "Oepratore di droni", - "BeastWhisperer": "Comapgno animale", + "GlobalAccess": "Chiave di rete", + "DroneJockey": "Operatore di droni", + "BeastWhisperer": "Compagno animale", "SenseTheUnnatural": "Percepire il sovrannaturale", "RepelTheUnnatural": "Scacciare il sovrannaturale", "ThwartTheUnnatural": "Resistere al sovrannaturale", diff --git a/lang/it/vampire-it.json b/lang/it/vampire-it.json index f86c0b31..11bde39d 100644 --- a/lang/it/vampire-it.json +++ b/lang/it/vampire-it.json @@ -1,18 +1,16 @@ { "WOD5E": { "VTM": { - "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", - "Label": "Vampiro", "Coterie": "Coterie", "Ghoul": "Ghoul", "Domitor": "Domitor", "Clan": "Clan", "Generation": "Generazione", - "_Chasse": "", - "_Lien": "", - "_Portillon": "", - "_HuntingDifficulty": "", + "Chasse": "Chasse", + "Lien": "Lien", + "Portillon": "Portillon", + "HuntingDifficulty": "Difficoltà caccia", "VampireDice": "Dadi vampiro", "HungerDice": "Dadi fame", "Humanity": "Umanità", diff --git a/lang/it/werewolf-it.json b/lang/it/werewolf-it.json index bad097e0..635da0df 100644 --- a/lang/it/werewolf-it.json +++ b/lang/it/werewolf-it.json @@ -1,10 +1,9 @@ { "WOD5E": { "WTA": { - "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", - + "Label": "Licantropo", - "_Pack": "", + "Pack": "Branco", "WerewolfDice": "Dadi Licantropo", "RageDice": "Dadi Furia", "GiftsandRites": "Doni e Riti", @@ -34,13 +33,13 @@ "FrenzyActiveWarning": "La frenesia è attiva.", "Active": "Attiva", "FrenzyActiveWarning2": "Non puoi utilizzare doni e riti durante una frenesia.", - "_LostTheWolf": "", - "_LostWolfWarning": "", - "LostWolfFormChange": "Hai perso il lupo: Non puoi assumere forme naturali al momento.", - "_LostWolfShiftDown": "", - "_LostWolfShiftAnyway": "", + "LostTheWolf": "Perso il lupo", + "LostWolfWarning": "Questo personaggio ha furia zero e ha perso il lupo", + "LostWolfFormChange": "Hai perso il lupo: Non puoi assumere forme sovrannaturali al momento.", + "LostWolfShiftDown": "Questo personaggio ha perso il lupo e non può rimanere nella sua forma sovrannaturale. Scegli una forma a cui scendere", + "LostWolfShiftAnyway": "Questo personaggio ha perso il lupo e non può trasformarsi a causa della basa furia. Vuoi Trasformarti comunque?", "Renown": "Prestigio", - "_AddRenown": "", + "AddRenown": "Aggiungi Prestigio", "Wisdom": "Saggezza", "Glory": "Gloria", "Honor": "Onore", From 5d247704ff620d445ee967973ecdd56285b94f20 Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 21 Jun 2024 05:41:32 -0500 Subject: [PATCH 60/64] Fix the storyteller menu and the titles of the storyteller menu/automation menu not being localized --- module/menus/automation-menu.js | 2 +- module/menus/storyteller-menu.js | 2 +- templates/ui/automation-menu.hbs | 22 +++++++++++----------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/module/menus/automation-menu.js b/module/menus/automation-menu.js index 7e3aec46..34b7d6e0 100644 --- a/module/menus/automation-menu.js +++ b/module/menus/automation-menu.js @@ -3,7 +3,7 @@ export class AutomationMenu extends FormApplication { static get defaultOptions () { return foundry.utils.mergeObject(super.defaultOptions, { - title: 'Automation Settings', + title: game.i18n.localize('WOD5E.Settings.AutomationSettings'), id: 'wod5e-automation', classes: ['wod5e'], template: 'systems/vtm5e/templates/ui/automation-menu.hbs', diff --git a/module/menus/storyteller-menu.js b/module/menus/storyteller-menu.js index 56cd0dcd..d4869a80 100644 --- a/module/menus/storyteller-menu.js +++ b/module/menus/storyteller-menu.js @@ -3,7 +3,7 @@ export class StorytellerMenu extends FormApplication { static get defaultOptions () { return foundry.utils.mergeObject(super.defaultOptions, { - title: 'Storyteller Settings', + title: game.i18n.localize('WOD5E.Settings.StorytellerMenu'), id: 'wod5e-storyteller', classes: ['wod5e'], template: 'systems/vtm5e/templates/ui/storyteller-menu.hbs', diff --git a/templates/ui/automation-menu.hbs b/templates/ui/automation-menu.hbs index 7cb6ffbc..8f2927f7 100644 --- a/templates/ui/automation-menu.hbs +++ b/templates/ui/automation-menu.hbs @@ -3,54 +3,54 @@

    World of Darkness

    - +
    -

    Disables all automation without having to individually press all the below buttons.

    +

    {{localize 'WOD5E.Settings.DisableAutomationHint'}}

    {{#unless disableAutomation}}
    - +
    -

    If enabled, using features that deal Willpower damage will automatically tick Willpower damage on the associated actor.

    +

    {{localize 'WOD5E.Settings.AutomateWillpowerHint'}}

    Vampire the Masquerade

    - +
    -

    If enabled, rolling Hunger Dice and failing will automatically increase the Hunger of the associated actor.

    +

    {{localize 'WOD5E.Settings.AutomateHungerHint'}}

    - +
    -

    If enabled, rolling 1 or 10 on rouse checks on Oblivion discipline powers will grant a stain on the humanity of the associated actor.

    +

    {{localize 'WOD5E.Settings.AutomateOblivionHint'}}

    Werewolf the Apocalypse

    - +
    -

    If enabled, rolling Rage Dice and failing will automatically decrease Rage from the associated actor.

    +

    {{localize 'WOD5E.Settings.AutomateRageHint'}}

    {{/unless}}
    -
  3. \ No newline at end of file + From 3819e0144c646b322094aa4438bb2bad76e45abd Mon Sep 17 00:00:00 2001 From: Veilza Date: Fri, 21 Jun 2024 05:47:46 -0500 Subject: [PATCH 61/64] Fix hint text in the config menus being too dark to read in dark mode --- css/themes/dark-theme.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/themes/dark-theme.css b/css/themes/dark-theme.css index 6af7612e..ea6c6ebe 100644 --- a/css/themes/dark-theme.css +++ b/css/themes/dark-theme.css @@ -263,3 +263,7 @@ .dark-theme .wod5e .resource-counter .resource-counter-step[data-state="-"] { background-color: #f30018; } + +.dark-theme .wod5e-config-form .notes { + color: #FFF; +} From 2ffe72c842af9097af9accfe46f9f154249784f6 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 22 Jun 2024 23:34:54 -0500 Subject: [PATCH 62/64] Remove unnecessary custom "New Actor/Item" script + Redo localization --- lang/de/core-de.json | 20 +++++++ lang/en/core-en.json | 20 +++++++ lang/es/core-es.json | 20 +++++++ lang/es/vampire-es.json | 2 +- lang/fr/core-fr.json | 20 +++++++ lang/it/core-it.json | 21 ++++++- lang/lang_template/core-template.json | 20 +++++++ lang/pl/core-pl.json | 20 +++++++ lang/pl/vampire-pl.json | 2 +- lang/pt-BR/core-pt-BR.json | 22 +++++++- lang/pt-BR/vampire-pt-BR.json | 2 +- lang/ru/core-ru.json | 20 +++++++ lang/uk/core-uk.json | 22 +++++++- module/actor/actor.js | 77 -------------------------- module/item/item.js | 80 --------------------------- 15 files changed, 205 insertions(+), 163 deletions(-) diff --git a/lang/de/core-de.json b/lang/de/core-de.json index 606700f5..1ec20011 100644 --- a/lang/de/core-de.json +++ b/lang/de/core-de.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Vampir", + "ghoul": "Ghoul", + "mortal": "Sterblicher", + "hunter": "Jäger", + "werewolf": "Werwolf", + "spc": "Erzähler-Charakter", + "group": "Gruppen-Bogen" + }, + "Item": { + "boon": "Gefallen", + "customRoll": "Benutzerdefinierter Wurf", + "feature": "Merkmal", + "gift": "Gabe", + "perk": "Verstärkung", + "power": "Disziplin" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", diff --git a/lang/en/core-en.json b/lang/en/core-en.json index d6b9f394..0ecda1b0 100644 --- a/lang/en/core-en.json +++ b/lang/en/core-en.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Vampire", + "ghoul": "Ghoul", + "mortal": "Mortal", + "hunter": "Hunter", + "werewolf": "Werewolf", + "spc": "Story Player Character", + "group": "Group" + }, + "Item": { + "boon": "Boon", + "customRoll": "Custom Roll", + "feature": "Feature", + "gift": "Gift", + "perk": "Perk", + "power": "Discipline" + } + }, + "WOD5E": { "Name": "Name", "Confirm": "Confirm", diff --git a/lang/es/core-es.json b/lang/es/core-es.json index 0185889b..92a13bd5 100644 --- a/lang/es/core-es.json +++ b/lang/es/core-es.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Vampiro", + "ghoul": "Ghoul", + "mortal": "Mortal", + "hunter": "Cazador", + "werewolf": "Hombre lobo", + "spc": "Personaje del narrador", + "_group": "" + }, + "Item": { + "boon": "Bendición", + "customRoll": "Tirada Personalizadas", + "feature": "Rasgo", + "_gift": "", + "perk": "Beneficio", + "power": "Disciplina" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", diff --git a/lang/es/vampire-es.json b/lang/es/vampire-es.json index 855d2b80..4b9604a0 100644 --- a/lang/es/vampire-es.json +++ b/lang/es/vampire-es.json @@ -23,7 +23,7 @@ "Rouse": "Enardecimiento", "Frenzy": "Frenesí", "Remorse": "Remordimiento", - "_Discipline": "", + "Discipline": "Disciplina", "Disciplines": "Disciplinas", "DisciplineType": "Tipo de disciplina", "Blood": "Sangre", diff --git a/lang/fr/core-fr.json b/lang/fr/core-fr.json index b717374e..33275f8b 100644 --- a/lang/fr/core-fr.json +++ b/lang/fr/core-fr.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Vampire", + "ghoul": "Goule", + "mortal": "Mortel", + "hunter": "Chasseur", + "_werewolf": "", + "spc": "Antagoniste", + "_group": "" + }, + "Item": { + "boon": "Dette", + "customRoll": "Jet Personnalisé", + "feature": "Atout", + "_gift": "", + "perk": "Avantage", + "power": "Discipline" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", diff --git a/lang/it/core-it.json b/lang/it/core-it.json index ad4f182e..74585a1e 100644 --- a/lang/it/core-it.json +++ b/lang/it/core-it.json @@ -1,6 +1,25 @@ { + "TYPES": { + "Actor": { + "vampire": "Vampiro", + "ghoul": "Ghoul", + "mortal": "Mortale", + "hunter": "Cacciatore", + "werewolf": "Licantropo", + "spc": "PNG", + "group": "Scheda di gruppo" + }, + "Item": { + "boon": "Favore", + "customRoll": "Tiro personalizzato", + "feature": "Caratteristica", + "gift": "Dono", + "perk": "Beneficio", + "power": "Disciplina" + } + }, + "WOD5E": { - "Name": "Nome", "Confirm": "Conferma", "Close": "Chiudi", diff --git a/lang/lang_template/core-template.json b/lang/lang_template/core-template.json index f63e4b23..2db1f174 100644 --- a/lang/lang_template/core-template.json +++ b/lang/lang_template/core-template.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "", + "ghoul": "", + "mortal": "", + "hunter": "", + "werewolf": "", + "spc": "", + "group": "" + }, + "Item": { + "boon": "", + "customRoll": "", + "feature": "", + "gift": "", + "perk": "", + "power": "" + } + }, + "WOD5E": { "Name": "", "Confirm": "", diff --git a/lang/pl/core-pl.json b/lang/pl/core-pl.json index b240194b..d17d48c8 100644 --- a/lang/pl/core-pl.json +++ b/lang/pl/core-pl.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Wampir", + "ghoul": "Ghul", + "mortal": "Śmiertelnik", + "hunter": "Łowca", + "_werewolf": "", + "_spc": "", + "_group": "" + }, + "Item": { + "boon": "Przysługa", + "customRoll": "Własny Rzut", + "feature": "Cechy", + "_gift": "", + "perk": "Perk", + "power": "Dyscyplinę" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", diff --git a/lang/pl/vampire-pl.json b/lang/pl/vampire-pl.json index 1579fa45..956fb0de 100644 --- a/lang/pl/vampire-pl.json +++ b/lang/pl/vampire-pl.json @@ -23,7 +23,7 @@ "Rouse": "Pobudzenie", "Frenzy": "Szał", "Remorse": "Skrucha", - "_Discipline": "", + "Discipline": "Dyscyplinę", "Disciplines": "Dyscypliny", "_DisciplineType": "", "Blood": "Krew", diff --git a/lang/pt-BR/core-pt-BR.json b/lang/pt-BR/core-pt-BR.json index aabd2db9..43691736 100644 --- a/lang/pt-BR/core-pt-BR.json +++ b/lang/pt-BR/core-pt-BR.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Vampiro", + "ghoul": "Carniçal", + "mortal": "Mortal", + "hunter": "Caçador", + "werewolf": "", + "spc": "Personagem do Narrador", + "_group": "" + }, + "Item": { + "boon": "Favor", + "customRoll": "Rolagem Personalizada", + "feature": "Vantagem", + "_gift": "", + "perk": "Distinção", + "power": "Disciplina" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", @@ -157,7 +177,7 @@ "Points": "Pontos", "UseSkill": "Usar Habilidades", "Rollable": "Rolável", - "_Feature": "", + "Feature": "Vantagem", "FeatureType": "Tipo de Vantagem", "Type": "Tipo", "NewSpecialty": "New Specialty", diff --git a/lang/pt-BR/vampire-pt-BR.json b/lang/pt-BR/vampire-pt-BR.json index f0b36e4b..46061461 100644 --- a/lang/pt-BR/vampire-pt-BR.json +++ b/lang/pt-BR/vampire-pt-BR.json @@ -23,7 +23,7 @@ "Rouse": "Inflamar", "Frenzy": "Frenesi", "Remorse": "Remorso", - "_Discipline": "", + "Discipline": "Disciplina", "Disciplines": "Disciplinas", "DisciplineType": "Tipo de Disciplina", "Blood": "Sangue", diff --git a/lang/ru/core-ru.json b/lang/ru/core-ru.json index 35edc765..fc7ee966 100644 --- a/lang/ru/core-ru.json +++ b/lang/ru/core-ru.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Вампир", + "ghoul": "Гуль", + "mortal": "Смертный", + "hunter": "Охотник", + "werewolf": "Оборотень", + "spc": "Персонаж Рассказчика", + "group": "Лист Котерии" + }, + "Item": { + "boon": "Долг", + "customRoll": "Уникальная проверка", + "feature": "Преимущества", + "gift": "дара", + "perk": "Улучшение", + "power": "Дисциплина" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", diff --git a/lang/uk/core-uk.json b/lang/uk/core-uk.json index e976bf18..1b6a223c 100644 --- a/lang/uk/core-uk.json +++ b/lang/uk/core-uk.json @@ -1,4 +1,24 @@ { + "TYPES": { + "Actor": { + "vampire": "Вампір", + "ghoul": "Упир", + "mortal": "Смертний", + "hunter": "Мисливець", + "werewolf": "Перевертень", + "spc": "НІП", + "_group": "" + }, + "Item": { + "boon": "Милість", + "customRoll": "Власна перевірка", + "feature": "Особливості", + "gift": "Дар", + "perk": "Вигоду", + "power": "Дисципліна" + } + }, + "WOD5E": { "_COMMENT": "This localization file has missing translations, marked with an underscore before the string. If you have a translation, please submit a pull request!", @@ -157,7 +177,7 @@ "Points": "Крапки", "UseSkill": "Використовує Навички", "Rollable": "Є перевірка", - "_Feature": "", + "Feature": "Особливості", "FeatureType": "Тип Особливості", "Type": "Тип", "_NewSpecialty": "", diff --git a/module/actor/actor.js b/module/actor/actor.js index 6831e8c0..9545e6c0 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -9,83 +9,6 @@ export class ActorInfo extends Actor { super.prepareData() } - /** - * Redefines the create "actor" type with translations :) - * @param {object} data Initial data with which to populate the creation form - * @param {object} [options] Positioning and sizing options for the resulting dialog - * @return {Promise} A Promise which resolves to the created Document - * @memberof ClientDocumentMixin - */ - static async createDialog (data = {}, options = {}) { - // Define data from the system and the game to be used when rendering the new actor dialog - // Actor name - const documentName = this.metadata.name - - // List of actor templates - const actorTemplateTypes = game.template.Actor.types - - // List of folders; either in the compendium pack the item's being made in, or the world itself - let gameFolders = [] - if (options.pack) { - gameFolders = game.packs.get(options.pack).folders.filter(f => (f.type === documentName) && f.displayed) - } else { - gameFolders = game.folders.filter(f => (f.type === documentName) && f.displayed) - } - - // Localize the label and title - const label = game.i18n.localize(this.metadata.label) - const title = game.i18n.format('DOCUMENT.Create', { type: label }) - // Generate a default name based on the label - const defaultName = game.i18n.format('WOD5E.New', { type: label }) - - // Reorganize the actor templates into something usable for the creation form - const actorTypes = {} - const actorTypesList = WOD5E.ActorTypes.getList() - // Cycle through all the template types, and use a label if one is found; - // default to just the base type (key) provided - for (const actorType of actorTemplateTypes) { - actorTypes[actorType] = actorTypesList[actorType] ? actorTypesList[actorType].label : actorType - } - - // Render the document creation form - const html = await renderTemplate('templates/sidebar/document-create.html', { - name: data.name || defaultName, - folder: data.folder, - folders: gameFolders, - hasFolders: gameFolders.length > 0, - type: data.type || 'vampire', - types: actorTypes, - hasTypes: true - }) - - // Render the confirmation dialog window - return Dialog.prompt({ - title, - content: html, - label: title, - callback: html => { - // Grab the element for data manipulation - const form = html[0].querySelector('form') - const fd = new FormDataExtended(form) - // Merge data with Foundry's default object before we manipulate it - data = foundry.utils.mergeObject(data, fd.object) - // Force a default name if none is given - if (!data.name) data.name = game.i18n.format('WOD5E.New', { type: actorTypes[data.type] }) - // If folder isn't given, delete the field - if (!data.folder) delete data.folder - // Choose the default actor type if there's only one - if (actorTypes.length === 1) data.type = actorTypes[0] - // Render the sheet after creating it - return this.create(data, { - renderSheet: true, - pack: options.pack || '' - }) - }, - rejectClose: false, - options - }) - } - async _preCreate (data, context, user) { await super._preCreate(data, context, user) diff --git a/module/item/item.js b/module/item/item.js index 78ab64f7..2da1dc95 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -8,84 +8,4 @@ export class ItemInfo extends Item { prepareData () { super.prepareData() } - - /** - * Redefines the create "item" type with translations - * @param {object} data Initial data with which to populate the creation form - * @param {object} [options] Positioning and sizing options for the resulting dialog - * @return {Promise} A Promise which resolves to the created Document - * @memberof ClientDocumentMixin - */ - static async createDialog (data = {}, options = {}) { - // Define data from the system and the game to be used when rendering the new item dialog - // Item name - const documentName = this.metadata.name - - // List of item templates - const itemTemplateTypes = game.template.Item.types - - // List of folders; either in the compendium pack the item's being made in, or the world itself - let gameFolders = [] - if (options.pack) { - gameFolders = game.packs.get(options.pack).folders.filter(f => (f.type === documentName) && f.displayed) - } else { - gameFolders = game.folders.filter(f => (f.type === documentName) && f.displayed) - } - - // Localize the label and title - const label = game.i18n.localize(this.metadata.label) - const title = game.i18n.format('DOCUMENT.Create', { type: label }) - // Generate a default name based on the label - const defaultName = game.i18n.format('WOD5E.New', { type: label }) - - // Reorganize the item templates into something usable for the creation form - const itemTypes = {} - const itemTypesList = WOD5E.ItemTypes.getList() - // Cycle through all the template types, and use a label if one is found; - // default to just the base type (key) provided - for (const itemType of itemTemplateTypes) { - itemTypes[itemType] = itemTypesList[itemType] ? itemTypesList[itemType].label : itemType - } - - // Render the document creation form - const html = await renderTemplate('templates/sidebar/document-create.html', { - name: data.name || defaultName, - folder: data.folder, - folders: gameFolders, - hasFolders: gameFolders.length > 0, - type: data.type || 'feature', - types: itemTypes, - hasTypes: true - }) - - // Render the confirmation dialog window - return Dialog.prompt({ - title, - content: html, - label: title, - callback: html => { - // Grab the element for data manipulation - const form = html[0].querySelector('form') - const fd = new FormDataExtended(form) - // Merge data with Foundry's default object before we manipulate it - data = foundry.utils.mergeObject(data, fd.object) - // Force a default name if none is given - if (!data.name) data.name = game.i18n.format('WOD5E.New', { type: itemTypes[data.type] }) - // Generate a default image depending on the item type - const itemsList = WOD5E.ItemTypes.getList() - data.img = itemsList[data.type].img ? itemsList[data.type].img : 'systems/vtm5e/assets/icons/items/item-default.svg' - // If folder isn't given, delete the field - if (!data.folder) delete data.folder - // Choose the default item type if there's only one - if (itemTypes.length === 1) data.type = itemTypes[0] - // Render the item after creating it - return this.create(data, { - renderSheet: true, - pack: options.pack || '' - }) - }, - rejectClose: false, - options - }) - } } From d995bcede6bf78ad1713a471813cb142871618f2 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 22 Jun 2024 23:40:23 -0500 Subject: [PATCH 63/64] Linting --- module/actor/actor.js | 2 +- module/item/item.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index 9545e6c0..aeea3ca1 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -1,4 +1,4 @@ -/* global Actor, game, renderTemplate, Dialog, FormDataExtended, foundry, WOD5E, CONST */ +/* global Actor, game, foundry */ /** * Extend the base ActorSheet document and put all our base functionality here diff --git a/module/item/item.js b/module/item/item.js index 2da1dc95..cce29593 100644 --- a/module/item/item.js +++ b/module/item/item.js @@ -1,4 +1,4 @@ -/* global Item, game, renderTemplate, Dialog, FormDataExtended, foundry, WOD5E */ +/* global Item */ /** * Extend the base ItemSheet document and put all our base functionality here From bbab07ef817bdfeb60e93edccd3d82936ad87540 Mon Sep 17 00:00:00 2001 From: Veilza Date: Sat, 22 Jun 2024 23:43:04 -0500 Subject: [PATCH 64/64] Linting --- module/actor/actor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index aeea3ca1..fd1bd204 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -1,4 +1,4 @@ -/* global Actor, game, foundry */ +/* global Actor, game, foundry, CONST */ /** * Extend the base ActorSheet document and put all our base functionality here