Skip to content

Commit

Permalink
Merge pull request dmdorman#1508 from phBalance/phBalance/v12-migrati…
Browse files Browse the repository at this point in the history
…on-warnings

v12 migration warnings
  • Loading branch information
phBalance authored Nov 23, 2024
2 parents abd99a9 + bdc77d2 commit bb9d82b
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 123 deletions.
13 changes: 5 additions & 8 deletions module/actor/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -703,12 +703,9 @@ export class HeroSystemActorSheet extends ActorSheet {
item.actor?.name ||
item.compendium?.name ||
(item.uuid.startsWith("Item.") ? "ItemSidebar" : null);
// const speaker = ChatMessage.getSpeaker({ actor: actor, token });
// speaker.alias = actor.name;
const chatData = {
user: game.user._id,
author: game.user._id,
whisper: [...whisperUserTargetsForActor(actor), ...whisperUserTargetsForActor(item.actor)],
//speaker: speaker,
};

// Delete original if equipment and it belonged to an actor (as opposed to item sidebar or compendium)?
Expand Down Expand Up @@ -905,7 +902,7 @@ export class HeroSystemActorSheet extends ActorSheet {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: heroRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -944,7 +941,7 @@ export class HeroSystemActorSheet extends ActorSheet {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: characteristicRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -1019,7 +1016,7 @@ export class HeroSystemActorSheet extends ActorSheet {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: characteristicRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -1311,7 +1308,7 @@ export class HeroSystemActorSheet extends ActorSheet {
const token = this.actor.token;
const speaker = ChatMessage.getSpeaker({ actor: this.actor, token });
const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: content,
speaker: speaker,
Expand Down
15 changes: 7 additions & 8 deletions module/actor/actor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class HeroSystem6eActor extends Actor {

if (content) {
const chatData = {
user: game.user.id,
author: game.user.id,
whisper: ChatMessage.getWhisperRecipients("GM"),
speaker: ChatMessage.getSpeaker({ actor: this }),
blind: true,
Expand All @@ -225,10 +225,10 @@ export class HeroSystem6eActor extends Actor {
const token = this.getActiveTokens()[0];
const speaker = ChatMessage.getSpeaker({ actor: this, token });
const tokenName = token?.name || this.name;
speaker["alias"] = game.user.name; //game.token?.name || this.name;
speaker["alias"] = game.user.name;
const content = `<b>${tokenName}</b> ${changed.system.heroicIdentity ? "entered" : "left"} their heroic identity.`;
const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: content,
speaker: speaker,
Expand Down Expand Up @@ -437,7 +437,7 @@ export class HeroSystem6eActor extends Actor {
const content = `${tokenName} <i>is holding their breath</i>.`;
if (asAction) {
const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: content,
speaker: speaker,
Expand Down Expand Up @@ -486,7 +486,7 @@ export class HeroSystem6eActor extends Actor {
}

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: content,
speaker: speaker,
Expand Down Expand Up @@ -556,12 +556,11 @@ export class HeroSystem6eActor extends Actor {
if (!result && overrideCanAct) {
const speaker = ChatMessage.getSpeaker({
actor: this,
//token,
});
speaker["alias"] = game.user.name;

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: `${this.name} is ${badStatus.join(", ")} and cannot move. Override key was used.`,
whisper: whisperUserTargetsForActor(this),
Expand Down Expand Up @@ -622,7 +621,7 @@ export class HeroSystem6eActor extends Actor {
speaker["alias"] = game.user.name;

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: `${this.name} is ${badStatus.join(", ")} and cannot act. Override key was used.`,
whisper: whisperUserTargetsForActor(this),
Expand Down
8 changes: 4 additions & 4 deletions module/combat.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export class HeroSystem6eCombat extends Combat {
speaker["alias"] = combatant.actor.name;

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: content,
whisper: whisperUserTargetsForActor(combatant.actor),
Expand Down Expand Up @@ -618,7 +618,7 @@ export class HeroSystem6eCombat extends Combat {
const content = `${combatant.actor.name} recovers from being stunned.`;

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: content,
};
Expand Down Expand Up @@ -673,7 +673,7 @@ export class HeroSystem6eCombat extends Combat {
This typically occurs when rewinding combat or during speed changes.</p>`;
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
user: game.user._id,
author: game.user._id,
content: content,
};

Expand Down Expand Up @@ -754,7 +754,7 @@ export class HeroSystem6eCombat extends Combat {
contentHidden += "</ul>";
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
user: game.user._id,
author: game.user._id,
content: content,
};

Expand Down
2 changes: 1 addition & 1 deletion module/herosystem6e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ Hooks.on("updateWorldTime", async (worldTime, options) => {

if (content) {
const chatData = {
user: game.user.id, //ChatMessage.getWhisperRecipients('GM'),
author: game.user.id,
whisper: [
...ChatMessage.getWhisperRecipients(actor.name),
...ChatMessage.getWhisperRecipients("GM"),
Expand Down
2 changes: 1 addition & 1 deletion module/item/item-attack-application.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ export class ItemAttackFormApplication extends FormApplication {

const templateData = {
t: templateType,
user: game.user.id,
author: game.user.id,
distance: distance,
direction: -token.document?.rotation || 0 + 90, // Top down tokens typically face south
fillColor: game.user.color,
Expand Down
34 changes: 17 additions & 17 deletions module/item/item-attack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export async function AttackAoeToHit(item, options) {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: attackHeroRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -903,7 +903,7 @@ export async function AttackToHit(item, options) {
speaker["alias"] = item.actor.name;

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: `${resourcesUsedDescription}${resourcesUsedDescriptionRenderedRoll}`,
whisper: ChatMessage.getWhisperRecipients("GM"),
Expand Down Expand Up @@ -943,7 +943,7 @@ export async function AttackToHit(item, options) {
speaker["alias"] = item.actor.name;

const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: `${item.name} ${dcv.signedString()} DCV`,
speaker,
Expand Down Expand Up @@ -1000,7 +1000,7 @@ export async function AttackToHit(item, options) {
.flat()
.concat(stunForEndHeroRoller?.rawRolls())
.filter(Boolean),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -1384,7 +1384,7 @@ async function _rollApplyKnockback(token, knockbackDice) {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: damageRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -1615,7 +1615,7 @@ export async function _onRollDamage(event) {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: damageRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -1669,7 +1669,7 @@ export async function _onRollMindScan(event) {

const content = await renderTemplate(template2, data);
const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content,
speaker: ChatMessage.getSpeaker({ actor: item.actor }),
Expand Down Expand Up @@ -1837,7 +1837,7 @@ export async function _onRollMindScanEffectRoll(event) {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: damageRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -2165,7 +2165,7 @@ export async function _onApplyDamageToSpecificToken(event, tokenId) {
const speaker = ChatMessage.getSpeaker({ actor: token.actor });
speaker["alias"] = token.actor.name;
const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content,
whisper: ChatMessage.getWhisperRecipients("GM"),
Expand All @@ -2176,7 +2176,7 @@ export async function _onApplyDamageToSpecificToken(event, tokenId) {
}
}

// Some defenses requre a roll not just to active, but on each use. 6e EVERYPHASE. 5e ACTIVATIONROLL
// Some defenses require a roll not just to active, but on each use. 6e EVERYPHASE. 5e ACTIVATIONROLL
const defenseEveryPhase = token.actor.items.filter(
(o) =>
(o.system.subType || o.system.type) === "defense" &&
Expand Down Expand Up @@ -2300,7 +2300,7 @@ export async function _onApplyDamageToSpecificToken(event, tokenId) {
let speaker = ChatMessage.getSpeaker({ actor: item.actor });

const chatData = {
user: game.user._id,
author: game.user._id,
content: `${item.name} did no damage.`,
speaker: speaker,
};
Expand Down Expand Up @@ -2470,7 +2470,7 @@ export async function _onApplyDamageToSpecificToken(event, tokenId) {
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: damageDetail.knockbackRoller?.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -2588,7 +2588,7 @@ export async function _onApplyEntangleToSpecificToken(item, token, originalRoll)

const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -2706,7 +2706,7 @@ export async function _onApplyDamageToEntangle(attackItem, token, originalRoll,

const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -2755,7 +2755,7 @@ async function _performAbsorptionForToken(token, absorptionItems, damageDetail,
const chatData = {
style: CONST.CHAT_MESSAGE_STYLES.OOC,
rolls: absorptionRoller.rawRolls(),
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -3042,7 +3042,7 @@ async function _onApplySenseAffectingToSpecificToken(senseAffectingItem, token,
const speaker = ChatMessage.getSpeaker({ actor: senseAffectingItem.actor });

const chatData = {
user: game.user._id,
author: game.user._id,
content: cardHtml,
speaker: speaker,
};
Expand Down Expand Up @@ -3531,7 +3531,7 @@ export async function userInteractiveVerifyOptionallyPromptThenSpendResources(it
speaker.alias = item.actor.name;
const overrideKeyText = game.keybindings.get(HEROSYS.module, "OverrideCanAct")?.[0].key;
const chatData = {
user: game.user._id,
author: game.user._id,
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
content: `${game.user.name} is using ${overrideKeyText} to override using ${resourcesUsedDescription} for <b>${item.name}</b>${resourcesUsedDescriptionRenderedRoll}`,
whisper: whisperUserTargetsForActor(this),
Expand Down
Loading

0 comments on commit bb9d82b

Please sign in to comment.