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

UI: book: add fairy buttons #285

Merged
merged 2 commits into from
Jan 25, 2024
Merged

UI: book: add fairy buttons #285

merged 2 commits into from
Jan 25, 2024

Conversation

AcipenserSturio
Copy link
Contributor

@AcipenserSturio AcipenserSturio commented Jan 25, 2024

Adds correctly positioned fairy buttons to the fairy book menu.

Buttons are not clickable, extra indicators (yellow triangle, green box) are not implemented.

The loop is O(n^2) unfortunately, it can be rewritten to be O(n) with hashmaps, but that's beyond my skill level with C# (which i've never used before lol).

book-fairy-buttons

Comment on lines 54 to 57
foreach (var ownedFairy in inventory.Fairies)
{
if (ownedFairy.cardId == fairyRow.CardId)
{
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of looping through yourself you can use inventory.Contains(fairies[i].CardId)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you, fixed

Copy link
Owner

@Helco Helco left a comment

Choose a reason for hiding this comment

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

Thanks again!

@Helco Helco merged commit d20602b into Helco:master Jan 25, 2024
2 checks passed
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