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

fix: Issue 227 - Named Creatures of same type append 1 #310

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

Conversation

NDomergue
Copy link

@NDomergue NDomergue commented Dec 29, 2024

Pull Request Description

Fix Issue 227 where in the Encounter Tracker, named or not named Creatures had a counter next to their name based on their underlying type (Gobelin, Hobgobelin, etc...) instead of their actual name (John Doe, Foo, Bar...).

Changes Proposed

  • Modify the algorithm in setNumbers to compare distinct names (display or not) instead, by using a Map to compare them
  • In both tracker.js/doUpdate, use Creature.getName() instead of re-doing the same algo that ignore the Creature.display attribute. I guess it affects the logs? I think it would be easier to read with the actual display name instead of the generic name. But I didn't check that part really, what do you think?

Related Issues

Fixes Issue 227 Named Creatures of same type append 1
Fixes Issue 283 Named Creatures have a "1" after their names in right panel

Checklist

  • I have read the contribution guidelines and code of conduct.
  • I have tested the changes locally and they are working as expected.
  • I have added appropriate comments and documentation for the code changes.
  • My code follows the coding style and standards of this project. (Not sure it does, do tell me)
  • I have rebased my branch on the latest main (or master) branch.
  • All tests (if applicable) have passed successfully. (don't think there are here?)
  • I have run linters and fixed any issues.
  • I have checked for any potential security issues or vulnerabilities. (Well, changes are fairly trivial)

Screenshots (if applicable)

With the changes, here is the tracker : As you can see, the first of each distinct name has no numbers, then we count 1,2,3...
image

Additional Notes

My main goal was to discover your code by trying to fix something easy.
My main goal after that is to implement the rules specific to the TTRPG TheOneRing to track combat.
That's my first contribution to an OSS and also my first PR in GitHub (although I'm working as an experienced SE, but mainly in C#), so do tell me if I did anything wrong.

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.

🐞 Named Creatures have a "1" after their names in right panel 🐞 Named Creatures of same type append 1
1 participant