From 14aa2e19771e797004e040715a221eb1d0e223a2 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:01:57 -0500 Subject: [PATCH 001/218] fix: get GM control buttons working in v13 --- src/module/hooks/addGMControlButtons.ts | 36 +++++++++++++++---------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/module/hooks/addGMControlButtons.ts b/src/module/hooks/addGMControlButtons.ts index 15fa1540c..4b133c3f1 100644 --- a/src/module/hooks/addGMControlButtons.ts +++ b/src/module/hooks/addGMControlButtons.ts @@ -9,16 +9,16 @@ import { simplifySkillName, sortObj } from "../utils/utils.ts"; Hooks.on("getSceneControlButtons", (controls) => { if (game.user.isGM) { - controls.find((c) => c.name === "token").tools.push({ + controls.tokens.tools.requestRoll = { name: "requestRoll", title: "TWODSIX.Chat.Roll.RequestRoll" + (game.settings.get("core", "showToolclips") ? "Clip" : ""), icon: "fa-solid fa-dice", button: true, visible: game.user.isGM, - onClick: async () => { + onChange: async () => { await requestRoll(); } - }); + }; } }); @@ -108,11 +108,14 @@ async function throwDialog(skillsList:string[], tokenData:any):Promise { other: 0 }; const returnValue = {}; - const buttons = { - ok: { - label: game.i18n.localize("TWODSIX.Chat.Roll.RequestRoll"), - icon: '', - callback: (buttonHtml) => { + const buttons = [ + { + action: "ok", + label: "TWODSIX.Chat.Roll.RequestRoll", + icon: "fa-solid fa-message", + callback: (event, button, dialog) => { + console.log(event, button, dialog); + const buttonHtml = $(dialog); returnValue.selectedTokens = buttonHtml.find('[name="selectedTokens"]').val(); returnValue.difficulty = TWODSIX.DIFFICULTIES[game.settings.get('twodsix', 'difficultyListUsed')][buttonHtml.find('[name="difficulty"]').val()]; returnValue.rollType = buttonHtml.find('[name="rollType"]').val(); @@ -123,25 +126,30 @@ async function throwDialog(skillsList:string[], tokenData:any):Promise { returnValue.other = parseInt(buttonHtml.find('[name="other"]').val()); } }, - cancel: { - icon: '', - label: game.i18n.localize("Cancel"), + { + action: "cancel", + icon: "fa-solid fa-xmark", + label: "Cancel", callback: () => { returnValue.shouldRoll = false; } }, - }; + ]; const html = await renderTemplate(template, dialogData); return new Promise((resolve) => { - new Dialog({ - title: game . i18n.localize("TWODSIX.Chat.Roll.RequestRoll"), + new foundry.applications.api.DialogV2({ + window: {title: "TWODSIX.Chat.Roll.RequestRoll"}, content: html, buttons: buttons, default: 'ok', close: () => { resolve(returnValue); }, + submit: () => { + console.log(returnValue); + resolve(returnValue); + } }).render(true); }); } From 777120c8c9f51353175c07450f1b27572b51b173 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:53:59 -0500 Subject: [PATCH 002/218] fix: need to check if active --- src/module/hooks/addGMControlButtons.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/module/hooks/addGMControlButtons.ts b/src/module/hooks/addGMControlButtons.ts index 4b133c3f1..9c25019c1 100644 --- a/src/module/hooks/addGMControlButtons.ts +++ b/src/module/hooks/addGMControlButtons.ts @@ -15,8 +15,10 @@ Hooks.on("getSceneControlButtons", (controls) => { icon: "fa-solid fa-dice", button: true, visible: game.user.isGM, - onChange: async () => { - await requestRoll(); + onChange: async (event, active) => { + if (active) { + await requestRoll(); + } } }; } From 1043c319322797406990052516e12331e8820679 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:55:05 -0500 Subject: [PATCH 003/218] fix: renderChatLog hook uses htmlElement and not html --- src/module/hooks/chatCard.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/module/hooks/chatCard.ts b/src/module/hooks/chatCard.ts index a6bbef25d..95704aa9d 100644 --- a/src/module/hooks/chatCard.ts +++ b/src/module/hooks/chatCard.ts @@ -9,13 +9,15 @@ import { TwodsixRollSettings } from "../utils/TwodsixRollSettings"; import { TWODSIX } from "../config"; import { handleSkillRoll, handleTableRoll } from "../utils/enrichers"; -Hooks.on("renderChatLog", (_app, html, _data) => { +Hooks.on("renderChatLog", (_app, htmlElement, _data) => { + const html = $(htmlElement); html.on("click", ".card-buttons button", onChatCardAction); html.on("click", ".item-name", onChatCardToggleContent); html.on("click", ".skill-roll", handleSkillRoll); html.on("click", ".table-roll", handleTableRoll); }); -Hooks.on("renderChatPopout", (_app, html, _data) => { +Hooks.on("renderChatPopout", (_app, htmlElement, _data) => { + const html = $(htmlElement); html.on("click", ".card-buttons button", onChatCardAction); html.on("click", ".item-name", onChatCardToggleContent); html.on("click", ".skill-roll", handleSkillRoll); From 22835a32b5d79048cdc6e1df8b98d4197c006c1c Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:55:26 -0500 Subject: [PATCH 004/218] fix: renderChatHTML hook changed --- src/module/hooks/renderChatMessage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/module/hooks/renderChatMessage.ts b/src/module/hooks/renderChatMessage.ts index f5686426f..9e766b0c3 100644 --- a/src/module/hooks/renderChatMessage.ts +++ b/src/module/hooks/renderChatMessage.ts @@ -3,7 +3,8 @@ import Crit from "../utils/crit"; -Hooks.on('renderChatMessage', (app, html) => { +Hooks.on('renderChatMessageHTML', (app, htmlElement) => { + const html = $(htmlElement); const damageMessage = html.find(".damage-message")[0]; if (damageMessage) { damageMessage.setAttribute("draggable", "true"); From b4dbece3384d90f6a93a859f13832cbaaf393113 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:59:05 -0500 Subject: [PATCH 005/218] fix: damage message update --- static/templates/chat/damage-message.html | 86 ++++++++++++----------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/static/templates/chat/damage-message.html b/static/templates/chat/damage-message.html index 08fdfd3ca..2d7913c29 100644 --- a/static/templates/chat/damage-message.html +++ b/static/templates/chat/damage-message.html @@ -1,52 +1,58 @@ -
+
{{{flavor}}}
- -
-
{{roll.formula}}
-
-
-
-
- {{roll.formula}} - {{roll.total}} -
-
    - {{#each dice as |die|}} -
  1. {{die.result}}
  2. - {{/each}} -
+
+
+
{{roll.formula}}
+
+
+
+
+
+ {{roll.formula}} + {{roll.total}} +
+
    + {{#each dice as |die|}} +
  1. {{die.result}}
  2. + {{/each}} +
+
+
-
+
+ {{#iff damageValue '>' '0'}} +

{{damageValue}}

+ {{else}} +

{{localize "TWODSIX.Damage.NoRegularDamage"}}

+ {{/iff}}
- {{#iff damageValue '>' '0'}} -

{{damageValue}}

- {{else}} -

{{localize "TWODSIX.Damage.NoRegularDamage"}}

- {{/iff}}
{{#if radRoll}}
- {{localize "TWODSIX.Items.Component.RadiationDamage"}} -
-
-
{{radRoll.formula}}
-
-
-
-
- {{radRoll.formula}} - {{radRoll.total}} -
-
    - {{#each radDice as |die|}} -
  1. {{die.result}}
  2. - {{/each}} -
+
{{localize "TWODSIX.Items.Component.RadiationDamage"}}
+
+
+
{{radRoll.formula}}
+
+
+
+
+
+ {{radRoll.formula}} + {{radRoll.total}} +
+
    + {{#each radDice as |die|}} +
  1. {{die.result}}
  2. + {{/each}} +
+
+
-
+
+

{{radDamage}}

-

{{radDamage}}

{{/if}}
From b5e8c73524b75857e878da8d9cd8679e64dbece1 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:59:22 -0500 Subject: [PATCH 006/218] fix: remove overall flex --- static/styles/twodsix.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 51c0536ae..bf7774aa2 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -189,9 +189,9 @@ table tr:nth-child(even) { flex-wrap: nowrap; justify-content: flex-start; } -.sheet > * { +/*.sheet > * { flex: 1; -} +}*/ .sheet > .flex0 { display: block; flex: 0; From cb3ef32a13221e2b6ea0b9a0e6f15eee89eca248 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Fri, 18 Oct 2024 07:38:47 -0500 Subject: [PATCH 007/218] fix: change measuredTemplate reference --- src/module/utils/ItemTemplate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/utils/ItemTemplate.ts b/src/module/utils/ItemTemplate.ts index 8108bdbc1..92f5451b0 100644 --- a/src/module/utils/ItemTemplate.ts +++ b/src/module/utils/ItemTemplate.ts @@ -7,7 +7,7 @@ import { TWODSIX } from "../config"; /** * A helper class for building MeasuredTemplates for item AOE. Adapted from D5e system */ -export default class ItemTemplate extends MeasuredTemplate { +export default class ItemTemplate extends foundry.canvas.placeables.MeasuredTemplate { /** * Track the timestamp when the last mouse move event was captured. From eb136ffedf35501bcc14295fbb2cca7303b62930 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:07:13 -0500 Subject: [PATCH 008/218] fix: stop overwriting itemTypes.skills --- src/module/sheets/AbstractTwodsixActorSheet.ts | 2 +- src/module/utils/TwodsixRollSettings.ts | 2 +- static/templates/actors/animal-sheet.html | 2 +- static/templates/actors/npc-sheet.html | 2 +- static/templates/actors/parts/actor/actor-skills.html | 2 +- static/templates/actors/robot-sheet.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/module/sheets/AbstractTwodsixActorSheet.ts b/src/module/sheets/AbstractTwodsixActorSheet.ts index 344e60f8d..f2e217dad 100644 --- a/src/module/sheets/AbstractTwodsixActorSheet.ts +++ b/src/module/sheets/AbstractTwodsixActorSheet.ts @@ -396,7 +396,7 @@ export abstract class AbstractTwodsixActorSheet extends ActorSheet { sheetData.container = actor.itemTypes; sheetData.container.equipmentAndTools = actor.itemTypes.equipment.concat(actor.itemTypes.tool).concat(actor.itemTypes.computer); sheetData.container.storageAndJunk = actor.itemTypes.storage.concat(actor.itemTypes.junk); - sheetData.container.skills = skillsList; + sheetData.container.skillsList = skillsList; sheetData.container.skillGroups = sortObj(skillGroups); if (actor.type === "traveller") { sheetData.numberOfSkills = numberOfSkills + (sheetData.jackOfAllTrades > 0 ? 1 : 0); diff --git a/src/module/utils/TwodsixRollSettings.ts b/src/module/utils/TwodsixRollSettings.ts index 292fb66f8..ca80d4eb9 100644 --- a/src/module/utils/TwodsixRollSettings.ts +++ b/src/module/utils/TwodsixRollSettings.ts @@ -74,7 +74,7 @@ export class TwodsixRollSettings { } //Check for "Untrained" value and use if better to account for JOAT - const joat = (selectedActor.getUntrainedSkill().system)?.value ?? CONFIG.Item.dataModels.skills.schema.getInitialValue().value; + const joat = (selectedActor.getUntrainedSkill()?.system)?.value ?? CONFIG.Item.dataModels.skills.schema.getInitialValue().value; if (joat > skillValue) { skillValue = joat; this.skillName = game.i18n.localize("TWODSIX.Actor.Skills.JOAT"); diff --git a/static/templates/actors/animal-sheet.html b/static/templates/actors/animal-sheet.html index ad2f5c32d..327b8a20d 100644 --- a/static/templates/actors/animal-sheet.html +++ b/static/templates/actors/animal-sheet.html @@ -45,7 +45,7 @@ {{localize "TWODSIX.Actor.Tabs.Skills"}} {{#unless limited}}
- {{#each_sort_item container.skills as |item id|}} + {{#each_sort_item container.skillsList as |item id|}} {{item.name}} diff --git a/static/templates/actors/npc-sheet.html b/static/templates/actors/npc-sheet.html index d7ae439b5..c2dc28b66 100644 --- a/static/templates/actors/npc-sheet.html +++ b/static/templates/actors/npc-sheet.html @@ -47,7 +47,7 @@ {{localize "TWODSIX.Actor.Skills.JOAT"}} , - {{#each_sort_item container.skills as |item id|}} + {{#each_sort_item container.skillsList as |item id|}} {{item.name}} {{#if ../settings.hideUntrainedSkills}},{{else}}{{#unless @last}},{{/unless}}{{/if}} diff --git a/static/templates/actors/parts/actor/actor-skills.html b/static/templates/actors/parts/actor/actor-skills.html index ae9b21c62..de4ef1eb4 100644 --- a/static/templates/actors/parts/actor/actor-skills.html +++ b/static/templates/actors/parts/actor/actor-skills.html @@ -38,7 +38,7 @@
{{#unless settings.showSkillGroups}} - {{#each_sort_item container.skills as |item id|}} + {{#each_sort_item container.skillsList as |item id|}} {{> "systems/twodsix/templates/actors/parts/actor/actor-skill-item.html" item = item id = id actor = ../actor}} {{/each_sort_item}} {{else}} diff --git a/static/templates/actors/robot-sheet.html b/static/templates/actors/robot-sheet.html index 89e03f12b..9eaa20148 100644 --- a/static/templates/actors/robot-sheet.html +++ b/static/templates/actors/robot-sheet.html @@ -45,7 +45,7 @@ {{localize "TWODSIX.Actor.Tabs.Skills"}} {{#unless limited}}
- {{#each_sort_item container.skills as |item id|}} + {{#each_sort_item container.skillsList as |item id|}} {{item.name}} From b9b155ef0f83a7c0af5d233cead0bba7195da589 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:43:12 -0500 Subject: [PATCH 009/218] fix: make npc characteristics area higher --- static/styles/twodsix_basic.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index 60645625b..ab7f18401 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -108,7 +108,7 @@ label.checkbox > input[type="checkbox"] { .npc-content-container { display: grid; grid-template-columns: 15em 22em 0.9fr; - grid-template-rows: 19em 0.5fr 0.5fr; + grid-template-rows: 20em 0.5fr 0.5fr; gap: 16px; position: relative; grid-template-areas: From e86a9daaf8bec64d51ad2b8693984e8735b5ccbe Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 07:39:22 -0500 Subject: [PATCH 010/218] fix: flavor table style fix --- src/module/utils/TwodsixDiceRoll.ts | 10 +++++----- static/styles/twodsix.css | 6 ++++++ static/styles/twodsix_basic.css | 10 ++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/module/utils/TwodsixDiceRoll.ts b/src/module/utils/TwodsixDiceRoll.ts index 53732ed6c..9d21d228b 100644 --- a/src/module/utils/TwodsixDiceRoll.ts +++ b/src/module/utils/TwodsixDiceRoll.ts @@ -249,7 +249,7 @@ export class TwodsixDiceRoll { } } - let flavorTable = ``; + let flavorTable = `
${game.i18n.localize("TWODSIX.Chat.Roll.Modifier")}${game.i18n.localize("TWODSIX.Chat.Roll.Description")}${game.i18n.localize("TWODSIX.Chat.Roll.DM")}
`; //Add roll data if (this.roll?.dice[0]?.values) { @@ -371,12 +371,12 @@ export class TwodsixDiceRoll { } //Add buttons - flavorText += `
`; + flavorText += `
`; if (this.isSuccess() && !game.settings.get("twodsix", "automateDamageRollOnHit") && (this.item?.type === "weapon" || (this.item?.type === "component" && this.item?.system?.subtype === "armament"))) { - flavorText += ``; + flavorText += ``; } else if (this.rollSettings.skillRoll && this.item?.type !== "weapon" && !(this.item?.type === "component" && this.item?.system?.subtype === "armament")) { - flavorText += ``; - flavorText += ``; + flavorText += ``; + flavorText += ``; } flavorText +=`
`; diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index bf7774aa2..4509a09bf 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -3427,6 +3427,12 @@ background: var(--s2d6-sidebar-background); gap: 0 5px; } +.flavor-table { + width: 95%; + margin: 1ch; + padding: 0.25rem; +} + /* #settings button { position: relative; diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index ab7f18401..e02bad5b0 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -2898,6 +2898,16 @@ background: var(--sidebar-background); gap: 0 5px; } +.flavor-table { + width: 95%; + margin: 1ch; + padding: 0.25rem; +} + +.flavor-table tr:nth-child(even) { + background-color: rgba(255, 255, 255, 0.2); +} + /* #settings button { position: relative; From 71ace92fd29d6e2eac50e856a7c992d75e81f4b8 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:32:53 -0500 Subject: [PATCH 011/218] fix: setup custom pause image --- .../TwodsixGamePause.ts} | 23 +++++++++++++--- src/twodsix.ts | 3 +++ static/styles/twodsix.css | 26 +++++++++++++++++++ 3 files changed, 48 insertions(+), 4 deletions(-) rename src/module/{hooks/renderPause.ts => entities/TwodsixGamePause.ts} (83%) diff --git a/src/module/hooks/renderPause.ts b/src/module/entities/TwodsixGamePause.ts similarity index 83% rename from src/module/hooks/renderPause.ts rename to src/module/entities/TwodsixGamePause.ts index 68a24a401..0ced1f1c6 100644 --- a/src/module/hooks/renderPause.ts +++ b/src/module/entities/TwodsixGamePause.ts @@ -1,7 +1,22 @@ -Hooks.on("renderPause", (app, html, options) => { - if (options.paused) { +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-nocheck This turns off *all* typechecking, make sure to remove this once foundry-vtt-types are updated to cover v10. + +/** + * Extend the GamePause application to use custom banner. + * @extends {GamePause} + */ +export class TwodsixGamePause extends foundry.applications.ui.GamePause { + /** @override */ + async _renderHTML(context, _options) { const svgImage = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' preserveAspectRatio='xMidYMid meet' version='1.0' viewBox='0 0 300 300'%3E%3Cg fill='%2329aaff' stroke='none'%3E%3Cpath d='M1636 2943 c-37 -37 -54 -71 -75 -153 -14 -52 -73 -179 -97 -209 -7 -9 -173 99 -213 139 -100 99 -161 134 -161 93 0 -10 -11 -42 -25 -71 -28 -59 -31 -95 -14 -152 7 -21 9 -54 5 -73 l-7 -35 -50 19 c-99 38 -155 72 -225 139 -69 66 -108 89 -122 75 -16 -15 -4 -161 17 -225 13 -36 28 -91 36 -123 11 -52 11 -57 -4 -53 -9 2 -43 7 -76 10 -33 4 -103 20 -155 37 -80 26 -100 29 -124 20 -25 -10 -28 -15 -22 -42 15 -75 56 -154 97 -189 67 -56 119 -107 119 -116 0 -5 -98 -11 -218 -12 -119 -2 -219 -6 -221 -8 -2 -2 3 -12 12 -22 10 -10 17 -21 17 -25 0 -8 107 -109 167 -156 29 -23 59 -54 68 -71 l15 -29 -39 -21 c-58 -29 -207 -70 -257 -70 -23 0 -46 -5 -49 -11 -21 -33 154 -151 256 -173 15 -3 36 -14 49 -24 l22 -18 -84 -79 c-67 -65 -94 -84 -143 -100 -102 -34 -85 -62 70 -116 129 -45 176 -53 225 -39 19 5 36 8 38 5 2 -2 -6 -24 -18 -49 -22 -46 -111 -136 -135 -136 -6 0 -19 -8 -29 -19 -21 -23 -11 -33 67 -57 54 -17 60 -17 105 -1 44 16 132 23 144 12 21 -21 -58 -235 -107 -292 -19 -23 -35 -48 -35 -57 0 -22 40 -30 116 -23 53 4 79 13 143 50 43 25 94 52 115 61 58 24 58 32 -15 -232 -30 -111 -24 -116 82 -62 108 55 143 82 164 128 21 44 44 72 60 72 20 0 37 -78 46 -205 4 -66 8 -121 8 -122 4 -15 37 7 78 49 35 38 53 67 62 101 14 56 63 113 70 81 5 -26 34 -66 118 -161 40 -45 81 -96 91 -114 25 -46 38 -46 53 -2 7 21 30 74 52 118 25 49 42 97 43 124 6 89 26 94 75 19 29 -45 47 -59 123 -99 49 -26 93 -54 98 -63 13 -24 35 -19 40 9 3 13 3 78 1 142 -6 153 -1 162 76 133 78 -30 122 -55 160 -90 26 -24 36 -28 47 -19 8 6 11 15 9 20 -3 4 -8 80 -11 167 l-6 160 45 -9 c24 -4 66 -23 93 -41 44 -29 57 -33 130 -35 55 -1 87 2 99 11 17 12 12 20 -62 107 -99 116 -133 167 -133 197 0 28 6 30 105 36 44 2 105 12 135 21 30 9 76 22 102 28 l48 12 -54 33 c-30 17 -100 75 -156 129 l-102 97 39 12 c21 6 67 25 103 41 36 16 94 40 130 52 96 32 99 35 70 66 -35 38 -131 84 -198 96 -31 6 -78 20 -104 31 -41 17 -46 23 -38 39 11 20 89 69 109 69 19 0 72 39 161 120 82 74 82 74 54 82 -67 18 -219 20 -284 5 -36 -9 -79 -18 -96 -21 l-31 -5 22 64 c20 56 56 120 76 135 3 3 10 16 14 30 4 13 33 50 63 82 l55 58 -180 0 c-142 0 -183 -3 -199 -15 -22 -17 -48 -20 -39 -5 4 6 9 23 11 38 3 15 25 58 49 95 49 76 78 153 73 191 l-3 25 -88 -29 c-88 -30 -130 -48 -239 -100 -32 -16 -60 -24 -64 -19 -3 5 -5 64 -5 130 1 66 -4 129 -9 140 -25 45 -141 0 -192 -74 -12 -18 -30 -42 -41 -54 l-20 -22 -18 34 c-10 19 -28 69 -40 112 -11 43 -35 122 -53 176 l-33 98 -27 -28z m104 -442 c117 -26 263 -88 352 -151 24 -17 54 -38 68 -47 43 -28 173 -166 215 -228 70 -103 129 -234 151 -333 56 -251 35 -473 -66 -689 -154 -331 -482 -562 -840 -593 -341 -30 -620 66 -851 291 -94 92 -127 137 -198 269 -25 47 -76 184 -89 240 -21 88 -35 230 -28 282 4 29 10 78 13 108 7 73 66 248 111 333 146 271 383 445 717 525 54 13 376 8 445 -7z' transform='translate(0.000000,300.000000) scale(0.100000,-0.100000)'/%3E%3Cpath d='M1339 2416 c-129 -23 -262 -77 -377 -153 -59 -39 -202 -170 -202 -184 0 -6 -9 -20 -21 -32 -55 -59 -139 -246 -165 -372 -18 -84 -20 -266 -5 -352 55 -299 257 -560 536 -689 296 -137 658 -109 932 73 74 49 183 151 230 217 21 28 42 56 48 61 21 19 93 190 116 275 34 124 34 339 0 460 -94 341 -348 592 -690 681 -98 26 -297 33 -402 15z' transform='translate(0.000000,300.000000) scale(0.100000,-0.100000)'/%3E%3C/g%3E%3C/svg%3E"; const replaceCode = `%23`+ game.settings.get('twodsix', 'defaultColor').substring(1); - html.find("img")[0].src = svgImage.replace('%2329aaff', replaceCode); + const img = document.createElement("img"); + img.src = svgImage.replace('%2329aaff', replaceCode); + if ( context.spin ) { + img.classList.add("fa-spin"); + } + const caption = document.createElement("figcaption"); + caption.innerText = context.text; + return [img, caption]; } -}); +} diff --git a/src/twodsix.ts b/src/twodsix.ts index aa2c351c1..fc2e081bc 100644 --- a/src/twodsix.ts +++ b/src/twodsix.ts @@ -35,6 +35,7 @@ import { ArmorData, AugmentData, ComponentData, ComputerData, ConsumableData, Ju import { GearData } from "./module/data/item-base"; import { TwodsixActiveEffect } from "./module/entities/TwodsixActiveEffect"; import { TwodsixBattleSheet } from "./module/sheets/TwodsixBattleSheet"; +import { TwodsixGamePause } from "./module/entities/TwodsixGamePause"; // @ts-ignore hookScriptFiles.forEach((hookFile:string) => import(`./module/hooks/${hookFile}.ts`)); @@ -204,6 +205,8 @@ Hooks.once('init', async function () { //Add TL to compendium index CONFIG.Item.compendiumIndexFields.push('system.techLevel'); + //Game pause icon change + CONFIG.ui.pause = TwodsixGamePause; // All other hooks are found in the module/hooks directory, and should be in the system.json esModules section. }); diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 4509a09bf..379d1dc02 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -4305,3 +4305,29 @@ input.red { grid-template-columns: 40% 15% 15% 15% 10%; padding-left: 1%; } + +#pause.paused { + display: flex; + animation: none; + +} + +#pause figcaption { + font-family: Asap, sans-serif; +} + +.standard-form fieldset { + padding: 0 0.5rem; + display: flex; + flex-direction: column; + flex-wrap: nowrap; + gap: 0; + border-color: unset; + border-radius: 0; + margin: 0 0.5rem; +} + +.selectTokens { + height: auto; + min-height: 5ch; +} From 5022e6e832968234c02b74563586e83adcd2d419 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:33:11 -0500 Subject: [PATCH 012/218] fix: more style changes for request roll --- static/templates/chat/request-roll-dialog.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/static/templates/chat/request-roll-dialog.html b/static/templates/chat/request-roll-dialog.html index 18501dbcf..e3ed95498 100644 --- a/static/templates/chat/request-roll-dialog.html +++ b/static/templates/chat/request-roll-dialog.html @@ -1,14 +1,14 @@ - + +
{{localize "TWODSIX.Actor.CharacterNames"}}
- {{selectOptions allTokenNames selected=initialTokens}}
-
{{localize "TWODSIX.Chat.Roll.RollDetails"}}
@@ -33,7 +33,6 @@
-
{{localize "TWODSIX.Chat.Roll.RollModifiers"}}
@@ -56,5 +55,5 @@
-
+
From 953c10f66158137e67ae3e3b1e9c8c474a96011e Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 10:31:05 -0500 Subject: [PATCH 013/218] fix: cleanup requestRoll dialog setup --- src/module/hooks/addGMControlButtons.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/module/hooks/addGMControlButtons.ts b/src/module/hooks/addGMControlButtons.ts index 9c25019c1..666387f7a 100644 --- a/src/module/hooks/addGMControlButtons.ts +++ b/src/module/hooks/addGMControlButtons.ts @@ -116,7 +116,7 @@ async function throwDialog(skillsList:string[], tokenData:any):Promise { label: "TWODSIX.Chat.Roll.RequestRoll", icon: "fa-solid fa-message", callback: (event, button, dialog) => { - console.log(event, button, dialog); + //console.log(event, button, dialog); const buttonHtml = $(dialog); returnValue.selectedTokens = buttonHtml.find('[name="selectedTokens"]').val(); returnValue.difficulty = TWODSIX.DIFFICULTIES[game.settings.get('twodsix', 'difficultyListUsed')][buttonHtml.find('[name="difficulty"]').val()]; @@ -145,11 +145,8 @@ async function throwDialog(skillsList:string[], tokenData:any):Promise { content: html, buttons: buttons, default: 'ok', - close: () => { - resolve(returnValue); - }, submit: () => { - console.log(returnValue); + //console.log(returnValue); resolve(returnValue); } }).render(true); From f6fd76f3d3f0d9f970cf2b9e4dbb28837cab812e Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 10:31:23 -0500 Subject: [PATCH 014/218] fix: scrollbar track colors --- static/styles/twodsix.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 379d1dc02..68311fbe0 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -394,6 +394,7 @@ form .form-group span.units { padding: 1ch 0 0; --color-scrollbar: var(--s2d6-default-color); --color-scrollbar-border: var(--s2d6-header-border); + --color-scrollbar-track: var(--s2d6-nav-background); } .editor-content strong { @@ -1575,6 +1576,7 @@ a.actor-notes-tab:hover { .tab, div{ scrollbar-width: thin; --color-scrollbar: var(--s2d6-default-color); + --color-scrollbar-track: var(--s2d6-nav-background); } /*.tab[data-tab].active { @@ -4105,6 +4107,7 @@ multi-select.select.target-modifier div.tags.input-element-tags { /* Battle Sheet */ .battle { --color-scrollbar: var(--s2d6-battle-color); + --color-scrollbar-track: var(--s2d6-nav-background); --s2d6-default-color: var(--s2d6-battle-color); } .battle-content { @@ -4211,6 +4214,7 @@ li.battle-damage button, li.battle-weapons button{ overflow-y: auto; overflow-x: hidden; --color-scrollbar: var(--s2d6-battle-color); + --color-scrollbar-track: var(--s2d6-nav-background); } .item-title-battle { From 488b4cc77b16bf01f7a3b6cebb7f6f3774b1f7f4 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 10:56:52 -0500 Subject: [PATCH 015/218] fix: stat table header border --- static/styles/twodsix.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 68311fbe0..8dfa7bfca 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -1251,6 +1251,7 @@ span.bgi-charEdit { font-size: smaller; margin: 0.5em 0 0; overflow-x: hidden; + border-radius: 0; } .stat-table-small { @@ -4033,7 +4034,7 @@ table thead { background: var(--s2d6-background-nearly-transparent); color: var(--s2d6-light-color); text-shadow: none !important; - border: 1px solid var(--s2d6-item-border); + /*border: 1px solid var(--s2d6-item-border);*/ } color-picker > input[type=color] { From 60ce999c68fa2cd791e0b0ac79d144216149043d Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 11:19:54 -0500 Subject: [PATCH 016/218] fix: tab padding and borders --- static/styles/twodsix.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 8dfa7bfca..2436f372e 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -3112,7 +3112,7 @@ select.form-input, input.form-input, span.form-input { } .sheet-navigation.tabs { - padding-bottom: 0.5em; + padding: 0.5em 0; border-bottom: 1px solid var(--color-border-light-tertiary); margin-bottom: 0.5em; } @@ -3781,6 +3781,7 @@ div.app.window-app.minimized.twodsix.ship.actor header a.close { /* margin-right: 3ch; */ height: 100%; /* margin-top: 0; */ + border: none; } .token-sheet .notes { From f1b3550def6195134091ccea3e71f4b793829461 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 11:29:11 -0500 Subject: [PATCH 017/218] Fix: update min compatibility version --- static/system.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/system.json b/static/system.json index 67adb3cbf..c0d5c482b 100644 --- a/static/system.json +++ b/static/system.json @@ -25,8 +25,8 @@ ], "compatibility": { - "minimum": "12", - "verified": "12.331" + "minimum": "13", + "verified": "13.332" }, "description": "Twodsix: A system for use with the Cepheus Engine Core Rules, Traveller (unofficial), and other similar games.
This Product is derived from the Traveller System Reference Document and other Open Gaming Content made available by the Open Gaming License, and does not contain closed content from products published by either Mongoose Publishing or Far Future Enterprises. This Product is not affiliated with either Mongoose Publishing or Far Future Enterprises, and it makes no claim to or challenge to any trademarks held by either entity. The use of the Traveller System Reference Document does not convey the endorsement of this Product by either Mongoose Publishing or Far Future Enterprises as a product of either of their product lines.
Cepheus Engine and Samardan Press™ are the trademarks of Jason \"Flynn\" Kemp; we are not affiliated with Jason \"Flynn\" Kemp or Samardan Press™.
See the files OpenGameLicense.md and LICENSE for license details.
", "esmodules": [ From 6731fa8ad9ebcd39ff61564ae278aae85a80bcbc Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:01:15 -0500 Subject: [PATCH 018/218] fix: move initiative roll to DialogV2 --- .../sheets/AbstractTwodsixActorSheet.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/module/sheets/AbstractTwodsixActorSheet.ts b/src/module/sheets/AbstractTwodsixActorSheet.ts index f2e217dad..12352bde9 100644 --- a/src/module/sheets/AbstractTwodsixActorSheet.ts +++ b/src/module/sheets/AbstractTwodsixActorSheet.ts @@ -478,12 +478,13 @@ export abstract class AbstractTwodsixActorSheet extends ActorSheet { protected async initiativeDialog(dialogData):Promise { const template = 'systems/twodsix/templates/chat/initiative-dialog.html'; - - const buttons = { - ok: { - label: game.i18n.localize("TWODSIX.Rolls.Roll"), - icon: '', - callback: (buttonHtml) => { + const buttons = [ + { + action: "ok", + label: "TWODSIX.Rolls.Roll", + icon: "fa-solid fa-dice", + callback: (event, button, dialog) => { + const buttonHtml = $(dialog); dialogData.shouldRoll = true; dialogData.rollType = buttonHtml.find('[name="rollType"]').val(); dialogData.diceModifier = buttonHtml.find('[name="diceModifier"]').val(); @@ -491,23 +492,24 @@ export abstract class AbstractTwodsixActorSheet extends ActorSheet { dialogData.rollFormula = buttonHtml.find('[name="rollFormula"]').val(); } }, - cancel: { - icon: '', - label: game.i18n.localize("Cancel"), + { + action: "cancel", + icon: "fa-solid fa-xmark", + label: "Cancel", callback: () => { dialogData.shouldRoll = false; } }, - }; + ]; const html = await renderTemplate(template, dialogData); return new Promise((resolve) => { - new Dialog({ - title: game.i18n.localize("TWODSIX.Rolls.RollInitiative"), + new foundry.applications.api.DialogV2({ + window: {title: "TWODSIX.Rolls.RollInitiative"}, content: html, buttons: buttons, default: 'ok', - close: () => { + submit: () => { resolve(); }, }).render(true); From f120fd50c0f8b7f5a003e4e1de1b5f3fce7c7e63 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:23:25 -0500 Subject: [PATCH 019/218] fix: move to DialogV2 for skill select with chain and contested rolls --- src/module/entities/TwodsixItem.ts | 2 +- src/module/hooks/chatCard.ts | 29 ++++++++++++++++------------- static/styles/twodsix.css | 4 ++-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/module/entities/TwodsixItem.ts b/src/module/entities/TwodsixItem.ts index 354584b7d..0b2acb807 100644 --- a/src/module/entities/TwodsixItem.ts +++ b/src/module/entities/TwodsixItem.ts @@ -1160,7 +1160,7 @@ async function promptAndAttackForCE(modes: string[], item: TwodsixItem):void { for ( const mode of modes) { const number = Number(mode); const attackDM = TwodsixItem.burstAttackDM(number); - const bonusDamage =TwodsixItem.burstBonusDamage(number); + const bonusDamage = TwodsixItem.burstBonusDamage(number); if (number === 1) { buttons["single"] = { diff --git a/src/module/hooks/chatCard.ts b/src/module/hooks/chatCard.ts index 95704aa9d..2e0210676 100644 --- a/src/module/hooks/chatCard.ts +++ b/src/module/hooks/chatCard.ts @@ -252,31 +252,34 @@ async function skillDialog(skillList: object): Promise { const select = ``; const content = `
`; - const buttons = { - ok: { - label: game.i18n.localize("TWODSIX.Rolls.SelectSkill"), - icon: '', - callback: async (htmlObject) => { - const skillId = htmlObject[0].querySelector("select[name='item-select']").value; + const buttons = [ + { + action: "ok", + label: "TWODSIX.Rolls.SelectSkill", + icon: "fa-solid fa-list", + callback: async (event, button, dialog) => { + const html = $(dialog); + const skillId = html[0].querySelector("select[name='item-select']").value; returnValue = skillId; } }, - cancel: { - icon: '', - label: game.i18n.localize("Cancel"), + { + action: "cancel", + icon: "fa-solid fa-xmark", + label: "Cancel", callback: () => { returnValue = false; } } - }; + ]; return new Promise((resolve) => { - new Dialog({ - title: game.i18n.localize("TWODSIX.Rolls.SelectSkill"), + new foundry.applications.api.DialogV2({ + window: {title: "TWODSIX.Rolls.SelectSkill"}, content: content, buttons: buttons, default: 'ok', - close: () => { + submit: () => { resolve(returnValue); }, }).render(true); diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 2436f372e..e4aa53598 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -332,7 +332,7 @@ form .form-group, form .form-group-stacked { display: flex; flex-direction: row; flex-wrap: wrap; - margin: 3px 0; + margin: 3px 1ch; /* color: var(--s2d6-default-color) ; */ } @@ -4334,6 +4334,6 @@ input.red { } .selectTokens { - height: auto; + height: auto !important; min-height: 5ch; } From 028c47940c7f17bb7db9e306d94c1d7cc69d6453 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:32:47 -0500 Subject: [PATCH 020/218] fix: clean up effectDM for damage rolls --- src/module/entities/TwodsixItem.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/module/entities/TwodsixItem.ts b/src/module/entities/TwodsixItem.ts index 0b2acb807..860b06ecd 100644 --- a/src/module/entities/TwodsixItem.ts +++ b/src/module/entities/TwodsixItem.ts @@ -1066,7 +1066,12 @@ export async function onRollDamage(event):Promise { if (game.settings.get('twodsix', 'addEffectToManualDamage') && game.settings.get('twodsix', 'addEffectToDamage')) { const lastMessage = (game.messages?.contents.pop()); if (lastMessage?.getFlag("twodsix", "effect")) { - bonusDamageFormula === "0" ? bonusDamageFormula = String(lastMessage.getFlag("twodsix", "effect")) : bonusDamageFormula += `+` + String(lastMessage.getFlag("twodsix", "effect")); + const effectDM = String(lastMessage.getFlag("twodsix", "effect")); + if (bonusDamageFormula === "0") { + bonusDamageFormula = effectDM; + } else { + bonusDamageFormula += `+` + effectDM; + } } } From 5abb79f3dbfc3c0be7fa164bd8a05f8162cbc787 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:52:31 -0500 Subject: [PATCH 021/218] fix: style fixes misc --- static/styles/twodsix.css | 2 +- static/styles/twodsix_basic.css | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index e4aa53598..0c8714a29 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -1765,7 +1765,7 @@ a:hover, a.active { /* Style overrides */ .skills input[type='number'] { - width: 2em; + /*width: 2em;*/ justify-self: center; } diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index e02bad5b0..8dd8d59d5 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -845,6 +845,7 @@ span.bgi-charEdit { font-size: smaller; /* max-width: 100%; */ /* height: -webkit-fill-available; */ + border-radius: 0; } .table-header-row { @@ -1272,7 +1273,7 @@ a.skill-tab.active, a.item-tab.active, a.finances-tab.active, a.info-tab.active, /* Style overrides */ .skills input[type='number'] { - width: 2em; + /*width: 2em;*/ justify-self: center; } @@ -2902,6 +2903,7 @@ background: var(--sidebar-background); width: 95%; margin: 1ch; padding: 0.25rem; + background-color: var(--color-text-light-3); } .flavor-table tr:nth-child(even) { @@ -3504,3 +3506,8 @@ input.red { grid-template-columns: 40% 15% 15% 15% 10%; padding-left: 1%; } + +.selectTokens { + height: auto !important; + min-height: 5ch; +} From 2efe2b3f44403c724bd12b9160dd39bd95c55dfa Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sun, 20 Oct 2024 08:43:27 -0500 Subject: [PATCH 022/218] fix: more style fixes --- static/styles/twodsix.css | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 0c8714a29..47dfe0ef7 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -3457,8 +3457,8 @@ form button { /*--- INTERFACE MAKEUP ---*/ button { - position: relative; - margin: 0.3em 0.1em; + /*position: relative; + margin: 0.3em 0.1em;*/ background-color: var(--s2d6-background-opaque); border-color: var(--s2d6-default-color); color: var(--s2d6-form-light); @@ -4337,3 +4337,7 @@ input.red { height: auto !important; min-height: 5ch; } + +#sidebar-tabs { + padding: 16px; +} From ad75378125096468c484f3434b74e5d5bc1d5129 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sun, 20 Oct 2024 10:43:03 -0500 Subject: [PATCH 023/218] fix: css error --- static/styles/twodsix_basic.css | 1 - 1 file changed, 1 deletion(-) diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index 8dd8d59d5..5a008056c 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -895,7 +895,6 @@ input.stat-name-table { width: 1.5em; text-align: center; border: none; - border: none; -moz-appearance: textfield; appearance: textfield; } From 3c159f2417186f20d8a524e7d72e4bb5e4f408f7 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sun, 20 Oct 2024 10:45:55 -0500 Subject: [PATCH 024/218] fix: and another css issue --- static/styles/twodsix.css | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 47dfe0ef7..49f4e5f01 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -3643,6 +3643,7 @@ div.app.window-app.minimized.twodsix.ship.actor header a.close { border-bottom: 1px solid var(--s2d6-default-color); box-shadow: 0 0 10px var(--s2d6-light-color); background-color: var(--s2d6-background-opaque); + padding: 16px; } #sidebar-tabs > .item { @@ -4337,7 +4338,3 @@ input.red { height: auto !important; min-height: 5ch; } - -#sidebar-tabs { - padding: 16px; -} From 2fd50de62dee7fb3f195547642bce5d7581db354 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Sun, 20 Oct 2024 10:47:44 -0500 Subject: [PATCH 025/218] fix: move item transfer dialog to V2 also, fix issues with item copy and reference --- src/module/entities/TwodsixActor.ts | 74 ++++++++++++++--------------- src/module/utils/sheetUtils.ts | 3 +- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/src/module/entities/TwodsixActor.ts b/src/module/entities/TwodsixActor.ts index 3c242eaf3..e267ea28a 100644 --- a/src/module/entities/TwodsixActor.ts +++ b/src/module/entities/TwodsixActor.ts @@ -950,8 +950,8 @@ export default class TwodsixActor extends Actor { await matching.update({"system.value": updateValue}); return false; } - const addedSkill = (await (this.sheet)._onDropItemCreate(foundry.utils.duplicate(skillData)))[0]; - //const addedSkill = (await this.createEmbeddedDocuments("Item", [foundry.utils.duplicate(skillData)]))[0]; + + const addedSkill = (await this.createEmbeddedDocuments("Item", [foundry.utils.duplicate(skillData)]))[0]; if (addedSkill.system.value < 0 || !addedSkill.system.value) { if (!game.settings.get('twodsix', 'hideUntrainedSkills')) { const skillValue = CONFIG.Item.dataModels.skills.schema.getInitialValue().value ?? -3; @@ -978,32 +978,24 @@ export default class TwodsixActor extends Actor { return false; } - let transferData = {}; - //Need to catch because Monk's enhanced Journal drops item data not TwodsixItem - try { - transferData = itemData.toJSON(); - } catch(err) { - transferData = itemData; - } let numberToMove = itemData.system?.quantity ?? 1; - + const originalItem:TwodsixItem = await fromUuid(itemData.uuid); //Handle moving items from another actor if enabled by settings - if (itemData.actor && game.settings.get("twodsix", "transferDroppedItems")) { - const sourceActor = itemData.actor; //fix + if (originalItem.actor && game.settings.get("twodsix", "transferDroppedItems")) { if (itemData.system.quantity > 1) { numberToMove = await getMoveNumber(itemData); if (numberToMove >= itemData.system.quantity) { - await itemData.update({"system.equipped": "ship"}); + await originalItem.update({"system.equipped": "ship"}); numberToMove = itemData.system.quantity; - await sourceActor.deleteEmbeddedDocuments("Item", [itemData.id]); + await originalItem.delete(); } else if (numberToMove === 0) { return false; } else { - await sourceActor.updateEmbeddedDocuments("Item", [{_id: itemData.id, 'system.quantity': (itemData.system.quantity - numberToMove)}]); + await originalItem.update({'system.quantity': (itemData.system.quantity - numberToMove)}); } } else if (itemData.system.quantity === 1) { - await itemData.update({"system.equipped": "ship"}); - await sourceActor.deleteEmbeddedDocuments("Item", [itemData.id]); + await originalItem.update({"system.equipped": "ship"}); + await originalItem.delete(); } else { return false; } @@ -1027,30 +1019,36 @@ export default class TwodsixActor extends Actor { } // Create the owned item - transferData.system.quantity = numberToMove; - transferData.system.equipped = "backpack"; - delete transferData._id; + itemData.system.quantity = numberToMove; + itemData.system.equipped = "backpack"; + if (Object.hasOwn(itemData, '_id')) { + delete itemData._id; + } + if (Object.hasOwn(itemData, 'uuid')){ + delete itemData.uuid; + } + // Prepare effects - if ( transferData.effects?.length > 0) { - for (const effect of transferData.effects) { + if ( itemData.effects?.length > 0) { + for (const effect of itemData.effects) { effect.disabled = false; effect.transfer = game.settings.get('twodsix', "useItemActiveEffects"); } } //Link an actor skill with names defined by item.associatedSkillName - transferData.system.skill = this.getBestSkill(transferData.system.associatedSkillName, false)?.id ?? this.getUntrainedSkill()?.id; + itemData.system.skill = this.getBestSkill(itemData.system.associatedSkillName, false)?.id ?? this.getUntrainedSkill()?.id; //Remove any attached consumables - transferData.system.consumables = []; - transferData.system.useConsumableForAttack = ''; + itemData.system.consumables = []; + itemData.system.useConsumableForAttack = ''; //Create Item - const addedItem = (await this.createEmbeddedDocuments("Item", [transferData]))[0]; + const addedItem = (await this.createEmbeddedDocuments("Item", [itemData]))[0]; if (game.settings.get('twodsix', 'useEncumbranceStatusIndicators') && this.type === 'traveller' && !["skills", "trait", "spell"].includes(addedItem.type)) { await applyEncumberedEffect(this); } - console.log(`Twodsix | Added Item ${itemData.name} to character`); + console.log(`Twodsix | Added Item ${addedItem.name} to character`); return (!!addedItem); } @@ -1370,21 +1368,23 @@ function getEquipmentWeight(item:TwodsixItem):number { */ async function getMoveNumber(itemData:TwodsixItem): Promise { const returnNumber:number = await new Promise((resolve) => { - new Dialog({ - title: game.i18n.localize("TWODSIX.Actor.Items.QuantityToTransfer"), + new foundry.applications.api.DialogV2({ + window: {title: "TWODSIX.Actor.Items.QuantityToTransfer"}, content: `
` + itemData.name + `
`+ `
`, - buttons: { - Transfer: { - label: ` ` + game.i18n.localize("TWODSIX.Actor.Items.Transfer"), - callback: - (html:JQuery) => { - resolve(html.find('[name="amount"]')[0]["value"]); - } + buttons: [ + { + action: "Transfer", + icon: "fa-solid fa-arrow-right-arrow-left", + label: "TWODSIX.Actor.Items.Transfer", + callback: (event, button, dialog) => { + const html:jQuery = $(dialog); + resolve(html.find('[name="amount"]')[0]["value"]); + } } - }, + ], default: `Transfer` }).render(true); }); diff --git a/src/module/utils/sheetUtils.ts b/src/module/utils/sheetUtils.ts index 065c15107..66ae9be13 100644 --- a/src/module/utils/sheetUtils.ts +++ b/src/module/utils/sheetUtils.ts @@ -232,7 +232,8 @@ export async function getItemDataFromDropData(dropData:Record) { const pack = game.packs.get(item.pack); item = await pack?.getDocument(item._id); } - const itemCopy = foundry.utils.duplicate(item); + const itemCopy = foundry.utils.duplicate(item); ///Should this be copy??? + Object.assign(itemCopy, {uuid: item.uuid}); return itemCopy; } From e366e3e4430aa1c30d9425e8faa070e6aa3c5f9f Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Mon, 21 Oct 2024 07:40:46 -0500 Subject: [PATCH 026/218] fix: convert roll formula validate to DialogV2 --- src/module/hooks/addGMControlButtons.ts | 2 +- src/module/utils/sheetUtils.ts | 24 +++++++++++++----------- static/styles/twodsix.css | 10 +++++++++- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/module/hooks/addGMControlButtons.ts b/src/module/hooks/addGMControlButtons.ts index 666387f7a..dd6270272 100644 --- a/src/module/hooks/addGMControlButtons.ts +++ b/src/module/hooks/addGMControlButtons.ts @@ -135,7 +135,7 @@ async function throwDialog(skillsList:string[], tokenData:any):Promise { callback: () => { returnValue.shouldRoll = false; } - }, + } ]; const html = await renderTemplate(template, dialogData); diff --git a/src/module/utils/sheetUtils.ts b/src/module/utils/sheetUtils.ts index 66ae9be13..3add1a238 100644 --- a/src/module/utils/sheetUtils.ts +++ b/src/module/utils/sheetUtils.ts @@ -305,20 +305,22 @@ export function isDisplayableSkill(skill:Skills): boolean { export async function confirmRollFormula(initFormula:string, title:string):Promise { const returnText:string = await new Promise((resolve) => { - new Dialog({ - title: title, + new foundry.applications.api.DialogV2({ + window: {title: title}, content: ``, - buttons: { - Roll: { - label: ` ` + game.i18n.localize("TWODSIX.Rolls.Roll"), - callback: - (html:JQuery) => { - resolve(html.find('[name="outputFormula"]')[0]["value"]); - } + buttons: [ + { + action: "roll", + icon: "fa-solid fa-dice", + label: "TWODSIX.Rolls.Roll", + callback: (event, button, dialog) => { + const html = $(dialog); + resolve(html.find('[name="outputFormula"]')[0]["value"]); + } } - }, - default: `Roll`, + ], + default: `roll`, }).render(true); }); return (returnText ?? ""); diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 49f4e5f01..96ffd7adf 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -391,7 +391,7 @@ form .form-group span.units { background-repeat: repeat-x; font-family: inherit; color: var(--s2d6-default-color); - padding: 1ch 0 0; + padding: 1ch; /*1ch 0 0 */ --color-scrollbar: var(--s2d6-default-color); --color-scrollbar-border: var(--s2d6-header-border); --color-scrollbar-track: var(--s2d6-nav-background); @@ -3545,6 +3545,10 @@ option { z-index: 99; } +.application { + border-color: var(--s2d6-header-border); +} + .window-app.twodsix.sheet.actor .window-header { /* padding-right: 9ch; */ padding-left: 3%; @@ -4338,3 +4342,7 @@ input.red { height: auto !important; min-height: 5ch; } + +h4 { + font-family: Asap, sans-serif; +} From 8c836803c3acbb86ef577e01b7aedf245b157893 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:26:47 -0500 Subject: [PATCH 027/218] fix: move roll setting dialog to DialogV2 --- src/module/utils/TwodsixRollSettings.ts | 62 +++++++++++++------------ static/templates/chat/throw-dialog.html | 8 +--- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/module/utils/TwodsixRollSettings.ts b/src/module/utils/TwodsixRollSettings.ts index ca80d4eb9..ae7bfe6dd 100644 --- a/src/module/utils/TwodsixRollSettings.ts +++ b/src/module/utils/TwodsixRollSettings.ts @@ -231,11 +231,13 @@ export class TwodsixRollSettings { showEncumbered: game.settings.get('twodsix', 'useEncumbranceStatusIndicators'), }; - const buttons = { - ok: { - label: game.i18n.localize("TWODSIX.Rolls.Roll"), - icon: '', - callback: (buttonHtml) => { + const buttons = [ + { + action: "ok", + label: "TWODSIX.Rolls.Roll", + icon: "fa-solid fa-dice", + callback: (event, button, dialog) => { + const buttonHtml = $(dialog); this.shouldRoll = true; this.difficulty = this.difficulties[buttonHtml.find('[name="difficulty"]').val()]; this.rollType = buttonHtml.find('[name="rollType"]').val(); @@ -271,46 +273,48 @@ export class TwodsixRollSettings { this.timeRollFormula = buttonHtml.find('[name="timeRollFormula"]').val(); } }, - cancel: { - icon: '', - label: game.i18n.localize("Cancel"), + { + action: "cancel", + icon: "fa-solid fa-xmark", + label: "Cancel", callback: () => { this.shouldRoll = false; } }, - }; + ]; const html = await renderTemplate(template, dialogData); - return new Promise((resolve) => { - new Dialog({ - title: title, - content: html, - buttons: buttons, - default: 'ok', - render: handleRender, - close: () => { - resolve(); - }, - }).render(true); + await foundry.applications.api.DialogV2.wait({ + window: {title: title}, + content: html, + buttons: buttons, + default: 'ok', + render: handleRender, + close: () => { + Promise.resolve(); + }, + rejectClose: false }); } } -function handleRender(html) { - html.on("change", ".select-skill", () => { - const characteristicElement = html.find('[name="rollModifiers.characteristic"]'); - const newSkillUuid = html.find('[name="rollModifiers.selectedSkill"]').val(); + +function handleRender(event, htmlRend) { + const workingHtml = $(htmlRend); + workingHtml.on("change", ".select-skill", () => { + const characteristicElement = workingHtml.find('[name="rollModifiers.characteristic"]'); + const newSkillUuid = workingHtml.find('[name="rollModifiers.selectedSkill"]').val(); const newSkill = fromUuidSync(newSkillUuid); characteristicElement.val(newSkill.system.characteristic); - let title = ""; - const titleElement = html.parent().parent().find('.window-title')[0]; + let newTitle = ""; + const titleElement = workingHtml.find('.window-title')[0]; if (titleElement) { const usingWord = ' ' + game.i18n.localize("TWODSIX.Actor.using") + ' '; if (titleElement.innerText.includes(usingWord)) { - title = `${titleElement.innerText.substring(0, titleElement.innerText.indexOf(usingWord))}${usingWord}${newSkill.name}`; + newTitle = `${titleElement.innerText.substring(0, titleElement.innerText.indexOf(usingWord))}${usingWord}${newSkill.name}`; } else { - title = newSkill.name || ""; + newTitle = newSkill.name || ""; } - titleElement.innerText = title; + titleElement.innerText = newTitle; } }); } diff --git a/static/templates/chat/throw-dialog.html b/static/templates/chat/throw-dialog.html index faee92257..e1439e2ae 100644 --- a/static/templates/chat/throw-dialog.html +++ b/static/templates/chat/throw-dialog.html @@ -23,7 +23,6 @@ -
{{localize "TWODSIX.Chat.Roll.RollModifiers"}} {{#if skillRoll}} @@ -114,7 +113,6 @@
-
{{#if showConditions}}
{{localize "TWODSIX.Chat.Roll.Conditions"}} @@ -133,22 +131,20 @@ {{/if}}
-
{{/if}} {{#if (twodsix_showTimeframe)}}
{{localize "TWODSIX.Chat.Roll.Timeframe"}}
-
-
{{/if}} From 64085a93531defe2c36b48ac63ffba6d837a1bcd Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:24:17 -0500 Subject: [PATCH 028/218] fix: need to wrap with div standard-form --- static/templates/chat/throw-dialog.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/templates/chat/throw-dialog.html b/static/templates/chat/throw-dialog.html index e1439e2ae..b74ec842e 100644 --- a/static/templates/chat/throw-dialog.html +++ b/static/templates/chat/throw-dialog.html @@ -1,3 +1,4 @@ +
{{localize "TWODSIX.Chat.Roll.RollDetails"}} @@ -148,3 +149,4 @@
{{/if}} +
From 9ede4cf54dfc0c488b68c104f5f8783da07b6d22 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:37:17 -0500 Subject: [PATCH 029/218] fix: consumable dialog to DialogV2 --- src/module/sheets/TwodsixItemSheet.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/module/sheets/TwodsixItemSheet.ts b/src/module/sheets/TwodsixItemSheet.ts index 4dfa226e5..83c8abddc 100644 --- a/src/module/sheets/TwodsixItemSheet.ts +++ b/src/module/sheets/TwodsixItemSheet.ts @@ -339,13 +339,15 @@ export class TwodsixItemSheet extends AbstractTwodsixItemSheet { const html = await renderTemplate(template, { consumables: consumablesList }); - new Dialog({ - title: `${game.i18n.localize("TWODSIX.Items.Items.New")} ${game.i18n.localize("TWODSIX.itemTypes.consumable")}`, + new foundry.applications.api.DialogV2({ + window: {title: `${game.i18n.localize("TWODSIX.Items.Items.New")} ${game.i18n.localize("TWODSIX.itemTypes.consumable")}`}, content: html, - buttons: { - ok: { - label: game.i18n.localize("TWODSIX.Create"), - callback: async (buttonHtml: JQuery) => { + buttons: [ + { + action: "ok", + label: "TWODSIX.Create", + callback: async (event, button, dialog) => { + const buttonHtml = $(dialog); const max = parseInt(buttonHtml.find('.consumable-max').val() as string, 10) || 0; let equippedState = ""; if (this.item.type !== "skills" && this.item.type !== "trait" && this.item.type !== "ship_position") { @@ -372,10 +374,11 @@ export class TwodsixItemSheet extends AbstractTwodsixItemSheet { } } }, - cancel: { - label: game.i18n.localize("Cancel") + { + action: "cancel", + label: "Cancel" } - }, + ], default: 'ok', }).render(true); } From 5b5210757890e66925c1437dcd8619f4de648334 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:37:36 -0500 Subject: [PATCH 030/218] fix: try to set format correctly --- src/module/hooks/addGMControlButtons.ts | 1 - static/styles/twodsix.css | 4 ++++ static/styles/twodsix_basic.css | 4 ++++ static/templates/chat/throw-dialog.html | 4 +--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/module/hooks/addGMControlButtons.ts b/src/module/hooks/addGMControlButtons.ts index dd6270272..c92eb58c7 100644 --- a/src/module/hooks/addGMControlButtons.ts +++ b/src/module/hooks/addGMControlButtons.ts @@ -116,7 +116,6 @@ async function throwDialog(skillsList:string[], tokenData:any):Promise { label: "TWODSIX.Chat.Roll.RequestRoll", icon: "fa-solid fa-message", callback: (event, button, dialog) => { - //console.log(event, button, dialog); const buttonHtml = $(dialog); returnValue.selectedTokens = buttonHtml.find('[name="selectedTokens"]').val(); returnValue.difficulty = TWODSIX.DIFFICULTIES[game.settings.get('twodsix', 'difficultyListUsed')][buttonHtml.find('[name="difficulty"]').val()]; diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 96ffd7adf..669db2c8b 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -4327,6 +4327,10 @@ input.red { font-family: Asap, sans-serif; } +.standard-form { + overflow-y: auto; +} + .standard-form fieldset { padding: 0 0.5rem; display: flex; diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index 5a008056c..2a13c79d3 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -3510,3 +3510,7 @@ input.red { height: auto !important; min-height: 5ch; } + +.standard-form { + overflow-y: auto; +} diff --git a/static/templates/chat/throw-dialog.html b/static/templates/chat/throw-dialog.html index b74ec842e..9d81ca9ab 100644 --- a/static/templates/chat/throw-dialog.html +++ b/static/templates/chat/throw-dialog.html @@ -1,5 +1,4 @@ -
-
+
{{localize "TWODSIX.Chat.Roll.RollDetails"}}
@@ -148,5 +147,4 @@
{{/if}} -
From 680d9ba69397bc820d745008720697253280ba5b Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:23:26 -0500 Subject: [PATCH 031/218] fix: move ROF dialogs to DialogV2 --- src/module/entities/TwodsixItem.ts | 140 ++++++++++++++--------------- 1 file changed, 67 insertions(+), 73 deletions(-) diff --git a/src/module/entities/TwodsixItem.ts b/src/module/entities/TwodsixItem.ts index 860b06ecd..adadd11de 100644 --- a/src/module/entities/TwodsixItem.ts +++ b/src/module/entities/TwodsixItem.ts @@ -1112,55 +1112,48 @@ export function getValueFromRollFormula(rollFormula:string, item:TwodsixItem): n async function promptForCELROF(weapon: TwodsixItem): Promise { if (weapon.system.doubleTap && game.settings.get('twodsix', 'ShowDoubleTap')) { - return new Promise((resolve) => { - new Dialog({ - title: game.i18n.localize("TWODSIX.Dialogs.ROFPickerTitle"), - content: "", - buttons: { - single: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFSingle"), callback: () => { - resolve('single'); - } - }, - doubleTap: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFDoubleTap"), callback: () => { - resolve('double-tap'); - } - } + return await foundry.applications.api.DialogV2.wait({ + window: {title: "TWODSIX.Dialogs.ROFPickerTitle"}, + content: "", + buttons: [ + { + action: "single", + label: "TWODSIX.Dialogs.ROFSingle" }, - default: 'single', - }).render(true); + { + action: "double-tap", + label: "TWODSIX.Dialogs.ROFDoubleTap", + } + ], + default: 'single', + rejectClose: false }); } else { - return new Promise((resolve) => { - new Dialog({ - title: game.i18n.localize("TWODSIX.Dialogs.ROFPickerTitle"), - content: "", - buttons: { - single: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFSingle"), callback: () => { - resolve('single'); - } - }, - burst: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFBurst"), callback: () => { - resolve('auto-burst'); - } - }, - full: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFFull"), callback: () => { - resolve('auto-full'); - } - } + return await foundry.applications.api.DialogV2.wait({ + window: {title: "TWODSIX.Dialogs.ROFPickerTitle"}, + content: "", + buttons: [ + { + action: "single", + label: "TWODSIX.Dialogs.ROFSingle" + }, + { + action: "auto-burst", + label: "TWODSIX.Dialogs.ROFBurst" }, - default: 'single', - }).render(true); + { + action: "auto-full", + label: "TWODSIX.Dialogs.ROFFull" + } + ], + default: "single", + rejectClose: false }); } } async function promptAndAttackForCE(modes: string[], item: TwodsixItem):void { - const buttons = {}; + const buttons = []; for ( const mode of modes) { const number = Number(mode); @@ -1168,61 +1161,62 @@ async function promptAndAttackForCE(modes: string[], item: TwodsixItem):void { const bonusDamage = TwodsixItem.burstBonusDamage(number); if (number === 1) { - buttons["single"] = { - "label": game.i18n.localize("TWODSIX.Dialogs.ROFSingle"), - "callback": () => { + buttons.push({ + action: "single", + label: "TWODSIX.Dialogs.ROFSingle", + callback: () => { item.performAttack("single", true, 1); } - }; + }); } else if (number > 1){ let key = game.i18n.localize("TWODSIX.Rolls.AttackDM")+ ' +' + attackDM; - buttons[key] = { - "label": key, - "callback": () => { + buttons.push({ + action: `burst${number}`, + label: key, + callback: () => { item.performAttack('burst-attack-dm', true, number); } - }; + }); key = game.i18n.localize("TWODSIX.Rolls.BonusDamage") + ' +' + bonusDamage; - buttons[key] = { - "label": key, - "callback": () => { + buttons.push({ + action: `bonus${number}`, + label: key, + callback: () => { item.performAttack('burst-bonus-damage', true, number); } - }; + }); } } - await new Dialog({ - title: game.i18n.localize("TWODSIX.Dialogs.ROFPickerTitle"), + await foundry.applications.api.DialogV2.wait({ + window: {title: "TWODSIX.Dialogs.ROFPickerTitle"}, content: "", buttons: buttons, - default: "single" - }).render(true); + default: "single", + rejectClose: false + }); } async function promptForCTROF(modes: string[]): Promise { if (parseInt(modes[0]) === 0) { return 'auto-full'; } else { - return new Promise((resolve) => { - new Dialog({ - title: game.i18n.localize("TWODSIX.Dialogs.ROFPickerTitle"), - content: "", - buttons: { - single: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFSingle"), callback: () => { - resolve('single'); - } - }, - full: { - label: game.i18n.localize("TWODSIX.Dialogs.ROFFull"), callback: () => { - resolve('auto-full'); - } - } + return await foundry.applications.api.DialogV2.wait({ + window: {title: "TWODSIX.Dialogs.ROFPickerTitle"}, + content: "", + buttons: [ + { + action: "single", + label: "TWODSIX.Dialogs.ROFSingle" }, - default: 'single', - }).render(true); + { + action: "auto-full", + label: "TWODSIX.Dialogs.ROFFull" + } + ], + default: 'single', + rejectClose: false }); } } From ce608373ed161a56fcaa6c427fdcfc6ae30ea688 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Tue, 22 Oct 2024 07:49:37 -0500 Subject: [PATCH 032/218] fix: convert damage dialog to DialogV2 --- src/module/utils/actorDamage.ts | 30 +-- static/lang/en.json | 3 +- static/styles/twodsix.css | 6 + static/styles/twodsix_basic.css | 6 + static/templates/actors/damage-dialog.html | 237 +++++++++++---------- 5 files changed, 155 insertions(+), 127 deletions(-) diff --git a/src/module/utils/actorDamage.ts b/src/module/utils/actorDamage.ts index 7839ed3b6..cab692fc0 100644 --- a/src/module/utils/actorDamage.ts +++ b/src/module/utils/actorDamage.ts @@ -329,13 +329,14 @@ export async function renderDamageDialog(damageData: Record): Promi const renderedHtml = await renderTemplate(template, {stats: damageDialogHandler.stats}); const title = game.i18n.localize("TWODSIX.Damage.DealDamageTo").replace("_ACTOR_NAME_", actor.name); - new Dialog({ - title: title, + await foundry.applications.api.DialogV2.wait({ + window: {title: title}, content: renderedHtml, - buttons: { - ok: { - label: game.i18n.localize("TWODSIX.Damage.DealDamage"), - icon: '', + buttons: [ + { + action: "ok", + label: "TWODSIX.Damage.DealDamage", + icon: "fa-solid fa-hand-fist", callback: () => { stats.edited = true; stats.applyDamage(); @@ -343,18 +344,23 @@ export async function renderDamageDialog(damageData: Record): Promi Hooks.call("destroyDamageDialog", damageId); } }, - cancel: { - icon: '', - label: game.i18n.localize("Cancel"), + { + action: "cancel", + icon: "fa-solid fa-xmark", + label: "Cancel", callback: () => { //pass } }, - }, + ], default: 'ok', close: () => damageDialogHandler.unRegisterListeners(), - render: (html: JQuery) => damageDialogHandler.setHtml(html), - }, {id: damageId}).render(true); + render: (event, html) => { + const inJQ = $(html); + damageDialogHandler.setHtml(inJQ); + }, + rejectClose: false + }, {id: damageId}); } export function destroyDamageDialog(damageId: string): void { diff --git a/static/lang/en.json b/static/lang/en.json index d09044ad3..4197fae1b 100644 --- a/static/lang/en.json +++ b/static/lang/en.json @@ -47,7 +47,8 @@ "DamageFormula": "Damage Formula", "NoRegularDamage": "No Regular Damage", "CanBeBlocked": "Can be blocked", - "CanBeParried": "Can be parried" + "CanBeParried": "Can be parried", + "DamageCalculation": "Applied Damage Calculation" }, "DamageType": { "Acid": "Acid", diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 669db2c8b..7981be924 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -3884,6 +3884,12 @@ div.app.window-app.minimized.twodsix.ship.actor header a.close { border: none !important; }*/ /* ------ Damage Dialog ------ */ +.damage-dialog { + font-size: revert; +} +.damage-table { + max-width: 30ch; +} .damage-dialog .red { color: var(--s2d6-damage-red); diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index 2a13c79d3..7b71308c4 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -3121,6 +3121,12 @@ form .form-group > label { } */ /* ------ Damage Dialog ------ */ +.damage-dialog { + font-size: revert; +} +.damage-table { + max-width: 30ch; +} .damage-dialog .red { color: var(--s2d6-damage-red); diff --git a/static/templates/actors/damage-dialog.html b/static/templates/actors/damage-dialog.html index 58969877d..2c091d488 100644 --- a/static/templates/actors/damage-dialog.html +++ b/static/templates/actors/damage-dialog.html @@ -1,119 +1,128 @@ -
+
+
{{#with stats}} -
${game.i18n.localize("TWODSIX.Chat.Roll.Modifier")}${game.i18n.localize("TWODSIX.Chat.Roll.Description")}${game.i18n.localize("TWODSIX.Chat.Roll.DM")}
- - - - {{#unless useCUData}} - - - {{else}} - - {{#if canOnlyBeBlocked}} - - {{else}} - - {{/if}} - {{/unless}} - - - - - - - - {{#unless useCUData}} - - {{/unless}} - - {{#if useCUData}} - - {{/if}} - - - - {{#iff damageLabel "!==" "---"}} - - - - - - - - {{/iff}} - -
{{localize "TWODSIX.Damage.Damage"}}{{localize "TWODSIX.Items.Armor.PrimaryArmor"}}{{localize "TWODSIX.Items.Armor.SecondaryArmor"}}{{localize "TWODSIX.Items.Armor.Armor"}}{{localize "TWODSIX.Items.Weapon.ShieldAV"}}{{localize "TWODSIX.Items.Weapon.ParryAV"}}{{localize "TWODSIX.Actor.Items.EffectiveArmor"}}{{localize "TWODSIX.Damage.TotalDamage"}}
({{localize damageLabel}})
- - {{localize "TWODSIX.Damage.Characteristics"}}:
- - - - - - - - - - - - {{#if useLifebloodStamina}} - - - - - - - - - - - - - +
+
{{localize "TWODSIX.Damage.Max"}}{{localize "TWODSIX.Damage.Current"}}{{localize "TWODSIX.Damage.Damage"}}{{localize "TWODSIX.Damage.ResultingStat"}}
{{localize "TWODSIX.Items.Skills.STA"}}{{originalCharacteristics.stamina.value}}{{originalCharacteristics.stamina.current}}
{{localize "TWODSIX.Items.Skills.LFB"}}{{originalCharacteristics.lifeblood.value}}{{originalCharacteristics.lifeblood.current}}
+ + + + {{#unless useCUData}} + + + {{else}} + + {{#if canOnlyBeBlocked}} + + {{else}} + + {{/if}} + {{/unless}} + + + + + + + + {{#unless useCUData}} + + {{/unless}} + + {{#if useCUData}} + + {{/if}} + + + + {{#iff damageLabel "!==" "---"}} + + + + + + + + {{/iff}} + +
{{localize "TWODSIX.Damage.Damage"}}{{localize "TWODSIX.Items.Armor.PrimaryArmor"}}{{localize "TWODSIX.Items.Armor.SecondaryArmor"}}{{localize "TWODSIX.Items.Armor.Armor"}}{{localize "TWODSIX.Items.Weapon.ShieldAV"}}{{localize "TWODSIX.Items.Weapon.ParryAV"}}{{localize "TWODSIX.Actor.Items.EffectiveArmor"}}{{localize "TWODSIX.Damage.TotalDamage"}}
({{localize damageLabel}})
+ +
+
+ +
+
+ {{localize "TWODSIX.Damage.UnallocatedDamage"}}: +
+
+ {{localize "TWODSIX.Damage.CharacterIsDead"}} +
{{/with}} + From c3de0efc74379db1728ddd767af5f7be0599eaac Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:17:18 -0500 Subject: [PATCH 033/218] fix: add card titles for popouts --- src/module/entities/TwodsixItem.ts | 1 + .../sheets/AbstractTwodsixActorSheet.ts | 2 +- src/module/sheets/TwodsixAnimalSheet.ts | 27 ++++++++++--------- src/module/sheets/TwodsixSpaceObjectSheet.ts | 1 + src/module/utils/TwodsixDiceRoll.ts | 12 +++++++++ src/module/utils/TwodsixShipActions.ts | 7 ++++- static/lang/en.json | 13 +++++++-- 7 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/module/entities/TwodsixItem.ts b/src/module/entities/TwodsixItem.ts index adadd11de..2c5e1c216 100644 --- a/src/module/entities/TwodsixItem.ts +++ b/src/module/entities/TwodsixItem.ts @@ -725,6 +725,7 @@ export default class TwodsixItem extends Item { } ); await damage.toMessage({ + title: game.i18n.localize("TWODSIX.Damage.DamageCard"), speaker: this.actor ? ChatMessage.getSpeaker({actor: this.actor}) : null, content: html, style: CONST.CHAT_MESSAGE_STYLES.OTHER, diff --git a/src/module/sheets/AbstractTwodsixActorSheet.ts b/src/module/sheets/AbstractTwodsixActorSheet.ts index 12352bde9..6f019147f 100644 --- a/src/module/sheets/AbstractTwodsixActorSheet.ts +++ b/src/module/sheets/AbstractTwodsixActorSheet.ts @@ -570,7 +570,7 @@ export abstract class AbstractTwodsixActorSheet extends ActorSheet { const capType = item.type.capitalize(); if (item.type === "trait" || item.type === "spell") { const msg = `
${capType}: ${item.name}

${item.system["description"]}`; - ChatMessage.create({ content: msg, speaker: ChatMessage.getSpeaker({ actor: this.actor }) }); + ChatMessage.create({ title: game.i18n.localize("TWODSIX.Chat.Roll.Types.TriatSpell"), content: msg, speaker: ChatMessage.getSpeaker({ actor: this.actor }) }); } } diff --git a/src/module/sheets/TwodsixAnimalSheet.ts b/src/module/sheets/TwodsixAnimalSheet.ts index 69a068451..0213df3f1 100644 --- a/src/module/sheets/TwodsixAnimalSheet.ts +++ b/src/module/sheets/TwodsixAnimalSheet.ts @@ -117,12 +117,12 @@ export class TwodsixAnimalSheet extends AbstractTwodsixActorSheet { } else { flavor = game.i18n.localize("TWODSIX.Animal.NoReactionMessage"); } - await roll.toMessage( - { speaker: ChatMessage.getSpeaker({ alias: this.actor.name}), - flavor: flavor, - style: CONST.CHAT_MESSAGE_STYLES.OTHER, - }, - {rollMode: CONST.DICE_ROLL_MODES.PRIVATE} + await roll.toMessage({ + title: game.i18n.localize("TWODSIX.Animal.Reaction"), + speaker: ChatMessage.getSpeaker({ alias: this.actor.name}), + flavor: flavor, + style: CONST.CHAT_MESSAGE_STYLES.OTHER, + }, {rollMode: CONST.DICE_ROLL_MODES.PRIVATE} ); } } @@ -149,13 +149,14 @@ export class TwodsixAnimalSheet extends AbstractTwodsixActorSheet { } else { flavor = game.i18n.localize("TWODSIX.Animal.FightToTheDeath"); } - await roll.toMessage( - { speaker: ChatMessage.getSpeaker({ alias: this.actor.name}), - flavor: flavor, - style: CONST.CHAT_MESSAGE_STYLES.OTHER, - rolls: [roll] - }, - {rollMode: CONST.DICE_ROLL_MODES.PRIVATE} + await roll.toMessage({ + title: game.i18n.localize("TWODSIX.Animal.MoraleRoll"), + speaker: ChatMessage.getSpeaker({ alias: this.actor.name}), + flavor: flavor, + style: CONST.CHAT_MESSAGE_STYLES.OTHER, + rolls: [roll] + }, + {rollMode: CONST.DICE_ROLL_MODES.PRIVATE} ); } } diff --git a/src/module/sheets/TwodsixSpaceObjectSheet.ts b/src/module/sheets/TwodsixSpaceObjectSheet.ts index d32f7e3f9..43f406bb9 100644 --- a/src/module/sheets/TwodsixSpaceObjectSheet.ts +++ b/src/module/sheets/TwodsixSpaceObjectSheet.ts @@ -83,6 +83,7 @@ export class TwodsixSpaceObjectSheet extends AbstractTwodsixActorSheet { } ); await damage.toMessage({ + title: game.i18n.localize("TWODSIX.Damage.DamageCard"), speaker: this.actor ? ChatMessage.getSpeaker({actor: this.actor}) : null, content: html, style: CONST.CHAT_MESSAGE_STYLES.OTHER, diff --git a/src/module/utils/TwodsixDiceRoll.ts b/src/module/utils/TwodsixDiceRoll.ts index 9d21d228b..919c5b60c 100644 --- a/src/module/utils/TwodsixDiceRoll.ts +++ b/src/module/utils/TwodsixDiceRoll.ts @@ -383,8 +383,20 @@ export class TwodsixDiceRoll { const flavor = (this.rollSettings.extraFlavor ? `
${this.rollSettings.extraFlavor}
`: ``) + `
`+ flavorText + `
`; + let title = ""; + if (this.item) { + title = "TWODSIX.Chat.Roll.Types.ItemRoll"; + } else if (this.skill) { + title = "TWODSIX.Chat.Roll.Types.SkillRoll"; + } else if (this.modifierList?.includes("characteristic")) { + title = "TWODSIX.Chat.Roll.Types.CharRoll"; + } else { + title = "TWODSIX.Chat.Roll.Types.OtherRoll"; + } + await this.roll?.toMessage( { + title: game.i18n.localize(title), speaker: ChatMessage.getSpeaker({actor: this.actor}), style: CONST.CHAT_MESSAGE_STYLES.OTHER, rolls: [this.roll], diff --git a/src/module/utils/TwodsixShipActions.ts b/src/module/utils/TwodsixShipActions.ts index 2b16b2493..221701344 100644 --- a/src/module/utils/TwodsixShipActions.ts +++ b/src/module/utils/TwodsixShipActions.ts @@ -53,7 +53,12 @@ export class TwodsixShipActions { if (Roll.validate(rollText)) { const rollData = extra.actor.getRollData() ?? {}; Object.assign(rollData, {ship: extra.ship.getRollData()}); - const msg = await new Roll(rollText, rollData).toMessage({speaker: speakerData, flavor: flavorText, type: CONST.CHAT_MESSAGE_TYPES.OTHER}); + const msg = await new Roll(rollText, rollData).toMessage({ + title: game.i18n.localize("TWODSIX.Chat.Roll.Types.ShipAction"), + speaker: speakerData, + flavor: flavorText, + type: CONST.CHAT_MESSAGE_TYPES.OTHER + }); return msg; } } diff --git a/static/lang/en.json b/static/lang/en.json index 4197fae1b..f65580c3e 100644 --- a/static/lang/en.json +++ b/static/lang/en.json @@ -48,7 +48,8 @@ "NoRegularDamage": "No Regular Damage", "CanBeBlocked": "Can be blocked", "CanBeParried": "Can be parried", - "DamageCalculation": "Applied Damage Calculation" + "DamageCalculation": "Applied Damage Calculation", + "DamageCard": "Damage Card" }, "DamageType": { "Acid": "Acid", @@ -465,7 +466,15 @@ "ablat": "Ablat", "combat": "Combat" }, - "Dice": "Dice" + "Dice": "Dice", + "Types": { + "SkillRoll": "Skill Roll Card", + "ItemRoll": "Item Roll Card", + "OtherRoll": "Other Roll Card", + "CharRoll": "Characteristic Roll Card", + "ShipAction": "Ship Action Card", + "TraitSpell": "Trait/Spell Card" + } } }, "Table": { From 6707d6b80bf946efbce58b64534b29f57dd4adea Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Wed, 23 Oct 2024 12:24:50 -0500 Subject: [PATCH 034/218] fix: style fixes tab icon padding and code-mirror background --- static/styles/twodsix.css | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 7981be924..455effa49 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -321,7 +321,7 @@ table tr:nth-child(even) { /******************************************************/ -.macro-sheet .form-group.command div[contenteditable] { +/*.macro-sheet .form-group.command div[contenteditable] { height: calc(100% - 24px); resize: none; color: var(--s2d6-light-color); @@ -333,12 +333,12 @@ form .form-group, form .form-group-stacked { flex-direction: row; flex-wrap: wrap; margin: 3px 1ch; - /* color: var(--s2d6-default-color) ; */ + * color: var(--s2d6-default-color) ; * } form .form-group > label { flex: 4; - /* line-height: 18px; */ + * line-height: 18px; * } form .form-group span.units { @@ -346,7 +346,7 @@ form .form-group span.units { line-height: 28px; font-size: 12px; color: var(--s2d6-form-light); -} +}*/ #player-config label { font-size: 14px; @@ -3647,7 +3647,7 @@ div.app.window-app.minimized.twodsix.ship.actor header a.close { border-bottom: 1px solid var(--s2d6-default-color); box-shadow: 0 0 10px var(--s2d6-light-color); background-color: var(--s2d6-background-opaque); - padding: 16px; + padding: 8px; } #sidebar-tabs > .item { @@ -4326,7 +4326,6 @@ input.red { #pause.paused { display: flex; animation: none; - } #pause figcaption { @@ -4356,3 +4355,7 @@ input.red { h4 { font-family: Asap, sans-serif; } + +.cm-editor { + background: var(--s2d6-background-opaque); +} From 72446eac11ef74736df7994783c9cf34a4885012 Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Wed, 23 Oct 2024 14:59:10 -0500 Subject: [PATCH 035/218] fix: ship sheet style changes --- static/styles/twodsix.css | 10 +++++++++- static/styles/twodsix_basic.css | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 455effa49..4257b9f99 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -2691,16 +2691,18 @@ a.ship-crew-tab.active, a.ship-positions-tab.active , a.ship-storage-tab.active, border: 1px groove var(--s2d6-default-color); min-height: 6ch; border-radius: 0; + display: flex; } .ship-position-add-box { text-align: center; min-height: 14ch; + flex-direction: column; + justify-content: center; } .ship-position-add-position { font-size: 6ch; - margin-top: 20px; } .ship-position-actor-token, .create-ship-position { @@ -4323,6 +4325,8 @@ input.red { padding-left: 1%; } + +/********v13 updates******/ #pause.paused { display: flex; animation: none; @@ -4359,3 +4363,7 @@ h4 { .cm-editor { background: var(--s2d6-background-opaque); } + +table { + border-radius: 0; +} diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index 7b71308c4..ff7112c67 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -1639,7 +1639,7 @@ span.total-output { position: absolute; display: grid; grid-template-columns: 51% 49%; - grid-template-rows: 5ch 19% 14% 8% 51%; + grid-template-rows: 5ch 20% 14% 8% 51%; gap: 1px; grid-template-areas: "ship-image ship-name" @@ -1737,7 +1737,7 @@ img.ship-mask-bg { /*margin-top: -0.2em;*/ /*margin-left: 1.3em;*/ font-size: 1.8ch; - width: 6ch; + width: 5ch; border: solid 1px; border-radius: 0.5ch; } @@ -1806,8 +1806,8 @@ img.ship-mask-bg { } .ship-armor-name textarea, .battle-armor-name textarea { - border: 2px solid; - border-radius: 1ch !important; + /*border: 2px solid; + border-radius: 1ch !important;*/ text-align: center; font-size: x-small; overflow-wrap: break-word; @@ -2162,11 +2162,14 @@ a.ship-positions-tab.active, a.ship-crew-tab.active, a.ship-component-tab.active border: 1px solid; border-radius: 0; align-content: space-evenly; + display: flex; } .ship-position-add-box { text-align: center; min-height: 14ch; + flex-direction: column; + justify-content: center; } .ship-position-add-position { @@ -2600,7 +2603,7 @@ select.form-input, input.form-input, span.form-input { }*/ .sheet-navigation.tabs { - padding-bottom: 0.5em; + padding: 0.5em 0; border-bottom: 1px solid var(--color-border-light-tertiary); margin-bottom: 0.5em; @@ -3517,6 +3520,12 @@ input.red { min-height: 5ch; } +/************ v13 Changes *******/ + .standard-form { overflow-y: auto; } + +table { + border-radius: 0; +} From 0de0cae913df23449dd014d9878c5ef9392a53ca Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:02:38 -0600 Subject: [PATCH 036/218] fix: npc icons and form font weight --- package-lock.json | 80 +++++++++++++++++++++++++++++++-------- package.json | 3 +- static/styles/twodsix.css | 5 ++- 3 files changed, 70 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 34e3fb820..5ffeb0db6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,8 @@ "name": "twodsix", "version": "5.12.0", "dependencies": { - "@league-of-foundry-developers/foundry-vtt-types": "github:League-of-Foundry-Developers/foundry-vtt-types#2315d2385e256f8e7011667683f0859f1f769fdf" + "@league-of-foundry-developers/foundry-vtt-types": "github:League-of-Foundry-Developers/foundry-vtt-types#2315d2385e256f8e7011667683f0859f1f769fdf", + "latest-version": "^9.0.0" }, "devDependencies": { "@rollup/plugin-commonjs": "^28.0.0", @@ -1692,7 +1693,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", - "dev": true, "license": "MIT", "engines": { "node": ">=12.22.0" @@ -1702,7 +1702,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", - "dev": true, "license": "MIT", "dependencies": { "graceful-fs": "4.2.10" @@ -1715,14 +1714,12 @@ "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true, "license": "ISC" }, "node_modules/@pnpm/npm-conf": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", - "dev": true, "license": "MIT", "dependencies": { "@pnpm/config.env-replace": "^1.1.0", @@ -3768,7 +3765,6 @@ "version": "1.1.13", "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "dev": true, "license": "MIT", "dependencies": { "ini": "^1.3.4", @@ -4034,7 +4030,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, "license": "MIT", "engines": { "node": ">=4.0.0" @@ -6250,7 +6245,6 @@ "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, "license": "ISC" }, "node_modules/internal-slot": { @@ -6952,6 +6946,18 @@ "graceful-fs": "^4.1.11" } }, + "node_modules/ky": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/ky/-/ky-1.7.2.tgz", + "integrity": "sha512-OzIvbHKKDpi60TnF9t7UUVAF1B4mcqc02z5PIvrm08Wyb+yOcz63GRvEuVxNT18a9E1SrNouhB4W2NNLeD7Ykg==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/ky?sponsor=1" + } + }, "node_modules/last-run": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/last-run/-/last-run-2.0.0.tgz", @@ -6962,6 +6968,21 @@ "node": ">= 10.13.0" } }, + "node_modules/latest-version": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-9.0.0.tgz", + "integrity": "sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==", + "license": "MIT", + "dependencies": { + "package-json": "^10.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lead": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/lead/-/lead-4.0.0.tgz", @@ -10933,6 +10954,24 @@ "node": ">=4" } }, + "node_modules/package-json": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-10.0.1.tgz", + "integrity": "sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==", + "license": "MIT", + "dependencies": { + "ky": "^1.2.0", + "registry-auth-token": "^5.0.2", + "registry-url": "^6.0.1", + "semver": "^7.6.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -11612,7 +11651,6 @@ "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true, "license": "ISC" }, "node_modules/punycode": { @@ -11672,7 +11710,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { "deep-extend": "^0.6.0", @@ -11688,7 +11725,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -11861,7 +11897,6 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.0.2.tgz", "integrity": "sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==", - "dev": true, "license": "MIT", "dependencies": { "@pnpm/npm-conf": "^2.1.0" @@ -11870,6 +11905,21 @@ "node": ">=14" } }, + "node_modules/registry-url": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", + "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", + "license": "MIT", + "dependencies": { + "rc": "1.2.8" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -12449,9 +12499,9 @@ } }, "node_modules/semantic-release/node_modules/hosted-git-info": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.0.0.tgz", - "integrity": "sha512-4nw3vOVR+vHUOT8+U4giwe2tcGv+R3pwwRidUe67DoMBTjhrfr6rZYJVVwdkBE+Um050SG+X9tf0Jo4fOpn01w==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.0.1.tgz", + "integrity": "sha512-/rLVQvNpQDQ2wG90ooueQe3hsRuoNBT3kh/vwcjgPjWCEODZbm44YwrShVr4Pnb9tNCIJlI6Q+OKxXLngV591g==", "dev": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index fed7c68d7..97adec39b 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "last 3 versions" ], "dependencies": { - "@league-of-foundry-developers/foundry-vtt-types": "github:League-of-Foundry-Developers/foundry-vtt-types#2315d2385e256f8e7011667683f0859f1f769fdf" + "@league-of-foundry-developers/foundry-vtt-types": "github:League-of-Foundry-Developers/foundry-vtt-types#2315d2385e256f8e7011667683f0859f1f769fdf", + "latest-version": "^9.0.0" } } diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 27fba56c7..824e661ed 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -929,8 +929,8 @@ h2 { } .status-icons.npc { - position: relative !important; - top: -20.5ch; + position: absolute !important; + top: 2ch; /* height: -webkit-fill-available !important; */ align-content: flex-start; /* flex-wrap: wrap; */ @@ -4107,6 +4107,7 @@ multi-select.actor-sheet select { .standard-form .form-group > label { color: var(--s2d6-default-color); + font-weight: normal; } .filepicker .favorites .path a.link[data-source]::before { From fd71ab3fb790a2df0ee695419e74e2a74b6f4e7d Mon Sep 17 00:00:00 2001 From: marvin9257 <72580196+marvin9257@users.noreply.github.com> Date: Thu, 21 Nov 2024 10:30:14 -0600 Subject: [PATCH 037/218] fix: dialog labels should't wrap inputs --- src/module/entities/TwodsixActor.ts | 4 +- static/styles/twodsix.css | 5 +- static/templates/actors/damage-dialog.html | 96 +++++++------- static/templates/chat/initiative-dialog.html | 29 ++-- .../templates/chat/request-roll-dialog.html | 46 +++---- static/templates/chat/throw-dialog.html | 124 ++++++++---------- 6 files changed, 138 insertions(+), 166 deletions(-) diff --git a/src/module/entities/TwodsixActor.ts b/src/module/entities/TwodsixActor.ts index 742498e2a..4718c3579 100644 --- a/src/module/entities/TwodsixActor.ts +++ b/src/module/entities/TwodsixActor.ts @@ -1386,8 +1386,8 @@ async function getMoveNumber(itemData:TwodsixItem): Promise { window: {title: "TWODSIX.Actor.Items.QuantityToTransfer"}, content: `
` + itemData.name + `
`+ - `
`, + `
`, buttons: [ { action: "Transfer", diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 824e661ed..73e2603d1 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -1834,7 +1834,7 @@ input.item-value-edit, input.joat-skill-input { gap: 1px; } -select.select-mod { +/*select.select-mod { width: 6em; margin-left: 1em; } @@ -1847,7 +1847,7 @@ select.select-difficulty { select.select-rolltype { width: 10em; margin-left: 1em; -} +}*/ span.total-output { text-align: center; @@ -4108,6 +4108,7 @@ multi-select.actor-sheet select { .standard-form .form-group > label { color: var(--s2d6-default-color); font-weight: normal; + flex: 2 1 0%; } .filepicker .favorites .path a.link[data-source]::before { diff --git a/static/templates/actors/damage-dialog.html b/static/templates/actors/damage-dialog.html index 2c091d488..03d3de309 100644 --- a/static/templates/actors/damage-dialog.html +++ b/static/templates/actors/damage-dialog.html @@ -1,55 +1,54 @@
{{#with stats}} -
- + {{/unless}} + {{localize "TWODSIX.Actor.Items.EffectiveArmor"}} + {{localize "TWODSIX.Damage.TotalDamage"}} + + + + + + {{#unless useCUData}} + + {{/unless}} + + {{#if useCUData}} + + {{/if}} + + + + {{#iff damageLabel "!==" "---"}} + + ({{localize damageLabel}}) + + + + + + {{/iff}} + +
-
-