diff --git a/.github/ABANDONED.md b/.github/ABANDONED.md index bb4598bc7..6a64c363d 100644 --- a/.github/ABANDONED.md +++ b/.github/ABANDONED.md @@ -2,21 +2,21 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry VTT better! Below is a list of translations keys on existing files that still need translated, based on `en.json`. -[cn.json (383 untranslated strings)](#cnjson) +[cn.json (384 untranslated strings)](#cnjson) -[cs.json (568 untranslated strings)](#csjson) +[cs.json (569 untranslated strings)](#csjson) -[ko.json (165 untranslated strings)](#kojson) +[ko.json (166 untranslated strings)](#kojson) -[pt-BR.json (113 untranslated strings)](#ptbrjson) +[pt-BR.json (114 untranslated strings)](#ptbrjson) -[ru.json (1229 untranslated strings)](#rujson) +[ru.json (1230 untranslated strings)](#rujson) -[sv.json (351 untranslated strings)](#svjson) +[sv.json (352 untranslated strings)](#svjson) ## cn.json -383 untranslated strings +384 untranslated strings ``` "CoC7.ActorIsTokenHint": "Actor is a token", "CoC7.ActorDataLinked": "Actor data are linked", @@ -400,10 +400,11 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", -"CoC7.TokenCreationRoll.ButtonAverage": "Average all" +"CoC7.TokenCreationRoll.ButtonAverage": "Average all", +"CoC7.RealRollDecaderPlaceholderName": "10's" ``` ## cs.json -568 untranslated strings +569 untranslated strings ``` "CoC7.Entities.Character": "Character", "CoC7.Entities.Container": "Container", @@ -972,10 +973,11 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", -"CoC7.TokenCreationRoll.ButtonAverage": "Average all" +"CoC7.TokenCreationRoll.ButtonAverage": "Average all", +"CoC7.RealRollDecaderPlaceholderName": "10's" ``` ## ko.json -165 untranslated strings +166 untranslated strings ``` "CoC7.CustomSpecialisationLabel": "Custom label - {specialisation}", "CoC7.RollDifficultyRegularTitle": "Regular difficulty", @@ -1141,10 +1143,11 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", -"CoC7.TokenCreationRoll.ButtonAverage": "Average all" +"CoC7.TokenCreationRoll.ButtonAverage": "Average all", +"CoC7.RealRollDecaderPlaceholderName": "10's" ``` ## pt-BR.json -113 untranslated strings +114 untranslated strings ``` "CoC7.EraRegency": "Regency Cthulhu - Standard", "CoC7.EraRegencyPulp": "Regency Cthulhu - Pulp", @@ -1258,10 +1261,11 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", -"CoC7.TokenCreationRoll.ButtonAverage": "Average all" +"CoC7.TokenCreationRoll.ButtonAverage": "Average all", +"CoC7.RealRollDecaderPlaceholderName": "10's" ``` ## ru.json -1229 untranslated strings +1230 untranslated strings ``` "CoC7.title": "Call of Cthulhu 7h Edition", "CoC7.Entities.Character": "Character", @@ -2491,10 +2495,11 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", -"CoC7.TokenCreationRoll.ButtonAverage": "Average all" +"CoC7.TokenCreationRoll.ButtonAverage": "Average all", +"CoC7.RealRollDecaderPlaceholderName": "10's" ``` ## sv.json -351 untranslated strings +352 untranslated strings ``` "CoC7.ActorIsTokenHint": "Actor is a token", "CoC7.ActorDataLinked": "Actor data are linked", @@ -2846,5 +2851,6 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", -"CoC7.TokenCreationRoll.ButtonAverage": "Average all" +"CoC7.TokenCreationRoll.ButtonAverage": "Average all", +"CoC7.RealRollDecaderPlaceholderName": "10's" ``` diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index f07eb2d44..b8b5ef566 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -9,6 +9,15 @@ Happy gaming ! When not specified, all changes were made by @castanhocorreia, @HavlockV, and @snap01. +## Version 0.10.11 + +When not specified, all changes were made by @castanhocorreia, @HavlockV, and @snap01. + +- Fix investigator wizard drag and drop for players +- Label decaders in Real Dice - Manual Rolling module +- Prevent cancelling casting spells from overwriting rolls with a fixed value +- Reimplement Dice So Nice support to fix other people seeing rolled dice in their selected appearance + ## Version 0.10.10 When not specified, all changes were made by @castanhocorreia, @HavlockV, and @snap01. diff --git a/.github/TRANSLATIONS.md b/.github/TRANSLATIONS.md index d28b357ea..dd228b494 100644 --- a/.github/TRANSLATIONS.md +++ b/.github/TRANSLATIONS.md @@ -2,39 +2,38 @@ Thank you for being interested in making Call of Cthulhu 7th Edition for Foundry VTT better! Below is a list of translations keys on existing files that still need translated, based on `en.json`. Feel free to create a new `*.json` file for a language that is not shown here! -The following translations are currently up to date **fr**, **it**, **pl** - The following translations have more than 50 untranslated strings [are you able to help?](./ABANDONED.md) -[cn.json (383 untranslated strings)](./ABANDONED.md#cnjson) +[cn.json (384 untranslated strings)](./ABANDONED.md#cnjson) -[cs.json (568 untranslated strings)](./ABANDONED.md#csjson) +[cs.json (569 untranslated strings)](./ABANDONED.md#csjson) -[ko.json (165 untranslated strings)](./ABANDONED.md#kojson) +[ko.json (166 untranslated strings)](./ABANDONED.md#kojson) -[pt-BR.json (113 untranslated strings)](./ABANDONED.md#ptbrjson) +[pt-BR.json (114 untranslated strings)](./ABANDONED.md#ptbrjson) -[ru.json (1229 untranslated strings)](./ABANDONED.md#rujson) +[ru.json (1230 untranslated strings)](./ABANDONED.md#rujson) -[sv.json (351 untranslated strings)](./ABANDONED.md#svjson) +[sv.json (352 untranslated strings)](./ABANDONED.md#svjson) -|Key|de|es|ja|zh-TW| -|:---|:---:|:---:|:---:|:---:| -|**Remaining**:|**1**|**1**|**10**|**12**| -|[CoC7.EraRegency](#coc7eraregency)|✅|✅|✅|❌| -|[CoC7.EraRegencyPulp](#coc7eraregencypulp)|✅|✅|✅|❌| -|[CoC7.ErrorTokenIncorrect](#coc7errortokenincorrect)|✅|✅|❌|❌| -|[CoC7.PersonalSpecialityPlaceholder](#coc7personalspecialityplaceholder)|❌|❌|❌|❌| -|[CoC7.SanityLossType](#coc7sanitylosstype)|✅|✅|❌|❌| -|[CoC7.System.Documentation](#coc7systemdocumentation)|✅|✅|❌|❌| -|[CoC7.TokenCreationRoll.ButtonAverage](#coc7tokencreationrollbuttonaverage)|✅|✅|❌|❌| -|[CoC7.TokenCreationRoll.ButtonRoll](#coc7tokencreationrollbuttonroll)|✅|✅|❌|❌| -|[CoC7.TokenCreationRoll.Prompt](#coc7tokencreationrollprompt)|✅|✅|❌|❌| -|[CoC7.TokenCreationRoll.Title](#coc7tokencreationrolltitle)|✅|✅|❌|❌| -|[SETTINGS.SceneDistanceNotCalcualtedNoError](#settingsscenedistancenotcalcualtednoerror)|✅|✅|❌|❌| -|[SETTINGS.SceneDistanceNotCalcualtedNoErrorHint](#settingsscenedistancenotcalcualtednoerrorhint)|✅|✅|❌|❌| +|Key|de|es|fr|it|ja|pl|zh-TW| +|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| +|**Remaining**:|**2**|**2**|**1**|**1**|**11**|**1**|**13**| +|[CoC7.EraRegency](#coc7eraregency)|✅|✅|✅|✅|✅|✅|❌| +|[CoC7.EraRegencyPulp](#coc7eraregencypulp)|✅|✅|✅|✅|✅|✅|❌| +|[CoC7.ErrorTokenIncorrect](#coc7errortokenincorrect)|✅|✅|✅|✅|❌|✅|❌| +|[CoC7.PersonalSpecialityPlaceholder](#coc7personalspecialityplaceholder)|❌|❌|✅|✅|❌|✅|❌| +|[CoC7.RealRollDecaderPlaceholderName](#coc7realrolldecaderplaceholdername)|❌|❌|❌|❌|❌|❌|❌| +|[CoC7.SanityLossType](#coc7sanitylosstype)|✅|✅|✅|✅|❌|✅|❌| +|[CoC7.System.Documentation](#coc7systemdocumentation)|✅|✅|✅|✅|❌|✅|❌| +|[CoC7.TokenCreationRoll.ButtonAverage](#coc7tokencreationrollbuttonaverage)|✅|✅|✅|✅|❌|✅|❌| +|[CoC7.TokenCreationRoll.ButtonRoll](#coc7tokencreationrollbuttonroll)|✅|✅|✅|✅|❌|✅|❌| +|[CoC7.TokenCreationRoll.Prompt](#coc7tokencreationrollprompt)|✅|✅|✅|✅|❌|✅|❌| +|[CoC7.TokenCreationRoll.Title](#coc7tokencreationrolltitle)|✅|✅|✅|✅|❌|✅|❌| +|[SETTINGS.SceneDistanceNotCalcualtedNoError](#settingsscenedistancenotcalcualtednoerror)|✅|✅|✅|✅|❌|✅|❌| +|[SETTINGS.SceneDistanceNotCalcualtedNoErrorHint](#settingsscenedistancenotcalcualtednoerrorhint)|✅|✅|✅|✅|❌|✅|❌| ##### CoC7.EraRegency ``` "CoC7.EraRegency": "Regency Cthulhu - Standard",``` ##### CoC7.EraRegencyPulp @@ -43,6 +42,8 @@ The following translations have more than 50 untranslated strings [are you able ``` "CoC7.ErrorTokenIncorrect": "Unable to find selected token",``` ##### CoC7.PersonalSpecialityPlaceholder ``` "CoC7.PersonalSpecialityPlaceholder": "other skill(s) as personal or era specialties",``` +##### CoC7.RealRollDecaderPlaceholderName +``` "CoC7.RealRollDecaderPlaceholderName": "10's",``` ##### CoC7.SanityLossType ``` "CoC7.SanityLossType": "Type",``` ##### CoC7.System.Documentation diff --git a/lang/en.json b/lang/en.json index 4be7d01c0..e4bb6d523 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1298,5 +1298,7 @@ "CoC7.TokenCreationRoll.Title": "Rollable detected", "CoC7.TokenCreationRoll.Prompt": "This token has rollables characteristics or skills.
What do you want to do ?", "CoC7.TokenCreationRoll.ButtonRoll": "Roll all", - "CoC7.TokenCreationRoll.ButtonAverage": "Average all" + "CoC7.TokenCreationRoll.ButtonAverage": "Average all", + + "CoC7.RealRollDecaderPlaceholderName": "10's" } diff --git a/module/apps/decader-die.js b/module/apps/decader-die.js index 5a5d911fe..a322b9645 100644 --- a/module/apps/decader-die.js +++ b/module/apps/decader-die.js @@ -1,9 +1,9 @@ -/* global DiceTerm */ +/* global Die */ -export class CoC7DecaderDie extends DiceTerm { +export class CoC7DecaderDie extends Die { constructor (termData) { + termData.faces = 10 super(termData) - this.faces = 10 } get total () { diff --git a/module/apps/decader-dsn-faces.js b/module/apps/decader-dsn-faces.js deleted file mode 100644 index b6246f8a7..000000000 --- a/module/apps/decader-dsn-faces.js +++ /dev/null @@ -1,34 +0,0 @@ -/* global game */ -export class CoC7DecaderDSNFaces { - construtor () { - this.selected = '' - } - - setFaces () { - let selected = game.user.getFlag('dice-so-nice', 'appearance')?.global - .system - if (selected !== this.selected) { - let data - let destination - let sourceDie = game.dice3d.DiceFactory.systems[selected]?.dice.find( - d => d.type === 'd100' - ) - if (typeof sourceDie === 'undefined') { - sourceDie = game.dice3d.DiceFactory.systems.standard.dice.find( - d => d.type === 'd100' - ) - selected = 'standard' - } - if (typeof sourceDie !== 'undefined') { - destination = game.dice3d.DiceFactory.systems.standard.dice.findIndex( - d => d.type === 'dt' - ) - data = Object.assign({}, sourceDie) - data.type = 'dt' - game.dice3d.DiceFactory.systems.standard.dice[destination] = - Object.assign(sourceDie.constructor.prototype, data) - } - this.selected = selected - } - } -} diff --git a/module/apps/investigator-wizard.js b/module/apps/investigator-wizard.js index 0a80974b2..c7cbb3312 100644 --- a/module/apps/investigator-wizard.js +++ b/module/apps/investigator-wizard.js @@ -1065,6 +1065,14 @@ export class CoC7InvestigatorWizard extends FormApplication { } } + _canDragStart (selector) { + return true + } + + _canDragDrop (selector) { + return true + } + async _onDrop (event) { try { const dataList = JSON.parse(event.dataTransfer.getData('text/plain')) diff --git a/module/hooks/dice-so-nice-ready-last.js b/module/hooks/dice-so-nice-ready-last.js new file mode 100644 index 000000000..604c01527 --- /dev/null +++ b/module/hooks/dice-so-nice-ready-last.js @@ -0,0 +1,20 @@ +/* global Hooks */ +export function listen () { + Hooks.once('diceSoNiceReady', dice3d => { + for (const system in dice3d.DiceFactory.systems) { + const d100 = dice3d.DiceFactory.systems[system].dice.find(d => d.type === 'd100') + if (typeof d100 !== 'undefined') { + if (typeof dice3d.DiceFactory.systems[system].dice.find(d => d.type === 'dt') === 'undefined') { + const diceDecader = Object.assign(Object.create(Object.getPrototypeOf(d100)), d100) + diceDecader.type = 'dt' + dice3d.DiceFactory.systems[system].dice.push(diceDecader) + } + if (typeof dice3d.DiceFactory.systems[system].dice.find(d => d.type === 'do') === 'undefined') { + const diceDecader = Object.assign(Object.create(Object.getPrototypeOf(d100)), d100) + diceDecader.type = 'do' + dice3d.DiceFactory.systems[system].dice.push(diceDecader) + } + } + } + }) +} diff --git a/module/hooks/dice-so-nice-ready.js b/module/hooks/dice-so-nice-ready.js index 682c9d1f9..82f2ae8ff 100644 --- a/module/hooks/dice-so-nice-ready.js +++ b/module/hooks/dice-so-nice-ready.js @@ -1,6 +1,4 @@ -/* global game, Hooks */ -import { CoC7DecaderDSNFaces } from '../apps/decader-dsn-faces.js' - +/* global Hooks */ export function listen () { Hooks.once('diceSoNiceReady', dice3d => { dice3d.addDicePreset({ @@ -15,6 +13,5 @@ export function listen () { fontScale: 0.75, system: 'standard' }) - game.CoC7DecaderDSNFaces = new CoC7DecaderDSNFaces() }) } diff --git a/module/hooks/dice-so-nice-roll-start.js b/module/hooks/dice-so-nice-roll-start.js deleted file mode 100644 index 4e32e74f0..000000000 --- a/module/hooks/dice-so-nice-roll-start.js +++ /dev/null @@ -1,6 +0,0 @@ -/* global game, Hooks */ -export function listen () { - Hooks.on('diceSoNiceRollStart', dice3d => { - game.CoC7DecaderDSNFaces.setFaces() - }) -} diff --git a/module/hooks/index.js b/module/hooks/index.js index 643aee327..1c1d702e2 100644 --- a/module/hooks/index.js +++ b/module/hooks/index.js @@ -1,6 +1,5 @@ import * as CreateToken from './create-token.js' import * as DiceSoNiceReady from './dice-so-nice-ready.js' -import * as DiceSoNiceRollStart from './dice-so-nice-roll-start.js' import * as Init from './init.js' import * as Ready from './ready.js' import * as RenderActorSheet from './render-actor-sheet.js' @@ -9,13 +8,13 @@ import * as RenderDialog from './render-dialog.js' import * as RenderItemSheet from './render-item-sheet.js' import * as RenderPause from './render-pause.js' import * as RenderPlayerList from './render-player-list.js' +import * as RenderRealRoll from './render-real-roll.js' import * as RenderSettingsConfig from './render-settings-config.js' export const CoC7Hooks = { listen () { CreateToken.listen() DiceSoNiceReady.listen() - DiceSoNiceRollStart.listen() Init.listen() Ready.listen() RenderActorSheet.listen() @@ -24,6 +23,7 @@ export const CoC7Hooks = { RenderItemSheet.listen() RenderPause.listen() RenderPlayerList.listen() + RenderRealRoll.listen() RenderSettingsConfig.listen() } } diff --git a/module/hooks/init.js b/module/hooks/init.js index 81a30f931..5be137c34 100644 --- a/module/hooks/init.js +++ b/module/hooks/init.js @@ -7,6 +7,7 @@ import { handlebarsHelper } from '../scripts/handlebars-helper.js' import { compendiumFilter } from '../scripts/compendium-filter.js' import { CoCID } from '../scripts/coc-id.js' import { CoC7Link } from '../apps/coc7-link.js' +import * as DiceSoNiceReadyLast from './dice-so-nice-ready-last.js' export function listen () { Hooks.once('init', async () => { @@ -18,5 +19,6 @@ export function listen () { compendiumFilter() CoCID.init() CoC7Link.init() + DiceSoNiceReadyLast.listen() }) } diff --git a/module/hooks/render-real-roll.js b/module/hooks/render-real-roll.js new file mode 100644 index 000000000..4ab55ab6d --- /dev/null +++ b/module/hooks/render-real-roll.js @@ -0,0 +1,17 @@ +/* global game, Hooks */ +import { CoC7DecaderDie } from '../apps/decader-die.js' + +export function listen () { + Hooks.on('renderRealRoll', (app, html, options) => { + for (const term in options.dieTerms) { + for (const input in options.dieTerms[term].inputs) { + if (options.dieTerms[term] instanceof CoC7DecaderDie) { + const tag = html.find('[name="' + term + '.' + input + '"]') + if (tag.length === 1) { + tag[0].placeholder = game.i18n.localize('CoC7.RealRollDecaderPlaceholderName') + } + } + } + } + }) +} diff --git a/module/items/spell/data.js b/module/items/spell/data.js index 62f0496ce..ef66a9540 100644 --- a/module/items/spell/data.js +++ b/module/items/spell/data.js @@ -17,7 +17,7 @@ export class CoC7Spell extends CoC7Item { /** This is not owned by any Actor */ return ui.notifications.error(game.i18n.localize('CoC7.NotOwned')) } - const costs = this.system.costs + const costs = foundry.utils.duplicate(this.system.costs) const losses = [] let convertSurplusIntoHitPoints costs.magicPoints = CoC7Utilities.isFormula(costs.magicPoints) diff --git a/styles/sheets/spell.less b/styles/sheets/spell.less index 2e3fb6383..777fdccf6 100644 --- a/styles/sheets/spell.less +++ b/styles/sheets/spell.less @@ -188,7 +188,7 @@ .body { input { flex: 0; - min-width: 2.5rem; + min-width: 6rem; } grid-area: body; diff --git a/system.json b/system.json index 8f7ce2a3a..bfa94b49a 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "CoC7", "title": "Call of Cthulhu 7th Edition", "description": "An implementation of the Call of Cthulhu 7th Edition game system for Foundry Virtual Tabletop.", - "version": "0.10.10", + "version": "0.10.11", "authors": [ { "name": "Miskatonic Investigative Society" @@ -146,5 +146,5 @@ "secondaryTokenAttribute": "attribs.san", "url": "https://github.com/Miskatonic-Investigative-Society/CoC7-FoundryVTT", "manifest": "https://github.com/Miskatonic-Investigative-Society/CoC7-FoundryVTT/releases/latest/download/system.json", - "download": "https://github.com/Miskatonic-Investigative-Society/CoC7-FoundryVTT/releases/download/0.10.10/system.zip" + "download": "https://github.com/Miskatonic-Investigative-Society/CoC7-FoundryVTT/releases/download/0.10.11/system.zip" }