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

Attack Sprite ToHit is wrong after deleting an attack #4501

Closed
pakfront opened this issue Jun 8, 2023 · 0 comments · Fixed by #4513
Closed

Attack Sprite ToHit is wrong after deleting an attack #4501

pakfront opened this issue Jun 8, 2023 · 0 comments · Fixed by #4513
Assignees
Labels
Bug GUI User Interface

Comments

@pakfront
Copy link
Collaborator

pakfront commented Jun 8, 2023

Environment

49.14

Description

The AttackSprite tooltip will always show the To Hit number for attacks as Impossible if you delete an existing attack with Backspace. This is because the ToHit .getValue() for an attack changes to Impossible after a new attack is added. Reason behind this is unknown by me, and it may be working as intend but is also causing UI issues elsewhere. Possible fix, if this is intended, is to cache the ToHit value somehow.
In addition, it would be good to change BoardView.attackSprites from ArrayList to HashMap as there is a lot of iterating looking for matches, and rebuilding which defeats caching.
There are also a few other minor issues with AttackSprite that could be cleaned up here, and a chunk of the text generation code moved to a central, static area so it can be share with other UI.

attackspritebug

@pakfront pakfront added the Bug label Jun 8, 2023
@pakfront pakfront self-assigned this Jun 8, 2023
@pakfront pakfront added the GUI User Interface label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI User Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant