Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a subtitle with actions when using lores #17223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xyzzy42
Copy link
Contributor

@xyzzy42 xyzzy42 commented Nov 7, 2024

Current it will show a subtitle like "Lie (PF2E.ActionsCheck.legal-lore)" when trying to use a skill that doesn't have a translation, which no lore will.

Detect the lack of translation and fall back to the "PF2E.ActionsCheck.x" translation format using the label of the skill. This will result in "Lie (Legal Lore Check)" if the skill was labeled in that way.

@@ -86,7 +86,7 @@ function escapeCheckContext<ItemType extends ItemPF2e<ActorPF2e>>(
);

if (highest) {
const { checkType, stat: slug, subtitle } = ActionMacroHelpers.resolveStat(highest.statistic.slug);
const { checkType, stat: slug, subtitle } = ActionMacroHelpers.resolveStat(highest.statistic.slug, opts.actor);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure how this is related?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to get access to the skill label, I added the actor as an argument to ActionMacroHelpers.resolveStat(). This is the one other call site of this function.

Current it will show a subtitle like "Lie (PF2E.ActionsCheck.legal-lore)" when
trying to use a skill that doesn't have a translation, which no lore will.

Detect the lack of translation and fall back to the "PF2E.ActionsCheck.x"
translation format using the label of the skill.  This will result in "Lie
(Legal Lore Check)" if the skill was labeled in that way.
@xyzzy42 xyzzy42 force-pushed the actions-with-lores-subtitle branch from 7353ad0 to 1840460 Compare November 19, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants